From ea50b3a8ea9a1b4ff8ee9715d02cd75baf475f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Fortin=20Tam?= Date: Thu, 17 Feb 2022 21:52:00 -0500 Subject: [PATCH 1/2] Use a blue button for Record, red button for Stop This makes it much more obvious if I forget to stop the recording. --- pulsecaster/ui.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pulsecaster/ui.py b/pulsecaster/ui.py index 391c5d6..a7b6bc1 100644 --- a/pulsecaster/ui.py +++ b/pulsecaster/ui.py @@ -145,6 +145,7 @@ def on_activate(self, app): self.close.connect('clicked', self.on_close) self.record = self.builder.get_object('record_button') self.record_id = self.record.connect('clicked', self.on_record) + self.record.get_style_context().add_class("suggested-action") self.record.set_sensitive(True) self.main_logo = self.builder.get_object('logo') self.main_logo.set_from_icon_name('pulsecaster', Gtk.IconSize.DIALOG) @@ -334,6 +335,8 @@ def on_record(self, *args): # FIXME: Dim elements other than the 'record' widget self.record.set_label(Gtk.STOCK_MEDIA_STOP) + self.record.get_style_context().remove_class("suggested-action") + self.record.get_style_context().add_class("destructive-action") self.record.disconnect(self.record_id) self.stop_id = self.record.connect('clicked', self.on_stop) self.record.show() @@ -348,6 +351,8 @@ def on_stop(self, *args): self.combiner.set_state(Gst.State.NULL) self.showFileChooser() self.record.set_label(Gtk.STOCK_MEDIA_RECORD) + self.record.get_style_context().remove_class("destructive-action") + self.record.get_style_context().add_class("suggested-action") self.record.disconnect(self.stop_id) self.record_id = self.record.connect('clicked', self.on_record) self.user_vox.cbox.set_sensitive(True) From f49fafee6cb63386f5c221b843a7a533b6d8284d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Fortin=20Tam?= Date: Thu, 17 Feb 2022 21:52:49 -0500 Subject: [PATCH 2/2] Set dialogs as modal and properly parent them There is no clearly visible visual change from this, but it's theoretically better depending on the WM's behavior. --- pulsecaster/ui.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pulsecaster/ui.py b/pulsecaster/ui.py index a7b6bc1..3c17bbb 100644 --- a/pulsecaster/ui.py +++ b/pulsecaster/ui.py @@ -409,6 +409,8 @@ def showFileChooser(self, *args): Gtk.STOCK_OK, Gtk.ResponseType.OK)) self.file_chooser.set_local_only(True) + self.file_chooser.set_transient_for(self.main) + self.file_chooser.set_modal(True) response = self.file_chooser.run() if response == Gtk.ResponseType.OK: self.updateFileSinkPath() @@ -430,6 +432,9 @@ def hideFileChooser(self, *args): erase_message, Gtk.ResponseType.YES), message_format=confirm_message) + + confirm.set_transient_for(self.file_chooser) + confirm.set_modal(True) response = confirm.run() confirm.destroy() if response == Gtk.ResponseType.YES: