Skip to content

Commit 7b50820

Browse files
committed
add option to switch auto scrollbar hide on/off
1 parent 3596732 commit 7b50820

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public bool HideNotifyIcon
9797
public bool RememberLastLaunchLocation { get; set; }
9898
public bool IgnoreHotkeysOnFullscreen { get; set; }
9999

100+
public bool AutoHideScrollBar { get; set; } = false;
101+
100102
public HttpProxy Proxy { get; set; } = new HttpProxy();
101103

102104
[JsonConverter(typeof(JsonStringEnumConverter))]

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys in fullscreen mode</system:String>
3232
<system:String x:Key="pythonDirectory">Python Directory</system:String>
3333
<system:String x:Key="autoUpdates">Auto Update</system:String>
34+
<system:String x:Key="autoHideScrollBar">Auto Hide Scroll Bar</system:String>
35+
<system:String x:Key="autoHideScrollBarToolTip">Automatically hides the setting window's scroll bar, and show when hover the mouse over it</system:String>
3436
<system:String x:Key="selectPythonDirectory">Select</system:String>
3537
<system:String x:Key="hideOnStartup">Hide Flow Launcher on startup</system:String>
3638
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>

Flow.Launcher/SettingWindow.xaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
<TabControl Height="auto" SelectedIndex="0">
3838
<TabItem Header="{DynamicResource general}">
39-
<ScrollViewer ui:ScrollViewerHelper.AutoHideScrollBars="False" Margin="60,30,0,30">
39+
<ScrollViewer ui:ScrollViewerHelper.AutoHideScrollBars="{Binding Settings.AutoHideScrollBar}" Margin="60,30,0,30">
4040
<StackPanel Orientation="Vertical">
4141
<ui:ToggleSwitch Margin="10" IsOn="{Binding PortableMode}">
4242
<TextBlock Text="{DynamicResource portableMode}" />
@@ -63,9 +63,14 @@
6363
<ui:ToggleSwitch Margin="10" IsOn="{Binding AutoUpdates}">
6464
<TextBlock Text="{DynamicResource autoUpdates}" />
6565
</ui:ToggleSwitch>
66-
<CheckBox Margin="10" IsChecked="{Binding ShouldUsePinyin}" ToolTip="{DynamicResource ShouldUsePinyinToolTip}">
66+
<CheckBox Margin="10" IsChecked="{Binding ShouldUsePinyin}"
67+
ToolTip="{DynamicResource ShouldUsePinyinToolTip}">
6768
<TextBlock Text="{DynamicResource ShouldUsePinyin}" />
6869
</CheckBox>
70+
<ui:ToggleSwitch Margin="10" IsOn="{Binding AutoHideScrollBar}"
71+
ToolTip="{DynamicResource autoHideScrollBarToolTip}">
72+
<TextBlock Text="{DynamicResource autoHideScrollBar}" />
73+
</ui:ToggleSwitch>
6974
<StackPanel Margin="10" Orientation="Horizontal">
7075
<TextBlock Text="{DynamicResource querySearchPrecision}" FontSize="14" />
7176
<ComboBox Margin="10 0 0 0" MaxWidth="200"
@@ -112,7 +117,7 @@
112117
</TextBlock>
113118
<ListBox SelectedIndex="0" SelectedItem="{Binding SelectedPlugin}"
114119
ItemsSource="{Binding PluginViewModels}"
115-
Margin="10, 0, 10, 10" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ui:ScrollViewerHelper.AutoHideScrollBars="True">
120+
Margin="10, 0, 10, 10" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ui:ScrollViewerHelper.AutoHideScrollBars="{Binding Settings.AutoHideScrollBar}">
116121
<ListBox.ItemTemplate>
117122
<DataTemplate>
118123
<StackPanel Orientation="Horizontal" Margin="3">

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ public bool AutoUpdates
6161
}
6262
}
6363

64+
public bool AutoHideScrollBar
65+
{
66+
get
67+
{
68+
return Settings.AutoHideScrollBar;
69+
}
70+
set
71+
{
72+
Settings.AutoHideScrollBar = value;
73+
}
74+
}
75+
6476
// This is only required to set at startup. When portable mode enabled/disabled a restart is always required
6577
private bool _portableMode = DataLocation.PortableDataLocationInUse();
6678
public bool PortableMode

0 commit comments

Comments
 (0)