From 4b66a2e4d0c3d310b22ed15bc74fd34982e7d77b Mon Sep 17 00:00:00 2001 From: oguzhankoral Date: Fri, 6 Jan 2023 16:20:32 +0300 Subject: [PATCH 1/2] Reset dialog if it's closed --- speckle_connector/src/ui/dialog.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/speckle_connector/src/ui/dialog.rb b/speckle_connector/src/ui/dialog.rb index 82efae5..bd2a048 100644 --- a/speckle_connector/src/ui/dialog.rb +++ b/speckle_connector/src/ui/dialog.rb @@ -33,7 +33,7 @@ module SpeckleConnector # reset dialog only if it is marked ready, otherwise # add_exec_callback is triggered twice upon first initialization - reset_dialog! if @ready + reset_dialog! html_dialog.show end @@ -73,6 +73,9 @@ module SpeckleConnector # @return [UI::HtmlDialog] the Sketchup interface to html dialog def init_dialog dialog = UI::HtmlDialog.new(@dialog_specs) + dialog.set_can_close do + true + end File.exist?(@htm_file) ? dialog.set_file(@htm_file) : dialog.set_url('http://localhost:8081') # dialog.set_url('http://localhost:8081') # uncomment this line if you want to use your local version of ui add_exec_callback(dialog) From 929c97ff5edabe64b0b3c00cf9273bf0b4dc3030 Mon Sep 17 00:00:00 2001 From: oguzhankoral Date: Fri, 6 Jan 2023 16:20:53 +0300 Subject: [PATCH 2/2] Bring to front dialog if it is minimized when user reclicked UI button --- speckle_connector/src/ui/dialog.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/speckle_connector/src/ui/dialog.rb b/speckle_connector/src/ui/dialog.rb index bd2a048..137b3ed 100644 --- a/speckle_connector/src/ui/dialog.rb +++ b/speckle_connector/src/ui/dialog.rb @@ -29,6 +29,7 @@ module SpeckleConnector # Show dialog if it's not visible yet def show + bring_to_front if html_dialog.visible? return if html_dialog.visible? # reset dialog only if it is marked ready, otherwise