-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save/Load view extension size and location #11278
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
35930cb
Working version
mmisol 6ace125
Remove screen specific code
mmisol 3a53e39
Fix maximize on another monitor, hopefully
mmisol 1d7422b
Save and use screen
mmisol 9357551
One more attempt
mmisol dfa60bb
Cleanup after verifying this works
mmisol c2022fb
Add tests
mmisol 1c76c37
Merge changes from master
mmisol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setting here is good design. I also wonder when we about do make internal window like Python editor dockable, do we apply same setting for them or use a list of different but similar setting? Or we make this setting more generic? Let me know what you think. I think it might be something we want to consider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can be reused just like that.
ViewExtensionSettings
by itself contains view extension specific properties likeUniqueId
andName
that don't apply to script editors. Still, a lot of things in this contribution can be reused.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmisol Yes, and thinking more on this. We may not need to support remembering the positions of python editor at all. Will take a look at the rest of code