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.orig_msg = {}
# alignment before notebook (to control top padding for when showing tabs)
self.alignment = self.xml.get_widget('alignment')
# notebook customizations
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')
if pref_pos != 'top':
if pref_pos == 'bottom':
@ -88,7 +91,11 @@ class Chat:
else:
nb_pos = gtk.POS_TOP
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'))
if gajim.config.get('useemoticons'):
@ -611,6 +618,10 @@ class Chat:
if len(self.xmls) == 1: # we now have only one tab
show_tabs_if_one_tab = gajim.config.get('tabs_always_visible')
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()
def bring_scroll_to_end(self, textview, diff_y = 0):
@ -737,6 +748,7 @@ class Chat:
if len(self.xmls) > 1:
self.notebook.set_show_tabs(True)
self.alignment.set_property('top-padding', 1)
if self.widget_name == 'tabbed_chat_window':
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="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>
<widget class="GtkNotebook" id="chat_notebook">
<property name="visible">True</property>
@ -9743,6 +9755,8 @@ topic</property>
</widget>
</child>
</widget>
</child>
</widget>
<widget class="GtkWindow" id="join_groupchat_window">
<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="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>
<widget class="GtkNotebook" id="chat_notebook">
<property name="visible">True</property>
@ -11343,6 +11369,8 @@ Status message</property>
</widget>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="edit_groups_dialog">
<property name="border_width">6</property>