Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions material_maker/doc/user_interface_main_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ View menu

* *Reset zoom* Resets the zoom level of the current material graph view

* *Show/Hide side panels* (or the *Control+SpaceBar* keyboard shortcut) can
be used to hide the side panels so the space available for the main panel
* *Show/Hide side panels* (or the *Control/Cmd+Alt+SpaceBar* keyboard shortcut) can
be used to hide the other panels so the space available for the graph panel
is maximized (which can be useful on smaller displays).

* the *Panels* submenu can be used to show or hide all side panels
Expand Down
3 changes: 3 additions & 0 deletions material_maker/doc/user_interface_shortcuts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ General
+-------------------------------------------------------+----------------------------------------------------+
| :kbd:`Ctrl/Cmd-E` | Export material again |
+-------------------------------------------------------+----------------------------------------------------+
| :kbd:`Ctrl/Cmd-Alt-Space` | Toggle side panels to maximize graph area |
+-------------------------------------------------------+----------------------------------------------------+


Graph Editor
++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion material_maker/main_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const MENU : Array[Dictionary] = [
{ menu="View/Center view", command="view_center", shortcut="C" },
{ menu="View/Reset zoom", command="view_reset_zoom", shortcut="Control+0" },
{ menu="View/-" },
# { menu="View/Show or Hide side panels", command="toggle_side_panels", shortcut="Control+Space" },
{ menu="View/Show or Hide side panels", command="toggle_side_panels", shortcut="Alt+Control+Space" },
{ menu="View/Panels", submenu="show_panels" },
{ menu="View/Presets", submenu="panels_preset" },
{ menu="View/Reset Panels", command="view_reset_panels" },
Expand Down
15 changes: 14 additions & 1 deletion material_maker/main_window_layout.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,22 @@ var current_mode : String = "material"
var layout : Dictionary = {}

var presets : Array[Dictionary]
var previous_layout : Dictionary


func _ready() -> void:
previous_width = size.x

func toggle_side_panels() -> void:
pass
if not previous_layout.is_empty():
$FlexibleLayout.init(previous_layout)
previous_layout.clear()
else:
var main_layout : Dictionary = {
&"main": { &"type": "FlexTop",&"w": 1073.0, &"h": 939.0,
&"children": [{ &"type": "FlexMain", &"w": 1073.0, &"h": 939.0, &"children": [] }] }, &"windows": [] }
previous_layout = $FlexibleLayout.serialize()
$FlexibleLayout.init(main_layout)

func load_panels() -> void:
# Create panels
Expand Down Expand Up @@ -81,6 +91,8 @@ func load_panels() -> void:

func save_config() -> void:
layout[current_mode] = $FlexibleLayout.serialize()
if not previous_layout.is_empty():
layout[current_mode] = previous_layout
for mode in [ "material", "paint" ]:
if layout.has(mode):
mm_globals.config.set_value("layout", mode, JSON.stringify(layout[mode]))
Expand All @@ -107,6 +119,7 @@ func is_panel_visible(panel_name : String) -> bool:
return $FlexibleLayout.flex_layout.is_panel_shown(panel_name)

func set_panel_visible(panel_name : String, v : bool) -> void:
previous_layout.clear()
$FlexibleLayout.show_panel(panel_name, v)
$FlexibleLayout.layout()

Expand Down