mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
Remove usage of ClutterLayoutManager easing API
It is going away.
This commit is contained in:
parent
b985c4035e
commit
b1b3bfb74e
@ -24,7 +24,6 @@
|
||||
"Press h\t\342\236\236\tSwitch homogeneous\n" \
|
||||
"Press p\t\342\236\236\tSwitch pack start/end\n" \
|
||||
"Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \
|
||||
"Press a\t\342\236\236\tSwitch animations on/off\n" \
|
||||
"Press +\t\342\236\236\tAdd a new actor\n" \
|
||||
"Press q\t\342\236\236\tQuit"
|
||||
|
||||
@ -190,13 +189,6 @@ key_release_cb (ClutterActor *stage,
|
||||
|
||||
switch (clutter_event_get_key_symbol (event))
|
||||
{
|
||||
case CLUTTER_KEY_a:
|
||||
toggle = clutter_layout_manager_get_use_animations
|
||||
(CLUTTER_LAYOUT_MANAGER (layout));
|
||||
clutter_layout_manager_set_use_animations
|
||||
(CLUTTER_LAYOUT_MANAGER (layout), !toggle);
|
||||
break;
|
||||
|
||||
case CLUTTER_KEY_v:
|
||||
{
|
||||
ClutterOrientation orientation;
|
||||
@ -273,7 +265,6 @@ main (int argc, char *argv[])
|
||||
clutter_actor_set_x_expand (box, TRUE);
|
||||
clutter_actor_set_y_expand (box, TRUE);
|
||||
layout = clutter_box_layout_new ();
|
||||
clutter_layout_manager_set_use_animations (layout, TRUE);
|
||||
clutter_actor_set_layout_manager (box, layout);
|
||||
clutter_actor_add_child (stage, box);
|
||||
|
||||
|
@ -9,7 +9,6 @@ static gboolean is_homogeneous = FALSE;
|
||||
static gboolean vertical = FALSE;
|
||||
static gboolean random_size = FALSE;
|
||||
static gboolean fixed_size = FALSE;
|
||||
static gboolean use_animations = FALSE;
|
||||
|
||||
static gint n_rects = N_RECTS;
|
||||
static gint x_spacing = 0;
|
||||
@ -65,13 +64,6 @@ static GOptionEntry entries[] = {
|
||||
&fixed_size,
|
||||
"Fix the layout size", NULL
|
||||
},
|
||||
{
|
||||
"use-animations", 'a',
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&use_animations,
|
||||
"Use animations", NULL
|
||||
},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -110,7 +102,6 @@ main (int argc, char *argv[])
|
||||
x_spacing);
|
||||
clutter_flow_layout_set_row_spacing (CLUTTER_FLOW_LAYOUT (layout),
|
||||
y_spacing);
|
||||
clutter_layout_manager_set_use_animations (layout, use_animations);
|
||||
|
||||
box = clutter_actor_new ();
|
||||
clutter_actor_set_layout_manager (box, layout);
|
||||
|
@ -23,7 +23,6 @@
|
||||
"Press r\t\342\236\236\tSwitch row homogeneous\n" \
|
||||
"Press c\t\342\236\236\tSwitch column homogeneous\n" \
|
||||
"Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \
|
||||
"Press a\t\342\236\236\tSwitch animations on/off\n" \
|
||||
"Press q\t\342\236\236\tQuit\n\n" \
|
||||
"Left/right click\t\t\342\236\236\tChange actor align\n" \
|
||||
"Shift left/right click\t\342\236\236\tChange actor expand"
|
||||
@ -277,13 +276,6 @@ key_release_cb (ClutterActor *stage,
|
||||
|
||||
switch (clutter_event_get_key_symbol (event))
|
||||
{
|
||||
case CLUTTER_KEY_a:
|
||||
toggle = clutter_layout_manager_get_use_animations
|
||||
(CLUTTER_LAYOUT_MANAGER (layout));
|
||||
clutter_layout_manager_set_use_animations
|
||||
(CLUTTER_LAYOUT_MANAGER (layout), !toggle);
|
||||
break;
|
||||
|
||||
case CLUTTER_KEY_c:
|
||||
toggle = clutter_grid_layout_get_column_homogeneous (layout);
|
||||
clutter_grid_layout_set_column_homogeneous (layout, !toggle);
|
||||
|
@ -193,9 +193,6 @@ multi_layout_allocate (ClutterLayoutManager *manager,
|
||||
int n_items, n_items_per_row = 0, item_index;
|
||||
ClutterPoint center = CLUTTER_POINT_INIT_ZERO;
|
||||
double radius = 0, theta = 0;
|
||||
gboolean use_animations;
|
||||
ClutterAnimationMode easing_mode;
|
||||
guint easing_duration, easing_delay;
|
||||
|
||||
n_items = get_visible_children (CLUTTER_ACTOR (container));
|
||||
if (n_items == 0)
|
||||
@ -224,11 +221,6 @@ multi_layout_allocate (ClutterLayoutManager *manager,
|
||||
(avail_height - self->cell_height) / 2.0);
|
||||
}
|
||||
|
||||
use_animations = clutter_layout_manager_get_easing_state (manager,
|
||||
&easing_mode,
|
||||
&easing_duration,
|
||||
&easing_delay);
|
||||
|
||||
clutter_actor_iter_init (&iter, CLUTTER_ACTOR (container));
|
||||
while (clutter_actor_iter_next (&iter, &child))
|
||||
{
|
||||
@ -262,19 +254,8 @@ multi_layout_allocate (ClutterLayoutManager *manager,
|
||||
child_allocation.y2 = child_allocation.y1 + self->cell_height;
|
||||
}
|
||||
|
||||
if (use_animations)
|
||||
{
|
||||
clutter_actor_save_easing_state (child);
|
||||
clutter_actor_set_easing_mode (child, easing_mode);
|
||||
clutter_actor_set_easing_duration (child, easing_duration);
|
||||
clutter_actor_set_easing_delay (child, easing_delay);
|
||||
}
|
||||
|
||||
clutter_actor_allocate (child, &child_allocation, flags);
|
||||
|
||||
if (use_animations)
|
||||
clutter_actor_restore_easing_state (child);
|
||||
|
||||
item_index += 1;
|
||||
}
|
||||
}
|
||||
@ -404,7 +385,6 @@ main (int argc, char *argv[])
|
||||
|
||||
manager = multi_layout_new ();
|
||||
multi_layout_set_spacing ((MultiLayout *) manager, PADDING);
|
||||
clutter_layout_manager_set_use_animations (manager, TRUE);
|
||||
|
||||
margin.top = margin.bottom = margin.left = margin.right = PADDING;
|
||||
|
||||
@ -431,6 +411,8 @@ main (int argc, char *argv[])
|
||||
clutter_actor_set_pivot_point (rect, .5f, .5f);
|
||||
clutter_actor_set_background_color (rect, &color);
|
||||
clutter_actor_set_reactive (rect, TRUE);
|
||||
clutter_actor_set_easing_duration (rect, 250);
|
||||
clutter_actor_set_easing_mode (rect, CLUTTER_EASE_OUT_CUBIC);
|
||||
clutter_actor_add_child (box, rect);
|
||||
|
||||
g_signal_connect (rect, "enter-event", G_CALLBACK (on_enter), NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user