[libhandy] stackable-box: Make 'slide' the last transition
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] stackable-box: Make 'slide' the last transition
- Date: Thu, 18 Jun 2020 15:32:34 +0000 (UTC)
commit 8495fd82bfdaa4ff73ee71c93d97d034a3a207c1
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Jun 17 23:54:36 2020 +0500
stackable-box: Make 'slide' the last transition
Rearrange them so that 'over' will be the first one after 'none' is
removed.
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-stackable-box-private.h | 2 +-
src/hdy-stackable-box.c | 20 ++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/hdy-stackable-box-private.h b/src/hdy-stackable-box-private.h
index 605e80b4..423fa5b1 100644
--- a/src/hdy-stackable-box-private.h
+++ b/src/hdy-stackable-box-private.h
@@ -21,9 +21,9 @@ G_DECLARE_FINAL_TYPE (HdyStackableBox, hdy_stackable_box, HDY, STACKABLE_BOX, GO
typedef enum {
HDY_STACKABLE_BOX_TRANSITION_TYPE_NONE,
- HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE,
HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER,
HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER,
+ HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE,
} HdyStackableBoxTransitionType;
HdyStackableBox *hdy_stackable_box_new (GtkContainer *container,
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index d8016d84..6657996c 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -41,9 +41,9 @@
/**
* HdyStackableBoxTransitionType:
* @HDY_STACKABLE_BOX_TRANSITION_TYPE_NONE: No transition
- * @HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE: Slide from left, right, up or down according to the
orientation, text direction and the children order
* @HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER: Cover the old page or uncover the new page, sliding from or
towards the end according to orientation, text direction and children order
* @HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER: Uncover the new page or cover the old page, sliding from or
towards the start according to orientation, text direction and children order
+ * @HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE: Slide from left, right, up or down according to the
orientation, text direction and the children order
*
* This enumeration value describes the possible transitions between modes and
* children in a #HdyStackableBox widget.
@@ -262,12 +262,12 @@ is_window_moving_child_transition (HdyStackableBox *self)
switch (self->child_transition.active_type) {
case HDY_STACKABLE_BOX_TRANSITION_TYPE_NONE:
return FALSE;
- case HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE:
- return TRUE;
case HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER:
return direction == GTK_PAN_DIRECTION_UP || direction == left_or_right;
case HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER:
return direction == GTK_PAN_DIRECTION_DOWN || direction == right_or_left;
+ case HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE:
+ return TRUE;
default:
g_assert_not_reached ();
}
@@ -278,9 +278,9 @@ old and new child */
static inline gboolean
is_direction_dependent_child_transition (HdyStackableBoxTransitionType transition_type)
{
- return (transition_type == HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE ||
- transition_type == HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER ||
- transition_type == HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER);
+ return (transition_type == HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER ||
+ transition_type == HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER ||
+ transition_type == HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE);
}
static GtkPanDirection
@@ -1587,9 +1587,9 @@ hdy_stackable_box_size_allocate_folded (HdyStackableBox *self,
}
break;
- case HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE:
case HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER:
case HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER:
+ case HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE:
/* Compute visible child size. */
visible_size = orientation == GTK_ORIENTATION_HORIZONTAL ?
@@ -2687,13 +2687,13 @@ hdy_stackable_box_draw (HdyStackableBox *self,
cairo_clip (cr);
switch (self->child_transition.active_type) {
- case HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE:
- hdy_stackable_box_draw_slide (self, cr);
- break;
case HDY_STACKABLE_BOX_TRANSITION_TYPE_OVER:
case HDY_STACKABLE_BOX_TRANSITION_TYPE_UNDER:
hdy_stackable_box_draw_over_or_under (self, cr);
break;
+ case HDY_STACKABLE_BOX_TRANSITION_TYPE_SLIDE:
+ hdy_stackable_box_draw_slide (self, cr);
+ break;
case HDY_STACKABLE_BOX_TRANSITION_TYPE_NONE:
default:
g_assert_not_reached ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]