From c69ba4bc9017cce252a9fdc51c2ea13591c31d0f Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Fri, 11 Dec 2015 13:58:20 +0900 Subject: [PATCH] menu: modify some variable names for Always on Top Change-Id: I9d57e4de836273ac735117895dff41a6ed28ef47 Signed-off-by: GiWoong Kim (cherry picked from commit d78b475e882c242050d248e5456c7743f3df60f8) --- tizen/src/ui/mainwindow.cpp | 7 +++--- tizen/src/ui/mainwindow.h | 3 +-- tizen/src/ui/menu/contextmenu.cpp | 41 ++++++++++++++++++------------- tizen/src/ui/menu/contextmenu.h | 21 +++++++++------- 4 files changed, 40 insertions(+), 32 deletions(-) diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp index 56b11de4e7..aa2120eb0b 100644 --- a/tizen/src/ui/mainwindow.cpp +++ b/tizen/src/ui/mainwindow.cpp @@ -5,11 +5,10 @@ * * Contact: * Jihye Won - * Hyunjin Lee * SungMin Ha * GiWoong Kim * SeokYeon Hwang - * Sangho Park + * Sangho Park * Stanislav Vorobiov * * This program is free software; you can redistribute it and/or @@ -324,7 +323,7 @@ void MainWindow::openController(int index, int dockPos) display->update(); #ifdef CONFIG_LINUX - popupMenu->slotTopMost(getUiState()->isOnTop()); + popupMenu->slotOnTop(getUiState()->isOnTop()); #endif } @@ -518,7 +517,7 @@ void MainWindow::processCaptured(bool captured, void *pixels, void MainWindow::setTopMost(bool on) { - popupMenu->slotTopMost(on); + popupMenu->slotOnTop(on); } KeyboardShortcut *MainWindow::getKeyboardShortcut() diff --git a/tizen/src/ui/mainwindow.h b/tizen/src/ui/mainwindow.h index b23522fc38..24a15a879a 100644 --- a/tizen/src/ui/mainwindow.h +++ b/tizen/src/ui/mainwindow.h @@ -5,11 +5,10 @@ * * Contact: * Jihye Won - * Hyunjin Lee * SungMin Ha * GiWoong Kim * SeokYeon Hwang - * Sangho Park + * Sangho Park * Stanislav Vorobiov * * This program is free software; you can redistribute it and/or diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index de60814e3e..b308ebae3b 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -6,7 +6,8 @@ * Contact: * SungMin Ha * GiWoong Kim - * Sangho Park + * SeokYeon Hwang + * Sangho Park * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -61,7 +62,7 @@ ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent) this->controllerMenu = NULL; this->actionDetailedInfo = NULL; - this->actionTopMost = NULL; + this->actionOnTop = NULL; this->actionShell = NULL; this->actionControlPanel = NULL; this->actionScreenShot = NULL; @@ -90,6 +91,10 @@ ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent) installEventFilter(this); } +QAction *ContextMenu::getOnTopAction() { + return actionOnTop; +} + void ContextMenu::createItems(QMenu *menu, QList &list) { MenuItem *item = NULL; @@ -214,22 +219,22 @@ void ContextMenu::createOnTopItem(QMenu *menu, MenuItem *item) } QString menuName = item->getName(); - actionTopMost = menu->addAction( + actionOnTop = menu->addAction( menuName.isEmpty() ? MENU_ONTOP_ITEM_TEXT : menuName); #ifdef CONFIG_DARWIN - actionTopMost->setIcon(QIcon(QPixmap(":/icons/alwaysontop.png"))); + actionOnTop->setIcon(QIcon(QPixmap(":/icons/alwaysontop.png"))); #endif - actionTopMost->setCheckable(true); - connect(actionTopMost, SIGNAL(triggered(bool)), this, SLOT(slotTopMost(bool))); + actionOnTop->setCheckable(true); + connect(actionOnTop, SIGNAL(triggered(bool)), this, SLOT(slotOnTop(bool))); /* shortcut */ if (item->getShortcuts().isEmpty() == false) { QShortcut *shortcut = new QShortcut( item->getShortcuts().begin().value(), parent); - attachShortcut(actionTopMost, shortcut, SLOT(slotTopMostShortcut())); + attachShortcut(actionOnTop, shortcut, SLOT(slotOnTopShortcut())); } - item->setAction(actionTopMost); + item->setAction(actionOnTop); } void ContextMenu::createMoveItem(QMenu *menu, MenuItem *item) @@ -656,11 +661,11 @@ void ContextMenu::slotDetailedInfo() infoDialog->show(); #ifdef CONFIG_LINUX - slotTopMost(parent->getUiState()->isOnTop()); + slotOnTop(parent->getUiState()->isOnTop()); #endif } -void ContextMenu::slotTopMost(bool on) +void ContextMenu::slotOnTop(bool on) { qDebug("stays on top: %s", on? "on" : "off"); @@ -681,16 +686,18 @@ void ContextMenu::slotTopMost(bool on) UiUtil::setTopMost(parent, on); - actionTopMost->setChecked(on); + if (actionOnTop != NULL) { + actionOnTop->setChecked(on); + } parent->getUiState()->setOnTop(on); } -void ContextMenu::slotTopMostShortcut() +void ContextMenu::slotOnTopShortcut() { /* toggle */ - slotTopMost(!actionTopMost->isChecked()); + slotOnTop(!actionOnTop->isChecked()); - qDebug() << "shortcut:" << actionTopMost->text() << actionTopMost->isChecked(); + qDebug() << "shortcut:" << actionOnTop->text() << actionOnTop->isChecked(); } void ContextMenu::slotMove() @@ -1012,7 +1019,7 @@ void ContextMenu::slotShowScreenshot(const QPixmap &screenshot) screenshotDialog->show(); #ifdef CONFIG_LINUX - slotTopMost(parent->getUiState()->isOnTop()); + slotOnTop(parent->getUiState()->isOnTop()); #endif } @@ -1038,7 +1045,7 @@ void ContextMenu::slotAbout() aboutDialog->show(); #ifdef CONFIG_LINUX - slotTopMost(parent->getUiState()->isOnTop()); + slotOnTop(parent->getUiState()->isOnTop()); #endif } @@ -1118,7 +1125,7 @@ QMessageBox *ContextMenu::showMsgBox( msgBox->show(); /* non-blocking */ #ifdef CONFIG_LINUX - slotTopMost(parent->getUiState()->isOnTop()); + slotOnTop(parent->getUiState()->isOnTop()); #endif return msgBox; diff --git a/tizen/src/ui/menu/contextmenu.h b/tizen/src/ui/menu/contextmenu.h index 942a077b67..3c2181eda7 100644 --- a/tizen/src/ui/menu/contextmenu.h +++ b/tizen/src/ui/menu/contextmenu.h @@ -6,7 +6,8 @@ * Contact: * SungMin Ha * GiWoong Kim - * Sangho Park + * SeokYeon Hwang + * Sangho Park * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -59,23 +60,20 @@ public: explicit ContextMenu(QWidget *parent = 0); ~ContextMenu(); + QAction *getOnTopAction(); + QSignalMapper *getSwitchMapper(); QSignalMapper *getScaleMapper(); QSignalMapper *getControllerMapper(); - QActionGroup *switchGroup; - QActionGroup *scaleGroup; - QActionGroup *keyboardGroup; - QActionGroup *controllerGroup; - ScreenShotDialog *screenshotDialog; public slots: void slotAmbiguousShortcut(); void slotDetailedInfo(); - void slotTopMost(bool on); - void slotTopMostShortcut(); + void slotOnTop(bool on); + void slotOnTopShortcut(); void slotMove(); void slotSwitch(int index); void slotSwitchShortcutPrev(); @@ -144,8 +142,13 @@ private: QMenu *scaleMenu; QMenu *controllerMenu; + QActionGroup *switchGroup; + QActionGroup *scaleGroup; + QActionGroup *keyboardGroup; + QActionGroup *controllerGroup; + QAction *actionDetailedInfo; - QAction *actionTopMost; + QAction *actionOnTop; QAction *actionMove; QAction *actionShell; QAction *actionControlPanel; -- 2.34.1