Make completion height configurable

This commit is contained in:
Florian Bruhin 2014-02-18 18:42:43 +01:00
parent 9568be3d2a
commit 9318558eb6
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,7 @@
[general] [general]
# show_completion: bool, whether to show the autocompletion window or not. # show_completion: bool, whether to show the autocompletion window or not.
# completion_height: the height of the completion, in pixels
# ignorecase: bool, whether to do case-insensitive searching. # ignorecase: bool, whether to do case-insensitive searching.
# wrapsearch: bool, whether to wrap search to the top when arriving at the end. # wrapsearch: bool, whether to wrap search to the top when arriving at the end.
# startpage: The default pages to open at the start, multiple pages can be # startpage: The default pages to open at the start, multiple pages can be
@ -26,6 +27,7 @@
# dns: Use DNS matching (might be slow) # dns: Use DNS matching (might be slow)
# false: Never search automatically # false: Never search automatically
show_completion = true show_completion = true
completion_height = 400
ignorecase = true ignorecase = true
wrapsearch = true wrapsearch = true
startpage = http://www.duckduckgo.com/ startpage = http://www.duckduckgo.com/

View File

@ -94,7 +94,8 @@ class CompletionView(QTreeView):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self._height = QPoint(0, 200) # FIXME make that configurable height = int(config.config.get('general', 'completion_height'))
self._height = QPoint(0, height)
self._enabled = config.config.getboolean('general', 'show_completion') self._enabled = config.config.getboolean('general', 'show_completion')
self._completion_models = {} self._completion_models = {}
self._completion_models[''] = None self._completion_models[''] = None