summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeokYeon Hwang <syeon.hwang@samsung.com>2014-10-28 01:23:27 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2014-10-28 01:23:27 -0700
commite7d67070e24ca624920449bbc02f21c4fce234e7 (patch)
tree8891580bb597e3b394940dfe3250ec919c097f43
parent27a98560f96160b421410d67601cf97dea43f6d1 (diff)
parentc52c034f0336fdfa436dd094bef967fb87270db9 (diff)
downloadqemu-e7d67070e24ca624920449bbc02f21c4fce234e7.tar.gz
qemu-e7d67070e24ca624920449bbc02f21c4fce234e7.tar.bz2
qemu-e7d67070e24ca624920449bbc02f21c4fce234e7.zip
Merge "controller: control the controller position" into features/qt_dr
-rw-r--r--tizen/src/display/qt5_supplement.cpp18
-rw-r--r--tizen/src/ui/mainwindow.cpp6
-rw-r--r--tizen/src/ui/menu/contextmenu.cpp2
-rw-r--r--tizen/src/ui/uistate.cpp1
-rw-r--r--tizen/src/ui/uistate.h1
5 files changed, 24 insertions, 4 deletions
diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp
index 422cd8a8b4..5a362bf93f 100644
--- a/tizen/src/display/qt5_supplement.cpp
+++ b/tizen/src/display/qt5_supplement.cpp
@@ -62,6 +62,7 @@ static UIInformation *uiInfo;
#define SKIN_PROPERTY_WINDOW_Y "window.y"
#define SKIN_PROPERTY_WINDOW_SCALE "window.scale"
#define SKIN_PROPERTY_CONTROLLER_INDEX "controller.index"
+#define SKIN_PROPERTY_CONTROLLER_DOCK "controller.dock"
#define SKIN_INFO_FILE_NAME "info.ini"
#define FORM_FILE_NAME "layout.qml"
@@ -117,7 +118,7 @@ void qt5_gui_init(void)
qDebug("previous scale value is %d", scale);
if (scale <= 0) {
- scale = 50;
+ scale = 50; /* default scale */
}
uiInfo->uiState.mainFormScale = scale;
@@ -185,7 +186,12 @@ void qt5_gui_init(void)
int conIndex = mruInfo.value(SKIN_PROPERTY_CONTROLLER_INDEX).toInt();
if (conIndex >= 0 && conIndex < uiInfo->conFormList.count()) {
- mainwindow->openController(conIndex, Qt::AlignRight | Qt::AlignCenter);
+ int conDockPos = mruInfo.value(SKIN_PROPERTY_CONTROLLER_DOCK).toInt();
+ if (conDockPos <= 0) {
+ conDockPos = Qt::AlignRight | Qt::AlignCenter;
+ }
+
+ mainwindow->openController(conIndex, conDockPos);
}
mainwindow->startSwapper();
@@ -203,6 +209,14 @@ void qt5_destroy()
mruInfo.setValue(SKIN_PROPERTY_WINDOW_SCALE, uiInfo->uiState.mainFormScale);
mruInfo.setValue(SKIN_PROPERTY_CONTROLLER_INDEX, uiInfo->uiState.conState.conFormIndex);
+ DockingController *con = uiInfo->uiState.conState.dockingCon;
+ if (con != NULL) {
+ mruInfo.setValue(SKIN_PROPERTY_CONTROLLER_DOCK, con->getDockPos());
+ } else {
+ mruInfo.setValue(SKIN_PROPERTY_CONTROLLER_DOCK, 0);
+ }
+
+ /* clean up */
mainwindow->terminateSwapper();
mainwindow->closeController();
diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp
index 54628de9b7..2ca0014349 100644
--- a/tizen/src/ui/mainwindow.cpp
+++ b/tizen/src/ui/mainwindow.cpp
@@ -238,6 +238,7 @@ void MainWindow::openController(int index, int dockPos)
} else {
getUIState()->conState.dockingCon =
new DockingController(conForm, action, dockPos, this);
+ getUIState()->conState.recentlyDockPos = dockPos;
}
/* update layout */
@@ -265,9 +266,10 @@ void MainWindow::closeController()
if (getDockingCon() != NULL) {
qDebug("close docking controller");
+ getUIState()->conState.recentlyDockPos = -1;
winLayout->removeWidget(getDockingCon());
-
getDockingCon()->close();
+
getUIState()->conState.dockingCon = NULL;
adjustSize();
@@ -276,7 +278,9 @@ void MainWindow::closeController()
if (getFloatingCon() != NULL) {
qDebug("close floating controller");
+ getUIState()->conState.recentlyFloatPos = getFloatingCon()->pos();
getFloatingCon()->close();
+
getUIState()->conState.floatingCon = NULL;
}
}
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp
index db70dfdbac..2411f5431e 100644
--- a/tizen/src/ui/menu/contextmenu.cpp
+++ b/tizen/src/ui/menu/contextmenu.cpp
@@ -273,7 +273,7 @@ void ContextMenu::slotController(int index)
qDebug("controller : %d", index);
MainWindow *win = ((MainWindow *)this->parent());
- win->openController(index, Qt::AlignRight | Qt::AlignCenter);
+ win->openController(index, win->getUIState()->conState.recentlyDockPos);
}
void ContextMenu::slotShell()
diff --git a/tizen/src/ui/uistate.cpp b/tizen/src/ui/uistate.cpp
index af8c79d5dd..dff66fdad9 100644
--- a/tizen/src/ui/uistate.cpp
+++ b/tizen/src/ui/uistate.cpp
@@ -35,6 +35,7 @@ UIState::UIState() :
conState.conFormIndex = 0;
conState.dockingCon = NULL;
conState.floatingCon = NULL;
+ conState.recentlyDockPos = -1;
conState.recentlyFloatPos = QPoint(-1, -1);
}
diff --git a/tizen/src/ui/uistate.h b/tizen/src/ui/uistate.h
index 562af2f383..bbd99c56be 100644
--- a/tizen/src/ui/uistate.h
+++ b/tizen/src/ui/uistate.h
@@ -45,6 +45,7 @@ public:
int conFormIndex;
DockingController *dockingCon;
FloatingController *floatingCon;
+ int recentlyDockPos;
QPoint recentlyFloatPos;
};