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 detachable tabs feature to preferences #698

Merged
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
3 changes: 2 additions & 1 deletion terminatorlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
'case_sensitive' : True,
'invert_search' : False,
'link_single_click' : False,
'title_at_bottom' : False
'title_at_bottom' : False,
'detachable_tabs' : True,
},
'keybindings': {
'zoom_in' : '<Control>plus',
Expand Down
4 changes: 2 additions & 2 deletions terminatorlib/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def split_axis(self, widget, vertical=True, cwd=None, sibling=None, widgetfirst=
sibling.force_set_profile(None, widget.get_profile())

self.insert_page(container, None, page_num)
self.set_tab_detachable(container, True)
self.set_tab_detachable(container, self.config['detachable_tabs'])
self.child_set_property(container, 'tab-expand', True)
self.child_set_property(container, 'tab-fill', True)
self.set_tab_reorderable(container, True)
Expand Down Expand Up @@ -320,7 +320,7 @@ def newtab(self, debugtab=False, widget=None, cwd=None, metadata=None, profile=N

dbg('inserting page at position: %s' % tabpos)
self.insert_page(widget, None, tabpos)
self.set_tab_detachable(widget, True)
self.set_tab_detachable(widget, self.config['detachable_tabs'])

if maker.isinstance(widget, 'Terminal'):
containers, objects = ([], [widget])
Expand Down
124 changes: 73 additions & 51 deletions terminatorlib/preferences.glade
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkListStore" id="BackspaceKeyListStore">
Expand Down Expand Up @@ -413,7 +413,7 @@
<property name="spacing">36</property>
<property name="homogeneous">True</property>
<child>
<!-- n-columns=2 n-rows=7 -->
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can-focus">False</property>
Expand Down Expand Up @@ -553,6 +553,23 @@
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="detachable_tabs">
<property name="label" translatable="yes">Detach tab into new window on drag (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_detachable_tabs_toggled" swapped="no"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
<property name="width">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
Expand Down Expand Up @@ -3721,81 +3738,86 @@
</child>
<child>
<object class="GtkVBox" id="vbox124">
<child>
<property name="can-focus">False</property>
<child>
<object class="GtkEntry" id="keybindingsearchentry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">False</property>
<property name="placeholder_text">filter keybindings</property>
<property name="placeholder-text">filter keybindings</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="vadjustment">adjustment4</property>
<property name="hscrollbar-policy">never</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="keybindingtreeview">
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="model">KeybindingsListStore</property>
<property name="headers-clickable">False</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection4"/>
</child>
<property name="vadjustment">adjustment4</property>
<property name="hscrollbar-policy">never</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">Name</property>
<object class="GtkTreeView" id="keybindingtreeview">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="model">KeybindingsListStore</property>
<property name="headers-clickable">False</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection4"/>
</child>
<child>
<object class="GtkCellRendererText" id="cellrenderertext10"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">Name</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext10"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="title" translatable="yes">Action</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext11"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="title" translatable="yes">Action</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext11"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="title" translatable="yes">Keybinding</property>
<child>
<object class="GtkCellRendererAccel" id="cellrendereraccel1">
<property name="editable">True</property>
<property name="accel-mode">other</property>
<signal name="accel-cleared" handler="on_cellrenderer_accel_cleared" object="KeybindingsListStore" swapped="yes"/>
<signal name="accel-edited" handler="on_cellrenderer_accel_edited" object="KeybindingsListStore" swapped="yes"/>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="title" translatable="yes">Keybinding</property>
<child>
<object class="GtkCellRendererAccel" id="cellrendereraccel1">
<property name="editable">True</property>
<property name="accel-mode">other</property>
<signal name="accel-cleared" handler="on_cellrenderer_accel_cleared" object="KeybindingsListStore" swapped="yes"/>
<signal name="accel-edited" handler="on_cellrenderer_accel_edited" object="KeybindingsListStore" swapped="yes"/>
</object>
<attributes>
<attribute name="accel-key">2</attribute>
<attribute name="accel-mods">3</attribute>
</attributes>
</child>
</object>
<attributes>
<attribute name="accel-key">2</attribute>
<attribute name="accel-mods">3</attribute>
</attributes>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
Expand Down
7 changes: 7 additions & 0 deletions terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ def set_values(self):
# DBus Server
widget = guiget('dbuscheck')
widget.set_active(self.config['dbus'])
# Detachable tabs
widget = guiget('detachable_tabs')
widget.set_active(self.config['detachable_tabs'])
#Hide from taskbar
widget = guiget('hidefromtaskbcheck')
widget.set_active(self.config['hide_from_taskbar'])
Expand Down Expand Up @@ -801,6 +804,10 @@ def on_dbuscheck_toggled(self, widget):
self.config['dbus'] = widget.get_active()
self.config.save()

def on_detachable_tabs_toggled(self, widget):
self.config['detachable_tabs'] = widget.get_active()
self.config.save()

def on_disable_mousewheel_zoom_toggled(self, widget):
"""Ctrl+mousewheel zoom setting changed"""
self.config['disable_mousewheel_zoom'] = widget.get_active()
Expand Down