Skip to content

Commit d06a803

Browse files
authored
Merge pull request #3447 from onesounds/250411-NumberBoxforDelay
Adjust Numberbox Design & Revert PositionResetToolTip string
2 parents b362bc6 + c5f2868 commit d06a803

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Globalization;
3+
using System.Windows;
34
using System.Windows.Controls;
45
using System.Windows.Data;
56
using System.Windows.Media;
@@ -43,8 +44,16 @@ values[2] is not string queryText ||
4344

4445
// Check if Text will be larger than our QueryTextBox
4546
Typeface typeface = new Typeface(queryTextBox.FontFamily, queryTextBox.FontStyle, queryTextBox.FontWeight, queryTextBox.FontStretch);
46-
// TODO: Obsolete warning?
47-
var ft = new FormattedText(queryTextBox.Text, CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, queryTextBox.FontSize, Brushes.Black);
47+
var dpi = VisualTreeHelper.GetDpi(queryTextBox);
48+
var ft = new FormattedText(
49+
queryTextBox.Text,
50+
CultureInfo.CurrentCulture,
51+
FlowDirection.LeftToRight,
52+
typeface,
53+
queryTextBox.FontSize,
54+
Brushes.Black,
55+
dpi.PixelsPerDip
56+
);
4857

4958
var offset = queryTextBox.Padding.Right;
5059

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<system:String x:Key="GameMode">Game Mode</system:String>
4545
<system:String x:Key="GameModeToolTip">Suspend the use of Hotkeys.</system:String>
4646
<system:String x:Key="PositionReset">Position Reset</system:String>
47+
<system:String x:Key="PositionResetToolTip">Reset search window position</system:String>
4748
<system:String x:Key="queryTextBoxPlaceholder">Type here to search</system:String>
4849

4950
<!-- Setting General -->
@@ -109,6 +110,7 @@
109110
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
110111
<system:String x:Key="searchDelay">Search Delay</system:String>
111112
<system:String x:Key="searchDelayToolTip">Adds a short delay while typing to reduce UI flicker and result load. Recommended if your typing speed is average.</system:String>
113+
<system:String x:Key="searchDelayNumberBoxToolTip">Enter the wait time (in ms) until input is considered complete. This can only be edited if Search Delay is enabled.</system:String>
112114
<system:String x:Key="searchDelayTime">Default Search Delay Time</system:String>
113115
<system:String x:Key="searchDelayTimeToolTip">Wait time before showing results after typing stops. Higher values wait longer. (ms)</system:String>
114116

Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,11 @@
9696
PlaceholderText="{Binding DefaultSearchDelay}"
9797
SmallChange="10"
9898
SpinButtonPlacementMode="Compact"
99-
ToolTip="{DynamicResource searchDelayToolTip}"
99+
ToolTip="{DynamicResource searchDelayNumberBoxToolTip}"
100+
ToolTipService.InitialShowDelay="0"
101+
ToolTipService.ShowOnDisabled="True"
100102
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" />
103+
101104
</StackPanel>
102105

103106
<!-- Put OnOffControl after PriorityControl & SearchDelayControl so that it can display correctly -->

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@
12851285
BasedOn="{StaticResource DefaultComboBoxStyle}"
12861286
TargetType="ComboBox">
12871287
<Setter Property="Padding" Value="12 0 0 0" />
1288-
<Setter Property="VerticalContentAlignment" Value="Center" />
12891288
<Setter Property="HorizontalAlignment" Value="Stretch" />
12901289
<Setter Property="VerticalAlignment" Value="Stretch" />
12911290
<Setter Property="ui:ControlHelper.CornerRadius" Value="0" />
@@ -2784,9 +2783,12 @@
27842783
</Trigger>
27852784
<Trigger Property="IsEnabled" Value="false">
27862785
<Setter TargetName="HeaderContentPresenter" Property="Foreground" Value="{DynamicResource TextControlHeaderForegroundDisabled}" />
2787-
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" />
2786+
<Setter Property="Background" Value="{DynamicResource CustomNumberBoxBGDisabled}" />
2787+
<Setter TargetName="BorderElementInline" Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" />
27882788
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" />
2789-
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
2789+
<Setter TargetName="BorderElement" Property="BorderThickness" Value="0 0 0 0" />
2790+
<Setter TargetName="BorderElementInline" Property="BorderThickness" Value="0 0 0 0" />
2791+
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundDisabled}" />
27902792
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundDisabled}" />
27912793
</Trigger>
27922794
<Trigger Property="IsMouseOver" Value="true">
@@ -2801,7 +2803,7 @@
28012803
<Setter TargetName="BorderElementInline" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
28022804
<Setter TargetName="BorderElementInline" Property="BorderThickness" Value="0 0 0 2" />
28032805
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource CustomTextBoxOutline}" />
2804-
<Setter TargetName="BorderElement" Property="BorderThickness" Value="{DynamicResource 2 2 2 0}" />
2806+
<Setter TargetName="BorderElement" Property="BorderThickness" Value="2 2 2 0" />
28052807
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
28062808
</Trigger>
28072809
<MultiTrigger>
@@ -2872,7 +2874,6 @@
28722874
FontFamily="{TemplateBinding FontFamily}"
28732875
FontSize="{TemplateBinding FontSize}"
28742876
FontWeight="{TemplateBinding FontWeight}"
2875-
Foreground="{DynamicResource Color05B}"
28762877
InputScope="{TemplateBinding InputScope}"
28772878
SelectionBrush="{TemplateBinding SelectionBrush}"
28782879
TextAlignment="{TemplateBinding TextAlignment}" />

0 commit comments

Comments
 (0)