-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
full support for auto tallscreen/widescreen panel layout #458
Merged
OverloadedOrama
merged 17 commits into
Orama-Interactive:master
from
ballerburg9005:master
Mar 6, 2021
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7cfed07
full support for auto tallscreen/widescreen panel layout
2d37ecd
Update Main.tscn
ballerburg9005 b16714f
Update CanvasPreviewContainer.tscn
ballerburg9005 89c7bab
Update UI.tscn
ballerburg9005 35b923c
tallscreen support - better display scale
2c969c0
tallscreen support - better display scale
fe83bde
Update UI.tscn
ballerburg9005 34dc322
Update Main.gd
ballerburg9005 839e85b
tallscreen support - better display scale
9294838
tallscreen support - better display scale
5860485
tallscreen support - alternate panel placement comment-784228607
0ff2a65
tallscreen support - code cleanup
99e587d
tallscreen support - color picker swap: comment-785032683
fbfe8b5
prettier border
ballerburg9005 101adf8
tallscreen support - color picker
686421e
tallscreen support - pullrequestreview-601156079
7294bfe
tallscreen support - bugfix & review
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
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
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 |
---|---|---|
|
@@ -83,6 +83,7 @@ func setup_view_menu() -> void: | |
var view_menu_items := { # order as in ViewMenuId enum | ||
"Tile Mode" : 0, | ||
"Window Transparency" : 0, | ||
"Panel Layout" : 0, | ||
"Mirror View" : InputMap.get_action_list("mirror_view")[0].get_scancode_with_modifiers(), | ||
"Show Grid" : InputMap.get_action_list("show_grid")[0].get_scancode_with_modifiers(), | ||
"Show Pixel Grid" : InputMap.get_action_list("show_pixel_grid")[0].get_scancode_with_modifiers(), | ||
|
@@ -100,6 +101,8 @@ func setup_view_menu() -> void: | |
setup_tile_mode_submenu(item) | ||
elif item == "Window Transparency": | ||
setup_window_transparency_submenu(item) | ||
elif item == "Panel Layout": | ||
setup_panel_layout_submenu(item) | ||
else: | ||
view_menu.add_check_item(item, i, view_menu_items[item]) | ||
i += 1 | ||
|
@@ -124,6 +127,12 @@ func setup_window_transparency_submenu(item : String): | |
view_menu.add_submenu_item(item, Global.window_transparency_submenu.get_name()) | ||
|
||
|
||
func setup_panel_layout_submenu(item : String): | ||
Global.panel_layout_submenu.connect("id_pressed", self, "panel_layout_submenu_id_pressed") | ||
view_menu.add_child(Global.panel_layout_submenu) | ||
view_menu.add_submenu_item(item, Global.panel_layout_submenu.get_name()) | ||
|
||
|
||
func setup_image_menu() -> void: | ||
var image_menu_items := { # order as in ImageMenuId enum | ||
"Scale Image" : 0, | ||
|
@@ -314,6 +323,13 @@ func window_transparency_submenu_id_pressed(id : float) -> void: | |
window_transparency(id/10) | ||
|
||
|
||
func panel_layout_submenu_id_pressed(id : int) -> void: | ||
Global.current_project.panel_layout = id | ||
for i in Global.TileMode.values(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this line should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
Global.panel_layout_submenu.set_item_checked(i, i == id) | ||
get_tree().get_root().get_node("Control").handle_resize() | ||
|
||
|
||
func window_transparency(value :float) -> void: | ||
if value == 1: | ||
get_node("../../AlternateTransparentBackground").visible = false | ||
|
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
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.
Is the panel layout meant to be a per-project setting? Because if I, for example, select Tallscreen and then switch tabs, the submenu item that is checked returns to Auto, but the UI does not change.
Per-project setting means that the UI would change depending on the project, each project would have its own panel layout. If this is something we want, then this code also needs to call
change_ui_layout()
from Main.gd. If this is something we don't want, then these 3 new lines of code should be removed completely. Personally, I don't think it should be a per-project setting as it's a UI change that may confuse the users.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.
It will now save and restore the layout if you close and reopen the window.
On that matter: shouldn't most other global view settings also save and restore? If the users sets a different window transparency or hides the animation timeline for example. Maybe not tile mode though and especially not mirror view.
Honestly, when I tied panel_layout to current_project I wasn't sure whether or not saving the view settings was broken. So I didn't think it through any further. Sorry about that.