public
Description: A Clutter-based Twitter client
Homepage: http://live.gnome.org/Tweet
Clone URL: git://github.com/ebassi/tweet.git
Search Repo:
Use a themed icon for the favorite status button

If we are installed we should have the favorite-status icon inside
the application data directory; the GtkIconTheme should find it and
set up the texture.

If we are not installed, use a rectangle so that the UI doesn't
look empty and we can still test the user interaction.
Emmanuele Bassi (author)
Fri May 23 09:34:32 -0700 2008
commit  5c18d1c4140e37c19af117a6e0c022327adbd01c
tree    c57ff7d754a3d58776d6ce250af67c2abb60c8cf
parent  08bab088b393d68309779691bc38395beffeaf9c
...
54
55
56
57
 
58
59
60
...
188
189
190
191
 
 
 
 
 
192
193
194
...
218
219
220
221
 
 
 
222
223
224
...
321
322
323
324
 
 
 
 
 
 
 
 
 
325
326
327
...
334
335
336
337
338
339
340
...
54
55
56
 
57
58
59
60
...
188
189
190
 
191
192
193
194
195
196
197
198
...
222
223
224
 
225
226
227
228
229
230
...
327
328
329
 
330
331
332
333
334
335
336
337
338
339
340
341
...
348
349
350
 
351
352
353
0
@@ -54,7 +54,7 @@
0
 #define TEXT_Y (ICON_Y + ICON_HEIGHT + (2 * V_PADDING))
0
 #define TEXT_WIDTH (MAX_WIDTH - (2 * H_PADDING))
0
 
0
-#define BUTTON_SIZE 24
0
+#define BUTTON_SIZE 32
0
 
0
 #define BG_ROUND_RADIUS 24
0
 
0
@@ -188,7 +188,11 @@ on_button_enter (ClutterActor *actor,
0
   ClutterColor white = { 255, 255, 255, 255 };
0
   gint x_pos;
0
 
0
- clutter_rectangle_set_color (CLUTTER_RECTANGLE (actor), &white);
0
+ if (CLUTTER_IS_RECTANGLE (actor))
0
+ clutter_rectangle_set_color (CLUTTER_RECTANGLE (actor), &white);
0
+ else
0
+ {
0
+ }
0
 
0
   clutter_label_set_text (CLUTTER_LABEL (info->button_tip),
0
                           g_object_get_data (G_OBJECT (actor), "button-tip"));
0
@@ -218,7 +222,9 @@ on_button_leave (ClutterActor *actor,
0
 {
0
   ClutterColor black = { 0, 0, 0, 255 };
0
 
0
- clutter_rectangle_set_color (CLUTTER_RECTANGLE (actor), &black);
0
+ if (CLUTTER_IS_RECTANGLE (actor))
0
+ clutter_rectangle_set_color (CLUTTER_RECTANGLE (actor), &black);
0
+
0
   tweet_actor_animate (info->button_tip, TWEET_LINEAR, 150,
0
                        "opacity", tweet_interval_new (G_TYPE_UCHAR, 255, 0),
0
                        NULL);
0
@@ -321,7 +327,15 @@ tweet_status_info_constructed (GObject *gobject)
0
 
0
   g_free (text);
0
 
0
- info->star_button = clutter_rectangle_new ();
0
+ info->star_button =
0
+ tweet_texture_new_from_icon_name (NULL, "favorite-status", -1);
0
+ if (!info->star_button)
0
+ {
0
+ info->star_button = clutter_rectangle_new ();
0
+ clutter_rectangle_set_color (CLUTTER_RECTANGLE (info->star_button),
0
+ &text_color);
0
+ }
0
+
0
   g_object_set_data_full (G_OBJECT (info->star_button), "button-tip",
0
                           g_strdup ("Favorite this update"),
0
                           g_free);
0
@@ -334,7 +348,6 @@ tweet_status_info_constructed (GObject *gobject)
0
   g_signal_connect (info->star_button,
0
                     "button-press-event", G_CALLBACK (on_button_press),
0
                     info);
0
- clutter_rectangle_set_color (CLUTTER_RECTANGLE (info->star_button), &text_color);
0
   clutter_actor_set_size (info->star_button, BUTTON_SIZE, BUTTON_SIZE);
0
   clutter_actor_set_parent (info->star_button, CLUTTER_ACTOR (info));
0
   clutter_actor_set_position (info->star_button,

Comments

    No one has commented yet.