mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Use the same window flags for the scan window, on Win and Linux.
Previously, the scan popup used Qt::Popup flag on Linux, but this flag is incompatible with the new translate box UI, esp. the floating suggestion list, since in the Qt::Popup-styled windows all the events go to the popup, hence the creation of additional windows is problematic, and those new windows don't work properly since they don't receive events. Without this change, the scrolling of the suggestion list in the Scan Popup's translate box is impossible.
This commit is contained in:
parent
ffa9f5778b
commit
8a8c7cc7d7
20
scanpopup.cc
20
scanpopup.cc
|
@ -16,16 +16,7 @@
|
|||
|
||||
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
|
||||
;
|
||||
static Qt::WindowFlags popupWindowFlags = Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint;
|
||||
|
||||
ScanPopup::ScanPopup( QWidget * parent,
|
||||
Config::Class & cfg_,
|
||||
|
@ -313,14 +304,7 @@ void ScanPopup::translateWord( QString const & word )
|
|||
altModeExpirationTimer.stop();
|
||||
|
||||
inputWord = str;
|
||||
engagePopup( false,
|
||||
#ifdef Q_WS_WIN
|
||||
true // We only focus popup under Windows when activated via Ctrl+C+C
|
||||
// -- on Linux it already has an implicit focus
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
);
|
||||
engagePopup( false, true );
|
||||
}
|
||||
|
||||
void ScanPopup::clipboardChanged( QClipboard::Mode m )
|
||||
|
|
Loading…
Reference in a new issue