[libadwaita] indicator-bin: Rename show-indicator to needs-attention



commit de2786cda93f55274a4bbbc06a089fa80d53ba43
Author: CodedOre <CodedOre>
Date:   Mon Jun 28 17:20:13 2021 +0500

    indicator-bin: Rename show-indicator to needs-attention
    
    We'll add a second type of indicator later, clarify the name.

 src/adw-indicator-bin-private.h |  6 +++---
 src/adw-indicator-bin.c         | 42 ++++++++++++++++++++---------------------
 src/adw-view-switcher-button.ui |  4 ++--
 3 files changed, 26 insertions(+), 26 deletions(-)
---
diff --git a/src/adw-indicator-bin-private.h b/src/adw-indicator-bin-private.h
index 8336b381..556352b3 100644
--- a/src/adw-indicator-bin-private.h
+++ b/src/adw-indicator-bin-private.h
@@ -26,9 +26,9 @@ GtkWidget *adw_indicator_bin_get_child (AdwIndicatorBin *self);
 void       adw_indicator_bin_set_child (AdwIndicatorBin *self,
                                         GtkWidget       *child);
 
-gboolean adw_indicator_bin_get_show_indicator (AdwIndicatorBin *self);
-void     adw_indicator_bin_set_show_indicator (AdwIndicatorBin *self,
-                                               gboolean         show_indicator);
+gboolean adw_indicator_bin_get_needs_attention (AdwIndicatorBin *self);
+void     adw_indicator_bin_set_needs_attention (AdwIndicatorBin *self,
+                                                gboolean         needs_attention);
 
 gboolean adw_indicator_bin_get_contained (AdwIndicatorBin *self);
 void     adw_indicator_bin_set_contained (AdwIndicatorBin *self,
diff --git a/src/adw-indicator-bin.c b/src/adw-indicator-bin.c
index 7530241c..ba5e85c4 100644
--- a/src/adw-indicator-bin.c
+++ b/src/adw-indicator-bin.c
@@ -27,7 +27,7 @@ struct _AdwIndicatorBin
   GtkWidget parent_instance;
 
   GtkWidget *child;
-  gboolean show_indicator;
+  gboolean needs_attention;
   gboolean contained;
 
   GtkWidget *mask;
@@ -47,7 +47,7 @@ static GtkBuildableIface *parent_buildable_iface;
 enum {
   PROP_0,
   PROP_CHILD,
-  PROP_SHOW_INDICATOR,
+  PROP_NEEDS_ATTENTION,
   PROP_CONTAINED,
   LAST_PROP
 };
@@ -151,7 +151,7 @@ adw_indicator_bin_snapshot (GtkWidget   *widget,
 {
   AdwIndicatorBin *self = ADW_INDICATOR_BIN (widget);
 
-  if (!self->show_indicator) {
+  if (!self->needs_attention) {
     if (self->child)
       gtk_widget_snapshot_child (widget, self->child, snapshot);
 
@@ -204,8 +204,8 @@ adw_indicator_bin_get_property (GObject    *object,
     g_value_set_object (value, adw_indicator_bin_get_child (self));
     break;
 
-  case PROP_SHOW_INDICATOR:
-    g_value_set_boolean (value, adw_indicator_bin_get_show_indicator (self));
+  case PROP_NEEDS_ATTENTION:
+    g_value_set_boolean (value, adw_indicator_bin_get_needs_attention (self));
     break;
 
   case PROP_CONTAINED:
@@ -230,8 +230,8 @@ adw_indicator_bin_set_property (GObject      *object,
     adw_indicator_bin_set_child (self, g_value_get_object (value));
     break;
 
-  case PROP_SHOW_INDICATOR:
-    adw_indicator_bin_set_show_indicator (self, g_value_get_boolean (value));
+  case PROP_NEEDS_ATTENTION:
+    adw_indicator_bin_set_needs_attention (self, g_value_get_boolean (value));
     break;
 
   case PROP_CONTAINED:
@@ -284,16 +284,16 @@ adw_indicator_bin_class_init (AdwIndicatorBinClass *klass)
                            G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
-   * AdwIndicatorBin:show-indicator:
+   * AdwIndicatorBin:needs-attention:
    *
-   * Whether to show the indicator.
+   * Whether the indicator requires attention of the user.
    *
    * Since: 1.0
    */
-  props[PROP_SHOW_INDICATOR] =
-    g_param_spec_boolean ("show-indicator",
-                          "Show Indicator",
-                          "Whether to show the indicator",
+  props[PROP_NEEDS_ATTENTION] =
+    g_param_spec_boolean ("needs-attention",
+                          "Needs Attention",
+                          "Whether the indicator requires attention of the user",
                           FALSE,
                           G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
@@ -413,29 +413,29 @@ adw_indicator_bin_set_child (AdwIndicatorBin *self,
 }
 
 gboolean
-adw_indicator_bin_get_show_indicator (AdwIndicatorBin *self)
+adw_indicator_bin_get_needs_attention (AdwIndicatorBin *self)
 {
   g_return_val_if_fail (ADW_IS_INDICATOR_BIN (self), FALSE);
 
-  return self->show_indicator;
+  return self->needs_attention;
 }
 
 void
-adw_indicator_bin_set_show_indicator (AdwIndicatorBin *self,
-                                      gboolean         show_indicator)
+adw_indicator_bin_set_needs_attention (AdwIndicatorBin *self,
+                                       gboolean         needs_attention)
 {
   g_return_if_fail (ADW_IS_INDICATOR_BIN (self));
 
-  show_indicator = !!show_indicator;
+  needs_attention = !!needs_attention;
 
-  if (self->show_indicator == show_indicator)
+  if (self->needs_attention == needs_attention)
     return;
 
-  self->show_indicator = show_indicator;
+  self->needs_attention = needs_attention;
 
   gtk_widget_queue_allocate (GTK_WIDGET (self));
 
-  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SHOW_INDICATOR]);
+  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NEEDS_ATTENTION]);
 }
 
 gboolean
diff --git a/src/adw-view-switcher-button.ui b/src/adw-view-switcher-button.ui
index 6f44d438..daf21b6e 100644
--- a/src/adw-view-switcher-button.ui
+++ b/src/adw-view-switcher-button.ui
@@ -28,7 +28,7 @@
             <child>
               <object class="AdwIndicatorBin">
                 <property name="contained">True</property>
-                <binding name="show-indicator">
+                <binding name="needs-attention">
                   <closure type="gboolean" function="should_show_indicator">
                     <lookup name="needs-attention">AdwViewSwitcherButton</lookup>
                     <lookup name="active">AdwViewSwitcherButton</lookup>
@@ -69,7 +69,7 @@
             <child>
               <object class="AdwIndicatorBin">
                 <property name="halign">center</property>
-                <binding name="show-indicator">
+                <binding name="needs-attention">
                   <closure type="gboolean" function="should_show_indicator">
                     <lookup name="needs-attention">AdwViewSwitcherButton</lookup>
                     <lookup name="active">AdwViewSwitcherButton</lookup>


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