Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'title bar at bottom' option #182

Merged
merged 4 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions terminatorlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
'use_custom_url_handler': False,
'custom_url_handler' : '',
'disable_real_transparency' : False,
'title_at_bottom' : False,
'title_hide_sizetext' : False,
'title_transmit_fg_color' : '#ffffff',
'title_transmit_bg_color' : '#c80003',
Expand Down
16 changes: 16 additions & 0 deletions terminatorlib/preferences.glade
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,22 @@
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkCheckButton" id="title_at_bottom_checkbutton">
<property name="label" translatable="yes">Title bar at bottom (Require restart)</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_title_at_bottom_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="title_hide_sizetextcheck">
<property name="label" translatable="yes">Hide size from title</property>
Expand Down
10 changes: 10 additions & 0 deletions terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ def set_values(self):
#Hide size text from the title bar
widget = guiget('title_hide_sizetextcheck')
widget.set_active(self.config['title_hide_sizetext'])

# title bar at bottom
widget = guiget('title_at_bottom_checkbutton')
widget.set_active(self.config['title_at_bottom'])

#Always split with profile
widget = guiget('always_split_with_profile')
widget.set_active(self.config['always_split_with_profile'])
Expand Down Expand Up @@ -765,6 +770,11 @@ def on_title_hide_sizetextcheck_toggled(self, widget):
self.config['title_hide_sizetext'] = widget.get_active()
self.config.save()

def on_title_at_bottom_checkbutton_toggled(self, widget):
"""Title at bottom setting changed"""
self.config['title_at_bottom'] = widget.get_active()
self.config.save()

def on_always_split_with_profile_toggled(self, widget):
"""Always split with profile setting changed"""
self.config['always_split_with_profile'] = widget.get_active()
Expand Down
9 changes: 7 additions & 2 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ def __init__(self):
self.searchbar.connect('end-search', self.on_search_done)

self.show()
self.pack_start(self.titlebar, False, True, 0)
self.pack_start(self.terminalbox, True, True, 0)
if self.config['title_at_bottom']:
self.pack_start(self.terminalbox, True, True, 0)
self.pack_start(self.titlebar, False, True, 0)
else:
self.pack_start(self.titlebar, False, True, 0)
self.pack_start(self.terminalbox, True, True, 0)

self.pack_end(self.searchbar, True, True, 0)

self.connect_signals()
Expand Down