Compare commits
1
Commits
v1.1.0
..
1992f2f963
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1992f2f963 |
@@ -138,22 +138,9 @@ jobs:
|
|||||||
- name: Build the installer
|
- name: Build the installer
|
||||||
run: ./Packaging/build-installer.ps1 -Version ${{ steps.version.outputs.plain }}
|
run: ./Packaging/build-installer.ps1 -Version ${{ steps.version.outputs.plain }}
|
||||||
|
|
||||||
# The artifact is where the package waits to be uploaded to Partner Center.
|
# The artifact is where the package waits to be uploaded to Partner Center
|
||||||
#
|
|
||||||
# The action comes from this Gitea rather than from github.com, and it is
|
|
||||||
# a fork of actions/upload-artifact with one line changed. Upstream reads
|
|
||||||
# GITHUB_SERVER_URL, takes every host but github.com and its enterprise
|
|
||||||
# ones for a GitHub Enterprise Server — where the v4 artifact backend does
|
|
||||||
# not exist — and throws before it makes a request. Here that backend does
|
|
||||||
# exist and answers, but the check runs on the runner ahead of the network
|
|
||||||
# and never lets it prove itself; nor can the name be corrected from this
|
|
||||||
# file, as the runner sets the GITHUB_ ones over the env of a step. The
|
|
||||||
# fork carries the reasoning in full in its GITEA-PATCH.md.
|
|
||||||
#
|
|
||||||
# The tag is a fixed one. A floating tag is how this broke before: the
|
|
||||||
# action is fetched at run time, and what arrives can change on its own
|
|
||||||
- name: Keep the package
|
- name: Keep the package
|
||||||
uses: https://git.alrakis.kz/actions/upload-artifact@v4-gitea
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: msix-${{ steps.version.outputs.version }}
|
name: msix-${{ steps.version.outputs.version }}
|
||||||
path: artifacts/packages/
|
path: artifacts/packages/
|
||||||
@@ -162,7 +149,7 @@ jobs:
|
|||||||
# The .wixpdb next to each installer is left out on purpose: it is of use
|
# The .wixpdb next to each installer is left out on purpose: it is of use
|
||||||
# only when something has to be traced back to the WiX source
|
# only when something has to be traced back to the WiX source
|
||||||
- name: Keep the installer
|
- name: Keep the installer
|
||||||
uses: https://git.alrakis.kz/actions/upload-artifact@v4-gitea
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: installer-${{ steps.version.outputs.plain }}
|
name: installer-${{ steps.version.outputs.plain }}
|
||||||
path: artifacts/installers/*.msi
|
path: artifacts/installers/*.msi
|
||||||
@@ -180,8 +167,10 @@ jobs:
|
|||||||
|
|
||||||
# The GITHUB_ names are what Gitea itself hands to the workflow — its
|
# The GITHUB_ names are what Gitea itself hands to the workflow — its
|
||||||
# actions repeat those of GitHub, and the addresses in them point at
|
# actions repeat those of GitHub, and the addresses in them point at
|
||||||
# this Gitea instance
|
# this Gitea instance. GITHUB_API_URL used not to reach the steps at
|
||||||
$api = "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/releases"
|
# all, so the address is put together from the server one when empty
|
||||||
|
$root = if ($env:GITHUB_API_URL) { $env:GITHUB_API_URL } else { "$env:GITHUB_SERVER_URL/api/v1" }
|
||||||
|
$api = "$root/repos/$env:GITHUB_REPOSITORY/releases"
|
||||||
$headers = @{ Authorization = "token $env:GITEA_TOKEN" }
|
$headers = @{ Authorization = "token $env:GITEA_TOKEN" }
|
||||||
|
|
||||||
# Gitea makes a release of its own for a pushed tag, so the release is
|
# Gitea makes a release of its own for a pushed tag, so the release is
|
||||||
|
|||||||
@@ -68,42 +68,42 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PopupWindowNative.Rect? anchor = TryGetAnchor();
|
bool atFixedPoint = _settings.PlacementMode == PopupPlacementMode.FixedPoint;
|
||||||
PopupModeSettings mode = ModeFor(anchor);
|
|
||||||
|
|
||||||
PopupWindowNative.Rect work = default;
|
PopupWindowNative.Rect work = default;
|
||||||
|
PopupWindowNative.Rect anchor = default;
|
||||||
double scale;
|
double scale;
|
||||||
|
|
||||||
if (anchor is { } at)
|
if (atFixedPoint)
|
||||||
{
|
|
||||||
scale = PopupWindowNative.GetScaleAt(new PopupWindowNative.Point { X = at.Left, Y = at.Top });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
(work, scale) = PopupWindowNative.GetActiveMonitorWorkArea();
|
(work, scale) = PopupWindowNative.GetActiveMonitorWorkArea();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
anchor = GetAnchor();
|
||||||
|
scale = PopupWindowNative.GetScaleAt(new PopupWindowNative.Point { X = anchor.Left, Y = anchor.Top });
|
||||||
|
}
|
||||||
|
|
||||||
EnsureFont(mode, scale);
|
EnsureFont(scale);
|
||||||
|
|
||||||
Size measured = MeasureText(text);
|
Size measured = MeasureText(text);
|
||||||
int width = measured.Width + (2 * PopupLayout.ToPixels(PaddingX, scale));
|
int width = measured.Width + (2 * PopupLayout.ToPixels(PaddingX, scale));
|
||||||
int height = measured.Height + (2 * PopupLayout.ToPixels(PaddingY, scale));
|
int height = measured.Height + (2 * PopupLayout.ToPixels(PaddingY, scale));
|
||||||
|
|
||||||
PopupWindowNative.Point position = anchor is { } near
|
PopupWindowNative.Point position = atFixedPoint
|
||||||
? PopupLayout.NearAnchor(
|
? PopupLayout.OnScreen(
|
||||||
near,
|
|
||||||
SideForMode(),
|
|
||||||
PopupLayout.ToPixels(mode.Offset, scale),
|
|
||||||
width,
|
|
||||||
height)
|
|
||||||
: PopupLayout.OnScreen(
|
|
||||||
work,
|
work,
|
||||||
_settings.FixedPoint.Position,
|
_settings.FixedPoint.Position,
|
||||||
PopupLayout.ToPixels(mode.Offset, scale),
|
PopupLayout.ToPixels(_settings.FixedPoint.Offset, scale),
|
||||||
|
width,
|
||||||
|
height)
|
||||||
|
: PopupLayout.NearAnchor(
|
||||||
|
anchor,
|
||||||
|
SideForMode(),
|
||||||
|
PopupLayout.ToPixels(_settings.Current.Offset, scale),
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
|
||||||
if (!Draw(mode, text, position, width, height, PopupLayout.ToPixels(CornerRadius, scale)))
|
if (!Draw(text, position, width, height, PopupLayout.ToPixels(CornerRadius, scale)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -139,8 +139,7 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
/// kilobytes for the length of one call, the popup is shown rarely, and a cached one
|
/// kilobytes for the length of one call, the popup is shown rarely, and a cached one
|
||||||
/// would have to be rebuilt on every change of size, colour or scale anyway.
|
/// would have to be rebuilt on every change of size, colour or scale anyway.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private bool Draw(
|
private bool Draw(string text, PopupWindowNative.Point at, int width, int height, int radius)
|
||||||
PopupModeSettings mode, string text, PopupWindowNative.Point at, int width, int height, int radius)
|
|
||||||
{
|
{
|
||||||
IntPtr screen = GdiNative.GetDC(IntPtr.Zero);
|
IntPtr screen = GdiNative.GetDC(IntPtr.Zero);
|
||||||
if (screen == IntPtr.Zero)
|
if (screen == IntPtr.Zero)
|
||||||
@@ -167,8 +166,8 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
|
|
||||||
GdiNative.SelectObject(memory, surface);
|
GdiNative.SelectObject(memory, surface);
|
||||||
|
|
||||||
Fill(mode, bits, width, height);
|
Fill(bits, width, height);
|
||||||
DrawText(mode, memory, text, width, height);
|
DrawText(memory, text, width, height);
|
||||||
|
|
||||||
// GDI writes nothing into the alpha channel, so the letters it just drew are
|
// GDI writes nothing into the alpha channel, so the letters it just drew are
|
||||||
// sitting at zero alpha and would come out invisible. The inside of the
|
// sitting at zero alpha and would come out invisible. The inside of the
|
||||||
@@ -179,7 +178,7 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
RoundTheCorners(bits, width, height, radius);
|
RoundTheCorners(bits, width, height, radius);
|
||||||
|
|
||||||
var size = new WindowNative.Size { Width = width, Height = height };
|
var size = new WindowNative.Size { Width = width, Height = height };
|
||||||
var alpha = (byte)Math.Clamp(Math.Round(mode.Opacity * 255), 0, 255);
|
var alpha = (byte)Math.Clamp(Math.Round(_settings.Current.Opacity * 255), 0, 255);
|
||||||
|
|
||||||
return WindowNative.SetContent(Handle, at, size, memory, alpha);
|
return WindowNative.SetContent(Handle, at, size, memory, alpha);
|
||||||
}
|
}
|
||||||
@@ -201,9 +200,9 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Fill(PopupModeSettings mode, IntPtr bits, int width, int height)
|
private void Fill(IntPtr bits, int width, int height)
|
||||||
{
|
{
|
||||||
Color background = mode.BackgroundColor;
|
Color background = _settings.Current.BackgroundColor;
|
||||||
|
|
||||||
// Straight into the bitmap rather than through a brush: the pixels have to be
|
// Straight into the bitmap rather than through a brush: the pixels have to be
|
||||||
// written anyway to carry an alpha channel GDI would not touch
|
// written anyway to carry an alpha channel GDI would not touch
|
||||||
@@ -217,8 +216,7 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawText(
|
private void DrawText(IntPtr deviceContext, string text, int width, int height)
|
||||||
PopupModeSettings mode, IntPtr deviceContext, string text, int width, int height)
|
|
||||||
{
|
{
|
||||||
if (_font == IntPtr.Zero || text.Length == 0)
|
if (_font == IntPtr.Zero || text.Length == 0)
|
||||||
{
|
{
|
||||||
@@ -229,7 +227,7 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
|
|
||||||
IntPtr previousFont = GdiNative.SelectObject(deviceContext, _font);
|
IntPtr previousFont = GdiNative.SelectObject(deviceContext, _font);
|
||||||
GdiNative.SetBkMode(deviceContext, GdiNative.TRANSPARENT);
|
GdiNative.SetBkMode(deviceContext, GdiNative.TRANSPARENT);
|
||||||
GdiNative.SetTextColor(deviceContext, GdiNative.ToColorRef(mode.ForegroundColor));
|
GdiNative.SetTextColor(deviceContext, GdiNative.ToColorRef(_settings.Current.ForegroundColor));
|
||||||
|
|
||||||
GdiNative.DrawText(deviceContext, text, text.Length, ref bounds,
|
GdiNative.DrawText(deviceContext, text, text.Length, ref bounds,
|
||||||
GdiNative.DT_SINGLELINE | GdiNative.DT_CENTER | GdiNative.DT_VCENTER |
|
GdiNative.DT_SINGLELINE | GdiNative.DT_CENTER | GdiNative.DT_VCENTER |
|
||||||
@@ -331,40 +329,18 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
return (int)((alpha << 24) | (red << 16) | (green << 8) | blue);
|
return (int)((alpha << 24) | (red << 16) | (green << 8) | blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
// The anchor point: the caret in the input field or the mouse cursor. The cursor
|
||||||
/// What the popup is placed next to, or <c>null</c> when there is nothing: the fixed
|
// is a rectangle of zero size, so the corner computation is shared by both
|
||||||
/// point mode, and the caret mode where the application reports no caret.
|
private PopupWindowNative.Rect GetAnchor()
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The cursor is a rectangle of zero size, so the corner arithmetic is shared by it
|
|
||||||
/// and the caret.
|
|
||||||
/// </remarks>
|
|
||||||
private PopupWindowNative.Rect? TryGetAnchor() => _settings.PlacementMode switch
|
|
||||||
{
|
{
|
||||||
PopupPlacementMode.FixedPoint => null,
|
if (_settings.PlacementMode == PopupPlacementMode.AtCaret &&
|
||||||
PopupPlacementMode.AtCaret => CaretNative.TryGetCaretRect(),
|
CaretNative.TryGetCaretRect() is { } caret)
|
||||||
_ => PopupLayout.AsAnchor(PopupWindowNative.GetCursorPosition()),
|
{
|
||||||
};
|
return caret;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
return PopupLayout.AsAnchor(PopupWindowNative.GetCursorPosition());
|
||||||
/// The settings the popup is shown with: those of the mode chosen, or those of the
|
}
|
||||||
/// fixed point when there is no anchor to stand next to.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The caret mode falls back to the fixed point rather than to the mouse cursor:
|
|
||||||
/// the cursor is wherever it was last left — off to a side, on another monitor, or
|
|
||||||
/// over the very text being typed — and a popup that lands there while the eyes are
|
|
||||||
/// on the caret is one that is looked for and not found. The fixed point is always
|
|
||||||
/// in the same place, so it is known where to look.
|
|
||||||
///
|
|
||||||
/// The look comes from the fixed point mode too, not just the place. The two are set
|
|
||||||
/// up together for a reason: the popup by the caret is small and quiet because it
|
|
||||||
/// sits inside a text being read, while the one in the corner of the monitor is
|
|
||||||
/// looked for on purpose and is set larger. Keeping the caret look at the corner
|
|
||||||
/// would put a popup meant to go unnoticed where nothing else draws the eye.
|
|
||||||
/// </remarks>
|
|
||||||
private PopupModeSettings ModeFor(PopupWindowNative.Rect? anchor) =>
|
|
||||||
anchor is null ? _settings.FixedPoint : _settings.Current;
|
|
||||||
|
|
||||||
// The caret has two sides to choose from and the cursor has six, so each mode names
|
// The caret has two sides to choose from and the cursor has six, so each mode names
|
||||||
// its own side in its own terms
|
// its own side in its own terms
|
||||||
@@ -397,10 +373,10 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
// The font is rebuilt only when the size in the settings or the monitor scale
|
// The font is rebuilt only when the size in the settings or the monitor scale
|
||||||
// changes: it is the one expensive thing a show does. A switch of the placement
|
// changes: it is the one expensive thing a show does. A switch of the placement
|
||||||
// mode counts as a change of the size, since the size belongs to the mode
|
// mode counts as a change of the size, since the size belongs to the mode
|
||||||
private void EnsureFont(PopupModeSettings mode, double scale)
|
private void EnsureFont(double scale)
|
||||||
{
|
{
|
||||||
if (_font != IntPtr.Zero &&
|
if (_font != IntPtr.Zero &&
|
||||||
Math.Abs(_fontSize - mode.FontSize) < 0.01 &&
|
Math.Abs(_fontSize - _settings.Current.FontSize) < 0.01 &&
|
||||||
Math.Abs(_fontScale - scale) < 0.01)
|
Math.Abs(_fontScale - scale) < 0.01)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -408,7 +384,7 @@ internal sealed class NativePopupWindow : NativeWindow, ILayoutPopupWindow
|
|||||||
|
|
||||||
ReleaseFont();
|
ReleaseFont();
|
||||||
|
|
||||||
_fontSize = mode.FontSize;
|
_fontSize = _settings.Current.FontSize;
|
||||||
_fontScale = scale;
|
_fontScale = scale;
|
||||||
_font = GdiNative.CreateFont(_fontSize, scale);
|
_font = GdiNative.CreateFont(_fontSize, scale);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ internal static class CaretNative
|
|||||||
private static PopupWindowNative.Rect? TryGetAutomationCaret()
|
private static PopupWindowNative.Rect? TryGetAutomationCaret()
|
||||||
{
|
{
|
||||||
// A hung application must not hang the popup along with it: we wait for the
|
// A hung application must not hang the popup along with it: we wait for the
|
||||||
// answer for a limited time, otherwise the popup goes to the fixed point
|
// answer for a limited time, otherwise we show the popup at the cursor
|
||||||
Task<PopupWindowNative.Rect?> query = Task.Run(QueryAutomationCaret);
|
Task<PopupWindowNative.Rect?> query = Task.Run(QueryAutomationCaret);
|
||||||
return query.Wait(AutomationTimeout) ? query.Result : null;
|
return query.Wait(AutomationTimeout) ? query.Result : null;
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ internal static class CaretNative
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Built without UI Automation: Chromium and Electron keep the system caret and MSAA
|
// Built without UI Automation: Chromium and Electron keep the system caret and MSAA
|
||||||
// steps above, and where those stay silent the popup falls back to the fixed point
|
// steps above, and where those stay silent the popup falls back to the cursor
|
||||||
private static PopupWindowNative.Rect? TryGetAutomationCaret() => null;
|
private static PopupWindowNative.Rect? TryGetAutomationCaret() => null;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ public enum PopupPlacementMode
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Next to the caret in the active input field. When the application does not
|
/// Next to the caret in the active input field. When the application does not
|
||||||
/// report its position, the popup is shown as in <see cref="FixedPoint"/> — at the
|
/// report its position, the popup is shown at the mouse cursor.
|
||||||
/// place and with the look that mode is set up with.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AtCaret,
|
AtCaret,
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using CursorLang.Core.Models;
|
using CursorLang.Core.Models;
|
||||||
using CursorLang.Core.Services;
|
using CursorLang.Core.Services;
|
||||||
|
using CursorLang.Settings.Tests.Infrastructure;
|
||||||
using CursorLang.Settings.ViewModels;
|
using CursorLang.Settings.ViewModels;
|
||||||
using CursorLang.Tests.Shared;
|
using CursorLang.Tests.Shared;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=vm:SettingsViewModel}"
|
d:DataContext="{d:DesignInstance Type=vm:SettingsViewModel}"
|
||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
Width="560" SizeToContent="Height" MaxHeight="940"
|
Width="1000" SizeToContent="Height" MaxHeight="900"
|
||||||
ResizeMode="CanMinimize"
|
ResizeMode="CanMinimize"
|
||||||
Background="{DynamicResource Theme.WindowBackground}"
|
Background="{DynamicResource Theme.WindowBackground}"
|
||||||
Foreground="{DynamicResource Theme.Foreground}">
|
Foreground="{DynamicResource Theme.Foreground}">
|
||||||
@@ -59,348 +59,370 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
|
<!-- The settings are laid out in two columns: this way the window fits on the
|
||||||
|
screen entirely and does without scrolling. Scrolling is kept for the case of
|
||||||
|
a large system font, with which the content is taller than the monitor after all.
|
||||||
|
|
||||||
|
The left column holds what the popup does; the right one holds the single
|
||||||
|
section describing how and where the popup looks -->
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Padding="16">
|
<ScrollViewer VerticalScrollBarVisibility="Auto" Padding="16">
|
||||||
<StackPanel>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<GroupBox Header="{Binding Localization[SectionInterface]}">
|
<StackPanel>
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="164" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Style="{StaticResource FieldLabel}"
|
<GroupBox Header="{Binding Localization[SectionInterface]}">
|
||||||
Text="{Binding Localization[LanguageLabel]}" />
|
<Grid>
|
||||||
<ComboBox Grid.Column="1"
|
<Grid.ColumnDefinitions>
|
||||||
ItemsSource="{Binding Localization.AvailableLanguages}"
|
<ColumnDefinition Width="164" />
|
||||||
DisplayMemberPath="DisplayName"
|
<ColumnDefinition Width="*" />
|
||||||
SelectedValuePath="Code"
|
</Grid.ColumnDefinitions>
|
||||||
SelectedValue="{Binding Settings.Language}" />
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Margin="0,12,12,0"
|
<TextBlock Style="{StaticResource FieldLabel}"
|
||||||
Style="{StaticResource FieldLabel}"
|
Text="{Binding Localization[LanguageLabel]}" />
|
||||||
Text="{Binding Localization[ThemeLabel]}" />
|
<ComboBox Grid.Column="1"
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Margin="0,12,0,0"
|
ItemsSource="{Binding Localization.AvailableLanguages}"
|
||||||
ItemsSource="{Binding Themes}"
|
DisplayMemberPath="DisplayName"
|
||||||
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
SelectedValuePath="Code"
|
||||||
SelectedValuePath="Value"
|
SelectedValue="{Binding Settings.Language}" />
|
||||||
SelectedValue="{Binding Settings.Theme}" />
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
|
|
||||||
<GroupBox Header="{Binding Localization[SectionPopup]}">
|
<TextBlock Grid.Row="1" Margin="0,12,12,0"
|
||||||
<Grid>
|
Style="{StaticResource FieldLabel}"
|
||||||
<Grid.ColumnDefinitions>
|
Text="{Binding Localization[ThemeLabel]}" />
|
||||||
<ColumnDefinition Width="164" />
|
<ComboBox Grid.Row="1" Grid.Column="1" Margin="0,12,0,0"
|
||||||
<ColumnDefinition Width="*" />
|
ItemsSource="{Binding Themes}"
|
||||||
<ColumnDefinition Width="Auto" />
|
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
||||||
</Grid.ColumnDefinitions>
|
SelectedValuePath="Value"
|
||||||
<Grid.RowDefinitions>
|
SelectedValue="{Binding Settings.Theme}" />
|
||||||
<RowDefinition Height="Auto" />
|
</Grid>
|
||||||
<RowDefinition Height="Auto" />
|
</GroupBox>
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Style="{StaticResource FieldLabel}">
|
<GroupBox Header="{Binding Localization[SectionBehavior]}">
|
||||||
<Run Text="{Binding Localization[PlacementModeLabel], Mode=OneWay}" />
|
<Grid>
|
||||||
<InlineUIContainer BaselineAlignment="Baseline">
|
<Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding Localization[MoreInfoLink]}"
|
<ColumnDefinition Width="164" />
|
||||||
Foreground="{DynamicResource Theme.Accent}"
|
<ColumnDefinition Width="*" />
|
||||||
TextDecorations="Underline"
|
<ColumnDefinition Width="Auto" />
|
||||||
Cursor="Help"
|
</Grid.ColumnDefinitions>
|
||||||
ToolTipService.InitialShowDelay="200"
|
<Grid.RowDefinitions>
|
||||||
ToolTipService.ShowDuration="60000">
|
<RowDefinition Height="Auto" />
|
||||||
<TextBlock.ToolTip>
|
<RowDefinition Height="Auto" />
|
||||||
<ToolTip>
|
<RowDefinition Height="Auto" />
|
||||||
<TextBlock TextWrapping="Wrap" MaxWidth="320"
|
<RowDefinition Height="Auto" />
|
||||||
Text="{Binding Localization[PopupLookPerModeHint]}" />
|
<RowDefinition Height="Auto" />
|
||||||
</ToolTip>
|
<RowDefinition Height="Auto" />
|
||||||
</TextBlock.ToolTip>
|
</Grid.RowDefinitions>
|
||||||
</TextBlock>
|
|
||||||
</InlineUIContainer>
|
|
||||||
</TextBlock>
|
|
||||||
<ComboBox Grid.Column="1" Grid.ColumnSpan="2"
|
|
||||||
ItemsSource="{Binding PlacementModes}"
|
|
||||||
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
|
||||||
SelectedValuePath="Value"
|
|
||||||
SelectedValue="{Binding Settings.PlacementMode}" />
|
|
||||||
|
|
||||||
<!-- The "at cursor" mode: a side and an offset of its own -->
|
<TextBlock Style="{StaticResource FieldLabel}"
|
||||||
<TextBlock Grid.Row="1" Margin="0,12,12,0"
|
Text="{Binding Localization[DurationLabel]}" />
|
||||||
Style="{StaticResource FieldLabel}"
|
<Slider Grid.Column="1" Minimum="200" Maximum="5000" TickFrequency="100"
|
||||||
Text="{Binding Localization[CursorCornerLabel]}"
|
Value="{Binding Settings.DurationMilliseconds}" />
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
Converter={StaticResource EnumToVisibility},
|
<TextBlock Style="{StaticResource FieldValue}"
|
||||||
ConverterParameter=AtCursor}" />
|
Text="{Binding Settings.DurationMilliseconds, StringFormat={}{0:F0}}" />
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
<TextBlock Margin="4,0,0,0"
|
||||||
ItemsSource="{Binding AnchorSides}"
|
Foreground="{DynamicResource Theme.SecondaryForeground}"
|
||||||
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
Text="{Binding Localization[MillisecondsSuffix]}" />
|
||||||
SelectedValuePath="Value"
|
</StackPanel>
|
||||||
SelectedValue="{Binding Settings.AtCursor.Side}"
|
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
|
||||||
Converter={StaticResource EnumToVisibility},
|
|
||||||
ConverterParameter=AtCursor}" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Margin="0,12,12,0"
|
<TextBlock Grid.Row="1" Margin="0,12,12,0"
|
||||||
Style="{StaticResource FieldLabel}"
|
Style="{StaticResource FieldLabel}"
|
||||||
Text="{Binding Localization[CursorOffsetLabel]}"
|
Text="{Binding Localization[CapsLockLabel]}" />
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
<CheckBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
Converter={StaticResource EnumToVisibility},
|
IsChecked="{Binding Settings.UseCapsLockHotkey}"
|
||||||
ConverterParameter=AtCursor}" />
|
Content="{Binding Localization[CapsLockHotkeyCheck]}" />
|
||||||
<Slider Grid.Row="2" Grid.Column="1" Margin="0,12,0,0"
|
|
||||||
Minimum="0" Maximum="80" TickFrequency="1"
|
|
||||||
Value="{Binding Settings.AtCursor.Offset}"
|
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
|
||||||
Converter={StaticResource EnumToVisibility},
|
|
||||||
ConverterParameter=AtCursor}" />
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="2" Margin="12,12,0,0"
|
|
||||||
Style="{StaticResource FieldValue}"
|
|
||||||
Text="{Binding Settings.AtCursor.Offset, StringFormat={}{0:F0}}"
|
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
|
||||||
Converter={StaticResource EnumToVisibility},
|
|
||||||
ConverterParameter=AtCursor}" />
|
|
||||||
|
|
||||||
<!-- The "at caret" mode: a side and an offset of its own -->
|
<TextBlock Grid.Row="2" Margin="0,12,12,0"
|
||||||
<TextBlock Grid.Row="3" Margin="0,12,12,0"
|
Style="{StaticResource FieldLabel}"
|
||||||
Style="{StaticResource FieldLabel}"
|
Text="{Binding Localization[CapsLockHoldLabel]}" />
|
||||||
Text="{Binding Localization[CursorCornerLabel]}"
|
<Slider Grid.Row="2" Grid.Column="1" Margin="0,12,0,0"
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
Minimum="150" Maximum="1500" TickFrequency="50"
|
||||||
Converter={StaticResource EnumToVisibility},
|
Value="{Binding Settings.CapsLockHoldMilliseconds}"
|
||||||
ConverterParameter=AtCaret}" />
|
IsEnabled="{Binding Settings.UseCapsLockHotkey}" />
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
<StackPanel Grid.Row="2" Grid.Column="2" Margin="0,12,0,0"
|
||||||
ItemsSource="{Binding CaretSides}"
|
Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
<TextBlock Style="{StaticResource FieldValue}"
|
||||||
SelectedValuePath="Value"
|
Text="{Binding Settings.CapsLockHoldMilliseconds, StringFormat={}{0:F0}}" />
|
||||||
SelectedValue="{Binding Settings.AtCaret.Side}"
|
<TextBlock Margin="4,0,0,0"
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
Foreground="{DynamicResource Theme.SecondaryForeground}"
|
||||||
Converter={StaticResource EnumToVisibility},
|
Text="{Binding Localization[MillisecondsSuffix]}" />
|
||||||
ConverterParameter=AtCaret}" />
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock Grid.Row="4" Margin="0,12,12,0"
|
<TextBlock Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
Style="{StaticResource FieldLabel}"
|
Margin="0,6,0,0" TextWrapping="Wrap"
|
||||||
Text="{Binding Localization[CursorOffsetLabel]}"
|
Foreground="{DynamicResource Theme.SecondaryForeground}">
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
<Run Text="{Binding Localization[CapsLockHoldHint], Mode=OneWay}" />
|
||||||
Converter={StaticResource EnumToVisibility},
|
<InlineUIContainer BaselineAlignment="Baseline">
|
||||||
ConverterParameter=AtCaret}" />
|
<!-- The elevation caveat lives in the tooltip to keep the section compact -->
|
||||||
<Slider Grid.Row="4" Grid.Column="1" Margin="0,12,0,0"
|
<TextBlock Text="{Binding Localization[MoreInfoLink]}"
|
||||||
Minimum="0" Maximum="80" TickFrequency="1"
|
Foreground="{DynamicResource Theme.Accent}"
|
||||||
Value="{Binding Settings.AtCaret.Offset}"
|
TextDecorations="Underline"
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
Cursor="Help"
|
||||||
Converter={StaticResource EnumToVisibility},
|
ToolTipService.InitialShowDelay="200"
|
||||||
ConverterParameter=AtCaret}" />
|
ToolTipService.ShowDuration="60000"
|
||||||
<TextBlock Grid.Row="4" Grid.Column="2" Margin="12,12,0,0"
|
Visibility="{Binding Settings.UseCapsLockHotkey, Converter={StaticResource BooleanToVisibility}}">
|
||||||
Style="{StaticResource FieldValue}"
|
<TextBlock.ToolTip>
|
||||||
Text="{Binding Settings.AtCaret.Offset, StringFormat={}{0:F0}}"
|
<ToolTip>
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
<TextBlock TextWrapping="Wrap"
|
||||||
Converter={StaticResource EnumToVisibility},
|
Text="{Binding Localization[CapsLockElevationHint]}" />
|
||||||
ConverterParameter=AtCaret}" />
|
</ToolTip>
|
||||||
|
</TextBlock.ToolTip>
|
||||||
|
</TextBlock>
|
||||||
|
</InlineUIContainer>
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
<!-- The "fixed point" mode -->
|
<TextBlock Grid.Row="4" Margin="0,12,12,0"
|
||||||
<TextBlock Grid.Row="5" Margin="0,12,12,0"
|
Style="{StaticResource FieldLabel}"
|
||||||
Style="{StaticResource FieldLabel}"
|
Visibility="{Binding IsStartupAvailable, Converter={StaticResource BooleanToVisibility}}"
|
||||||
Text="{Binding Localization[ScreenPositionLabel]}"
|
Text="{Binding Localization[StartupLabel]}" />
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
<CheckBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
Converter={StaticResource EnumToVisibility},
|
Visibility="{Binding IsStartupAvailable, Converter={StaticResource BooleanToVisibility}}"
|
||||||
ConverterParameter=FixedPoint}" />
|
IsEnabled="{Binding CanChangeStartup}"
|
||||||
<ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
IsChecked="{Binding RunAtStartup}"
|
||||||
ItemsSource="{Binding ScreenPositions}"
|
Content="{Binding Localization[StartupCheck]}" />
|
||||||
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
|
||||||
SelectedValuePath="Value"
|
|
||||||
SelectedValue="{Binding Settings.FixedPoint.Position}"
|
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
|
||||||
Converter={StaticResource EnumToVisibility},
|
|
||||||
ConverterParameter=FixedPoint}" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="6" Margin="0,12,12,0"
|
<TextBlock Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
Style="{StaticResource FieldLabel}"
|
Margin="0,6,0,0" TextWrapping="Wrap"
|
||||||
Text="{Binding Localization[ScreenMarginLabel]}"
|
Foreground="{DynamicResource Theme.SecondaryForeground}"
|
||||||
IsEnabled="{Binding Settings.FixedPoint.IsAtAnEdge}"
|
Visibility="{Binding IsStartupLocked, Converter={StaticResource BooleanToVisibility}}"
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
Text="{Binding Localization[StartupLockedHint]}" />
|
||||||
Converter={StaticResource EnumToVisibility},
|
</Grid>
|
||||||
ConverterParameter=FixedPoint}" />
|
</GroupBox>
|
||||||
<Slider Grid.Row="6" Grid.Column="1" Margin="0,12,0,0"
|
|
||||||
Minimum="0" Maximum="200" TickFrequency="1"
|
|
||||||
Value="{Binding Settings.FixedPoint.Offset}"
|
|
||||||
IsEnabled="{Binding Settings.FixedPoint.IsAtAnEdge}"
|
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
|
||||||
Converter={StaticResource EnumToVisibility},
|
|
||||||
ConverterParameter=FixedPoint}" />
|
|
||||||
<TextBlock Grid.Row="6" Grid.Column="2" Margin="12,12,0,0"
|
|
||||||
Style="{StaticResource FieldValue}"
|
|
||||||
Text="{Binding Settings.FixedPoint.Offset, StringFormat={}{0:F0}}"
|
|
||||||
IsEnabled="{Binding Settings.FixedPoint.IsAtAnEdge}"
|
|
||||||
Visibility="{Binding Settings.PlacementMode,
|
|
||||||
Converter={StaticResource EnumToVisibility},
|
|
||||||
ConverterParameter=FixedPoint}" />
|
|
||||||
|
|
||||||
<Border Grid.Row="7" Grid.ColumnSpan="3"
|
</StackPanel>
|
||||||
Margin="0,16,0,0" Height="1"
|
|
||||||
Background="{DynamicResource Theme.ControlBorder}" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="8" Margin="0,12,12,0"
|
<StackPanel Grid.Column="1" Margin="16,0,0,0">
|
||||||
Style="{StaticResource FieldLabel}"
|
|
||||||
Text="{Binding Localization[FontSizeLabel]}" />
|
|
||||||
<Slider Grid.Row="8" Grid.Column="1" Margin="0,12,0,0"
|
|
||||||
Minimum="10" Maximum="72" TickFrequency="1"
|
|
||||||
Value="{Binding Settings.Current.FontSize}" />
|
|
||||||
<TextBlock Grid.Row="8" Grid.Column="2" Margin="12,12,0,0"
|
|
||||||
Style="{StaticResource FieldValue}"
|
|
||||||
Text="{Binding Settings.Current.FontSize, StringFormat={}{0:F0}}" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="9" Margin="0,12,12,0"
|
<!-- Where the popup appears and how it looks are one question for the
|
||||||
Style="{StaticResource FieldLabel}"
|
user, so both live in a single section: the rule is picked at the
|
||||||
Text="{Binding Localization[OpacityLabel]}" />
|
top and its result is seen in the preview at the bottom -->
|
||||||
<Slider Grid.Row="9" Grid.Column="1" Margin="0,12,0,0"
|
<GroupBox Header="{Binding Localization[SectionPopup]}">
|
||||||
Minimum="0.1" Maximum="1" TickFrequency="0.05"
|
<Grid>
|
||||||
Value="{Binding Settings.Current.Opacity}" />
|
<Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="9" Grid.Column="2" Margin="12,12,0,0"
|
<ColumnDefinition Width="164" />
|
||||||
Style="{StaticResource FieldValue}"
|
<ColumnDefinition Width="*" />
|
||||||
Text="{Binding Settings.Current.Opacity, StringFormat={}{0:P0}}" />
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Row="10" Margin="0,12,12,0"
|
<TextBlock Style="{StaticResource FieldLabel}">
|
||||||
Style="{StaticResource FieldLabel}"
|
<Run Text="{Binding Localization[PlacementModeLabel], Mode=OneWay}" />
|
||||||
Text="{Binding Localization[BackgroundColorLabel]}" />
|
<InlineUIContainer BaselineAlignment="Baseline">
|
||||||
<ComboBox Grid.Row="10" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
<TextBlock Text="{Binding Localization[MoreInfoLink]}"
|
||||||
ItemsSource="{Binding BackgroundPalette}"
|
Foreground="{DynamicResource Theme.Accent}"
|
||||||
ItemTemplate="{StaticResource ColorSwatchTemplate}"
|
TextDecorations="Underline"
|
||||||
SelectedItem="{Binding Settings.Current.BackgroundColor}" />
|
Cursor="Help"
|
||||||
|
ToolTipService.InitialShowDelay="200"
|
||||||
|
ToolTipService.ShowDuration="60000">
|
||||||
|
<TextBlock.ToolTip>
|
||||||
|
<ToolTip>
|
||||||
|
<TextBlock TextWrapping="Wrap" MaxWidth="320"
|
||||||
|
Text="{Binding Localization[PopupLookPerModeHint]}" />
|
||||||
|
</ToolTip>
|
||||||
|
</TextBlock.ToolTip>
|
||||||
|
</TextBlock>
|
||||||
|
</InlineUIContainer>
|
||||||
|
</TextBlock>
|
||||||
|
<ComboBox Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
ItemsSource="{Binding PlacementModes}"
|
||||||
|
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
||||||
|
SelectedValuePath="Value"
|
||||||
|
SelectedValue="{Binding Settings.PlacementMode}" />
|
||||||
|
|
||||||
<TextBlock Grid.Row="11" Margin="0,12,12,0"
|
<!-- The "at cursor" mode: a side and an offset of its own -->
|
||||||
Style="{StaticResource FieldLabel}"
|
<TextBlock Grid.Row="1" Margin="0,12,12,0"
|
||||||
Text="{Binding Localization[TextColorLabel]}" />
|
Style="{StaticResource FieldLabel}"
|
||||||
<ComboBox Grid.Row="11" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
Text="{Binding Localization[CursorCornerLabel]}"
|
||||||
ItemsSource="{Binding TextPalette}"
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
ItemTemplate="{StaticResource ColorSwatchTemplate}"
|
Converter={StaticResource EnumToVisibility},
|
||||||
SelectedItem="{Binding Settings.Current.ForegroundColor}" />
|
ConverterParameter=AtCursor}" />
|
||||||
|
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
|
ItemsSource="{Binding AnchorSides}"
|
||||||
|
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
||||||
|
SelectedValuePath="Value"
|
||||||
|
SelectedValue="{Binding Settings.AtCursor.Side}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCursor}" />
|
||||||
|
|
||||||
<TextBlock Grid.Row="12" Margin="0,12,12,0"
|
<TextBlock Grid.Row="2" Margin="0,12,12,0"
|
||||||
Style="{StaticResource FieldLabel}"
|
Style="{StaticResource FieldLabel}"
|
||||||
Text="{Binding Localization[PreviewLabel]}" />
|
Text="{Binding Localization[CursorOffsetLabel]}"
|
||||||
<Border Grid.Row="12" Grid.Column="1" Grid.ColumnSpan="2"
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
Margin="0,12,0,0" Padding="16"
|
Converter={StaticResource EnumToVisibility},
|
||||||
Height="152" ClipToBounds="True"
|
ConverterParameter=AtCursor}" />
|
||||||
Background="{DynamicResource Theme.SurfaceStrong}" CornerRadius="4"
|
<Slider Grid.Row="2" Grid.Column="1" Margin="0,12,0,0"
|
||||||
HorizontalAlignment="Stretch">
|
Minimum="0" Maximum="80" TickFrequency="1"
|
||||||
<Border CornerRadius="4" Padding="10,4"
|
Value="{Binding Settings.AtCursor.Offset}"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
Opacity="{Binding Settings.Current.Opacity}"
|
Converter={StaticResource EnumToVisibility},
|
||||||
Background="{Binding Settings.Current.BackgroundColor,
|
ConverterParameter=AtCursor}" />
|
||||||
Converter={StaticResource ColorToBrush}}">
|
<TextBlock Grid.Row="2" Grid.Column="2" Margin="12,12,0,0"
|
||||||
<TextBlock Text="RU" FontWeight="SemiBold"
|
Style="{StaticResource FieldValue}"
|
||||||
FontSize="{Binding Settings.Current.FontSize}"
|
Text="{Binding Settings.AtCursor.Offset, StringFormat={}{0:F0}}"
|
||||||
Foreground="{Binding Settings.Current.ForegroundColor,
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
Converter={StaticResource ColorToBrush}}" />
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCursor}" />
|
||||||
|
|
||||||
|
<!-- The "at caret" mode: a side and an offset of its own -->
|
||||||
|
<TextBlock Grid.Row="3" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[CursorCornerLabel]}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCaret}" />
|
||||||
|
<ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
|
ItemsSource="{Binding CaretSides}"
|
||||||
|
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
||||||
|
SelectedValuePath="Value"
|
||||||
|
SelectedValue="{Binding Settings.AtCaret.Side}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCaret}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="4" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[CursorOffsetLabel]}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCaret}" />
|
||||||
|
<Slider Grid.Row="4" Grid.Column="1" Margin="0,12,0,0"
|
||||||
|
Minimum="0" Maximum="80" TickFrequency="1"
|
||||||
|
Value="{Binding Settings.AtCaret.Offset}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCaret}" />
|
||||||
|
<TextBlock Grid.Row="4" Grid.Column="2" Margin="12,12,0,0"
|
||||||
|
Style="{StaticResource FieldValue}"
|
||||||
|
Text="{Binding Settings.AtCaret.Offset, StringFormat={}{0:F0}}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=AtCaret}" />
|
||||||
|
|
||||||
|
<!-- The "fixed point" mode -->
|
||||||
|
<TextBlock Grid.Row="5" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[ScreenPositionLabel]}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=FixedPoint}" />
|
||||||
|
<ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
|
ItemsSource="{Binding ScreenPositions}"
|
||||||
|
ItemTemplate="{StaticResource EnumOptionTemplate}"
|
||||||
|
SelectedValuePath="Value"
|
||||||
|
SelectedValue="{Binding Settings.FixedPoint.Position}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=FixedPoint}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="6" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[ScreenMarginLabel]}"
|
||||||
|
IsEnabled="{Binding Settings.FixedPoint.IsAtAnEdge}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=FixedPoint}" />
|
||||||
|
<Slider Grid.Row="6" Grid.Column="1" Margin="0,12,0,0"
|
||||||
|
Minimum="0" Maximum="200" TickFrequency="1"
|
||||||
|
Value="{Binding Settings.FixedPoint.Offset}"
|
||||||
|
IsEnabled="{Binding Settings.FixedPoint.IsAtAnEdge}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=FixedPoint}" />
|
||||||
|
<TextBlock Grid.Row="6" Grid.Column="2" Margin="12,12,0,0"
|
||||||
|
Style="{StaticResource FieldValue}"
|
||||||
|
Text="{Binding Settings.FixedPoint.Offset, StringFormat={}{0:F0}}"
|
||||||
|
IsEnabled="{Binding Settings.FixedPoint.IsAtAnEdge}"
|
||||||
|
Visibility="{Binding Settings.PlacementMode,
|
||||||
|
Converter={StaticResource EnumToVisibility},
|
||||||
|
ConverterParameter=FixedPoint}" />
|
||||||
|
|
||||||
|
<!-- A hairline between the two halves of the section: the
|
||||||
|
placement above, the look of the popup below -->
|
||||||
|
<Border Grid.Row="7" Grid.ColumnSpan="3"
|
||||||
|
Margin="0,16,0,0" Height="1"
|
||||||
|
Background="{DynamicResource Theme.ControlBorder}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="8" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[FontSizeLabel]}" />
|
||||||
|
<Slider Grid.Row="8" Grid.Column="1" Margin="0,12,0,0"
|
||||||
|
Minimum="10" Maximum="72" TickFrequency="1"
|
||||||
|
Value="{Binding Settings.Current.FontSize}" />
|
||||||
|
<TextBlock Grid.Row="8" Grid.Column="2" Margin="12,12,0,0"
|
||||||
|
Style="{StaticResource FieldValue}"
|
||||||
|
Text="{Binding Settings.Current.FontSize, StringFormat={}{0:F0}}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="9" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[OpacityLabel]}" />
|
||||||
|
<Slider Grid.Row="9" Grid.Column="1" Margin="0,12,0,0"
|
||||||
|
Minimum="0.1" Maximum="1" TickFrequency="0.05"
|
||||||
|
Value="{Binding Settings.Current.Opacity}" />
|
||||||
|
<TextBlock Grid.Row="9" Grid.Column="2" Margin="12,12,0,0"
|
||||||
|
Style="{StaticResource FieldValue}"
|
||||||
|
Text="{Binding Settings.Current.Opacity, StringFormat={}{0:P0}}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="10" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[BackgroundColorLabel]}" />
|
||||||
|
<ComboBox Grid.Row="10" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
|
ItemsSource="{Binding BackgroundPalette}"
|
||||||
|
ItemTemplate="{StaticResource ColorSwatchTemplate}"
|
||||||
|
SelectedItem="{Binding Settings.Current.BackgroundColor}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="11" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[TextColorLabel]}" />
|
||||||
|
<ComboBox Grid.Row="11" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
||||||
|
ItemsSource="{Binding TextPalette}"
|
||||||
|
ItemTemplate="{StaticResource ColorSwatchTemplate}"
|
||||||
|
SelectedItem="{Binding Settings.Current.ForegroundColor}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="12" Margin="0,12,12,0"
|
||||||
|
Style="{StaticResource FieldLabel}"
|
||||||
|
Text="{Binding Localization[PreviewLabel]}" />
|
||||||
|
<Border Grid.Row="12" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
Margin="0,12,0,0" Padding="16"
|
||||||
|
Height="152" ClipToBounds="True"
|
||||||
|
Background="{DynamicResource Theme.SurfaceStrong}" CornerRadius="4"
|
||||||
|
HorizontalAlignment="Stretch">
|
||||||
|
<Border CornerRadius="4" Padding="10,4"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
|
Opacity="{Binding Settings.Current.Opacity}"
|
||||||
|
Background="{Binding Settings.Current.BackgroundColor,
|
||||||
|
Converter={StaticResource ColorToBrush}}">
|
||||||
|
<TextBlock Text="RU" FontWeight="SemiBold"
|
||||||
|
FontSize="{Binding Settings.Current.FontSize}"
|
||||||
|
Foreground="{Binding Settings.Current.ForegroundColor,
|
||||||
|
Converter={StaticResource ColorToBrush}}" />
|
||||||
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Grid>
|
||||||
</Grid>
|
</GroupBox>
|
||||||
</GroupBox>
|
|
||||||
|
|
||||||
<GroupBox Header="{Binding Localization[SectionBehavior]}">
|
</StackPanel>
|
||||||
<Grid>
|
</Grid>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="164" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Style="{StaticResource FieldLabel}"
|
|
||||||
Text="{Binding Localization[DurationLabel]}" />
|
|
||||||
<Slider Grid.Column="1" Minimum="200" Maximum="5000" TickFrequency="100"
|
|
||||||
Value="{Binding Settings.DurationMilliseconds}" />
|
|
||||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
|
||||||
<TextBlock Style="{StaticResource FieldValue}"
|
|
||||||
Text="{Binding Settings.DurationMilliseconds, StringFormat={}{0:F0}}" />
|
|
||||||
<TextBlock Margin="4,0,0,0"
|
|
||||||
Foreground="{DynamicResource Theme.SecondaryForeground}"
|
|
||||||
Text="{Binding Localization[MillisecondsSuffix]}" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Margin="0,12,12,0"
|
|
||||||
Style="{StaticResource FieldLabel}"
|
|
||||||
Text="{Binding Localization[CapsLockLabel]}" />
|
|
||||||
<CheckBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
|
||||||
IsChecked="{Binding Settings.UseCapsLockHotkey}"
|
|
||||||
Content="{Binding Localization[CapsLockHotkeyCheck]}" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Margin="0,12,12,0"
|
|
||||||
Style="{StaticResource FieldLabel}"
|
|
||||||
Text="{Binding Localization[CapsLockHoldLabel]}" />
|
|
||||||
<Slider Grid.Row="2" Grid.Column="1" Margin="0,12,0,0"
|
|
||||||
Minimum="150" Maximum="1500" TickFrequency="50"
|
|
||||||
Value="{Binding Settings.CapsLockHoldMilliseconds}"
|
|
||||||
IsEnabled="{Binding Settings.UseCapsLockHotkey}" />
|
|
||||||
<StackPanel Grid.Row="2" Grid.Column="2" Margin="0,12,0,0"
|
|
||||||
Orientation="Horizontal" VerticalAlignment="Center">
|
|
||||||
<TextBlock Style="{StaticResource FieldValue}"
|
|
||||||
Text="{Binding Settings.CapsLockHoldMilliseconds, StringFormat={}{0:F0}}" />
|
|
||||||
<TextBlock Margin="4,0,0,0"
|
|
||||||
Foreground="{DynamicResource Theme.SecondaryForeground}"
|
|
||||||
Text="{Binding Localization[MillisecondsSuffix]}" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2"
|
|
||||||
Margin="0,6,0,0" TextWrapping="Wrap"
|
|
||||||
Foreground="{DynamicResource Theme.SecondaryForeground}">
|
|
||||||
<Run Text="{Binding Localization[CapsLockHoldHint], Mode=OneWay}" />
|
|
||||||
<InlineUIContainer BaselineAlignment="Baseline">
|
|
||||||
<!-- The elevation caveat lives in the tooltip to keep the section compact -->
|
|
||||||
<TextBlock Text="{Binding Localization[MoreInfoLink]}"
|
|
||||||
Foreground="{DynamicResource Theme.Accent}"
|
|
||||||
TextDecorations="Underline"
|
|
||||||
Cursor="Help"
|
|
||||||
ToolTipService.InitialShowDelay="200"
|
|
||||||
ToolTipService.ShowDuration="60000"
|
|
||||||
Visibility="{Binding Settings.UseCapsLockHotkey, Converter={StaticResource BooleanToVisibility}}">
|
|
||||||
<TextBlock.ToolTip>
|
|
||||||
<ToolTip>
|
|
||||||
<TextBlock TextWrapping="Wrap"
|
|
||||||
Text="{Binding Localization[CapsLockElevationHint]}" />
|
|
||||||
</ToolTip>
|
|
||||||
</TextBlock.ToolTip>
|
|
||||||
</TextBlock>
|
|
||||||
</InlineUIContainer>
|
|
||||||
</TextBlock>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="4" Margin="0,12,12,0"
|
|
||||||
Style="{StaticResource FieldLabel}"
|
|
||||||
Visibility="{Binding IsStartupAvailable, Converter={StaticResource BooleanToVisibility}}"
|
|
||||||
Text="{Binding Localization[StartupLabel]}" />
|
|
||||||
<CheckBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,12,0,0"
|
|
||||||
Visibility="{Binding IsStartupAvailable, Converter={StaticResource BooleanToVisibility}}"
|
|
||||||
IsEnabled="{Binding CanChangeStartup}"
|
|
||||||
IsChecked="{Binding RunAtStartup}"
|
|
||||||
Content="{Binding Localization[StartupCheck]}" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2"
|
|
||||||
Margin="0,6,0,0" TextWrapping="Wrap"
|
|
||||||
Foreground="{DynamicResource Theme.SecondaryForeground}"
|
|
||||||
Visibility="{Binding IsStartupLocked, Converter={StaticResource BooleanToVisibility}}"
|
|
||||||
Text="{Binding Localization[StartupLockedHint]}" />
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -136,8 +136,8 @@
|
|||||||
Condition="REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE" />
|
Condition="REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE" />
|
||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<SetProperty Id="WixShellExecTarget" Value="[INSTALLFOLDER]CursorLang.exe"
|
<!-- Offered at the end of the wizard, the way an installer usually does -->
|
||||||
After="CostFinalize" Sequence="ui" />
|
<Property Id="WixShellExecTarget" Value="[#CursorLang.exe]" />
|
||||||
<CustomAction Id="LaunchApplication" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
<CustomAction Id="LaunchApplication" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
||||||
DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
|
DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
|
||||||
|
|
||||||
|
|||||||
@@ -169,24 +169,6 @@ MSIX всегда выполняются в контексте вошедшег
|
|||||||
на месте, а не исчезает из раздела — появляющаяся и исчезающая строка сдвигала бы
|
на месте, а не исчезает из раздела — появляющаяся и исчезающая строка сдвигала бы
|
||||||
всё, что ниже, при каждой смене места.
|
всё, что ниже, при каждой смене места.
|
||||||
|
|
||||||
Положение каретки сообщает не всякое приложение, и тогда рядом с курсором ввода —
|
|
||||||
нигде. Подсказка уходит на фиксированную точку: место, отступ и оформление берутся
|
|
||||||
оттуда, из режима каретки не берётся ничего. Курсор мыши был бы запасным вариантом
|
|
||||||
поближе — и неверным: он там, где его оставили, сбоку или на другом мониторе, тогда
|
|
||||||
как смотрят на каретку. Фиксированная точка всегда на одном и том же месте, и потому
|
|
||||||
известно, куда смотреть, — а вместе с местом должно приходить и оформление: подсказка,
|
|
||||||
настроенная мелкой и незаметной для середины текста, в углу монитора останется
|
|
||||||
незамеченной.
|
|
||||||
|
|
||||||
Какие-то приложения, решает не то, на чём они написаны, а то, что окно о себе
|
|
||||||
сообщает. Обычный элемент Win32 заводит системную каретку, и её читают сразу;
|
|
||||||
Chrome и Electron рисуют свою и сообщают о ней через интерфейсы доступности.
|
|
||||||
Окну, которое рисует текст на голом холсте, сообщать нечего — и оба случая
|
|
||||||
уживаются в одном приложении: редакторы JetBrains отвечают, потому что каретку
|
|
||||||
для них держит их среда выполнения, а панель инструментов, нарисованная Compose,
|
|
||||||
не содержит текстового элемента, который нашли бы UI Automation или Java Access
|
|
||||||
Bridge. Ради такого окна фиксированная точка и нужна.
|
|
||||||
|
|
||||||
К какому режиму относится оформление, объясняет всплывающая подсказка рядом с самим
|
К какому режиму относится оформление, объясняет всплывающая подсказка рядом с самим
|
||||||
режимом, а не строка текста в разделе: ползунки ниже показывают другие числа после
|
режимом, а не строка текста в разделе: ползунки ниже показывают другие числа после
|
||||||
переключения режима, и это вопрос, который задают один раз.
|
переключения режима, и это вопрос, который задают один раз.
|
||||||
|
|||||||
@@ -163,24 +163,6 @@ zero and the settings window shows it greyed out. It stays in place rather than
|
|||||||
leaving the section — a row that comes and goes would move everything below it on
|
leaving the section — a row that comes and goes would move everything below it on
|
||||||
every switch of the place.
|
every switch of the place.
|
||||||
|
|
||||||
Not every application reports where its caret is, and next to the caret is then
|
|
||||||
nowhere. The popup goes to the fixed point instead — the place, the offset and the
|
|
||||||
look all from that mode, none of them from the caret one. The mouse cursor would be
|
|
||||||
the nearer fallback and is the wrong one: it is wherever it was last left, off to a
|
|
||||||
side or on another monitor, while the eyes are on the caret. The fixed point is
|
|
||||||
always in the same place, so it is known where to look — and the look must come with
|
|
||||||
it, since a popup set small and quiet for the middle of a text goes unnoticed in the
|
|
||||||
corner of a monitor.
|
|
||||||
|
|
||||||
Some applications those are is decided by what a window exposes rather than by
|
|
||||||
what it is written in. A Win32 control creates a system caret and is read at once;
|
|
||||||
Chromium and Electron draw their own and report it over the accessibility
|
|
||||||
interfaces. A window that paints its text into a bare canvas has nothing to report
|
|
||||||
at all — and both kinds live in the same application: the editors of a JetBrains
|
|
||||||
IDE answer, since the runtime keeps a caret for them, while a tool window whose
|
|
||||||
interface is painted by Compose holds no text component for UI Automation or the
|
|
||||||
Java Access Bridge to find. That window is where the fixed point earns its keep.
|
|
||||||
|
|
||||||
Which mode the look belongs to is explained in a tooltip next to the mode itself
|
Which mode the look belongs to is explained in a tooltip next to the mode itself
|
||||||
rather than by a line of text in the section: the sliders below show other numbers
|
rather than by a line of text in the section: the sliders below show other numbers
|
||||||
after a switch of the mode, and that is a question asked once.
|
after a switch of the mode, and that is a question asked once.
|
||||||
|
|||||||
Reference in New Issue
Block a user