Track library width across application restarts
- Issue MatterHackers/MCCentral#2236 Library panel should maintain its width across application restarts
This commit is contained in:
parent
c970edd88e
commit
f4bd1ab3d5
4 changed files with 28 additions and 5 deletions
|
|
@ -22,7 +22,8 @@ namespace MatterHackers.MatterControl
|
|||
public const string SliceSettingsWidth = nameof(SliceSettingsWidth);
|
||||
public const string SliceSettingsWidget_CurrentTab = nameof(SliceSettingsWidget_CurrentTab);
|
||||
public const string OpenScadPath = nameof(OpenScadPath);
|
||||
}
|
||||
public const string LibraryViewWidth = nameof(LibraryViewWidth);
|
||||
}
|
||||
|
||||
public class UserSettings
|
||||
{
|
||||
|
|
@ -111,6 +112,24 @@ namespace MatterHackers.MatterControl
|
|||
setting.Commit();
|
||||
}
|
||||
|
||||
public double LibraryViewWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!double.TryParse(this.get(UserSettingsKey.LibraryViewWidth), out double controlWidth))
|
||||
{
|
||||
// Default to 254 if no UserSetting value exists
|
||||
controlWidth = 254 * GuiWidget.DeviceScale;
|
||||
}
|
||||
|
||||
return controlWidth;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.set(UserSettingsKey.LibraryViewWidth, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsTouchScreen => this.get(UserSettingsKey.ApplicationDisplayMode) == "touchscreen";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue