Skip to content

Commit e833333

Browse files
committed
Add ui in general page
1 parent e9ef26a commit e833333

File tree

3 files changed

+57
-13
lines changed

3 files changed

+57
-13
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@
126126
<system:String x:Key="KoreanImeOpenLinkButton">Open</system:String>
127127
<system:String x:Key="KoreanImeRegistry">Use Previous Korean IME</system:String>
128128
<system:String x:Key="KoreanImeRegistryTooltip">You can change the Previous Korean IME settings directly from here</system:String>
129+
<system:String x:Key="homePage">Home Page</system:String>
130+
<system:String x:Key="homePageToolTip">Show home page results when query text is empty.</system:String>
131+
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
132+
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
129133

130134
<!-- Setting Plugin -->
131135
<system:String x:Key="searchplugin">Search Plugin</system:String>

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,22 @@ public int SearchDelayTimeValue
154154
{
155155
Settings.SearchDelayTime = value;
156156
OnPropertyChanged();
157-
OnPropertyChanged(nameof(SearchDelayTimeDisplay));
158157
}
159158
}
160159
}
161-
public string SearchDelayTimeDisplay => $"{SearchDelayTimeValue}ms";
160+
161+
public int MaxHistoryResultsToShowValue
162+
{
163+
get => Settings.MaxHistoryResultsToShowForHomePage;
164+
set
165+
{
166+
if (Settings.MaxHistoryResultsToShowForHomePage != value)
167+
{
168+
Settings.MaxHistoryResultsToShowForHomePage = value;
169+
OnPropertyChanged();
170+
}
171+
}
172+
}
162173

163174
private void UpdateEnumDropdownLocalizations()
164175
{

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,46 @@
217217
Title="{DynamicResource searchDelayTime}"
218218
Sub="{DynamicResource searchDelayTimeToolTip}"
219219
Type="InsideFit">
220-
<StackPanel Orientation="Horizontal">
221-
<ui:NumberBox
222-
Width="120"
223-
Margin="0 0 0 0"
224-
Maximum="1000"
225-
Minimum="0"
226-
SmallChange="10"
227-
SpinButtonPlacementMode="Compact"
228-
ValidationMode="InvalidInputOverwritten"
229-
Value="{Binding SearchDelayTimeValue}" />
230-
</StackPanel>
220+
<ui:NumberBox
221+
Width="120"
222+
Margin="0 0 0 0"
223+
Maximum="1000"
224+
Minimum="0"
225+
SmallChange="10"
226+
SpinButtonPlacementMode="Compact"
227+
ValidationMode="InvalidInputOverwritten"
228+
Value="{Binding SearchDelayTimeValue}" />
229+
</cc:Card>
230+
</cc:ExCard>
231+
232+
<cc:Card
233+
Title="{DynamicResource homePage}"
234+
Margin="0 14 0 0"
235+
Icon="&#xE80F;"
236+
Sub="{DynamicResource homePageToolTip}">
237+
<ui:ToggleSwitch
238+
IsOn="{Binding Settings.ShowHomePage}"
239+
OffContent="{DynamicResource disable}"
240+
OnContent="{DynamicResource enable}" />
241+
</cc:Card>
242+
243+
<cc:ExCard Title="{DynamicResource historyResultsForHomePage}" Icon="&#xE81C;">
244+
<cc:ExCard.SideContent>
245+
<ui:ToggleSwitch
246+
IsOn="{Binding Settings.ShowHistoryResultsForHomePage}"
247+
OffContent="{DynamicResource disable}"
248+
OnContent="{DynamicResource enable}" />
249+
</cc:ExCard.SideContent>
250+
<cc:Card Title="{DynamicResource historyResultsCountForHomePage}" Type="InsideFit">
251+
<ui:NumberBox
252+
Width="120"
253+
Margin="0 0 0 0"
254+
Maximum="100"
255+
Minimum="0"
256+
SmallChange="5"
257+
SpinButtonPlacementMode="Compact"
258+
ValidationMode="InvalidInputOverwritten"
259+
Value="{Binding MaxHistoryResultsToShowValue}" />
231260
</cc:Card>
232261
</cc:ExCard>
233262

0 commit comments

Comments
 (0)