Skip to content

Commit 0b69beb

Browse files
authored
Merge pull request #440 from Flow-Launcher/StopHidingScroller
stop hiding scroller
2 parents e6db8b8 + 131c5cb commit 0b69beb

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
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; }
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 Settings window 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: 12 additions & 5 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="True" Margin="60,30,0,30">
39+
<ScrollViewer ui:ScrollViewerHelper.AutoHideScrollBars="{Binding AutoHideScrollBar, Mode=OneWay}" 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, Mode=TwoWay}"
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 AutoHideScrollBar, Mode=OneWay}">
116121
<ListBox.ItemTemplate>
117122
<DataTemplate>
118123
<StackPanel Orientation="Horizontal" Margin="3">
@@ -216,8 +221,10 @@
216221
<Run Text="{DynamicResource browserMoreThemes}" />
217222
</Hyperlink>
218223
</TextBlock>
219-
<Button DockPanel.Dock="Top" Margin="0,10,0,0" Width="180" HorizontalAlignment="Center" Click="OpenPluginFolder">Open Theme Folder</Button>
220-
<ListBox DockPanel.Dock="Top" SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
224+
<Button DockPanel.Dock="Top" Margin="0,10,0,0" Width="180" HorizontalAlignment="Center"
225+
Click="OpenPluginFolder">Open Theme Folder</Button>
226+
<ListBox DockPanel.Dock="Top" SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
227+
ui:ScrollViewerHelper.AutoHideScrollBars="{Binding AutoHideScrollBar, Mode=OneWay}"
221228
Margin="10, 0, 10, 10" Width="180" Height="394" />
222229

223230
</DockPanel>

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

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

64+
public bool AutoHideScrollBar
65+
{
66+
get => Settings.AutoHideScrollBar;
67+
set => Settings.AutoHideScrollBar = value;
68+
}
69+
6470
// This is only required to set at startup. When portable mode enabled/disabled a restart is always required
6571
private bool _portableMode = DataLocation.PortableDataLocationInUse();
6672
public bool PortableMode
@@ -138,11 +144,11 @@ public string Language
138144

139145
public bool ShouldUsePinyin
140146
{
141-
get
147+
get
142148
{
143-
return Settings.ShouldUsePinyin;
149+
return Settings.ShouldUsePinyin;
144150
}
145-
set
151+
set
146152
{
147153
Settings.ShouldUsePinyin = value;
148154
}
@@ -181,7 +187,7 @@ public string TestProxy()
181187
}
182188

183189
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(_updater.GitHubRepository);
184-
190+
185191
if (string.IsNullOrEmpty(proxyUserName) || string.IsNullOrEmpty(Settings.Proxy.Password))
186192
{
187193
request.Proxy = new WebProxy(proxyServer, Settings.Proxy.Port);
@@ -225,7 +231,7 @@ public IList<PluginViewModel> PluginViewModels
225231
var metadatas = PluginManager.AllPlugins
226232
.OrderBy(x => x.Metadata.Disabled)
227233
.ThenBy(y => y.Metadata.Name)
228-
.Select(p => new PluginViewModel { PluginPair = p})
234+
.Select(p => new PluginViewModel { PluginPair = p })
229235
.ToList();
230236
return metadatas;
231237
}
@@ -453,7 +459,7 @@ public FamilyTypeface SelectedResultFontFaces
453459
#region about
454460

455461
public string Website => Constant.Website;
456-
public string ReleaseNotes => _updater.GitHubRepository + @"/releases/latest";
462+
public string ReleaseNotes => _updater.GitHubRepository + @"/releases/latest";
457463
public string Documentation => Constant.Documentation;
458464
public static string Version => Constant.Version;
459465
public string ActivatedTimes => string.Format(_translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);

0 commit comments

Comments
 (0)