[pan2] Fix : Click on Body Pane header info row expands/hides headers.
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] Fix : Click on Body Pane header info row expands/hides headers.
- Date: Tue, 13 Dec 2011 11:26:53 +0000 (UTC)
commit cb593addc1516e80ffb18ebf9b05fd0c4120fb55
Author: Heinrich MÃller <henmull src gnome org>
Date: Tue Dec 13 12:24:30 2011 +0100
Fix : Click on Body Pane header info row expands/hides headers.
pan/gui/body-pane.cc | 14 ++++++++++++++
pan/gui/body-pane.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 5069cfc..d0c5013 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -1239,6 +1239,7 @@ BodyPane :: expander_activated_idle (gpointer self_gpointer)
self->_prefs.set_flag ("body-pane-headers-expanded", expanded);
return false;
}
+
void
BodyPane :: expander_activated_cb (GtkExpander*, gpointer self_gpointer)
{
@@ -1246,6 +1247,17 @@ BodyPane :: expander_activated_cb (GtkExpander*, gpointer self_gpointer)
}
void
+BodyPane :: verbose_clicked_cb (GtkWidget*, GdkEvent *event, gpointer self_gpointer)
+{
+ BodyPane * self (static_cast<BodyPane*>(self_gpointer));
+ GtkExpander * ex (GTK_EXPANDER(self->_expander));
+ bool expanded = gtk_expander_get_expanded (ex);
+ expanded = !expanded;
+ gtk_expander_set_expanded (ex, expanded);
+ g_idle_add (expander_activated_idle, self_gpointer);
+}
+
+void
BodyPane :: refresh_scroll_visible_state ()
{
GtkScrolledWindow * w (GTK_SCROLLED_WINDOW (_scroll));
@@ -1403,6 +1415,7 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs):
gtk_label_set_selectable (GTK_LABEL(_terse), true);
gtk_label_set_ellipsize (GTK_LABEL(_terse), PANGO_ELLIPSIZE_MIDDLE);
gtk_widget_show (_terse);
+ g_signal_connect (_terse, "button-press-event", G_CALLBACK(verbose_clicked_cb), this);
GtkWidget * hbox = _verbose = gtk_hbox_new (false, 0);
g_object_ref_sink (G_OBJECT(_verbose));
@@ -1419,6 +1432,7 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs):
gtk_widget_set_size_request (w, 48, 48);
gtk_box_pack_start (GTK_BOX(hbox), w, false, false, PAD_SMALL);
gtk_widget_show_all (_verbose);
+ g_signal_connect (_verbose, "button-press-event", G_CALLBACK(verbose_clicked_cb), this);
// setup
_text = gtk_text_view_new ();
diff --git a/pan/gui/body-pane.h b/pan/gui/body-pane.h
index 1e73437..dd3d110 100644
--- a/pan/gui/body-pane.h
+++ b/pan/gui/body-pane.h
@@ -86,6 +86,7 @@ namespace pan
void append_part (GMimeObject*, GtkAllocation*);
static gboolean expander_activated_idle (gpointer self);
static void expander_activated_cb (GtkExpander*, gpointer self);
+ static void verbose_clicked_cb (GtkWidget*, GdkEvent *event, gpointer self_gpointer);
static void foreach_part_cb (GMimeObject*, GMimeObject*, gpointer self);
static void text_size_allocated (GtkWidget*, GtkAllocation*, gpointer);
static gboolean text_size_allocated_idle_cb (gpointer p);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]