diff options
author | SeokYeon Hwang <syeon.hwang@samsung.com> | 2014-11-05 21:03:42 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2014-11-05 21:03:42 -0800 |
commit | af7640681494964d8de9557468ecb6cb502a3447 (patch) | |
tree | 01e2600db4a705f26ac6e2a942c4dc0aedfc20a0 | |
parent | 19d0ca4e299be52293f388c816316be228a8006e (diff) | |
parent | 571eeb11b463ef649ae54d7d09c72d4c230e62ec (diff) | |
download | qemu-af7640681494964d8de9557468ecb6cb502a3447.tar.gz qemu-af7640681494964d8de9557468ecb6cb502a3447.tar.bz2 qemu-af7640681494964d8de9557468ecb6cb502a3447.zip |
Merge "menu: Added "Always on top" in MacOS" into features/qt_dr
-rw-r--r-- | tizen/src/ui/menu/contextmenu.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index cec6373eea..2b5c182a47 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -75,11 +75,9 @@ void ContextMenu::createItems() { addSeparator(); /* Always On Top menu */ -#ifndef CONFIG_DARWIN actionTopMost = addAction("&Always on Top"); actionTopMost->setCheckable(true); connect(actionTopMost, SIGNAL(triggered(bool)), this, SLOT(slotTopMost(bool))); -#endif /* = Rotate menu = */ if (win->uiInfo->mainFormList.count() > 1) { @@ -269,7 +267,7 @@ void ContextMenu::slotTopMost(bool on) HWND hWnd = (HWND)parent->winId(); HWND hWndInsertAfter = ((on == true) ? HWND_TOPMOST : HWND_NOTOPMOST); SetWindowPos(hWnd, hWndInsertAfter, parent->pos().x(), parent->pos().y(), 0, 0, SWP_NOSIZE); -#elif defined (CONFIG_LINUX) +#elif defined(CONFIG_LINUX) Display* display = XOpenDisplay(NULL); if (display == NULL) { qDebug("Error: XOpenDisplay() Failed. Always on top failed."); @@ -293,8 +291,14 @@ void ContextMenu::slotTopMost(bool on) XFlush(display); XCloseDisplay(display); -#elif defined (CONFIG_DARWIN) - // TODO: +#elif defined(CONFIG_DARWIN) + if (on == true) { + parent->setWindowFlags(parent->windowFlags() | Qt::WindowStaysOnTopHint); + } else { + parent->setWindowFlags(parent->windowFlags() & ~(Qt::WindowStaysOnTopHint)); + } + + parent->show(); #endif actionTopMost->setChecked(on); |