<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/tweet-canvas.c</filename>
    </added>
    <added>
      <filename>src/tweet-canvas.h</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -36,6 +36,7 @@ tweet_h = \
 	tweet-animation.h \
 	tweet-app.h \
 	tweet-auth-dialog.h \
+	tweet-canvas.h \
 	tweet-config.h \
 	tweet-interval.h \
 	tweet-overlay.h \
@@ -79,6 +80,8 @@ libtweet_ui_la_SOURCES = \
 	tweet-app.h \
 	tweet-auth-dialog.c \
 	tweet-auth-dialog.h \
+	tweet-canvas.c \
+	tweet-canvas.h \
 	tweet-config.c \
 	tweet-config.h \
 	tweet-enum-types.c \</diff>
      <filename>src/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -172,9 +172,6 @@ tweet_overlay_pick (ClutterActor       *actor,
   TweetOverlayPrivate *priv = TWEET_OVERLAY (actor)-&gt;priv;
   GList *l;
 
-  if (!clutter_actor_should_pick_paint (actor))
-    return;
-
   CLUTTER_ACTOR_CLASS (tweet_overlay_parent_class)-&gt;pick (actor, pick_color);
 
   for (l = priv-&gt;children; l != NULL; l = l-&gt;next)</diff>
      <filename>src/tweet-overlay.c</filename>
    </modified>
    <modified>
      <diff>@@ -43,6 +43,7 @@
 #include &lt;twitter-glib/twitter-glib.h&gt;
 
 #include &quot;tweet-animation.h&quot;
+#include &quot;tweet-canvas.h&quot;
 #include &quot;tweet-config.h&quot;
 #include &quot;tweet-preferences.h&quot;
 #include &quot;tweet-spinner.h&quot;
@@ -52,11 +53,8 @@
 #include &quot;tweet-utils.h&quot;
 #include &quot;tweet-window.h&quot;
 
-#define CANVAS_WIDTH    350
-#define CANVAS_HEIGHT   500
 #define CANVAS_PADDING  6
-
-#define WINDOW_WIDTH    (CANVAS_WIDTH + (2 * CANVAS_PADDING))
+#define WINDOW_WIDTH    (TWEET_CANVAS_MIN_WIDTH + (2 * CANVAS_PADDING))
 
 typedef enum {
   TWEET_WINDOW_RECENT,
@@ -257,10 +255,16 @@ on_status_received (TwitterClient *client,
 
   if (error)
     {
+      TweetAnimation *animation;
+
       tweet_spinner_stop (TWEET_SPINNER (priv-&gt;spinner));
-      tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
-                           &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 127, 0),
-                           NULL);
+      animation =
+        tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
+                             &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 127, 0),
+                             NULL);
+      g_signal_connect_swapped (animation,
+                                &quot;completed&quot;, G_CALLBACK (clutter_actor_hide),
+                                priv-&gt;spinner);
 
       /* if the content was not modified since the last update,
        * silently ignore the error; Twitter-GLib still emits it
@@ -297,11 +301,16 @@ on_timeline_complete (TwitterClient *client,
                       TweetWindow   *window)
 {
   TweetWindowPrivate *priv = window-&gt;priv;
+  TweetAnimation *animation;
 
   tweet_spinner_stop (TWEET_SPINNER (priv-&gt;spinner));
-  tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
-                       &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 127, 0),
-                       NULL);
+  animation =
+    tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
+                         &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 127, 0),
+                         NULL);
+  g_signal_connect_swapped (animation,
+                            &quot;completed&quot;, G_CALLBACK (clutter_actor_hide),
+                            priv-&gt;spinner);
 
   if (priv-&gt;n_status_received &gt; 0)
     {
@@ -542,6 +551,7 @@ on_status_view_button_release (ClutterActor       *actor,
       ClutterGeometry geometry = { 0, };
       ClutterActor *stage;
       ClutterColor info_color = { 255, 255, 255, 255 };
+      GtkRequisition canvas_req = { 0, };
 
       priv-&gt;in_press = FALSE;
 
@@ -598,18 +608,31 @@ on_status_view_button_release (ClutterActor       *actor,
       clutter_actor_set_reactive (priv-&gt;info, FALSE);
       clutter_actor_show (priv-&gt;info);
 
-      /* the status info is non-reactive until it has
-       * been fully &quot;unrolled&quot; by the animation
-       */
-      animation =
-        tweet_actor_animate (priv-&gt;info, TWEET_LINEAR, 250,
-                             &quot;y&quot;, tweet_interval_new (G_TYPE_INT, geometry.y + CANVAS_PADDING, 100 + CANVAS_PADDING),
-                             &quot;height&quot;, tweet_interval_new (G_TYPE_INT, 16, (CANVAS_HEIGHT - (100 * 2))),
-                             &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 0, 224),
-                             NULL);
-      g_signal_connect (animation,
-                        &quot;completed&quot;, G_CALLBACK (on_status_info_visible),
-                        window);
+      {
+        gint old_y, new_y;
+        gint old_height, new_height;
+
+        gtk_widget_size_request (priv-&gt;canvas, &amp;canvas_req);
+
+        old_y = geometry.y + CANVAS_PADDING;
+        new_y = 100 + CANVAS_PADDING;
+
+        old_height = 16;
+        new_height = canvas_req.height - (100 * 2);
+
+         /* the status info is non-reactive until it has
+          * been fully &quot;unrolled&quot; by the animation
+          */
+        animation =
+          tweet_actor_animate (priv-&gt;info, TWEET_LINEAR, 250,
+                               &quot;y&quot;, tweet_interval_new (G_TYPE_INT, old_y, new_y),
+                               &quot;height&quot;, tweet_interval_new (G_TYPE_INT, old_height, new_height),
+                               &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 0, 224),
+                               NULL);
+        g_signal_connect (animation,
+                          &quot;completed&quot;, G_CALLBACK (on_status_info_visible),
+                          window);
+      }
 
       /* set the status view as not reactive to avoid opening
        * the status info on double tap
@@ -781,6 +804,7 @@ tweet_window_constructed (GObject *gobject)
   TweetWindowPrivate *priv = window-&gt;priv;
   ClutterActor *stage;
   ClutterActor *img;
+  GtkRequisition canvas_req = { 0, };
 #ifdef HAVE_NM_GLIB
   libnm_glib_state nm_state;
 #endif /* HAVE_NM_GLIB */
