Skip to content

Commit 2cd9edc

Browse files
committed
arc-clock: Remove clutter deprecated functions
1 parent 2822d11 commit 2cd9edc

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

arc-clock/arc-clock.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ enum
2525
static double slices[N_HANDS] = { 0.0, };
2626

2727
static ClutterActor *hands[N_HANDS] = { NULL, };
28+
static ClutterColor hands_color[N_HANDS];
2829

2930
static const char *colors[N_HANDS] = {
3031
"#4e9a06",
@@ -51,15 +52,12 @@ hand_paint (ClutterActor *hand)
5152

5253
float radius = clutter_actor_get_width (hand) / 2.0 + 0.5;
5354

54-
ClutterColor hand_color;
55-
clutter_rectangle_get_color (CLUTTER_RECTANGLE (hand), &hand_color);
56-
5755
CoglColor fill_color;
5856
cogl_color_init_from_4ub (&fill_color,
59-
hand_color.red,
60-
hand_color.green,
61-
hand_color.blue,
62-
hand_color.alpha);
57+
hands_color[hand_id].red,
58+
hands_color[hand_id].green,
59+
hands_color[hand_id].blue,
60+
hands_color[hand_id].alpha);
6361

6462
cogl_set_source_color (&fill_color);
6563

@@ -157,10 +155,8 @@ main (int argc, char *argv[])
157155

158156
for (int i = SECONDS; i < N_HANDS; i++)
159157
{
160-
ClutterColor color;
161-
162-
clutter_color_from_string (&color, colors[i]);
163-
hands[i] = clutter_rectangle_new_with_color (&color);
158+
clutter_color_from_string (&hands_color[i], colors[i]);
159+
hands[i] = clutter_actor_new ();
164160
clutter_actor_set_size (hands[i], (HAND_WIDTH * 3.0) * i, (HAND_WIDTH * 3.0) * i);
165161
clutter_actor_add_constraint (hands[i], clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5));
166162
clutter_actor_add_constraint (hands[i], clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));

0 commit comments

Comments
 (0)