Merge pull request #46 from filipkilibarda/master
Added option to disable ctrl+mousewheel zoom
This commit is contained in:
commit
86f90337f6
|
@ -221,6 +221,7 @@ DEFAULTS = {
|
||||||
'scroll_on_output' : False,
|
'scroll_on_output' : False,
|
||||||
'scrollback_lines' : 500,
|
'scrollback_lines' : 500,
|
||||||
'scrollback_infinite' : False,
|
'scrollback_infinite' : False,
|
||||||
|
'disable_mousewheel_zoom': False,
|
||||||
'exit_action' : 'close',
|
'exit_action' : 'close',
|
||||||
'palette' : '#2e3436:#cc0000:#4e9a06:#c4a000:\
|
'palette' : '#2e3436:#cc0000:#4e9a06:#c4a000:\
|
||||||
#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:\
|
#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:\
|
||||||
|
|
|
@ -1626,6 +1626,23 @@
|
||||||
<property name="position">5</property>
|
<property name="position">5</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="disablemousewheelzoom">
|
||||||
|
<property name="label" translatable="yes">Disable Ctrl+mousewheel zoom</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_disable_mousewheel_zoom_toggled" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">6</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="word_chars_hbox">
|
<object class="GtkBox" id="word_chars_hbox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -1664,7 +1681,7 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">6</property>
|
<property name="position">7</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -286,6 +286,9 @@ class PrefsEditor:
|
||||||
else:
|
else:
|
||||||
active = 1
|
active = 1
|
||||||
widget.set_active(active)
|
widget.set_active(active)
|
||||||
|
# Disable Ctrl+mousewheel zoom
|
||||||
|
widget = guiget('disablemousewheelzoom')
|
||||||
|
widget.set_active(self.config['disable_mousewheel_zoom'])
|
||||||
# scroll_tabbar
|
# scroll_tabbar
|
||||||
widget = guiget('scrolltabbarcheck')
|
widget = guiget('scrolltabbarcheck')
|
||||||
widget.set_active(self.config['scroll_tabbar'])
|
widget.set_active(self.config['scroll_tabbar'])
|
||||||
|
@ -698,6 +701,11 @@ class PrefsEditor:
|
||||||
self.config['dbus'] = widget.get_active()
|
self.config['dbus'] = widget.get_active()
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
||||||
|
def on_disable_mousewheel_zoom_toggled(self, widget):
|
||||||
|
"""Ctrl+mousewheel zoom setting changed"""
|
||||||
|
self.config['disable_mousewheel_zoom'] = widget.get_active()
|
||||||
|
self.config.save()
|
||||||
|
|
||||||
def on_winbordercheck_toggled(self, widget):
|
def on_winbordercheck_toggled(self, widget):
|
||||||
"""Window border setting changed"""
|
"""Window border setting changed"""
|
||||||
self.config['borderless'] = not widget.get_active()
|
self.config['borderless'] = not widget.get_active()
|
||||||
|
|
|
@ -991,7 +991,10 @@ class Terminal(Gtk.VBox):
|
||||||
SMOOTH_SCROLL_UP = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y <= 0.
|
SMOOTH_SCROLL_UP = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y <= 0.
|
||||||
SMOOTH_SCROLL_DOWN = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y > 0.
|
SMOOTH_SCROLL_DOWN = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y > 0.
|
||||||
if event.state & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK:
|
if event.state & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK:
|
||||||
# Ctrl + mouse wheel up/down with Shift and Super additions
|
# Zoom the terminal(s) in or out if not disabled in config
|
||||||
|
if self.config["disable_mousewheel_zoom"] is True:
|
||||||
|
return (False)
|
||||||
|
# Choice of target terminals depends on Shift and Super modifiers
|
||||||
if event.state & Gdk.ModifierType.MOD4_MASK == Gdk.ModifierType.MOD4_MASK:
|
if event.state & Gdk.ModifierType.MOD4_MASK == Gdk.ModifierType.MOD4_MASK:
|
||||||
targets=self.terminator.terminals
|
targets=self.terminator.terminals
|
||||||
elif event.state & Gdk.ModifierType.SHIFT_MASK == Gdk.ModifierType.SHIFT_MASK:
|
elif event.state & Gdk.ModifierType.SHIFT_MASK == Gdk.ModifierType.SHIFT_MASK:
|
||||||
|
|
Loading…
Reference in New Issue