[libhandy/wip/haecker-felix/flap-widget: 131/138] Rename HdyFlapMode to HdyFlapFoldPolicy




commit 5ed490320c6f7459330f7fd44f6176ddb3c1d6e7
Author: Felix Häcker <haeckerfelix gnome org>
Date:   Sat Aug 1 14:29:13 2020 +0200

    Rename HdyFlapMode to HdyFlapFoldPolicy

 src/hdy-flap.c | 66 +++++++++++++++++++++++++++++-----------------------------
 src/hdy-flap.h | 14 ++++++-------
 2 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/src/hdy-flap.c b/src/hdy-flap.c
index 20df65d9..ba1f1334 100644
--- a/src/hdy-flap.c
+++ b/src/hdy-flap.c
@@ -24,7 +24,7 @@ struct _HdyFlap
   GtkBin parent_instance;
 
   GtkWidget *flap;
-  HdyFlapMode flap_mode;
+  HdyFlapFoldPolicy flap_fold_policy;
   GtkPackType flap_position;
   gboolean reveal_flap;
   gboolean overlay;
@@ -49,7 +49,7 @@ enum {
   PROP_0,
 
   PROP_FLAP,
-  PROP_FLAP_MODE,
+  PROP_FLAP_FOLD_POLICY,
   PROP_FLAP_POSITION,
   PROP_REVEAL_FLAP,
   PROP_OVERLAY,
@@ -89,8 +89,8 @@ hdy_flap_get_property (GObject    *object,
   case PROP_FLAP:
     g_value_set_object (value, hdy_flap_get_flap (self));
     break;
-  case PROP_FLAP_MODE:
-    g_value_set_enum (value, hdy_flap_get_flap_mode (self));
+  case PROP_FLAP_FOLD_POLICY:
+    g_value_set_enum (value, hdy_flap_get_flap_fold_policy (self));
     break;
   case PROP_FLAP_POSITION:
     g_value_set_enum (value, hdy_flap_get_flap_position (self));
@@ -127,8 +127,8 @@ hdy_flap_set_property (GObject      *object,
   case PROP_FLAP:
     hdy_flap_set_flap (self, g_value_get_object (value));
     break;
-  case PROP_FLAP_MODE:
-    hdy_flap_set_flap_mode  (self, g_value_get_enum (value));
+  case PROP_FLAP_FOLD_POLICY:
+    hdy_flap_set_flap_fold_policy  (self, g_value_get_enum (value));
     break;
   case PROP_FLAP_POSITION:
     hdy_flap_set_flap_position (self, g_value_get_enum (value));
@@ -319,7 +319,7 @@ hdy_flap_measure (GtkWidget      *widget,
       if (content) gtk_widget_get_preferred_height (content, &content_min, &content_nat);
       if (self->flap) gtk_widget_get_preferred_height (self->flap, &flap_min, &flap_nat);
 
-      if (self->orientation == GTK_ORIENTATION_VERTICAL && self->flap_mode != HDY_FLAP_MODE_AUTO){
+      if (self->orientation == GTK_ORIENTATION_VERTICAL && self->flap_fold_policy != 
HDY_FLAP_FOLD_POLICY_AUTO){
           *minimum = MAX (content_min + adjust_for_overlay (self, flap_min), flap_min);
           *natural = MAX (content_nat + adjust_for_overlay (self, flap_nat), flap_nat);
           return;
@@ -330,7 +330,7 @@ hdy_flap_measure (GtkWidget      *widget,
       if (content) gtk_widget_get_preferred_width (content, &content_min, &content_nat);
       if (self->flap) gtk_widget_get_preferred_width (self->flap, &flap_min, &flap_nat);
 
-      if (self->orientation == GTK_ORIENTATION_HORIZONTAL && self->flap_mode != HDY_FLAP_MODE_AUTO){
+      if (self->orientation == GTK_ORIENTATION_HORIZONTAL && self->flap_fold_policy != 
HDY_FLAP_FOLD_POLICY_AUTO){
           *minimum = MAX (content_min + adjust_for_overlay (self, flap_min), flap_min);
           *natural = MAX (content_nat + adjust_for_overlay (self, flap_nat), flap_nat);
           return;
@@ -441,7 +441,7 @@ allocate_content (HdyFlap       *self,
 
   if (self->orientation == GTK_ORIENTATION_HORIZONTAL){
       int min = content_min.width + flap_min.width;
-      if (self->flap_mode == HDY_FLAP_MODE_AUTO)
+      if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_AUTO)
         set_overlay (self, widget_alloc->width <= min);
 
       if (self->flap_position == adjust_for_text_direction (self, GTK_PACK_START)){
@@ -456,7 +456,7 @@ allocate_content (HdyFlap       *self,
 
   if (self->orientation == GTK_ORIENTATION_VERTICAL){
       gint min = content_min.height + flap_min.height;
-      if (self->flap_mode == HDY_FLAP_MODE_AUTO) set_overlay (self, widget_alloc->height <= min);
+      if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_AUTO) set_overlay (self, widget_alloc->height <= 
min);
 
       if (self->flap_position == GTK_PACK_START){
           content_x = widget_alloc->x;
@@ -601,16 +601,16 @@ hdy_flap_class_init (HdyFlapClass *klass)
                            G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
-   * HdyFlap:flap-mode:
+   * HdyFlap:flap-fold-policy:
    *
    * Since: 1.0
    */
-  props[PROP_FLAP_MODE] =
-      g_param_spec_enum ("flap-mode",
-                         _("Flap Mode"),
-                         _("Flap Mode"),
-                         HDY_TYPE_FLAP_MODE,
-                         HDY_FLAP_MODE_NON_OVERLAY,
+  props[PROP_FLAP_FOLD_POLICY] =
+      g_param_spec_enum ("flap-fold-policy",
+                         _("Flap Fold Policy"),
+                         _("Flap Fold Policy"),
+                         HDY_TYPE_FLAP_FOLD_POLICY,
+                         HDY_FLAP_FOLD_POLICY_NEVER,
                          G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
@@ -690,7 +690,7 @@ hdy_flap_init (HdyFlap *self)
 {
   self->orientation = GTK_ORIENTATION_HORIZONTAL;
   self->flap_position = GTK_PACK_START;
-  self->flap_mode = HDY_FLAP_MODE_NON_OVERLAY;
+  self->flap_fold_policy = HDY_FLAP_FOLD_POLICY_NEVER;
   self->reveal_flap = TRUE;
   self->reveal_progress = 1;
   self->overlay = FALSE;
@@ -758,46 +758,46 @@ hdy_flap_set_flap (HdyFlap *self,
 }
 
 /**
- * hdy_flap_get_flap_mode:
+ * hdy_flap_get_flap_fold_policy:
  * @self: a #HdyFlap
  *
- * Returns: current flap mode.
+ * Returns: current flap fold policy.
  *
  * Since: 1.0
  */
-HdyFlapMode
-hdy_flap_get_flap_mode (HdyFlap *self)
+HdyFlapFoldPolicy
+hdy_flap_get_flap_fold_policy (HdyFlap *self)
 {
-  g_return_val_if_fail (HDY_IS_FLAP (self), HDY_FLAP_MODE_NON_OVERLAY);
+  g_return_val_if_fail (HDY_IS_FLAP (self), HDY_FLAP_FOLD_POLICY_NEVER);
 
-  return self->flap_mode;
+  return self->flap_fold_policy;
 }
 
 /**
- * hdy_flap_set_flap_mode:
+ * hdy_flap_set_flap_fold_policy:
  * @self: a #HdyFlap
- * @flap_mode: Flap mode
+ * @flap_fold_policy: Flap fold policy
  *
  * Since: 1.0
  */
 void
-hdy_flap_set_flap_mode (HdyFlap     *self,
-                        HdyFlapMode  flap_mode)
+hdy_flap_set_flap_fold_policy (HdyFlap     *self,
+                        HdyFlapFoldPolicy  flap_fold_policy)
 {
   g_return_if_fail (HDY_IS_FLAP (self));
 
-  if (self->flap_mode == flap_mode)
+  if (self->flap_fold_policy == flap_fold_policy)
     return;
 
-  self->flap_mode = flap_mode;
+  self->flap_fold_policy = flap_fold_policy;
 
-  if (self->flap_mode == HDY_FLAP_MODE_OVERLAY)
+  if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_ALWAYS)
     set_overlay(self, TRUE);
 
-  if (self->flap_mode == HDY_FLAP_MODE_NON_OVERLAY)
+  if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_NEVER)
     set_overlay(self, FALSE);
 
-  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FLAP_MODE]);
+  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FLAP_FOLD_POLICY]);
 }
 
 /**
diff --git a/src/hdy-flap.h b/src/hdy-flap.h
index 02070767..b5ef7d23 100644
--- a/src/hdy-flap.h
+++ b/src/hdy-flap.h
@@ -20,10 +20,10 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (HdyFlap, hdy_flap, HDY, FLAP, GtkBin)
 
 typedef enum {
-  HDY_FLAP_MODE_NON_OVERLAY,
-  HDY_FLAP_MODE_OVERLAY,
-  HDY_FLAP_MODE_AUTO,
-} HdyFlapMode;
+  HDY_FLAP_FOLD_POLICY_NEVER,
+  HDY_FLAP_FOLD_POLICY_ALWAYS,
+  HDY_FLAP_FOLD_POLICY_AUTO,
+} HdyFlapFoldPolicy;
 
 
 GtkWidget *hdy_flap_new (void);
@@ -31,9 +31,9 @@ GtkWidget *hdy_flap_new (void);
 GtkWidget *hdy_flap_get_flap (HdyFlap   *self);
 void       hdy_flap_set_flap (HdyFlap   *self,
                               GtkWidget *flap);
-HdyFlapMode hdy_flap_get_flap_mode (HdyFlap *self);
-void        hdy_flap_set_flap_mode (HdyFlap *self,
-                                    HdyFlapMode flap_mode);
+HdyFlapFoldPolicy hdy_flap_get_flap_fold_policy (HdyFlap *self);
+void        hdy_flap_set_flap_fold_policy (HdyFlap *self,
+                                    HdyFlapFoldPolicy flap_mode);
 GtkPackType hdy_flap_get_flap_position (HdyFlap *self);
 void        hdy_flap_set_flap_position (HdyFlap *self,
                                         GtkPackType flap_position);


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