File tree Expand file tree Collapse file tree 8 files changed +80
-19
lines changed Expand file tree Collapse file tree 8 files changed +80
-19
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ private void Init()
67
67
services . AddWpfTitleBarKit ( ) ;
68
68
services . AddLocalization ( ) ;
69
69
services . AddWpfBlazorWebView ( ) ;
70
- services . AddBlazorWebViewDeveloperTools ( ) ;
71
70
services . AddMudServices ( config =>
72
71
{
73
72
config . SnackbarConfiguration . PositionClass = Defaults . Classes . Position . TopLeft ;
@@ -87,6 +86,11 @@ private void Init()
87
86
Thread . CurrentThread . CurrentCulture = cultureInfo ;
88
87
Thread . CurrentThread . CurrentUICulture = cultureInfo ;
89
88
89
+ if ( sp . GetRequiredService < AppSettings > ( ) . IsEnableSoftwareRendering )
90
+ {
91
+ System . Windows . Media . RenderOptions . ProcessRenderMode = System . Windows . Interop . RenderMode . SoftwareOnly ;
92
+ }
93
+
90
94
_mainWindow = sp . GetRequiredService < WindowMain > ( ) ;
91
95
Application . Current . MainWindow = _mainWindow ;
92
96
_mainWindow . Show ( ) ;
Original file line number Diff line number Diff line change 24
24
Color =" Color.Primary"
25
25
Style =" max-width: fit-content;" />
26
26
27
+ <div class =" d-flex flex-column" >
28
+ <MudCheckBox T =" bool"
29
+ Value =" @(AppSettings.IsEnableSoftwareRendering)"
30
+ ValueChanged =" SoftwareRenderingChange"
31
+ Label =" @(Lang[" EnableSoftwareRendering " ])"
32
+ Color =" Color.Primary"
33
+ Style =" max-width: fit-content;" />
34
+ <MudText Typo =" Typo.caption" Color =" Color.Secondary" Class =" ml-12" >
35
+ @( Lang [" EnableSoftwareRenderingRemark" ])
36
+ </MudText >
37
+ </div >
38
+
27
39
<MudSelect T =" ThemeEnum"
28
40
Class =" mt-4"
29
41
Dense =" true"
53
65
54
66
<div class =" d-flex align-center" >
55
67
<MudText Typo =" Typo.subtitle2" >@( Lang [" LogFiles" ]) </MudText >
56
- @if (_logLoadingOk )
57
- {
58
- <MudChip T =" string"
59
- Label =" true"
60
- Disabled =" true"
61
- Variant =" Variant.Text"
62
- Color =" Color.Secondary"
63
- Size =" Size.Small" >
64
- @( $" {_logFilesSize / 1024 / 1024 : N2 } MB" )
65
- </MudChip >
66
- }
67
- </div >
68
- <div class =" d-flex align-center" >
69
68
@if (! _logLoadingOk )
70
69
{
71
70
<MudProgressCircular Color =" Color.Secondary"
75
74
}
76
75
else
77
76
{
77
+ <MudChip T =" string"
78
+ Label =" true"
79
+ Disabled =" true"
80
+ Variant =" Variant.Text"
81
+ Color =" Color.Secondary"
82
+ Size =" Size.Small" >
83
+ @( $" {_logFilesSize / 1024 / 1024 : N2 } MB" )
84
+ </MudChip >
85
+
78
86
<MudButton Variant =" Variant.Text"
79
87
Color =" Color.Primary"
80
88
Size =" Size.Small"
90
98
91
99
<div class =" d-flex align-center" >
92
100
<MudText Typo =" Typo.subtitle2" >@( Lang [" Advanced" ]) </MudText >
101
+ <MudButton Class =" ml-2"
102
+ Variant =" Variant.Text"
103
+ Color =" Color.Error"
104
+ Size =" Size.Small"
105
+ OnClick =" ResetSettingsAsync" >@( Lang [" ResetSettings" ]) </MudButton >
93
106
</div >
94
- <MudButton Class =" mt-2"
95
- Variant =" Variant.Text"
96
- Color =" Color.Error"
97
- Size =" Size.Small"
98
- OnClick =" ResetSettingsAsync" >@( Lang [" ResetSettings" ]) </MudButton >
Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ private void AutostartChange(bool isChecked)
44
44
}
45
45
_isAutostart = AutostartHook . IsAutostart ( ) ;
46
46
}
47
+
48
+ private void SoftwareRenderingChange ( bool isChecked )
49
+ {
50
+ AppSettings . IsEnableSoftwareRendering = isChecked ;
51
+ SaveSettings ( ) ;
52
+ RestartTips ( ) ;
53
+ }
54
+
47
55
private void SaveSettings ( )
48
56
{
49
57
AppSettingsProvider . SaveSettings ( AppSettings ) ;
Original file line number Diff line number Diff line change @@ -145,4 +145,9 @@ public void Initialize(HotkeyTools hotkeyTools)
145
145
/// 锁屏状态展示
146
146
/// </summary>
147
147
public LockStatusDisplay LockStatusDisplay { get ; set ; } = LockStatusDisplay . None ;
148
+
149
+ /// <summary>
150
+ /// 启用软件渲染
151
+ /// </summary>
152
+ public bool IsEnableSoftwareRendering { get ; set ; } = true ;
148
153
}
Original file line number Diff line number Diff line change 366
366
<data name =" HideWindowWhenEsc" xml : space =" preserve" >
367
367
<value >Minimize to tray on pressing ESC</value >
368
368
</data >
369
+ <data name =" EnableSoftwareRendering" xml : space =" preserve" >
370
+ <value >Enable Software Rendering</value >
371
+ </data >
372
+ <data name =" EnableSoftwareRenderingRemark" xml : space =" preserve" >
373
+ <value >Reduces memory usage when enabled, but may affect animation smoothness.</value >
374
+ </data >
369
375
</root >
Original file line number Diff line number Diff line change 384
384
<data name =" HideWindowWhenEsc" xml : space =" preserve" >
385
385
<value />
386
386
</data >
387
+ <data name =" EnableSoftwareRendering" xml : space =" preserve" >
388
+ <value />
389
+ </data >
390
+ <data name =" EnableSoftwareRenderingRemark" xml : space =" preserve" >
391
+ <value />
392
+ </data >
387
393
</root >
Original file line number Diff line number Diff line change 363
363
<data name =" HideWindowWhenEsc" xml : space =" preserve" >
364
364
<value >按下 ESC 键后最小化到托盘</value >
365
365
</data >
366
+ <data name =" EnableSoftwareRendering" xml : space =" preserve" >
367
+ <value >启用软件渲染</value >
368
+ </data >
369
+ <data name =" EnableSoftwareRenderingRemark" xml : space =" preserve" >
370
+ <value >启用时可减少内存占用,但可能影响动画流畅性</value >
371
+ </data >
366
372
</root >
You can’t perform that action at this time.
0 commit comments