Add config option to hide terminal size. Patch from João Pinto. Fixes LP#691213

This commit is contained in:
Chris Jones 2011-08-21 01:07:11 +01:00
parent aadeb45dc3
commit 845ca998c0
4 changed files with 45 additions and 2 deletions

View File

@ -91,6 +91,7 @@ DEFAULTS = {
'hide_on_lose_focus' : False, 'hide_on_lose_focus' : False,
'sticky' : False, 'sticky' : False,
'try_posix_regexp' : platform.system() != 'Linux', 'try_posix_regexp' : platform.system() != 'Linux',
'title_hide_sizetext' : False,
'title_transmit_fg_color' : '#ffffff', 'title_transmit_fg_color' : '#ffffff',
'title_transmit_bg_color' : '#c80003', 'title_transmit_bg_color' : '#c80003',
'title_receive_fg_color' : '#ffffff', 'title_receive_fg_color' : '#ffffff',

View File

@ -298,7 +298,7 @@
<child> <child>
<object class="GtkTable" id="global_config_table"> <object class="GtkTable" id="global_config_table">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">11</property> <property name="n_rows">12</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">6</property> <property name="column_spacing">6</property>
<child> <child>
@ -637,6 +637,37 @@
<property name="y_options">GTK_EXPAND</property> <property name="y_options">GTK_EXPAND</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel" id="label29">
<property name="visible">True</property>
<property name="xalign">0.50999999046325684</property>
<property name="label" translatable="yes">Hide size from title</property>
</object>
<packing>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="title_hide_sizetextcheck">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_title_hide_sizetextcheck_toggled"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="x_options"></property>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="position">0</property> <property name="position">0</property>

View File

@ -230,6 +230,9 @@ class PrefsEditor:
#Show on all workspaces #Show on all workspaces
widget = guiget('stickycheck') widget = guiget('stickycheck')
widget.set_active(self.config['sticky']) widget.set_active(self.config['sticky'])
#Hide size text from the title bar
widget = guiget('title_hide_sizetextcheck')
widget.set_active(self.config['title_hide_sizetext'])
## Profile tab ## Profile tab
# Populate the profile list # Populate the profile list
@ -583,6 +586,11 @@ class PrefsEditor:
self.config['sticky'] = widget.get_active() self.config['sticky'] = widget.get_active()
self.config.save() self.config.save()
def on_title_hide_sizetextcheck_toggled(self, widget):
"""Window geometry setting changed"""
self.config['title_hide_sizetext'] = widget.get_active()
self.config.save()
def on_allow_bold_checkbutton_toggled(self, widget): def on_allow_bold_checkbutton_toggled(self, widget):
"""Allow bold setting changed""" """Allow bold setting changed"""
self.config['allow_bold'] = widget.get_active() self.config['allow_bold'] = widget.get_active()

View File

@ -98,7 +98,10 @@ class Titlebar(gtk.EventBox):
def update(self, other=None): def update(self, other=None):
"""Update our contents""" """Update our contents"""
default_bg = False default_bg = False
self.label.set_text("%s %s" % (self.termtext, self.sizetext)) if self.config['title_hide_sizetext']:
self.label.set_text("%s" % self.termtext)
else:
self.label.set_text("%s %s" % (self.termtext, self.sizetext))
if other: if other:
term = self.terminal term = self.terminal