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:
Konstantin Isakov 2010-01-02 15:51:53 +03:00
parent cac8baf58f
commit 71c4709bad

View file

@ -15,6 +15,17 @@
using std::wstring; 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, ScanPopup::ScanPopup( QWidget * parent,
Config::Class & cfg_, Config::Class & cfg_,
ArticleNetworkAccessManager & articleNetMgr, ArticleNetworkAccessManager & articleNetMgr,
@ -48,7 +59,7 @@ ScanPopup::ScanPopup( QWidget * parent,
ui.groupList->fill( groups ); ui.groupList->fill( groups );
ui.groupList->setCurrentGroup( cfg.lastPopupGroupId ); ui.groupList->setCurrentGroup( cfg.lastPopupGroupId );
setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setWindowFlags( popupWindowFlags );
if ( cfg.lastPopupSize.isValid() ) if ( cfg.lastPopupSize.isValid() )
resize( cfg.lastPopupSize ); resize( cfg.lastPopupSize );
@ -461,7 +472,7 @@ void ScanPopup::pinButtonClicked( bool checked )
hideTimer.stop(); hideTimer.stop();
} }
else else
setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setWindowFlags( popupWindowFlags );
show(); show();
} }