From 77a992a2965d40d4702dd769c0ab409d8e4f1ca6 Mon Sep 17 00:00:00 2001 From: Tvangeste Date: Mon, 21 Jan 2013 21:50:57 +0100 Subject: [PATCH] Fixed #176: Menu button is not centered when toolbar is vertically positioned. We just disable the Left and Right areas for the main toolbar in the new UI mode. :) --- mainwindow.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mainwindow.cc b/mainwindow.cc index 31985eea..c08b1731 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -714,6 +714,8 @@ void MainWindow::updateSearchPaneAndBar( bool searchInDock ) { cfg.preferences.searchInDock = true; + navToolbar->setAllowedAreas( Qt::AllToolBarAreas ); + groupList = groupListInDock; translateLine = ui.translateLine; wordList = ui.wordList; @@ -728,6 +730,21 @@ void MainWindow::updateSearchPaneAndBar( bool searchInDock ) { cfg.preferences.searchInDock = false; + // handle the main toolbar, it must not be on the side, since it should + // contain the group widget and the translate line. Valid locations: Top and Bottom. + navToolbar->setAllowedAreas( Qt::BottomToolBarArea | Qt::TopToolBarArea ); + if ( toolBarArea( navToolbar ) & ( Qt::LeftToolBarArea | Qt::RightToolBarArea ) ) + { + if ( toolBarArea( &dictionaryBar ) == Qt::TopToolBarArea ) + { + insertToolBar( &dictionaryBar, navToolbar ); + } + else + { + addToolBar( Qt::TopToolBarArea, navToolbar ); + } + } + groupList = groupListInToolbar; translateLine = translateBox->translateLine(); wordList = translateBox->wordList();