Oops, sorry about that...
> One of the bugs caused by the changes is http://bugs.pwmt.org/issue338. I attach a patch fixing the :info thing. A bit of a hack remains to set the statusbar height the same as the inputbar (session.c lines 284-291). Do you know of a better solution? The notification box should be fine now. > Also, the padding doesn't look right. I have changed a few lines regarding horizontal padding (add the same amount of padding left and right). I don't think this is what you meant though. Could you elaborate? It looks fine to me. Abdó.
>From 262186074ae3965beb7c2f3fb7f90fa4b765f890 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges <[email protected]> Date: Thu, 22 Aug 2013 13:59:21 +0200 Subject: [PATCH] Fix notification bar height on GTK2 Fixes regression introduced in commit a026b72b297b7d83 which rendered the notification bar of fixed height, truncating multiline messages. This should fix Issue 338. --- session.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/session.c b/session.c index 5987708..71c35ac 100644 --- a/session.c +++ b/session.c @@ -247,15 +247,15 @@ girara_session_init(girara_session_t* session, const char* sessionname) widget. */ guint ypadding = 2; /* total amount of padding (top + bottom) */ - guint leftpadding = 4; /* left padding */ + guint xpadding = 8; /* total amount of padding (left + right) */ girara_setting_get(session, "statusbar-padding", &ypadding); #if (GTK_MAJOR_VERSION == 3) /* gtk_entry_set_inner_border is deprecated since gtk 3.4 and does nothing. */ GtkCssProvider* provider = gtk_css_provider_new(); - static const char CSS_PATTERN[] = "#bottom_box { border-style: none; margin: 0px 0px 0px 0px; padding:%dpx 0px %dpx %dpx; }"; - char* css = g_strdup_printf(CSS_PATTERN, ypadding - ypadding/2, ypadding/2, leftpadding); + static const char CSS_PATTERN[] = "#bottom_box { border-style: none; margin: 0px 0px 0px 0px; padding:%dpx %dpx %dpx %dpx; }"; + char* css = g_strdup_printf(CSS_PATTERN, ypadding - ypadding/2, xpadding/2, ypadding/2, xpadding - xpadding/2); gtk_css_provider_load_from_data(provider, css, strlen(css), NULL); g_free(css); @@ -270,29 +270,25 @@ girara_session_init(girara_session_t* session, const char* sessionname) gtk_widget_set_name(GTK_WIDGET(session->gtk.notification_text), "bottom_box"); #else GtkBorder inner_border = { - .left = leftpadding, - .right = 0, + .left = xpadding - xpadding/2, + .right = xpadding/2, .top = ypadding - ypadding/2, .bottom = ypadding/2 }; + /* set inner borders for inputbar and notification_text */ gtk_entry_set_inner_border(session->gtk.inputbar_entry, &inner_border); + gtk_misc_set_padding(GTK_MISC(session->gtk.notification_text), xpadding/2, ypadding/2); /* obtain the actual inputbar height */ - /* TODO: for some reason does not match */ GtkRequisition req; gtk_widget_size_request(GTK_WIDGET(session->gtk.inputbar_entry), &req); - /* have no idea where the extra 5 pixels come from. without this, the other - widgets get larger than the inputbar */ + /* have no idea where the extra 5 pixels come from. without this, the statusbar + gets larger than the inputbar */ guint statusbar_height = req.height - 5; - /* force all widgets to have the same height as inputbar */ - gtk_widget_set_size_request(GTK_WIDGET(session->gtk.inputbar_entry), -1, statusbar_height); + /* force statusbar to have same height as inputbar */ gtk_widget_set_size_request(GTK_WIDGET(session->gtk.statusbar_entries), -1, statusbar_height); - gtk_widget_set_size_request(GTK_WIDGET(session->gtk.notification_text), -1, statusbar_height); - - /* set horizontal padding. same for statusbar entries in statusbar.c */ - gtk_misc_set_padding(GTK_MISC(session->gtk.notification_text), leftpadding, 0); #endif session->signals.inputbar_key_pressed = g_signal_connect( -- 1.8.3.4
_______________________________________________ zathura mailing list [email protected] http://lists.pwmt.org/mailman/listinfo/zathura
