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. :)
This commit is contained in:
Tvangeste 2013-01-21 21:50:57 +01:00
parent 0ebe960ff6
commit 77a992a296

View file

@ -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();