[libhandy/wip/haecker-felix/flap-widget] Rename overlay property to folded
- From: Felix Häcker <haeckerfelix src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/haecker-felix/flap-widget] Rename overlay property to folded
- Date: Sat, 1 Aug 2020 15:14:43 +0000 (UTC)
commit b82b915ae45f8dbd4a1743dbd53723c15d559644
Author: Felix Häcker <haeckerfelix gnome org>
Date: Sat Aug 1 17:14:37 2020 +0200
Rename overlay property to folded
src/hdy-flap.c | 58 +++++++++++++++++++++++++++++-----------------------------
src/hdy-flap.h | 2 +-
2 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/src/hdy-flap.c b/src/hdy-flap.c
index c5421fad..64cdb272 100644
--- a/src/hdy-flap.c
+++ b/src/hdy-flap.c
@@ -28,7 +28,7 @@ struct _HdyFlap
GtkPackType flap_position;
gboolean reveal_flap;
gboolean locked;
- gboolean overlay;
+ gboolean folded;
gint overlay_duration;
gint reveal_duration;
@@ -54,7 +54,7 @@ enum {
PROP_FLAP_POSITION,
PROP_REVEAL_FLAP,
PROP_LOCKED,
- PROP_OVERLAY,
+ PROP_FOLDED,
PROP_OVERLAY_DURATION,
PROP_REVEAL_DURATION,
@@ -103,8 +103,8 @@ hdy_flap_get_property (GObject *object,
case PROP_LOCKED:
g_value_set_boolean (value, hdy_flap_get_locked (self));
break;
- case PROP_OVERLAY:
- g_value_set_boolean (value, hdy_flap_get_overlay (self));
+ case PROP_FOLDED:
+ g_value_set_boolean (value, hdy_flap_get_folded (self));
break;
case PROP_OVERLAY_DURATION:
g_value_set_int (value, hdy_flap_get_overlay_duration(self));
@@ -202,7 +202,7 @@ overlay_tick_cb (HdyFlap *self,
t = (frame_time - self->overlay_start_time) / self->overlay_duration;
if (t >= 1) {
- self->overlay_progress = self->overlay ? 1 : 0;
+ self->overlay_progress = self->folded ? 1 : 0;
self->overlay_tick_cb_id = 0;
gtk_widget_queue_resize (GTK_WIDGET (self));
@@ -212,7 +212,7 @@ overlay_tick_cb (HdyFlap *self,
self->overlay_progress = ease_out_cubic (t);
- if (!self->overlay)
+ if (!self->folded)
self->overlay_progress = 1 - self->overlay_progress;
gtk_widget_queue_resize (GTK_WIDGET (self));
@@ -224,7 +224,7 @@ static void
animate_overlay (HdyFlap *self)
{
if (!hdy_get_enable_animations (GTK_WIDGET (self)) || !gtk_widget_get_mapped (GTK_WIDGET (self))) {
- self->overlay_progress = self->overlay ? 1 : 0;
+ self->overlay_progress = self->folded ? 1 : 0;
gtk_widget_queue_resize (GTK_WIDGET (self));
return;
}
@@ -235,7 +235,7 @@ animate_overlay (HdyFlap *self)
}
self->overlay_start_time = gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (GTK_WIDGET (self)))
/ 1000;
- self->overlay_progress = self->overlay ? 0 : 1;
+ self->overlay_progress = self->folded ? 0 : 1;
self->overlay_tick_cb_id = gtk_widget_add_tick_callback (GTK_WIDGET (self), (GtkTickCallback)
overlay_tick_cb, NULL, NULL);
}
@@ -281,19 +281,19 @@ adjust_for_text_direction (HdyFlap *self,
}
static void
-set_overlay (HdyFlap *self,
- gboolean overlay)
+set_folded (HdyFlap *self,
+ gboolean folded)
{
g_return_if_fail (HDY_IS_FLAP (self));
- overlay = !!overlay;
+ folded = !!folded;
- if (self->overlay == overlay)
+ if (self->folded == folded)
return;
- self->overlay = overlay;
+ self->folded = folded;
animate_overlay(self);
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_OVERLAY]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FOLDED]);
}
/* This private method is prefixed by the call name because it will be a virtual
@@ -450,7 +450,7 @@ allocate_content (HdyFlap *self,
if (self->orientation == GTK_ORIENTATION_HORIZONTAL){
int min = content_min.width + flap_min.width;
if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_AUTO)
- set_overlay (self, widget_alloc->width <= min);
+ set_folded (self, widget_alloc->width <= min);
if (self->flap_position == adjust_for_text_direction (self, GTK_PACK_START)){
content_x = widget_alloc->x + adjust_for_overlay (self, get_flap_size(self, widget_alloc,
GTK_ORIENTATION_HORIZONTAL));
@@ -464,7 +464,7 @@ allocate_content (HdyFlap *self,
if (self->orientation == GTK_ORIENTATION_VERTICAL){
gint min = content_min.height + flap_min.height;
- if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_AUTO) set_overlay (self, widget_alloc->height <=
min);
+ if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_AUTO) set_folded (self, widget_alloc->height <=
min);
if (self->flap_position == GTK_PACK_START){
content_x = widget_alloc->x;
@@ -660,14 +660,14 @@ hdy_flap_class_init (HdyFlapClass *klass)
/**
- * HdyFlap:overlay:
+ * HdyFlap:folded:
*
* Since: 1.0
*/
- props[PROP_OVERLAY] =
- g_param_spec_boolean ("overlay",
- _("Overlay"),
- _("Overlay"),
+ props[PROP_FOLDED] =
+ g_param_spec_boolean ("folded",
+ _("Folded"),
+ _("Folded"),
FALSE,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
@@ -715,7 +715,7 @@ hdy_flap_init (HdyFlap *self)
self->reveal_flap = TRUE;
self->locked = FALSE;
self->reveal_progress = 1;
- self->overlay = FALSE;
+ self->folded = FALSE;
self->overlay_progress = 0;
self->overlay_duration = 250;
self->reveal_duration = 250;
@@ -814,10 +814,10 @@ hdy_flap_set_flap_fold_policy (HdyFlap *self,
self->flap_fold_policy = flap_fold_policy;
if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_ALWAYS)
- set_overlay(self, TRUE);
+ set_folded(self, TRUE);
if (self->flap_fold_policy == HDY_FLAP_FOLD_POLICY_NEVER)
- set_overlay(self, FALSE);
+ set_folded(self, FALSE);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FLAP_FOLD_POLICY]);
}
@@ -938,19 +938,19 @@ hdy_flap_set_locked (HdyFlap *self,
}
/**
- * hdy_flap_get_overlay:
+ * hdy_flap_get_folded:
* @self: a #HdyFlap
*
- * Returns: %TRUE if flap widget gets overlayed.
+ * Returns: %TRUE if flap widget is folded.
*
* Since: 1.0
*/
gboolean
-hdy_flap_get_overlay (HdyFlap *self)
+hdy_flap_get_folded (HdyFlap *self)
{
g_return_val_if_fail (HDY_IS_FLAP (self), FALSE);
- return self->overlay;
+ return self->folded;
}
/**
@@ -1009,7 +1009,7 @@ hdy_flap_get_reveal_duration (HdyFlap *self)
/**
* hdy_flap_set_reveal_duration:
* @self: a #HdyFlap
- * @reveal_duration: Duration for overlay animation
+ * @reveal_duration: Duration for reveal animation
*
* Since: 1.0
*/
diff --git a/src/hdy-flap.h b/src/hdy-flap.h
index 982d3cc6..71b6a545 100644
--- a/src/hdy-flap.h
+++ b/src/hdy-flap.h
@@ -43,7 +43,7 @@ void hdy_flap_set_reveal_flap (HdyFlap *self,
gboolean hdy_flap_get_locked (HdyFlap *self);
void hdy_flap_set_locked (HdyFlap *self,
gboolean locked);
-gboolean hdy_flap_get_overlay (HdyFlap *self);
+gboolean hdy_flap_get_folded (HdyFlap *self);
gint hdy_flap_get_overlay_duration (HdyFlap *self);
void hdy_flap_set_overlay_duration (HdyFlap *self,
gint overlay_duration);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]