Borderless experimenting

This commit is contained in:
2020-12-10 20:37:00 -06:00
parent 4adcff577a
commit 8a61b6263b
2 changed files with 21 additions and 3 deletions

View File

@@ -13,6 +13,24 @@ module TAC
true true
end end
def hit_test(x, y)
if y <= 4
return 2 if x <= 4
return 4 if x >= width - 4
return 3
end
if y >= height - 4
return 8 if x <= 4
return 6 if x >= width - 4
return 7
end
return 1 if y <= 36 && x <= width - 74
0
end
def close def close
if @backend.config_changed? if @backend.config_changed?
push_state(Dialog::ConfirmDialog, title: "Unsaved Config", message: "Config has unsaved changes\nthat will be lost if you continue!", callback_method: proc { cleanup_and_close }) push_state(Dialog::ConfirmDialog, title: "Unsaved Config", message: "Config has unsaved changes\nthat will be lost if you continue!", callback_method: proc { cleanup_and_close })
@@ -31,4 +49,4 @@ module TAC
close! close!
end end
end end
end end

View File

@@ -48,5 +48,5 @@ require_relative "lib/tacnet/server"
# Thread.abort_on_exception = true # Thread.abort_on_exception = true
if not defined?(Ocra) if not defined?(Ocra)
TAC::Window.new(width: (Gosu.screen_width * 0.8).round, height: (Gosu.screen_height * 0.8).round, resizable: true).show TAC::Window.new(width: (Gosu.screen_width * 0.8).round, height: (Gosu.screen_height * 0.8).round, resizable: true, borderless: true).show
end end