Skip to content

Commit 65c3d2b

Browse files
committed
Added a 'close' button to module menubar, justified on the right
(looks better)
1 parent 7e28851 commit 65c3d2b

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/main_window.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ function graphite_main_window.draw_module(module)
223223
if with_menubar then
224224
if imgui.BeginMenuBar() then
225225
module.draw_menu()
226+
local btn_width = autogui.button_size
227+
imgui.Dummy(imgui.GetContentRegionAvail()-btn_width,2)
228+
if imgui.SimpleButton(
229+
imgui.font_icon('window-close')..'##close'
230+
) then
231+
module.visible = false
232+
end
226233
imgui.EndMenuBar()
227234
end
228235
end

lib/text_editor.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,6 @@ end
506506

507507
function text_editor_gui.draw_window()
508508
text_editor_gui.parse_errors()
509-
if imgui.SimpleButton(
510-
imgui.font_icon('window-close')..'##close'
511-
) then
512-
text_editor_gui.visible = false
513-
end
514-
autogui.tooltip('Hide editor')
515-
imgui.SameLine()
516509
if imgui.SimpleButton(
517510
imgui.font_icon('circle-play')
518511
) then

0 commit comments

Comments
 (0)