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()
4141
4242 private string _theme = Constant . DefaultTheme ;
4343 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+
4559 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+
4775 public double WindowSize { get ; set ; } = 580 ;
4876 public string PreviewHotkey { get ; set ; } = $ "F1";
4977 public string AutoCompleteHotkey { get ; set ; } = $ "{ KeyConstant . Ctrl } + Tab";
Original file line number Diff line number Diff line change 3636 <converter : BadgePositionConverter x : Key =" BadgePositionConverter" />
3737 <converter : IconRadiusConverter x : Key =" IconRadiusConverter" />
3838 <converter : DiameterToCenterPointConverter x : Key =" DiameterToCenterPointConverter" />
39+ <converter : BoolToVisibilityConverter x : Key =" BoolToVisibilityConverter" />
3940 </ListBox .Resources>
4041 <ListBox .ItemTemplate>
4142 <DataTemplate >
6667 Grid.Column=" 2"
6768 Margin =" 0 0 10 0"
6869 VerticalAlignment =" Center"
69- Visibility =" {Binding ShowOpenResultHotkey}" >
70+ Visibility =" {Binding Settings. ShowOpenResultHotkey, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter} }" >
7071 <Border x : Name =" HotkeyBG" Style =" {DynamicResource ItemHotkeyBGStyle}" >
7172 <Border .Visibility>
7273 <Binding Converter =" {StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" RelativeSource =" {RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
7980 Style =" {DynamicResource ItemHotkeyStyle}" >
8081 <TextBlock .Text>
8182 <MultiBinding StringFormat =" {}{0}+{1}" >
82- <Binding Path =" OpenResultModifiers" />
83+ <Binding Mode = " OneWay " Path =" Settings. OpenResultModifiers" />
8384 <Binding Converter =" {StaticResource ResourceKey=OrdinalConverter}" RelativeSource =" {RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
8485 </MultiBinding >
8586 </TextBlock .Text>
Original file line number Diff line number Diff line change @@ -64,9 +64,6 @@ public ResultViewModel(Result result, Settings settings)
6464
6565 public Settings Settings { get ; }
6666
67- public Visibility ShowOpenResultHotkey =>
68- Settings . ShowOpenResultHotkey ? Visibility . Visible : Visibility . Collapsed ;
69-
7067 public Visibility ShowDefaultPreview => Result . PreviewPanel == null ? Visibility . Visible : Visibility . Collapsed ;
7168
7269 public Visibility ShowCustomizedPreview => Result . PreviewPanel == null ? Visibility . Collapsed : Visibility . Visible ;
@@ -152,8 +149,6 @@ public Visibility ShowBadge
152149
153150 private bool PreviewImageAvailable => ! string . IsNullOrEmpty ( Result . Preview . PreviewImagePath ) || Result . Preview . PreviewDelegate != null ;
154151
155- public string OpenResultModifiers => Settings . OpenResultModifiers ;
156-
157152 public string ShowTitleToolTip => string . IsNullOrEmpty ( Result . TitleToolTip )
158153 ? Result . Title
159154 : Result . TitleToolTip ;
You can’t perform that action at this time.
0 commit comments