if we have tabs in notebook, top-padding is 1

This commit is contained in:
Nikos Kouremenos 2005-11-24 18:12:51 +00:00
parent 7ca18675c7
commit 448dd4ace0
2 changed files with 1053 additions and 1013 deletions

View File

@ -72,9 +72,12 @@ class Chat:
self.typing_new = {} self.typing_new = {}
self.orig_msg = {} self.orig_msg = {}
# alignment before notebook (to control top padding for when showing tabs)
self.alignment = self.xml.get_widget('alignment')
# notebook customizations # notebook customizations
self.notebook = self.xml.get_widget('chat_notebook') self.notebook = self.xml.get_widget('chat_notebook')
self.notebook.remove_page(0) self.notebook.remove_page(0) # FIXME why??
pref_pos = gajim.config.get('tabs_position') pref_pos = gajim.config.get('tabs_position')
if pref_pos != 'top': if pref_pos != 'top':
if pref_pos == 'bottom': if pref_pos == 'bottom':
@ -88,7 +91,11 @@ class Chat:
else: else:
nb_pos = gtk.POS_TOP nb_pos = gtk.POS_TOP
self.notebook.set_tab_pos(nb_pos) self.notebook.set_tab_pos(nb_pos)
self.notebook.set_show_tabs(gajim.config.get('tabs_always_visible')) if gajim.config.get('tabs_always_visible'):
self.notebook.set_show_tabs(True)
self.alignment.set_property('top-padding', 1)
else:
self.notebook.set_show_tabs(False)
self.notebook.set_show_border(gajim.config.get('tabs_border')) self.notebook.set_show_border(gajim.config.get('tabs_border'))
if gajim.config.get('useemoticons'): if gajim.config.get('useemoticons'):
@ -611,6 +618,10 @@ class Chat:
if len(self.xmls) == 1: # we now have only one tab if len(self.xmls) == 1: # we now have only one tab
show_tabs_if_one_tab = gajim.config.get('tabs_always_visible') show_tabs_if_one_tab = gajim.config.get('tabs_always_visible')
self.notebook.set_show_tabs(show_tabs_if_one_tab) self.notebook.set_show_tabs(show_tabs_if_one_tab)
if not show_tabs_if_one_tab:
self.alignment.set_property('top-padding', 0)
self.show_title() self.show_title()
def bring_scroll_to_end(self, textview, diff_y = 0): def bring_scroll_to_end(self, textview, diff_y = 0):
@ -737,6 +748,7 @@ class Chat:
if len(self.xmls) > 1: if len(self.xmls) > 1:
self.notebook.set_show_tabs(True) self.notebook.set_show_tabs(True)
self.alignment.set_property('top-padding', 1)
if self.widget_name == 'tabbed_chat_window': if self.widget_name == 'tabbed_chat_window':
xm = gtk.glade.XML(GTKGUI_GLADE, 'chats_eventbox', APP) xm = gtk.glade.XML(GTKGUI_GLADE, 'chats_eventbox', APP)

View File

@ -9105,6 +9105,18 @@ Custom</property>
<signal name="delete_event" handler="on_groupchat_window_delete_event" last_modification_time="Mon, 07 Mar 2005 11:19:05 GMT"/> <signal name="delete_event" handler="on_groupchat_window_delete_event" last_modification_time="Mon, 07 Mar 2005 11:19:05 GMT"/>
<signal name="destroy" handler="on_groupchat_window_destroy" last_modification_time="Mon, 07 Mar 2005 16:46:37 GMT"/> <signal name="destroy" handler="on_groupchat_window_destroy" last_modification_time="Mon, 07 Mar 2005 16:46:37 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child> <child>
<widget class="GtkNotebook" id="chat_notebook"> <widget class="GtkNotebook" id="chat_notebook">
<property name="visible">True</property> <property name="visible">True</property>
@ -9743,6 +9755,8 @@ topic</property>
</widget> </widget>
</child> </child>
</widget> </widget>
</child>
</widget>
<widget class="GtkWindow" id="join_groupchat_window"> <widget class="GtkWindow" id="join_groupchat_window">
<property name="border_width">6</property> <property name="border_width">6</property>
@ -10640,6 +10654,18 @@ topic</property>
<signal name="destroy" handler="on_tabbed_chat_window_destroy" last_modification_time="Mon, 07 Mar 2005 16:35:25 GMT"/> <signal name="destroy" handler="on_tabbed_chat_window_destroy" last_modification_time="Mon, 07 Mar 2005 16:35:25 GMT"/>
<signal name="motion_notify_event" handler="on_tabbed_chat_window_motion_notify_event" last_modification_time="Thu, 21 Jul 2005 22:24:26 GMT"/> <signal name="motion_notify_event" handler="on_tabbed_chat_window_motion_notify_event" last_modification_time="Thu, 21 Jul 2005 22:24:26 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child> <child>
<widget class="GtkNotebook" id="chat_notebook"> <widget class="GtkNotebook" id="chat_notebook">
<property name="visible">True</property> <property name="visible">True</property>
@ -11343,6 +11369,8 @@ Status message</property>
</widget> </widget>
</child> </child>
</widget> </widget>
</child>
</widget>
<widget class="GtkDialog" id="edit_groups_dialog"> <widget class="GtkDialog" id="edit_groups_dialog">
<property name="border_width">6</property> <property name="border_width">6</property>