-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save/Load view extension size and location (#11278)
Information of where an extension control was last shown is saved and retrieved as preference settings. These are actually not directly visible for the user and are updating automatically, just like the main Dynamo window size. These settings are used when showing the extension control, to restore it to how it used to be before closing it. The available information for each view extension is: 1. How it is shown. For now this can be either as a floating window or docked to the right-side panel. 2. In case it is shown as a floating window, the following information about the window is saved: - Location by Top/Left coordinates - Size by Width/Height - Whether the window is maximized
- Loading branch information
Showing
10 changed files
with
395 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
namespace Dynamo.Configuration | ||
{ | ||
/// <summary> | ||
/// Settings that apply to a view extension specifically. | ||
/// </summary> | ||
public class ViewExtensionSettings | ||
{ | ||
/// <summary> | ||
/// Name of the view extension. | ||
/// </summary> | ||
public string Name { get; set; } | ||
/// <summary> | ||
/// UniqueId of the view extension. | ||
/// </summary> | ||
public string UniqueId { get; set; } | ||
/// <summary> | ||
/// Specifies how an extension UI control should be displayed. | ||
/// </summary> | ||
public ViewExtensionDisplayMode DisplayMode { get; set; } | ||
/// <summary> | ||
/// Window settings for the extension control when displayed in FloatingWindow mode. | ||
/// </summary> | ||
public WindowSettings WindowSettings { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// Possible display modes for an extension UI control. | ||
/// </summary> | ||
public enum ViewExtensionDisplayMode | ||
{ | ||
/// <summary> | ||
/// Not really a display mode but rather the absence of one. | ||
/// </summary> | ||
Unspecified, | ||
/// <summary> | ||
/// Extension control should be displayed docked to the right side. | ||
/// </summary> | ||
DockRight, | ||
/// <summary> | ||
/// Extension control should be displayed in a floating window. | ||
/// </summary> | ||
FloatingWindow | ||
} | ||
|
||
/// <summary> | ||
/// Settings that define how to display an extension control in floating window mode. | ||
/// </summary> | ||
public class WindowSettings | ||
{ | ||
/// <summary> | ||
/// Status of the window, i.e. whether it is maximized. | ||
/// </summary> | ||
public WindowStatus Status { get; set; } | ||
/// <summary> | ||
/// Coordinates of the leftmost side of the window. | ||
/// </summary> | ||
public int Left { get; set; } | ||
/// <summary> | ||
/// Coordinates of the topmost side of the window. | ||
/// </summary> | ||
public int Top { get; set; } | ||
/// <summary> | ||
/// Width of the window. | ||
/// </summary> | ||
public int Width { get; set; } | ||
/// <summary> | ||
/// Height of the window. | ||
/// </summary> | ||
public int Height { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// Possible status of a floating window. | ||
/// </summary> | ||
public enum WindowStatus | ||
{ | ||
/// <summary> | ||
/// The window can be moved and resized. | ||
/// </summary> | ||
Normal, | ||
/// <summary> | ||
/// The window is maximized. | ||
/// </summary> | ||
Maximized | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.