removed vpane in chat windows
This commit is contained in:
parent
22cf4b7433
commit
07f52fce9c
35
src/chat.py
35
src/chat.py
|
@ -363,38 +363,27 @@ class Chat:
|
|||
textview.scroll_to_iter(end_iter, 0, False, 1, 1)
|
||||
return False
|
||||
|
||||
def size_request(self, a, b, xml_top, message_scrolledwindow):
|
||||
def size_request(self, message_textview , requisition, xml_top,
|
||||
message_scrolledwindow):
|
||||
''' When message_textview changes its size. If the new height
|
||||
will enlarge the window, enable the scrollbar automatic policy'''
|
||||
message_textview = xml_top.get_widget('message_textview')
|
||||
if message_textview.window is None:
|
||||
return
|
||||
conversation_scrolledwindow = \
|
||||
xml_top.get_widget('conversation_scrolledwindow')
|
||||
conversation_textview = \
|
||||
xml_top.get_widget('conversation_textview')
|
||||
vpaned = xml_top.get_widget('vpaned')
|
||||
if not vpaned.window:
|
||||
return
|
||||
|
||||
banner_eventbox = xml_top.get_widget('banner_eventbox')
|
||||
actions_hbox = xml_top.get_widget('actions_hbox')
|
||||
if not actions_hbox:
|
||||
actions_hbox = xml_top.get_widget('gc_actions_hbox')
|
||||
|
||||
x1 = conversation_scrolledwindow.get_property('height-request')
|
||||
x2 = b.height
|
||||
x3 = vpaned.window.get_size()[1]
|
||||
x4 = banner_eventbox.size_request()[1]
|
||||
x5 = actions_hbox.size_request()[1]
|
||||
# difference between old height and new height
|
||||
diff_y = message_textview.window.get_size()[1] - b.height
|
||||
add_length = 22
|
||||
if not self.compact_view_current_state:
|
||||
add_length += x4 + x5
|
||||
|
||||
min_height = conversation_scrolledwindow.get_property('height-request')
|
||||
conversation_height = conversation_textview.window.get_size()[1]
|
||||
message_height = message_textview.window.get_size()[1]
|
||||
diff_y = message_height - requisition.height
|
||||
if diff_y is not 0:
|
||||
if x2 + x1 + add_length > x3:
|
||||
if conversation_height + diff_y < min_height:
|
||||
message_scrolledwindow.set_property('vscrollbar-policy', gtk.POLICY_AUTOMATIC)
|
||||
message_scrolledwindow.set_property('hscrollbar-policy', gtk.POLICY_AUTOMATIC)
|
||||
message_scrolledwindow.set_property('height-request', x3 - x1 - add_length)
|
||||
message_scrolledwindow.set_property('height-request', message_height + \
|
||||
conversation_height - min_height)
|
||||
self.bring_scroll_to_end(message_textview)
|
||||
else:
|
||||
message_scrolledwindow.set_property('vscrollbar-policy', gtk.POLICY_NEVER)
|
||||
|
|
|
@ -8560,14 +8560,16 @@ Custom</property>
|
|||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVPaned" id="vpaned">
|
||||
<widget class="GtkVBox" id="groupchat_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="conversation_scrolledwindow">
|
||||
<property name="border_width">1</property>
|
||||
<property name="width_request">200</property>
|
||||
<property name="height_request">40</property>
|
||||
<property name="height_request">60</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
|
@ -8601,18 +8603,18 @@ Custom</property>
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">False</property>
|
||||
<property name="resize">True</property>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="message_scrolledwindow">
|
||||
<property name="height_request">45</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
|
@ -8639,8 +8641,9 @@ Custom</property>
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">False</property>
|
||||
<property name="resize">False</property>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -10065,14 +10068,15 @@ Status message</property>
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVPaned" id="vpaned">
|
||||
<widget class="GtkVBox" id="tabbedchat_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">1</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="conversation_scrolledwindow">
|
||||
<property name="border_width">3</property>
|
||||
<property name="height_request">40</property>
|
||||
<property name="height_request">60</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
|
@ -10106,61 +10110,48 @@ Status message</property>
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">True</property>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2957">
|
||||
<widget class="GtkScrolledWindow" id="message_scrolledwindow">
|
||||
<property name="border_width">3</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="message_scrolledwindow">
|
||||
<property name="border_width">3</property>
|
||||
<property name="height_request">53</property>
|
||||
<widget class="GtkTextView" id="message_textview">
|
||||
<property name="border_width">1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTextView" id="message_textview">
|
||||
<property name="border_width">1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="overwrite">False</property>
|
||||
<property name="accepts_tab">True</property>
|
||||
<property name="justification">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||
<property name="cursor_visible">True</property>
|
||||
<property name="pixels_above_lines">2</property>
|
||||
<property name="pixels_below_lines">2</property>
|
||||
<property name="pixels_inside_wrap">0</property>
|
||||
<property name="left_margin">2</property>
|
||||
<property name="right_margin">2</property>
|
||||
<property name="indent">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<signal name="key_press_event" handler="on_message_textview_key_press_event" last_modification_time="Wed, 02 Mar 2005 21:05:35 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
<property name="editable">True</property>
|
||||
<property name="overwrite">False</property>
|
||||
<property name="accepts_tab">True</property>
|
||||
<property name="justification">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||
<property name="cursor_visible">True</property>
|
||||
<property name="pixels_above_lines">2</property>
|
||||
<property name="pixels_below_lines">2</property>
|
||||
<property name="pixels_inside_wrap">0</property>
|
||||
<property name="left_margin">2</property>
|
||||
<property name="right_margin">2</property>
|
||||
<property name="indent">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<signal name="key_press_event" handler="on_message_textview_key_press_event" last_modification_time="Wed, 02 Mar 2005 21:05:35 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">False</property>
|
||||
<property name="resize">False</property>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
Loading…
Reference in New Issue