Merge pull request #698 from zpalmtree/add-detchable-tabs-preference

Add detachable tabs feature to preferences
This commit is contained in:
Matt Rose 2023-04-24 09:55:48 -04:00 committed by GitHub
commit e0592eaf4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 4 deletions

View File

@ -117,7 +117,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',

View File

@ -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])

View File

@ -472,7 +472,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>
@ -612,6 +612,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>

View File

@ -337,6 +337,9 @@ class PrefsEditor:
# DBus Server # DBus Server
widget = guiget('dbuscheck') widget = guiget('dbuscheck')
widget.set_active(self.config['dbus']) widget.set_active(self.config['dbus'])
# Detachable tabs
widget = guiget('detachable_tabs')
widget.set_active(self.config['detachable_tabs'])
#Hide from taskbar #Hide from taskbar
widget = guiget('hidefromtaskbcheck') widget = guiget('hidefromtaskbcheck')
widget.set_active(self.config['hide_from_taskbar']) widget.set_active(self.config['hide_from_taskbar'])
@ -836,6 +839,10 @@ class PrefsEditor:
self.config['dbus'] = widget.get_active() self.config['dbus'] = widget.get_active()
self.config.save() 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): def on_disable_mousewheel_zoom_toggled(self, widget):
"""Ctrl+mousewheel zoom setting changed""" """Ctrl+mousewheel zoom setting changed"""
self.config['disable_mousewheel_zoom'] = widget.get_active() self.config['disable_mousewheel_zoom'] = widget.get_active()