Avoid always calling system.get_window_mode

This commit is contained in:
Francesco Abbate
2021-04-12 13:31:32 +02:00
parent 46791aefe5
commit 4de97d51fb
3 changed files with 16 additions and 2 deletions
+1 -2
View File
@@ -36,8 +36,7 @@ function TitleView:update()
self.size.y = 0
end
TitleView.super.update(self)
local window_mode = system.get_window_mode()
title_commands[2] = window_mode == "maximized" and restore_command or maximize_command
title_commands[2] = core.window_mode == "maximized" and restore_command or maximize_command
local title_height = self.size.y
if core.window_borderless and title_height ~= core.hit_test_title_height then
local icon_w = style.icon_font:get_width("_")