Merge pull request #1005 from SuslikV/patch-1

UI: Fix parent window geometry loading
master
Jim 2017-09-15 10:30:39 -07:00 committed by GitHub
commit 1e1808dbd9
1 changed files with 25 additions and 17 deletions

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,