summaryrefslogtreecommitdiff
path: root/tizen/src/ui/menu
diff options
context:
space:
mode:
authorGiWoong Kim <giwoong.kim@samsung.com>2015-12-11 13:58:20 +0900
committerGiWoong Kim <giwoong.kim@samsung.com>2015-12-11 17:03:10 +0900
commitd78b475e882c242050d248e5456c7743f3df60f8 (patch)
tree9796be9dc29076ee9c0b46eeabfeaeedba127b5e /tizen/src/ui/menu
parent97d3187c29996b5c87cecd6cd04102510884a2b2 (diff)
downloadqemu-d78b475e882c242050d248e5456c7743f3df60f8.tar.gz
qemu-d78b475e882c242050d248e5456c7743f3df60f8.tar.bz2
qemu-d78b475e882c242050d248e5456c7743f3df60f8.zip
menu: modify some variable names for Always on Top
Change-Id: I9d57e4de836273ac735117895dff41a6ed28ef47 Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
Diffstat (limited to 'tizen/src/ui/menu')
-rw-r--r--tizen/src/ui/menu/contextmenu.cpp41
-rw-r--r--tizen/src/ui/menu/contextmenu.h21
2 files changed, 36 insertions, 26 deletions
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp
index da0eb40405..307b600bf7 100644
--- a/tizen/src/ui/menu/contextmenu.cpp
+++ b/tizen/src/ui/menu/contextmenu.cpp
@@ -6,7 +6,8 @@
* Contact:
* SungMin Ha <sungmin82.ha@samsung.com>
* GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -62,7 +63,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;
@@ -91,6 +92,10 @@ ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
installEventFilter(this);
}
+QAction *ContextMenu::getOnTopAction() {
+ return actionOnTop;
+}
+
void ContextMenu::createItems(QMenu *menu, QList<MenuItem *> &list)
{
MenuItem *item = NULL;
@@ -215,22 +220,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)
@@ -658,11 +663,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");
@@ -683,16 +688,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()
@@ -1009,7 +1016,7 @@ void ContextMenu::slotShowScreenshot(const QPixmap &screenshot)
screenshotDialog->show();
#ifdef CONFIG_LINUX
- slotTopMost(parent->getUiState()->isOnTop());
+ slotOnTop(parent->getUiState()->isOnTop());
#endif
}
@@ -1035,7 +1042,7 @@ void ContextMenu::slotAbout()
aboutDialog->show();
#ifdef CONFIG_LINUX
- slotTopMost(parent->getUiState()->isOnTop());
+ slotOnTop(parent->getUiState()->isOnTop());
#endif
}
@@ -1115,7 +1122,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 <sungmin82.ha@samsung.com>
* GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
*
* 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;