#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"
qDebug("previous scale value is %d", scale);
if (scale <= 0) {
- scale = 50;
+ scale = 50; /* default scale */
}
uiInfo->uiState.mainFormScale = scale;
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();
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();
} else {
getUIState()->conState.dockingCon =
new DockingController(conForm, action, dockPos, this);
+ getUIState()->conState.recentlyDockPos = dockPos;
}
/* update layout */
if (getDockingCon() != NULL) {
qDebug("close docking controller");
+ getUIState()->conState.recentlyDockPos = -1;
winLayout->removeWidget(getDockingCon());
-
getDockingCon()->close();
+
getUIState()->conState.dockingCon = NULL;
adjustSize();
if (getFloatingCon() != NULL) {
qDebug("close floating controller");
+ getUIState()->conState.recentlyFloatPos = getFloatingCon()->pos();
getFloatingCon()->close();
+
getUIState()->conState.floatingCon = NULL;
}
}
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()
conState.conFormIndex = 0;
conState.dockingCon = NULL;
conState.floatingCon = NULL;
+ conState.recentlyDockPos = -1;
conState.recentlyFloatPos = QPoint(-1, -1);
}