Add correct hit-test information and menu icon

This commit is contained in:
Francesco Abbate
2021-04-11 15:08:25 +02:00
parent 7531a0ddc8
commit 8ad87d77da
6 changed files with 47 additions and 18 deletions
+3 -1
View File
@@ -400,9 +400,11 @@ function core.init()
end
end
core.window_borderless = false
core.hit_test_title_height = 0
if config.borderless then
system.set_window_bordered(false)
system.set_window_hit_test()
core.window_borderless = true
end
core.frame_start = 0
+15 -1
View File
@@ -16,11 +16,25 @@ function TitleView:on_mouse_pressed()
core.set_active_view(core.last_active_view)
end
function TitleView:on_mouse_moved(px, py, ...)
end
function TitleView:update()
TitleView.super.update(self)
local title_height = self.size.y
if core.window_borderless and title_height ~= core.hit_test_title_height then
local resize_border = title_height / 2
system.set_window_hit_test(title_height, resize_border)
core.hit_test_title_height = title_height
end
end
function TitleView:get_items()
local title = core.compose_window_title(core.window_title)
return {
style.text, style.icon_font, "g ", style.font, title,
style.text, style.icon_font, "M ", style.font, title,
}, {
style.text, style.icon_font, "_", TitleView.separator, "w", TitleView.separator, "W",
}