UI: Fix parent window geometry loading

The parent window adjusted according to child object polices and hint 
sizes. Thus, it is possible to disable all docking panes to restore 
true parent geometry first, the docking geometry and settings will be 
restored later in OBSBasic::OBSInit().
This commit is contained in:
SuslikV 2017-08-12 19:45:25 +02:00 committed by GitHub
parent d3c163b775
commit a21da59741

View file

@ -151,23 +151,6 @@ OBSBasic::OBSBasic(QWidget *parent)
ui->sources->setItemDelegate(new VisibilityItemDelegate(ui->sources));
const char *geometry = config_get_string(App()->GlobalConfig(),
"BasicWindow", "geometry");
if (geometry != NULL) {
QByteArray byteArray = QByteArray::fromBase64(
QByteArray(geometry));
restoreGeometry(byteArray);
QRect windowGeometry = normalGeometry();
if (!WindowPositionValid(windowGeometry)) {
QRect rect = App()->desktop()->geometry();
setGeometry(QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
size(), rect));
}
}
char styleSheetPath[512];
int ret = GetProfilePath(styleSheetPath, sizeof(styleSheetPath),
"stylesheet.qss");
@ -286,6 +269,31 @@ OBSBasic::OBSBasic(QWidget *parent)
assignDockToggle(ui->mixerDock, ui->toggleMixer);
assignDockToggle(ui->transitionsDock, ui->toggleTransitions);
assignDockToggle(ui->controlsDock, ui->toggleControls);
//hide all docking panes
ui->toggleScenes->setChecked(false);
ui->toggleSources->setChecked(false);
ui->toggleMixer->setChecked(false);
ui->toggleTransitions->setChecked(false);
ui->toggleControls->setChecked(false);
//restore parent window geometry
const char *geometry = config_get_string(App()->GlobalConfig(),
"BasicWindow", "geometry");
if (geometry != NULL) {
QByteArray byteArray = QByteArray::fromBase64(
QByteArray(geometry));
restoreGeometry(byteArray);
QRect windowGeometry = normalGeometry();
if (!WindowPositionValid(windowGeometry)) {
QRect rect = App()->desktop()->geometry();
setGeometry(QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
size(), rect));
}
}
}
static void SaveAudioDevice(const char *name, int channel, obs_data_t *parent,