[libadwaita] entry-row: Hide apply button when disabled



commit ca3267aadc58b33bd7f48edcb625a8875de7b678
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jul 2 14:12:02 2022 +0200

    entry-row: Hide apply button when disabled
    
    When setting the :show-apply-button property to FALSE, it seems
    reasonable to expect that the button will not be shown, regardless
    of whether it was visible before or not.
    
    This is done by resetting the text_changed state. As that is only
    tracked if the property is set, resetting it makes sure that
    toggling the property behaves consistently.

 src/adw-entry-row.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/adw-entry-row.c b/src/adw-entry-row.c
index 057df211..1dfff162 100644
--- a/src/adw-entry-row.c
+++ b/src/adw-entry-row.c
@@ -687,6 +687,11 @@ adw_entry_row_set_show_apply_button (AdwEntryRow *self,
 
   priv->show_apply_button = show_apply_button;
 
+  if (!priv->show_apply_button && priv->text_changed) {
+    priv->text_changed = FALSE;
+    update_empty (self);
+  }
+
   g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SHOW_APPLY_BUTTON]);
 }
 


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