Fix setting ui->default-zoom to a level not in ui->zoom-levels.

Fixes #296.
See #115.
This commit is contained in:
Florian Bruhin 2014-12-01 20:24:04 +01:00
parent e8a6238028
commit 51fcfa07b0
3 changed files with 3 additions and 11 deletions

View File

@ -196,7 +196,7 @@ DATA = collections.OrderedDict([
"The available zoom levels, separated by commas."),
('default-zoom',
SettingValue(typ.ZoomPerc(), '100%'),
SettingValue(typ.Perc(), '100%'),
"The default zoom level."),
('message-timeout',

View File

@ -959,14 +959,6 @@ class ShellCommand(BaseType):
return shlex.split(value)
class ZoomPerc(Perc):
"""A percentage which needs to be in the current zoom percentages."""
# FIXME we should validate the percentage is in the list here.
# https://github.com/The-Compiler/qutebrowser/issues/115
class HintMode(BaseType):
"""Base class for the hints -> mode setting."""

View File

@ -157,9 +157,9 @@ class WebView(QWebView):
def init_neighborlist(self):
"""Initialize the _zoom neighborlist."""
levels = config.get('ui', 'zoom-levels')
default = config.get('ui', 'default-zoom')
self._zoom = usertypes.NeighborList(
levels, default, mode=usertypes.NeighborList.Modes.block)
levels, mode=usertypes.NeighborList.Modes.block)
self._zoom.fuzzyval = config.get('ui', 'default-zoom')
def _mousepress_backforward(self, e):
"""Handle back/forward mouse button presses.