aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@src.gnome.org>2008-09-07 17:49:48 +0800
committerFrederic Peters <fpeters@src.gnome.org>2008-09-07 17:49:48 +0800
commit696bb34d4ec49d12ab94fbbdd7dfeccd3329f659 (patch)
treee8118e3b841fb4de6e7ea1378872f2fa0409183b /src/empathy-chat-window.c
parent8ef286020caa10c6c9a99df08725351f705b8b6d (diff)
downloadgsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.tar
gsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.tar.gz
gsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.tar.bz2
gsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.tar.lz
gsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.tar.xz
gsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.tar.zst
gsoc2013-empathy-696bb34d4ec49d12ab94fbbdd7dfeccd3329f659.zip
Hide the tab close button where there is a single tab (closes: #551096)
svn path=/trunk/; revision=1426
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 5d15d58b1..8760c6e2e 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -226,6 +226,7 @@ chat_window_create_label (EmpathyChatWindow *window,
close_button = gtk_button_new ();
gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+ g_object_set_data (G_OBJECT (chat), "chat-window-tab-close-button", close_button);
/* We don't want focus/keynav for the button to avoid clutter, and
* Ctrl-W works anyway.
@@ -288,11 +289,14 @@ chat_window_update (EmpathyChatWindow *window)
gboolean is_connected;
gint num_pages;
gint page_num;
+ gint i;
const gchar *name;
guint n_chats;
GdkPixbuf *icon;
EmpathyContact *remote_contact;
gboolean avatar_in_icon;
+ GtkWidget *chat;
+ GtkWidget *chat_close_button;
/* Get information */
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
@@ -342,6 +346,20 @@ chat_window_update (EmpathyChatWindow *window)
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
}
}
+
+ if (num_pages == 1) {
+ chat = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 0);
+ chat_close_button = g_object_get_data (G_OBJECT (chat),
+ "chat-window-tab-close-button");
+ gtk_widget_hide (chat_close_button);
+ } else {
+ for (i=0; i<num_pages; i++) {
+ chat = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), i);
+ chat_close_button = g_object_get_data (G_OBJECT (chat),
+ "chat-window-tab-close-button");
+ gtk_widget_show (chat_close_button);
+ }
+ }
}
static void