File tree Expand file tree Collapse file tree 3 files changed +33
-9
lines changed
Flow.Launcher.Infrastructure/UserSettings Expand file tree Collapse file tree 3 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,37 @@ public void Save()
41
41
42
42
private string _theme = Constant . DefaultTheme ;
43
43
public string Hotkey { get ; set ; } = $ "{ KeyConstant . Alt } + { KeyConstant . Space } ";
44
- public string OpenResultModifiers { get ; set ; } = KeyConstant . Alt ;
44
+
45
+ private string _openResultModifiers = KeyConstant . Alt ;
46
+ public string OpenResultModifiers
47
+ {
48
+ get => _openResultModifiers ;
49
+ set
50
+ {
51
+ if ( _openResultModifiers != value )
52
+ {
53
+ _openResultModifiers = value ;
54
+ OnPropertyChanged ( ) ;
55
+ }
56
+ }
57
+ }
58
+
45
59
public string ColorScheme { get ; set ; } = "System" ;
46
- public bool ShowOpenResultHotkey { get ; set ; } = true ;
60
+
61
+ private bool _showOpenResultHotkey = true ;
62
+ public bool ShowOpenResultHotkey
63
+ {
64
+ get => _showOpenResultHotkey ;
65
+ set
66
+ {
67
+ if ( _showOpenResultHotkey != value )
68
+ {
69
+ _showOpenResultHotkey = value ;
70
+ OnPropertyChanged ( ) ;
71
+ }
72
+ }
73
+ }
74
+
47
75
public double WindowSize { get ; set ; } = 580 ;
48
76
public string PreviewHotkey { get ; set ; } = $ "F1";
49
77
public string AutoCompleteHotkey { get ; set ; } = $ "{ KeyConstant . Ctrl } + Tab";
Original file line number Diff line number Diff line change 36
36
<converter : BadgePositionConverter x : Key =" BadgePositionConverter" />
37
37
<converter : IconRadiusConverter x : Key =" IconRadiusConverter" />
38
38
<converter : DiameterToCenterPointConverter x : Key =" DiameterToCenterPointConverter" />
39
+ <converter : BoolToVisibilityConverter x : Key =" BoolToVisibilityConverter" />
39
40
</ListBox .Resources>
40
41
<ListBox .ItemTemplate>
41
42
<DataTemplate >
66
67
Grid.Column=" 2"
67
68
Margin =" 0 0 10 0"
68
69
VerticalAlignment =" Center"
69
- Visibility =" {Binding ShowOpenResultHotkey}" >
70
+ Visibility =" {Binding Settings. ShowOpenResultHotkey, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter} }" >
70
71
<Border x : Name =" HotkeyBG" Style =" {DynamicResource ItemHotkeyBGStyle}" >
71
72
<Border .Visibility>
72
73
<Binding Converter =" {StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" RelativeSource =" {RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
79
80
Style =" {DynamicResource ItemHotkeyStyle}" >
80
81
<TextBlock .Text>
81
82
<MultiBinding StringFormat =" {}{0}+{1}" >
82
- <Binding Path =" OpenResultModifiers" />
83
+ <Binding Mode = " OneWay " Path =" Settings. OpenResultModifiers" />
83
84
<Binding Converter =" {StaticResource ResourceKey=OrdinalConverter}" RelativeSource =" {RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
84
85
</MultiBinding >
85
86
</TextBlock .Text>
Original file line number Diff line number Diff line change @@ -64,9 +64,6 @@ public ResultViewModel(Result result, Settings settings)
64
64
65
65
public Settings Settings { get ; }
66
66
67
- public Visibility ShowOpenResultHotkey =>
68
- Settings . ShowOpenResultHotkey ? Visibility . Visible : Visibility . Collapsed ;
69
-
70
67
public Visibility ShowDefaultPreview => Result . PreviewPanel == null ? Visibility . Visible : Visibility . Collapsed ;
71
68
72
69
public Visibility ShowCustomizedPreview => Result . PreviewPanel == null ? Visibility . Collapsed : Visibility . Visible ;
@@ -152,8 +149,6 @@ public Visibility ShowBadge
152
149
153
150
private bool PreviewImageAvailable => ! string . IsNullOrEmpty ( Result . Preview . PreviewImagePath ) || Result . Preview . PreviewDelegate != null ;
154
151
155
- public string OpenResultModifiers => Settings . OpenResultModifiers ;
156
-
157
152
public string ShowTitleToolTip => string . IsNullOrEmpty ( Result . TitleToolTip )
158
153
? Result . Title
159
154
: Result . TitleToolTip ;
You can’t perform that action at this time.
0 commit comments