[gnome-boxes/wip/snapshot-config-changes: 12/12] properties-toolbar: Indicate when changes in config editor aren't applied




commit b5675a5e7972d54dc1d2e3f0df94d4411a7e70fe
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Oct 12 12:29:47 2020 +0200

    properties-toolbar: Indicate when changes in config editor aren't applied
    
    Just like gedit shows a "*" before the filename in the titlebar.

 src/properties-toolbar.vala | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/properties-toolbar.vala b/src/properties-toolbar.vala
index 87574075..04adb390 100644
--- a/src/properties-toolbar.vala
+++ b/src/properties-toolbar.vala
@@ -43,6 +43,7 @@ public void setup_ui (AppWindow window, PropertiesWindow props_window) {
         this.props_window = props_window;
 
         window.notify["ui-state"].connect (ui_state_changed);
+        apply_config_button.notify["sensitive"].connect (on_apply_config_editor_sensitivity_changed);
     }
 
     public void click_back_button () {
@@ -68,6 +69,14 @@ private void on_config_editor_apply_config_clicked () {
         apply_config_button.sensitive = false;
     }
 
+    private void on_apply_config_editor_sensitivity_changed () {
+        if (apply_config_button.sensitive) {
+            config_editor.set_title ("*" + config_editor.get_title ());
+        } else {
+            config_editor.set_title (config_editor.get_title ().substring (1));
+        }
+    }
+
     [GtkCallback]
     private void on_title_entry_changed () {
         window.current_item.name = title_entry.text;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]