diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 1d332e62a..b03a4f52d 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -235,6 +235,11 @@ def data(readonly=False): SettingValue(typ.Perc(), '100%'), "The default zoom level."), + ('downloads-at-top', + SettingValue(typ.Bool(), 'true'), + "Whether to show downloaded files at top, " + "false will show at bottom."), + ('message-timeout', SettingValue(typ.Int(), '2000'), "Time (in ms) to show messages in the statusbar for."), diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index dbcead867..8f48c9155 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -90,19 +90,12 @@ class MainWindow(QWidget): self._vbox.setContentsMargins(0, 0, 0, 0) self._vbox.setSpacing(0) - log.init.debug("Initializing downloads...") - download_manager = downloads.DownloadManager(self.win_id, self) - objreg.register('download-manager', download_manager, scope='window', - window=self.win_id) - - self._downloadview = downloadview.DownloadView(self.win_id) - self._vbox.addWidget(self._downloadview) - self._downloadview.show() - - self._tabbed_browser = tabbedbrowser.TabbedBrowser(self.win_id) - objreg.register('tabbed-browser', self._tabbed_browser, scope='window', - window=self.win_id) - self._vbox.addWidget(self._tabbed_browser) + if config.get('ui', 'downloads-at-top'): + self._init_downloadview() + self._init_tabbed_browser() + else: + self._init_tabbed_browser() + self._init_downloadview() # We need to set an explicit parent for StatusBar because it does some # show/hide magic immediately which would mean it'd show up as a @@ -142,6 +135,22 @@ class MainWindow(QWidget): if section == 'completion' and option in ('height', 'shrink'): self.resize_completion() + def _init_downloadview(self): + log.init.debug("Initializing downloads...") + download_manager = downloads.DownloadManager(self.win_id, self) + objreg.register('download-manager', download_manager, scope='window', + window=self.win_id) + + self._downloadview = downloadview.DownloadView(self.win_id) + self._vbox.addWidget(self._downloadview) + self._downloadview.show() + + def _init_tabbed_browser(self): + self._tabbed_browser = tabbedbrowser.TabbedBrowser(self.win_id) + objreg.register('tabbed-browser', self._tabbed_browser, scope='window', + window=self.win_id) + self._vbox.addWidget(self._tabbed_browser) + def _load_state_geometry(self): """Load the geometry from the state file.""" state_config = objreg.get('state-config')