Add detachable tabs feature to preferences
This commit is contained in:
parent
403bf540d0
commit
808d2efaa9
|
@ -118,7 +118,8 @@ DEFAULTS = {
|
||||||
'case_sensitive' : True,
|
'case_sensitive' : True,
|
||||||
'invert_search' : False,
|
'invert_search' : False,
|
||||||
'link_single_click' : False,
|
'link_single_click' : False,
|
||||||
'title_at_bottom' : False
|
'title_at_bottom' : False,
|
||||||
|
'detachable_tabs' : True,
|
||||||
},
|
},
|
||||||
'keybindings': {
|
'keybindings': {
|
||||||
'zoom_in' : '<Control>plus',
|
'zoom_in' : '<Control>plus',
|
||||||
|
|
|
@ -191,7 +191,7 @@ class Notebook(Container, Gtk.Notebook):
|
||||||
sibling.force_set_profile(None, widget.get_profile())
|
sibling.force_set_profile(None, widget.get_profile())
|
||||||
|
|
||||||
self.insert_page(container, None, page_num)
|
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-expand', True)
|
||||||
self.child_set_property(container, 'tab-fill', True)
|
self.child_set_property(container, 'tab-fill', True)
|
||||||
self.set_tab_reorderable(container, True)
|
self.set_tab_reorderable(container, True)
|
||||||
|
@ -320,7 +320,7 @@ class Notebook(Container, Gtk.Notebook):
|
||||||
|
|
||||||
dbg('inserting page at position: %s' % tabpos)
|
dbg('inserting page at position: %s' % tabpos)
|
||||||
self.insert_page(widget, None, 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'):
|
if maker.isinstance(widget, 'Terminal'):
|
||||||
containers, objects = ([], [widget])
|
containers, objects = ([], [widget])
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.38.2 -->
|
<!-- Generated with glade 3.40.0 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.10"/>
|
<requires lib="gtk+" version="3.10"/>
|
||||||
<object class="GtkListStore" id="BackspaceKeyListStore">
|
<object class="GtkListStore" id="BackspaceKeyListStore">
|
||||||
|
@ -413,7 +413,7 @@
|
||||||
<property name="spacing">36</property>
|
<property name="spacing">36</property>
|
||||||
<property name="homogeneous">True</property>
|
<property name="homogeneous">True</property>
|
||||||
<child>
|
<child>
|
||||||
<!-- n-columns=2 n-rows=7 -->
|
<!-- n-columns=2 n-rows=8 -->
|
||||||
<object class="GtkGrid" id="grid1">
|
<object class="GtkGrid" id="grid1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
@ -553,6 +553,23 @@
|
||||||
<property name="width">2</property>
|
<property name="width">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</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>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
|
@ -3721,12 +3738,12 @@
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkVBox" id="vbox124">
|
<object class="GtkVBox" id="vbox124">
|
||||||
<child>
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
<object class="GtkEntry" id="keybindingsearchentry">
|
<object class="GtkEntry" id="keybindingsearchentry">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">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>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -3734,68 +3751,73 @@
|
||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</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>
|
<child>
|
||||||
<object class="GtkTreeView" id="keybindingtreeview">
|
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="has-focus">True</property>
|
<property name="vadjustment">adjustment4</property>
|
||||||
<property name="model">KeybindingsListStore</property>
|
<property name="hscrollbar-policy">never</property>
|
||||||
<property name="headers-clickable">False</property>
|
<property name="shadow-type">in</property>
|
||||||
<property name="search-column">0</property>
|
|
||||||
<child internal-child="selection">
|
|
||||||
<object class="GtkTreeSelection" id="treeview-selection4"/>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
<object class="GtkTreeView" id="keybindingtreeview">
|
||||||
<property name="title" translatable="yes">Name</property>
|
<property name="visible">True</property>
|
||||||
<child>
|
<property name="can-focus">True</property>
|
||||||
<object class="GtkCellRendererText" id="cellrenderertext10"/>
|
<property name="has-focus">True</property>
|
||||||
<attributes>
|
<property name="model">KeybindingsListStore</property>
|
||||||
<attribute name="text">0</attribute>
|
<property name="headers-clickable">False</property>
|
||||||
</attributes>
|
<property name="search-column">0</property>
|
||||||
|
<child internal-child="selection">
|
||||||
|
<object class="GtkTreeSelection" id="treeview-selection4"/>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
|
|
||||||
<property name="title" translatable="yes">Action</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" id="cellrenderertext11"/>
|
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
||||||
<attributes>
|
<property name="title" translatable="yes">Name</property>
|
||||||
<attribute name="text">1</attribute>
|
<child>
|
||||||
</attributes>
|
<object class="GtkCellRendererText" id="cellrenderertext10"/>
|
||||||
</child>
|
<attributes>
|
||||||
</object>
|
<attribute name="text">0</attribute>
|
||||||
</child>
|
</attributes>
|
||||||
<child>
|
</child>
|
||||||
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
|
</object>
|
||||||
<property name="title" translatable="yes">Keybinding</property>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererAccel" id="cellrendereraccel1">
|
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
|
||||||
<property name="editable">True</property>
|
<property name="title" translatable="yes">Action</property>
|
||||||
<property name="accel-mode">other</property>
|
<child>
|
||||||
<signal name="accel-cleared" handler="on_cellrenderer_accel_cleared" object="KeybindingsListStore" swapped="yes"/>
|
<object class="GtkCellRendererText" id="cellrenderertext11"/>
|
||||||
<signal name="accel-edited" handler="on_cellrenderer_accel_edited" object="KeybindingsListStore" swapped="yes"/>
|
<attributes>
|
||||||
|
<attribute name="text">1</attribute>
|
||||||
|
</attributes>
|
||||||
|
</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>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="accel-key">2</attribute>
|
||||||
|
<attribute name="accel-mods">3</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<attributes>
|
|
||||||
<attribute name="accel-key">2</attribute>
|
|
||||||
<attribute name="accel-mods">3</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">3</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
|
|
|
@ -770,6 +770,10 @@ class PrefsEditor:
|
||||||
else:
|
else:
|
||||||
widget.set_font_name(self.config['title_font'])
|
widget.set_font_name(self.config['title_font'])
|
||||||
|
|
||||||
|
# Whether tabs can be detached into their own window by dragging from titlebar
|
||||||
|
widget = guiget('detachable_tabs')
|
||||||
|
widget.set_active(self.config['detachable_tabs'])
|
||||||
|
|
||||||
def set_layout(self, layout_name):
|
def set_layout(self, layout_name):
|
||||||
"""Set a layout"""
|
"""Set a layout"""
|
||||||
self.layouteditor.set_layout(layout_name)
|
self.layouteditor.set_layout(layout_name)
|
||||||
|
@ -1873,6 +1877,10 @@ class PrefsEditor:
|
||||||
"""Open the fine manual"""
|
"""Open the fine manual"""
|
||||||
self.term.key_help()
|
self.term.key_help()
|
||||||
|
|
||||||
|
def on_detachable_tabs_toggled(self, widget):
|
||||||
|
self.config['detachable_tabs'] = widget.get_active()
|
||||||
|
self.config.save()
|
||||||
|
|
||||||
class LayoutEditor:
|
class LayoutEditor:
|
||||||
profile_ids_to_profile = None
|
profile_ids_to_profile = None
|
||||||
profile_profile_to_ids = None
|
profile_profile_to_ids = None
|
||||||
|
|
Loading…
Reference in New Issue