aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorranjiao <ranjiao@gmail.com>2009-12-08 09:29:25 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-08 18:09:53 +0800
commit9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f (patch)
treecea3a6b45e95fa3c5b5b3f43f2da1025d0a006fd
parentff031d276cc1ae2cb16fa700e84497fc599624b8 (diff)
downloadgsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.tar
gsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.tar.gz
gsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.tar.bz2
gsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.tar.lz
gsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.tar.xz
gsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.tar.zst
gsoc2013-empathy-9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f.zip
remember the chat window's paned width (#586290)
-rw-r--r--libempathy-gtk/empathy-chat.c24
-rw-r--r--libempathy-gtk/empathy-conf.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index e942f2151..e627a5ef8 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -1994,6 +1994,18 @@ chat_destroy_cb (EmpathyTpChat *tp_chat,
chat_update_contacts_visibility (chat, FALSE);
}
+static gboolean
+chat_hpaned_pos_changed_cb (GtkWidget* hpaned, gpointer user_data)
+{
+ gint hpaned_pos;
+ hpaned_pos = gtk_paned_get_position (GTK_PANED(hpaned));
+ empathy_conf_set_int (empathy_conf_get (),
+ EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS,
+ hpaned_pos);
+ return TRUE;
+}
+
+
static void
show_pending_messages (EmpathyChat *chat) {
EmpathyChatPriv *priv = GET_PRIV (chat);
@@ -2019,6 +2031,7 @@ chat_create_ui (EmpathyChat *chat)
GList *list = NULL;
gchar *filename;
GtkTextBuffer *buffer;
+ gint paned_pos;
filename = empathy_file_lookup ("empathy-chat.ui",
"libempathy-gtk");
@@ -2085,6 +2098,17 @@ chat_create_ui (EmpathyChat *chat)
/* Initialy hide the topic, will be shown if not empty */
gtk_widget_hide (priv->hbox_topic);
+ g_signal_connect (priv->hpaned, "notify::position",
+ G_CALLBACK (chat_hpaned_pos_changed_cb),
+ NULL);
+
+ /* Load the paned position */
+ if (empathy_conf_get_int (empathy_conf_get (),
+ EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS,
+ &paned_pos)
+ && paned_pos)
+ gtk_paned_set_position (GTK_PANED(priv->hpaned), paned_pos);
+
/* Set widget focus order */
list = g_list_append (NULL, priv->scrolled_window_input);
gtk_container_set_focus_chain (GTK_CONTAINER (priv->vbox_left), list);
diff --git a/libempathy-gtk/empathy-conf.h b/libempathy-gtk/empathy-conf.h
index d8e34f6b9..8d0066d90 100644
--- a/libempathy-gtk/empathy-conf.h
+++ b/libempathy-gtk/empathy-conf.h
@@ -74,6 +74,7 @@ struct _EmpathyConfClass {
#define EMPATHY_PREFS_UI_AVATAR_DIRECTORY EMPATHY_PREFS_PATH "/ui/avatar_directory"
#define EMPATHY_PREFS_UI_SHOW_AVATARS EMPATHY_PREFS_PATH "/ui/show_avatars"
#define EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST EMPATHY_PREFS_PATH "/ui/compact_contact_list"
+#define EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS EMPATHY_PREFS_PATH "/ui/chat_window_paned_pos"
#define EMPATHY_PREFS_CONTACTS_SHOW_OFFLINE EMPATHY_PREFS_PATH "/contacts/show_offline"
#define EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM EMPATHY_PREFS_PATH "/contacts/sort_criterium"
#define EMPATHY_PREFS_HINTS_CLOSE_MAIN_WINDOW EMPATHY_PREFS_PATH "/hints/close_main_window"