[notification-daemon] Set the width of the summary and message labels to be the same



commit 6869698fadd7c5deddc4528e0ab29d14b08ec376
Author: William Jon McCann <jmccann redhat com>
Date:   Fri Jan 29 05:03:41 2010 -0500

    Set the width of the summary and message labels to be the same
    
    They are fit into the same vbox so the width of the box shouldn't
    vary if one or the other isn't visible.

 src/themes/slider/theme.c |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c
index 3f7f8f8..9c986ea 100644
--- a/src/themes/slider/theme.c
+++ b/src/themes/slider/theme.c
@@ -278,10 +278,6 @@ destroy_windata(WindowData *windata)
 static void
 update_content_hbox_visibility (WindowData *windata)
 {
-        /*
-         * This is all a hack, but until we have a libview-style ContentBox,
-         * it'll just have to do.
-         */
         if (GTK_WIDGET_VISIBLE (windata->icon)
             || GTK_WIDGET_VISIBLE (windata->body_label)
             || GTK_WIDGET_VISIBLE (windata->actions_box)) {
@@ -406,7 +402,6 @@ GtkWindow *
 create_notification (UrlClickedCb url_clicked)
 {
         GtkWidget   *win;
-        GtkWidget   *drawbox;
         GtkWidget   *main_vbox;
         GtkWidget   *vbox;
         GtkWidget   *close_button;
@@ -636,9 +631,13 @@ set_notification_text (GtkWindow  *nw,
                        const char *summary,
                        const char *body)
 {
-        char *str, *quoted;
+        char          *str;
+        char          *quoted;
         GtkRequisition req;
-        WindowData *windata = g_object_get_data (G_OBJECT (nw), "windata");
+        WindowData    *windata;
+        int            summary_width;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
 
         g_assert (windata != NULL);
 
@@ -659,21 +658,20 @@ set_notification_text (GtkWindow  *nw,
 
         update_content_hbox_visibility (windata);
 
+        gtk_widget_size_request (windata->close_button, &req);
+        /* -1: main_vbox border width
+           -10: vbox border width
+           -6: spacing for hbox */
+        summary_width = WIDTH - (1*2) - (10*2) - BODY_X_OFFSET - req.width - (6*2);
+
         if (body != NULL && *body != '\0') {
-                gtk_widget_size_request (windata->iconbox, &req);
                 gtk_widget_set_size_request (windata->body_label,
-                                             /* -1: border width for
-                                                -6: spacing for hbox */
-                                             WIDTH - (1*2) - (10*2) - req.width - 6,
+                                             summary_width,
                                              -1);
         }
 
-        gtk_widget_size_request (windata->close_button, &req);
         gtk_widget_set_size_request (windata->summary_label,
-                                     /* -1: main_vbox border width
-                                        -10: vbox border width
-                                        -6: spacing for hbox */
-                                     WIDTH - (1*2) - (10*2) - BODY_X_OFFSET - req.width - (6*2),
+                                     summary_width,
                                      -1);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]