Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:zhy20120210:failed_1
notification-daemon
notification-daemon-extend-width.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File notification-daemon-extend-width.patch of Package notification-daemon
diff --git a/src/themes/newbubble/theme.c b/src/themes/newbubble/theme.c index 082102e..dd797c0 100644 --- a/src/themes/newbubble/theme.c +++ b/src/themes/newbubble/theme.c @@ -567,6 +567,18 @@ configure_event_cb(GtkWidget *nw, return FALSE; } +static void +make_predictable_size (GtkWidget *widget, GtkRequisition *requisition, gpointer data) +{ + g_return_if_fail (GTK_WIDGET (widget)); + + if (requisition->width < WIDTH) { + gtk_widget_set_size_request (widget, WIDTH, -1); + } else { + gtk_widget_set_size_request (widget, -1, -1); + } +} + GtkWindow * create_notification(UrlClickedCb url_clicked) { @@ -611,8 +623,8 @@ create_notification(UrlClickedCb url_clicked) GDK_WINDOW_TYPE_HINT_NOTIFICATION); gtk_widget_add_events(win, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); gtk_widget_set_name(win, "notification-window"); - gtk_widget_realize(win); - gtk_widget_set_size_request(win, WIDTH, -1); + + g_signal_connect (G_OBJECT (win), "size-request", make_predictable_size, NULL); g_object_set_data_full(G_OBJECT(win), "windata", windata, (GDestroyNotify)destroy_windata); @@ -790,6 +802,27 @@ notification_tick(GtkWindow *nw, glong remaining) PIE_WIDTH, PIE_HEIGHT); } } +static void +make_predictable_size_of_body_label (GtkWidget *widget, GtkRequisition *req, gpointer data) +{ + WindowData *windata; + GtkRequisition icon_req; + + g_return_if_fail (GTK_WIDGET (widget)); + + windata = (WindowData *) data; + + gtk_widget_size_request (windata->iconbox, &icon_req); + gtk_widget_set_size_request ( + widget, + /* -1: border width for + -6: spacing for hbox + -10: vbox border width + -1: border width fot vbox immediately contain body_label + */ + WIDTH - (1*2) - (10*2) - icon_req.width - 6, + -1); +} void set_notification_text(GtkWindow *nw, const char *summary, const char *body) @@ -808,23 +841,20 @@ set_notification_text(GtkWindow *nw, const char *summary, const char *body) sexy_url_label_set_markup(SEXY_URL_LABEL(windata->body_label), body); - if (body == NULL || *body == '\0') - gtk_widget_hide(windata->body_label); - else - gtk_widget_show(windata->body_label); - update_content_hbox_visibility(windata); 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, - -1); - } + /* coordinate width of body_label with iconbox. + * set_notification_icon would be called after the calling of + * set_notification_text, so signal handler should be used. + */ + g_signal_connect (G_OBJECT (windata->body_label), "size-request", + G_CALLBACK (make_predictable_size_of_body_label), windata); + gtk_widget_show(windata->body_label); + } else { + gtk_widget_hide(windata->body_label); + } gtk_widget_size_request (windata->close_button, &req); gtk_widget_set_size_request(
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor