diff --git a/config.go b/config.go index 537c8c1..990676a 100644 --- a/config.go +++ b/config.go @@ -194,29 +194,13 @@ func (app *App) setVFlip(vflip bool) { func (app *App) setFullscreen(fullscreen bool) { app.Config.Fullscreen = fullscreen - - if fullscreen { - app.W.MainWindow.Fullscreen() - } else { - app.W.MainWindow.Unfullscreen() - } - + app.toggleFullscreen(fullscreen) app.W.MenuItemFullscreen.SetActive(fullscreen) } func (app *App) setHideUI(hideUI bool) { app.Config.HideUI = hideUI - - if hideUI { - app.W.Menubar.Hide() - app.W.Toolbar.Hide() - app.W.Statusbar.Hide() - } else { - app.W.Menubar.Show() - app.W.Toolbar.Show() - app.W.Statusbar.Show() - } - + app.toggleHideUI(hideUI) app.W.MenuItemHideUI.SetActive(hideUI) } diff --git a/ui.go b/ui.go index 696cc19..f3dc8d3 100644 --- a/ui.go +++ b/ui.go @@ -119,3 +119,23 @@ func (app *App) syncWidgetsToConfig() { app.W.KamitePortContainer.SetSensitive(app.Config.KamiteEnabled) app.W.KamitePortEntry.SetText(fmt.Sprint(app.Config.KamitePort)) } + +func (app *App) toggleHideUI(hideUI bool) { + if hideUI { + app.W.Menubar.Hide() + app.W.Toolbar.Hide() + app.W.Statusbar.Hide() + } else { + app.W.Menubar.Show() + app.W.Toolbar.Show() + app.W.Statusbar.Show() + } +} + +func (app *App) toggleFullscreen(fullscreen bool) { + if fullscreen { + app.W.MainWindow.Fullscreen() + } else { + app.W.MainWindow.Unfullscreen() + } +}