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 @@ -40,9 +40,37 @@ public void Save()
40
40
}
41
41
42
42
public string Hotkey { get ; set ; } = $ "{ KeyConstant . Alt } + { KeyConstant . Space } ";
43
- public string OpenResultModifiers { get ; set ; } = KeyConstant . Alt ;
43
+
44
+ private string _openResultModifiers = KeyConstant . Alt ;
45
+ public string OpenResultModifiers
46
+ {
47
+ get => _openResultModifiers ;
48
+ set
49
+ {
50
+ if ( _openResultModifiers != value )
51
+ {
52
+ _openResultModifiers = value ;
53
+ OnPropertyChanged ( ) ;
54
+ }
55
+ }
56
+ }
57
+
44
58
public string ColorScheme { get ; set ; } = "System" ;
45
- public bool ShowOpenResultHotkey { get ; set ; } = true ;
59
+
60
+ private bool _showOpenResultHotkey = true ;
61
+ public bool ShowOpenResultHotkey
62
+ {
63
+ get => _showOpenResultHotkey ;
64
+ set
65
+ {
66
+ if ( _showOpenResultHotkey != value )
67
+ {
68
+ _showOpenResultHotkey = value ;
69
+ OnPropertyChanged ( ) ;
70
+ }
71
+ }
72
+ }
73
+
46
74
public double WindowSize { get ; set ; } = 580 ;
47
75
public string PreviewHotkey { get ; set ; } = $ "F1";
48
76
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