@@ -80,6 +80,7 @@ public double QueryBoxFontSize
80
80
get => Settings . QueryBoxFontSize ;
81
81
set => Settings . QueryBoxFontSize = value ;
82
82
}
83
+
83
84
public double ResultItemFontSize
84
85
{
85
86
get => Settings . ResultItemFontSize ;
@@ -94,30 +95,9 @@ public double ResultSubItemFontSize
94
95
public List < string > Themes =>
95
96
ThemeManager . Instance . LoadAvailableThemes ( ) . Select ( Path . GetFileNameWithoutExtension ) . ToList ( ) ;
96
97
98
+ public class ColorSchemeData : DropdownDataGeneric < ColorSchemes > { }
97
99
98
- public class ColorScheme
99
- {
100
- public string Display { get ; set ; }
101
- public ColorSchemes Value { get ; set ; }
102
- }
103
-
104
- public List < ColorScheme > ColorSchemes
105
- {
106
- get
107
- {
108
- List < ColorScheme > modes = new List < ColorScheme > ( ) ;
109
- var enums = ( ColorSchemes [ ] ) Enum . GetValues ( typeof ( ColorSchemes ) ) ;
110
- foreach ( var e in enums )
111
- {
112
- var key = $ "ColorScheme{ e } ";
113
- var display = InternationalizationManager . Instance . GetTranslation ( key ) ;
114
- var m = new ColorScheme { Display = display , Value = e , } ;
115
- modes . Add ( m ) ;
116
- }
117
-
118
- return modes ;
119
- }
120
- }
100
+ public List < ColorSchemeData > ColorSchemes { get ; } = DropdownDataGeneric < ColorSchemes > . GetValues < ColorSchemeData > ( "ColorScheme" ) ;
121
101
122
102
public List < string > TimeFormatList { get ; } = new ( )
123
103
{
@@ -185,29 +165,9 @@ public bool UseAnimation
185
165
set => Settings . UseAnimation = value ;
186
166
}
187
167
188
- public class AnimationSpeed
189
- {
190
- public string Display { get ; set ; }
191
- public AnimationSpeeds Value { get ; set ; }
192
- }
168
+ public class AnimationSpeedData : DropdownDataGeneric < AnimationSpeeds > { }
169
+ public List < AnimationSpeedData > AnimationSpeeds { get ; } = DropdownDataGeneric < AnimationSpeeds > . GetValues < AnimationSpeedData > ( "AnimationSpeed" ) ;
193
170
194
- public List < AnimationSpeed > AnimationSpeeds
195
- {
196
- get
197
- {
198
- List < AnimationSpeed > speeds = new List < AnimationSpeed > ( ) ;
199
- var enums = ( AnimationSpeeds [ ] ) Enum . GetValues ( typeof ( AnimationSpeeds ) ) ;
200
- foreach ( var e in enums )
201
- {
202
- var key = $ "AnimationSpeed{ e } ";
203
- var display = InternationalizationManager . Instance . GetTranslation ( key ) ;
204
- var m = new AnimationSpeed { Display = display , Value = e , } ;
205
- speeds . Add ( m ) ;
206
- }
207
-
208
- return speeds ;
209
- }
210
- }
211
171
public bool UseSound
212
172
{
213
173
get => Settings . UseSound ;
0 commit comments