From 8a61b6263b116b88909ec22ea78759da62933e0b Mon Sep 17 00:00:00 2001 From: cyberarm Date: Thu, 10 Dec 2020 20:37:00 -0600 Subject: [PATCH] Borderless experimenting --- lib/window.rb | 20 +++++++++++++++++++- timecrafters_configuration_tool.rb | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/window.rb b/lib/window.rb index bbf2203..38a2793 100644 --- a/lib/window.rb +++ b/lib/window.rb @@ -13,6 +13,24 @@ module TAC true 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 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 }) @@ -31,4 +49,4 @@ module TAC close! end end -end \ No newline at end of file +end diff --git a/timecrafters_configuration_tool.rb b/timecrafters_configuration_tool.rb index afe6841..f6df60c 100644 --- a/timecrafters_configuration_tool.rb +++ b/timecrafters_configuration_tool.rb @@ -48,5 +48,5 @@ require_relative "lib/tacnet/server" # Thread.abort_on_exception = true if not defined?(Ocra) - TAC::Window.new(width: (Gosu.screen_width * 0.8).round, height: (Gosu.screen_height * 0.8).round, resizable: true).show -end \ No newline at end of file + TAC::Window.new(width: (Gosu.screen_width * 0.8).round, height: (Gosu.screen_height * 0.8).round, resizable: true, borderless: true).show +end