mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
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:
parent
0ebe960ff6
commit
77a992a296
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue