[Xfce4-commits] <ristretto:ristretto-0.3> Fix Segfault and add ellipsize-config to warning label.
Stephan Arts
noreply at xfce.org
Sat Mar 3 12:04:01 CET 2012
Updating branch refs/heads/ristretto-0.3
to 1c390a05044a2355c1c46a7aceccee7d3865031d (commit)
from 7745cc7fb2a1cb074b10537e964d7bdb6eaa53ed (commit)
commit 1c390a05044a2355c1c46a7aceccee7d3865031d
Author: Stephan Arts <stephan at xfce.org>
Date: Sat Mar 3 12:02:33 2012 +0100
Fix Segfault and add ellipsize-config to warning label.
src/main_window.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/main_window.c b/src/main_window.c
index bdbb2f1..fb2fbc4 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -438,8 +438,7 @@ rstto_main_window_init (RsttoMainWindow *window)
GtkRecentFilter *recent_filter;
guint window_width, window_height;
gchar *desktop_type = NULL;
- GtkWidget *info_bar_content_area = gtk_info_bar_get_content_area (
- GTK_INFO_BAR (window->priv->warning));
+ GtkWidget *info_bar_content_area = NULL;
GClosure *toggle_fullscreen_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_fullscreen, window, NULL);
GClosure *leave_fullscreen_closure = g_cclosure_new_swap ((GCallback)gtk_window_unfullscreen, window, NULL);
@@ -587,7 +586,12 @@ rstto_main_window_init (RsttoMainWindow *window)
window->priv->image_viewer_menu = gtk_ui_manager_get_widget (window->priv->ui_manager, "/image-viewer-menu");
window->priv->position_menu = gtk_ui_manager_get_widget (window->priv->ui_manager, "/navigation-toolbar-menu");
window->priv->warning = gtk_info_bar_new();
+ info_bar_content_area = gtk_info_bar_get_content_area (
+ GTK_INFO_BAR (window->priv->warning));
window->priv->warning_label = gtk_label_new(NULL);
+ gtk_label_set_ellipsize (
+ GTK_LABEL (window->priv->warning_label),
+ PANGO_ELLIPSIZE_END);
gtk_container_add (
GTK_CONTAINER (info_bar_content_area),
@@ -1085,6 +1089,9 @@ rstto_main_window_update_statusbar (RsttoMainWindow *window)
g_free (status);
status = tmp_status;
gtk_label_set_text (GTK_LABEL(window->priv->warning_label), error->message);
+ gtk_widget_set_tooltip_text (
+ window->priv->warning_label,
+ error->message);
gtk_widget_show (window->priv->warning);
}
else
@@ -3076,6 +3083,7 @@ cb_rstto_main_window_close (
window->priv->image_list,
NULL,
NULL);
+ gtk_widget_hide (window->priv->warning);
}
/**
More information about the Xfce4-commits
mailing list