aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-widget.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-20 21:02:22 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-20 23:35:56 +0800
commit320771c43432260d55c1a32d127fdaa0dabfa1fe (patch)
treea3193ae1ff117bca21ccc93e3023a620e4571474 /libempathy-gtk/empathy-individual-widget.c
parent00b878b87455a47494ef640c0b5fd2cab4e6b66c (diff)
downloadgsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.tar
gsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.tar.gz
gsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.tar.bz2
gsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.tar.lz
gsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.tar.xz
gsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.tar.zst
gsoc2013-empathy-320771c43432260d55c1a32d127fdaa0dabfa1fe.zip
Bug 627360 — "Information" of a meta contact is too big for the screen
Add a GtkScrolledWindow to EmpathyIndividualWidget in the case that it's showing personas. Closes: bgo#627360
Diffstat (limited to 'libempathy-gtk/empathy-individual-widget.c')
-rw-r--r--libempathy-gtk/empathy-individual-widget.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 172f9e262..de7fbf489 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -88,6 +88,8 @@ typedef struct {
/* Individual */
GtkWidget *hbox_presence;
+ GtkWidget *scrolled_window_individual;
+ GtkWidget *viewport_individual;
GtkWidget *vbox_individual;
/* Location */
@@ -1787,6 +1789,8 @@ empathy_individual_widget_init (EmpathyIndividualWidget *self)
filename = empathy_file_lookup ("empathy-individual-widget.ui",
"libempathy-gtk");
gui = empathy_builder_get_file (filename,
+ "scrolled_window_individual", &priv->scrolled_window_individual,
+ "viewport_individual", &priv->viewport_individual,
"vbox_individual_widget", &vbox_individual_widget,
"vbox_individual", &priv->vbox_individual,
"vbox_location", &priv->vbox_location,
@@ -1817,6 +1821,40 @@ empathy_individual_widget_init (EmpathyIndividualWidget *self)
}
static void
+constructed (GObject *object)
+{
+ GObjectClass *klass = G_OBJECT_CLASS (empathy_individual_widget_parent_class);
+ EmpathyIndividualWidgetPriv *priv = GET_PRIV (object);
+ GtkScrolledWindow *scrolled_window =
+ GTK_SCROLLED_WINDOW (priv->scrolled_window_individual);
+
+ /* Allow scrolling of the list of Personas if we're showing Personas. */
+ if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_SHOW_PERSONAS)
+ {
+ gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy (scrolled_window,
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+
+ gtk_container_set_border_width (GTK_CONTAINER (priv->viewport_individual),
+ 6);
+ gtk_widget_set_size_request (GTK_WIDGET (scrolled_window), -1, 100);
+ }
+ else
+ {
+ gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_NONE);
+ gtk_scrolled_window_set_policy (scrolled_window,
+ GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+
+ gtk_container_set_border_width (GTK_CONTAINER (priv->viewport_individual),
+ 0);
+ }
+
+ /* Chain up */
+ if (klass->constructed != NULL)
+ klass->constructed (object);
+}
+
+static void
get_property (GObject *object,
guint param_id,
GValue *value,
@@ -1884,6 +1922,7 @@ empathy_individual_widget_class_init (EmpathyIndividualWidgetClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;