mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
For scan popup, use the Popup window type under X11, Tool window type under
Windows. Different types fit better under different platforms.
This commit is contained in:
parent
cac8baf58f
commit
71c4709bad
|
@ -15,6 +15,17 @@
|
|||
|
||||
using std::wstring;
|
||||
|
||||
/// We use different window flags under Windows and X11 due to slight differences
|
||||
/// in their behavior on those platforms.
|
||||
static Qt::WindowFlags popupWindowFlags =
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint
|
||||
#else
|
||||
Qt::Popup
|
||||
#endif
|
||||
;
|
||||
|
||||
ScanPopup::ScanPopup( QWidget * parent,
|
||||
Config::Class & cfg_,
|
||||
ArticleNetworkAccessManager & articleNetMgr,
|
||||
|
@ -48,7 +59,7 @@ ScanPopup::ScanPopup( QWidget * parent,
|
|||
ui.groupList->fill( groups );
|
||||
ui.groupList->setCurrentGroup( cfg.lastPopupGroupId );
|
||||
|
||||
setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
||||
setWindowFlags( popupWindowFlags );
|
||||
|
||||
if ( cfg.lastPopupSize.isValid() )
|
||||
resize( cfg.lastPopupSize );
|
||||
|
@ -461,7 +472,7 @@ void ScanPopup::pinButtonClicked( bool checked )
|
|||
hideTimer.stop();
|
||||
}
|
||||
else
|
||||
setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
||||
setWindowFlags( popupWindowFlags );
|
||||
|
||||
show();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue