Fixes #4035 - FileDialog keeps path when selecting folder (optionally) (#4065)

* WIP keep path

* Make new 'sticky filename' behaviour optional

* Tests for new behaviour when selecting in TreeView

* Add more tests, this time for table view navigation

* Add the new style option into UICatalog scenario
This commit is contained in:
Thomas Nind
2025-05-09 15:47:04 +01:00
committed by GitHub
parent b46b7781f1
commit d0bfa5ef13
5 changed files with 236 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ public class FileDialogExamples : Scenario
private CheckBox _cbAlwaysTableShowHeaders;
private CheckBox _cbCaseSensitive;
private CheckBox _cbDrivesOnlyInTree;
private CheckBox _cbPreserveFilenameOnDirectoryChanges;
private CheckBox _cbFlipButtonOrder;
private CheckBox _cbMustExist;
private CheckBox _cbShowTreeBranchLines;
@@ -55,6 +56,9 @@ public class FileDialogExamples : Scenario
_cbDrivesOnlyInTree = new CheckBox { CheckedState = CheckState.UnChecked, Y = y++, X = x, Text = "Only Show _Drives" };
win.Add (_cbDrivesOnlyInTree);
_cbPreserveFilenameOnDirectoryChanges = new CheckBox { CheckedState = CheckState.UnChecked, Y = y++, X = x, Text = "Preserve Filename" };
win.Add (_cbPreserveFilenameOnDirectoryChanges);
y = 0;
x = 24;
@@ -198,6 +202,9 @@ public class FileDialogExamples : Scenario
fd.Style.TreeRootGetter = () => { return Environment.GetLogicalDrives ().ToDictionary (dirInfoFactory.New, k => k); };
}
fd.Style.PreserveFilenameOnDirectoryChanges = _cbPreserveFilenameOnDirectoryChanges.CheckedState == CheckState.Checked;
if (_rgAllowedTypes.SelectedItem > 0)
{
fd.AllowedTypes.Add (new AllowedType ("Data File", ".csv", ".tsv"));