Skip to content

Commit

Permalink
do not allow move the dictionary tool bar
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Dec 31, 2024
1 parent 283a3a9 commit 745e997
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ui/scanpopup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ ScanPopup::ScanPopup( QWidget * parent,
dictionaryBar.setMutedDictionaries( grp ? &grp->popupMutedDictionaries : nullptr );
}

addToolBar( Qt::TopToolBarArea, &dictionaryBar );
addToolBar( Qt::RightToolBarArea, toolbar );

connect( &dictionaryBar, &DictionaryBar::editGroupRequested, this, &ScanPopup::editGroupRequested );
Expand Down Expand Up @@ -179,14 +178,17 @@ ScanPopup::ScanPopup( QWidget * parent,
restoreState( cfg.popupWindowState );
}

//fix this toolbar
addToolBar( Qt::TopToolBarArea, &dictionaryBar );

ui.onTopButton->setChecked( cfg.popupWindowAlwaysOnTop );
ui.onTopButton->setVisible( cfg.pinPopupWindow );
connect( ui.onTopButton, &QAbstractButton::clicked, this, &ScanPopup::alwaysOnTopClicked );

ui.pinButton->setChecked( cfg.pinPopupWindow );

if ( cfg.pinPopupWindow ) {
dictionaryBar.setMovable( true );
dictionaryBar.setMovable( false );
Qt::WindowFlags flags = pinnedWindowFlags;
if ( cfg.popupWindowAlwaysOnTop ) {
flags |= Qt::WindowStaysOnTopHint;
Expand Down Expand Up @@ -959,7 +961,7 @@ void ScanPopup::pinButtonClicked( bool checked )
#endif

setWindowTitle( QString( "%1 - GoldenDict-ng" ).arg( elideInputWord() ) );
dictionaryBar.setMovable( true );
dictionaryBar.setMovable( false );
hideTimer.stop();
}
else {
Expand Down

0 comments on commit 745e997

Please sign in to comment.