Skip to content

Commit f30c6fc

Browse files
committed
Modified strings and added BoolNegationConverter
1 parent c06fdb9 commit f30c6fc

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Globalization;
3+
using System.Windows.Data;
4+
5+
namespace Flow.Launcher.Converters
6+
{
7+
public class BoolNegationConverter : IValueConverter
8+
{
9+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10+
{
11+
if (value is bool b)
12+
return !b;
13+
return value;
14+
}
15+
16+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
17+
{
18+
if (value is bool b)
19+
return !b;
20+
return value;
21+
}
22+
}
23+
}

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
132132
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
133133
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
134-
<system:String x:Key="showAtTopmost">Show Search Window at Topmost</system:String>
135-
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>
134+
<system:String x:Key="showAtTopmost">Keep on top</system:String>
135+
<system:String x:Key="showAtTopmostToolTip">Keeps the search window on top even after it loses focus.</system:String>
136136

137137
<!-- Setting Plugin -->
138138
<system:String x:Key="searchplugin">Search Plugin</system:String>

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
mc:Ignorable="d">
1818
<ui:Page.Resources>
1919
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
20+
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
2021
</ui:Page.Resources>
2122
<ScrollViewer
2223
Margin="0"
@@ -63,12 +64,23 @@
6364
OnContent="{DynamicResource enable}" />
6465
</cc:Card>
6566

66-
<cc:Card Title="{DynamicResource hideFlowLauncherWhenLoseFocus}" Margin="0 14 0 0">
67-
<ui:ToggleSwitch
67+
<cc:ExCard Title="{DynamicResource hideFlowLauncherWhenLoseFocus}" Margin="0 14 0 0">
68+
<cc:ExCard.SideContent>
69+
<ui:ToggleSwitch
6870
IsOn="{Binding Settings.HideWhenDeactivated}"
6971
OffContent="{DynamicResource disable}"
7072
OnContent="{DynamicResource enable}" />
71-
</cc:Card>
73+
</cc:ExCard.SideContent>
74+
<cc:Card
75+
Title="{DynamicResource showAtTopmost}"
76+
Type="InsideFit"
77+
Sub="{DynamicResource showAtTopmostToolTip}">
78+
<ui:ToggleSwitch
79+
IsOn="{Binding Settings.ShowAtTopmost}"
80+
OffContent="{DynamicResource disable}"
81+
OnContent="{DynamicResource enable}" IsEnabled="{Binding Settings.HideWhenDeactivated, Converter={StaticResource BoolNegationConverter}}"/>
82+
</cc:Card>
83+
</cc:ExCard>
7284

7385
<cc:Card Title="{DynamicResource hideNotifyIcon}" Sub="{DynamicResource hideNotifyIconToolTip}">
7486
<ui:ToggleSwitch
@@ -77,16 +89,6 @@
7789
OnContent="{DynamicResource enable}" />
7890
</cc:Card>
7991

80-
<cc:Card
81-
Title="{DynamicResource showAtTopmost}"
82-
Margin="0 14 0 0"
83-
Icon="&#xE923;"
84-
Sub="{DynamicResource showAtTopmostToolTip}">
85-
<ui:ToggleSwitch
86-
IsOn="{Binding Settings.ShowAtTopmost}"
87-
OffContent="{DynamicResource disable}"
88-
OnContent="{DynamicResource enable}" />
89-
</cc:Card>
9092

9193
<cc:CardGroup Margin="0 14 0 0">
9294
<cc:Card Title="{DynamicResource SearchWindowPosition}" Icon="&#xe7f4;">

0 commit comments

Comments
 (0)