File tree Expand file tree Collapse file tree 5 files changed +36
-7
lines changed
Flow.Launcher.Infrastructure/UserSettings Expand file tree Collapse file tree 5 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ public string QuerySearchPrecisionString
232
232
/// </summary>
233
233
public double CustomWindowTop { get ; set ; } = 0 ;
234
234
235
+ public bool KeepMaxResults { get ; set ; } = false ;
235
236
public int MaxResultsToShow { get ; set ; } = 5 ;
236
237
public int ActivateTimes { get ; set ; }
237
238
Original file line number Diff line number Diff line change 56
56
<system : String x : Key =" LastQueryPreserved" >Preserve Last Query</system : String >
57
57
<system : String x : Key =" LastQuerySelected" >Select last Query</system : String >
58
58
<system : String x : Key =" LastQueryEmpty" >Empty last Query</system : String >
59
+ <system : String x : Key =" KeepMaxResults" >Keeping Window Max Height</system : String >
60
+ <system : String x : Key =" KeepMaxResultsToolTip" >Window height will keep to fit the maximum number of results</system : String >
59
61
<system : String x : Key =" maxShowResults" >Maximum results shown</system : String >
60
62
<system : String x : Key =" maxShowResultsToolTip" >You can also quickly adjust this by using CTRL+Plus and CTRL+Minus.</system : String >
61
63
<system : String x : Key =" ignoreHotkeysOnFullscreen" >Ignore hotkeys in fullscreen mode</system : String >
Original file line number Diff line number Diff line change @@ -120,14 +120,17 @@ private void OnResizeEnd()
120
120
shadowMargin = 32 ;
121
121
}
122
122
123
- if ( System . Convert . ToInt32 ( ( Height - ( _settings . WindowHeightSize + 14 ) - shadowMargin ) / _settings . ItemHeightSize ) < 1 )
124
- {
125
- _settings . MaxResultsToShow = 2 ;
126
- }
127
- else
128
- {
129
- _settings . MaxResultsToShow = System . Convert . ToInt32 ( Math . Truncate ( ( Height - ( _settings . WindowHeightSize + 14 ) - shadowMargin ) / _settings . ItemHeightSize ) ) ;
123
+ if ( ! _settings . KeepMaxResults ) {
124
+ if ( System . Convert . ToInt32 ( ( Height - ( _settings . WindowHeightSize + 14 ) - shadowMargin ) / _settings . ItemHeightSize ) < 1 )
125
+ {
126
+ _settings . MaxResultsToShow = 2 ;
127
+ }
128
+ else
129
+ {
130
+ _settings . MaxResultsToShow = System . Convert . ToInt32 ( Math . Truncate ( ( Height - ( _settings . WindowHeightSize + 14 ) - shadowMargin ) / _settings . ItemHeightSize ) ) ;
131
+ }
130
132
}
133
+
131
134
_settings . WindowSize = Width ;
132
135
FlowMainWindow . SizeToContent = SizeToContent . Height ;
133
136
}
Original file line number Diff line number Diff line change @@ -151,6 +151,11 @@ public bool ShouldUsePinyin
151
151
152
152
public List < Language > Languages => InternationalizationManager . Instance . LoadAvailableLanguages ( ) ;
153
153
public IEnumerable < int > MaxResultsRange => Enumerable . Range ( 2 , 16 ) ;
154
+ public bool KeepMaxResults
155
+ {
156
+ get => Settings . KeepMaxResults ;
157
+ set => Settings . KeepMaxResults = value ;
158
+ }
154
159
155
160
public string AlwaysPreviewToolTip => string . Format (
156
161
InternationalizationManager . Instance . GetTranslation ( "AlwaysPreviewToolTip" ) ,
Original file line number Diff line number Diff line change 153
153
</cc : Card >
154
154
</cc : CardGroup >
155
155
156
+ <cc : CardGroup Margin =" 0 30 0 0" >
157
+ <cc : Card
158
+ Title =" {DynamicResource KeepMaxResults}"
159
+ Icon ="  "
160
+ Sub =" {DynamicResource KeepMaxResultsToolTip}" >
161
+ <ui : ToggleSwitch IsOn =" {Binding KeepMaxResults}" />
162
+ </cc : Card >
163
+ <cc : Card
164
+ Title =" {DynamicResource maxShowResults}"
165
+ Sub =" {DynamicResource maxShowResultsToolTip}"
166
+ Visibility =" {Binding KeepMaxResults, Converter={StaticResource BoolToVisibilityConverter}}" >
167
+ <ComboBox
168
+ Width =" 100"
169
+ ItemsSource =" {Binding MaxResultsRange}"
170
+ SelectedItem =" {Binding Settings.MaxResultsToShow}" />
171
+ </cc : Card >
172
+ </cc : CardGroup >
173
+
156
174
<cc : Card
157
175
Title =" {DynamicResource defaultFileManager}"
158
176
Margin =" 0 30 0 0"
You can’t perform that action at this time.
0 commit comments