提交 d7d5e55d 编写于 作者: J jp9000

UI: Add splitter to main window

Allows adjusting the size of the bottom section of the main window
上级 9cded466
此差异已折叠。
......@@ -925,6 +925,25 @@ void OBSBasic::OBSInit()
connect(ui->preview, &OBSQTDisplay::DisplayCreated, addDisplay);
show();
QList<int> defSizes;
int top = config_get_int(App()->GlobalConfig(), "BasicWindow",
"splitterTop");
int bottom = config_get_int(App()->GlobalConfig(), "BasicWindow",
"splitterBottom");
if (!top || !bottom) {
defSizes = ui->mainSplitter->sizes();
int total = defSizes[0] + defSizes[1];
defSizes[0] = total * 75 / 100;
defSizes[1] = total - defSizes[0];
} else {
defSizes.push_back(top);
defSizes.push_back(bottom);
}
ui->mainSplitter->setSizes(defSizes);
}
void OBSBasic::InitHotkeys()
......@@ -1153,6 +1172,7 @@ OBSBasic::~OBSBasic()
LIBOBS_API_VER);
QRect lastGeom = normalGeometry();
QList<int> splitterSizes = ui->mainSplitter->sizes();
config_set_int(App()->GlobalConfig(), "BasicWindow", "cx",
lastGeom.width());
......@@ -1162,6 +1182,10 @@ OBSBasic::~OBSBasic()
lastGeom.x());
config_set_int(App()->GlobalConfig(), "BasicWindow", "posy",
lastGeom.y());
config_set_int(App()->GlobalConfig(), "BasicWindow", "splitterTop",
splitterSizes[0]);
config_set_int(App()->GlobalConfig(), "BasicWindow", "splitterBottom",
splitterSizes[1]);
config_set_bool(App()->GlobalConfig(), "BasicWindow", "PreviewEnabled",
previewEnabled);
config_save_safe(App()->GlobalConfig(), "tmp", nullptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册