summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-09-28 12:22:01 +0200
committerFlorian Bruhin <me@the-compiler.org>2018-09-28 12:22:17 +0200
commita8e95dc866f81e0dbf9758cb6926304de8466921 (patch)
treedb7d5073988268fbc42a7098fc377e8425ec7d4c
parente5c9c61ff9c9f3bc99963dc3d50d7b1386c37379 (diff)
parent003e007ace8dbf265e80bbb678f656e58d298ef2 (diff)
downloadqutebrowser-a8e95dc866f81e0dbf9758cb6926304de8466921.tar.gz
qutebrowser-a8e95dc866f81e0dbf9758cb6926304de8466921.zip
Merge remote-tracking branch 'origin/pr/4265'
-rw-r--r--doc/help/commands.asciidoc15
-rw-r--r--qutebrowser/browser/commands.py21
2 files changed, 29 insertions, 7 deletions
diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc
index 99d8b1e33..c3d737f4c 100644
--- a/doc/help/commands.asciidoc
+++ b/doc/help/commands.asciidoc
@@ -1413,7 +1413,7 @@ Yank something to the clipboard or primary selection.
[[zoom]]
=== zoom
-Syntax: +:zoom ['zoom']+
+Syntax: +:zoom [*--quiet*] ['zoom']+
Set the zoom level for the current tab.
@@ -1422,20 +1422,33 @@ The zoom can be given as argument or as [count]. If neither is given, the zoom i
==== positional arguments
* +'zoom'+: The zoom percentage to set.
+==== optional arguments
+* +*-q*+, +*--quiet*+: Don't show information message with result.
+
==== count
The zoom percentage to set.
[[zoom-in]]
=== zoom-in
+Syntax: +:zoom-in [*--quiet*]+
+
Increase the zoom level for the current tab.
+==== optional arguments
+* +*-q*+, +*--quiet*+: Don't show information message with result.
+
==== count
How many steps to zoom in.
[[zoom-out]]
=== zoom-out
+Syntax: +:zoom-out [*--quiet*]+
+
Decrease the zoom level for the current tab.
+==== optional arguments
+* +*-q*+, +*--quiet*+: Don't show information message with result.
+
==== count
How many steps to zoom out.
diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py
index 6cdbc0246..96db01fd9 100644
--- a/qutebrowser/browser/commands.py
+++ b/qutebrowser/browser/commands.py
@@ -870,37 +870,44 @@ class CommandDispatcher:
@cmdutils.register(instance='command-dispatcher', scope='window')
@cmdutils.argument('count', count=True)
- def zoom_in(self, count=1):
+ @cmdutils.argument('quiet')
+ def zoom_in(self, count=1, quiet=False):
"""Increase the zoom level for the current tab.
Args:
count: How many steps to zoom in.
+ quiet: Don't show a zoom level message.
"""
tab = self._current_widget()
try:
perc = tab.zoom.offset(count)
except ValueError as e:
raise cmdexc.CommandError(e)
- message.info("Zoom level: {}%".format(int(perc)), replace=True)
+ if not quiet:
+ message.info("Zoom level: {}%".format(int(perc)), replace=True)
@cmdutils.register(instance='command-dispatcher', scope='window')
@cmdutils.argument('count', count=True)
- def zoom_out(self, count=1):
+ @cmdutils.argument('quiet')
+ def zoom_out(self, count=1, quiet=False):
"""Decrease the zoom level for the current tab.
Args:
count: How many steps to zoom out.
+ quiet: Don't show a zoom level message.
"""
tab = self._current_widget()
try:
perc = tab.zoom.offset(-count)
except ValueError as e:
raise cmdexc.CommandError(e)
- message.info("Zoom level: {}%".format(int(perc)), replace=True)
+ if not quiet:
+ message.info("Zoom level: {}%".format(int(perc)), replace=True)
@cmdutils.register(instance='command-dispatcher', scope='window')
@cmdutils.argument('count', count=True)
- def zoom(self, zoom=None, count=None):
+ @cmdutils.argument('quiet')
+ def zoom(self, zoom=None, count=None, quiet=False):
"""Set the zoom level for the current tab.
The zoom can be given as argument or as [count]. If neither is
@@ -910,6 +917,7 @@ class CommandDispatcher:
Args:
zoom: The zoom percentage to set.
count: The zoom percentage to set.
+ quiet: Don't show a zoom level message.
"""
if zoom is not None:
try:
@@ -927,7 +935,8 @@ class CommandDispatcher:
tab.zoom.set_factor(float(level) / 100)
except ValueError:
raise cmdexc.CommandError("Can't zoom {}%!".format(level))
- message.info("Zoom level: {}%".format(int(level)), replace=True)
+ if not quiet:
+ message.info("Zoom level: {}%".format(int(level)), replace=True)
@cmdutils.register(instance='command-dispatcher', scope='window')
def tab_only(self, prev=False, next_=False, force=False):