Restore `TitleView` only when needed

Before, every time the user came back from fullscreen, the `TitleView` 
was shown regardless of its previous status.
This commit is contained in:
Guldoman 2021-11-09 22:21:45 +01:00
parent bcfd33a7df
commit 6bc4fbb238
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,7 @@ local LogView = require "core.logview"
local fullscreen = false
local restore_title_view = false
local function suggest_directory(text)
text = common.home_expand(text)
@ -28,9 +29,12 @@ command.add(nil, {
["core:toggle-fullscreen"] = function()
fullscreen = not fullscreen
if fullscreen then
restore_title_view = core.title_view.visible
end
system.set_window_mode(fullscreen and "fullscreen" or "normal")
core.show_title_bar(not fullscreen)
core.title_view:configure_hit_test(not fullscreen)
core.show_title_bar(not fullscreen and restore_title_view)
core.title_view:configure_hit_test(not fullscreen and restore_title_view)
end,
["core:reload-module"] = function()