@@ -793,14 +817,15 @@ tweet_window_constructed (GObject *gobject)
   if (!img)
     g_critical (&quot;Unable to load the `%s' stock icon&quot;, GTK_STOCK_REFRESH);
 
+  gtk_widget_size_request (priv-&gt;canvas, &amp;canvas_req);
+
   priv-&gt;spinner = tweet_spinner_new ();
   tweet_spinner_set_image (TWEET_SPINNER (priv-&gt;spinner), img);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), priv-&gt;spinner);
   clutter_actor_set_size (priv-&gt;spinner, 128, 128);
-  clutter_actor_set_anchor_point (priv-&gt;spinner, 64, 64);
   clutter_actor_set_position (priv-&gt;spinner,
-                              WINDOW_WIDTH / 2,
-                              CANVAS_HEIGHT / 2);
+                              (canvas_req.width + (2 * CANVAS_PADDING) - 128) / 2,
+                              (canvas_req.height - 128) / 2);
   clutter_actor_show (priv-&gt;spinner);
   tweet_spinner_start (TWEET_SPINNER (priv-&gt;spinner));
   tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
@@ -835,13 +860,19 @@ tweet_window_constructed (GObject *gobject)
     }
   else
     {
+      TweetAnimation *animation;
+
       tweet_window_status_message (window, TWEET_STATUS_NO_CONNECTION,
                                    _(&quot;No network connection available&quot;));
 
       tweet_spinner_stop (TWEET_SPINNER (priv-&gt;spinner));
-      tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
-                           &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 127, 0),
-                           NULL);
+      animation =
+        tweet_actor_animate (priv-&gt;spinner, TWEET_LINEAR, 500,
+                             &quot;opacity&quot;, tweet_interval_new (G_TYPE_UCHAR, 127, 0),
+                             NULL);
+      g_signal_connect_swapped (animation,
+                                &quot;completed&quot;, G_CALLBACK (clutter_actor_hide),
+                                priv-&gt;spinner);
     }
 
   priv-&gt;nm_state = nm_state;
@@ -1112,6 +1143,28 @@ on_canvas_focus_out (GtkWidget     *widget,
   return FALSE;
 }
 
+static void
+on_canvas_size_allocate (GtkWidget     *widget,
+                         GtkAllocation *allocation,
+                         TweetWindow   *window)
+{
+  TweetWindowPrivate *priv = window-&gt;priv;
+
+  if (!priv-&gt;scroll)
+    return;
+
+  clutter_actor_set_size (priv-&gt;scroll,
+                          allocation-&gt;width,
+                          allocation-&gt;height);
+  clutter_actor_set_size (priv-&gt;status_view,
+                          allocation-&gt;width,
+                          allocation-&gt;height);
+
+  clutter_actor_set_position (priv-&gt;spinner,
+                              (allocation-&gt;width + (2 * CANVAS_PADDING) - 128) / 2,
+                              (allocation-&gt;height - 128) / 2);
+}
+
 static gboolean
 tweet_window_focus_in (GtkWidget     *widget,
                        GdkEventFocus *event)
@@ -1193,9 +1246,9 @@ tweet_window_init (TweetWindow *window)
   GError *error;
   ClutterActor *stage, *view;
   ClutterColor stage_color = { 0, 0, 0, 255 };
+  GtkRequisition canvas_req = { 0, };
 
   GTK_WINDOW (window)-&gt;type = GTK_WINDOW_TOPLEVEL;
-  gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
   gtk_window_set_default_size (GTK_WINDOW (window), WINDOW_WIDTH, 600);
   gtk_window_set_title (GTK_WINDOW (window), &quot;Tweet&quot;);
 
@@ -1257,28 +1310,29 @@ tweet_window_init (TweetWindow *window)
   gtk_container_add (GTK_CONTAINER (priv-&gt;vbox), frame);
   gtk_widget_show (frame);
 
-  priv-&gt;canvas = gtk_clutter_embed_new ();
+  priv-&gt;canvas = tweet_canvas_new ();
+  tweet_canvas_set_border_width (TWEET_CANVAS (priv-&gt;canvas), CANVAS_PADDING);
+
   g_signal_connect (priv-&gt;canvas,
                     &quot;focus-in-event&quot;, G_CALLBACK (on_canvas_focus_in),
                     window);
   g_signal_connect (priv-&gt;canvas,
                     &quot;focus-out-event&quot;, G_CALLBACK (on_canvas_focus_out),
                     window);
-  GTK_WIDGET_SET_FLAGS (priv-&gt;canvas, GTK_CAN_FOCUS);
+  g_signal_connect (priv-&gt;canvas,
+                    &quot;size-allocate&quot;, G_CALLBACK (on_canvas_size_allocate),
+                    window);
 
-  gtk_widget_set_size_request (priv-&gt;canvas,
-                               CANVAS_WIDTH + CANVAS_PADDING,
-                               CANVAS_HEIGHT + CANVAS_PADDING);
+  GTK_WIDGET_SET_FLAGS (priv-&gt;canvas, GTK_CAN_FOCUS);
   gtk_container_add (GTK_CONTAINER (frame), priv-&gt;canvas);
 
+  gtk_widget_size_request (priv-&gt;canvas, &amp;canvas_req);
+
   stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv-&gt;canvas));
-  gtk_widget_set_size_request (priv-&gt;canvas,
-                               CANVAS_WIDTH + CANVAS_PADDING,
-                               CANVAS_HEIGHT + CANVAS_PADDING);
   clutter_stage_set_color (CLUTTER_STAGE (stage), &amp;stage_color);
   clutter_actor_set_size (stage,
-                          CANVAS_WIDTH + CANVAS_PADDING,
-                          CANVAS_HEIGHT + CANVAS_PADDING);
+                          canvas_req.width + CANVAS_PADDING,
+                          canvas_req.height + CANVAS_PADDING);
 
   view = tweet_status_view_new (priv-&gt;status_model);
   g_signal_connect (view,
@@ -1293,7 +1347,7 @@ tweet_window_init (TweetWindow *window)
   clutter_actor_set_reactive (view, TRUE);
   priv-&gt;status_view = view;
 
-  clutter_actor_set_size (priv-&gt;scroll, CANVAS_WIDTH, CANVAS_HEIGHT);
+  clutter_actor_set_size (priv-&gt;scroll, canvas_req.width, canvas_req.height);
   clutter_actor_set_position (priv-&gt;scroll, CANVAS_PADDING, CANVAS_PADDING);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), priv-&gt;scroll);
   clutter_actor_set_reactive (priv-&gt;scroll, TRUE);</diff>
      <filename>src/tweet-window.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dcc8a93b0d419ae9c4096f97eb834fd8b49463fb</id>
    </parent>
    <parent>
      <id>a236adf595f1f371c016a7798fd42051b420c780</id>
    </parent>
  </parents>
  <author>
    <name>Neil Roberts</name>
    <email>neil@o-hand.com</email>
  </author>
  <url>http://github.com/ebassi/tweet/commit/a3b2c1fa97599ae292dddc21933e23e29d1b7481</url>
  <id>a3b2c1fa97599ae292dddc21933e23e29d1b7481</id>
  <committed-date>2008-06-26T13:41:57-07:00</committed-date>
  <authored-date>2008-06-26T13:41:57-07:00</authored-date>
  <message>Merge branch 'master' into clickable-url</message>
  <tree>dc4373f9597956519f60f39e2b1ec2f06ede4c81</tree>
  <committer>
    <name>Neil Roberts</name>
    <email>neil@o-hand.com</email>
  </committer>
</commit>
