Skip to content

Commit 0f64453

Browse files
committed
Persist view size setting
1 parent abc3d19 commit 0f64453

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

MainWindow.xaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ public MainWindow()
199199
_language = ParseLanguage(_settings.Language);
200200
InitializeComponent();
201201
LanguageComboBox.SelectedIndex = _language == AppLanguage.English ? 1 : 0;
202+
ViewSizeSlider.Value = ClampViewSize(_settings.ViewSize);
202203
ApplyViewSize(ViewSizeSlider.Value);
203204
ApplyLanguage();
204205
LoadEmptyStateImage();
@@ -521,6 +522,8 @@ private void ViewSizeSlider_ValueChanged(object sender, RoutedPropertyChangedEve
521522
}
522523

523524
ApplyViewSize(e.NewValue);
525+
_settings.ViewSize = e.NewValue;
526+
_settings.Save();
524527
}
525528

526529
private List<ExplorerItem> GetSelectedExplorerItems()
@@ -655,6 +658,16 @@ private void ApplyViewSize(double value)
655658
ContentsList.InvalidateMeasure();
656659
}
657660

661+
private static double ClampViewSize(double value)
662+
{
663+
if (double.IsNaN(value))
664+
{
665+
return 72;
666+
}
667+
668+
return Math.Clamp(value, 0, 100);
669+
}
670+
658671
private async Task EnsureSearchIndexAsync()
659672
{
660673
if (_isSearchIndexReady || _rootItem is null)

README.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bin\Debug\net8.0-windows\CFRezManager.exe
3131

3232
Use the language selector in the top toolbar to switch between `中文` and `English`. Buttons, context menus, status text, and common dialog prompts update with the selected language.
3333

34-
The app remembers the selected language and the folders used for scanning, packing, extracting, and saving REZ files. On the next launch or the next matching dialog, it starts from the last used location.
34+
The app remembers the selected language, bottom-right size slider, and the folders used for scanning, packing, extracting, and saving REZ files. On the next launch or the next matching dialog, it restores the last used settings and location.
3535

3636
The search box builds an in-memory index the first time you type, then filters scanned files, folders, and internal REZ paths quickly, similar to Everything. Separate multiple keywords with spaces to require all terms to match.
3737

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bin\Debug\net8.0-windows\CFRezManager.exe
3131

3232
顶部语言选择框可以在 `中文``English` 之间切换,按钮、右键菜单、状态栏和常用对话框提示会随之更新。
3333

34-
程序会记住上次选择的语言,以及扫描、打包、导出、保存 REZ 时选择过的目录。下次启动或再次打开对应弹窗时,会优先从上次的位置开始
34+
程序会记住上次选择的语言、右下角大小滑条,以及扫描、打包、导出、保存 REZ 时选择过的目录。下次启动或再次打开对应弹窗时,会优先恢复上次使用的设置和位置
3535

3636
顶部搜索框会在首次输入时建立内存索引,之后会像 Everything 一样在已扫描的文件、目录和 REZ 内部路径中快速筛选。多个关键字用空格分隔时,需要全部命中才会显示结果。
3737

UserSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public sealed class UserSettings
1616
public string LastPackDirectory { get; set; } = string.Empty;
1717
public string LastOutputDirectory { get; set; } = string.Empty;
1818
public string LastSaveDirectory { get; set; } = string.Empty;
19+
public double ViewSize { get; set; } = 72;
1920

2021
public static string SettingsPath => Path.Combine(
2122
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),

0 commit comments

Comments
 (0)