From f9595938d0115ddadcf2c1be4ec0eee4e530a613 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 28 Apr 2017 18:12:53 -0700 Subject: [PATCH] UI: Add 1920x1080/1280x720 to the settings base res list Adds 1920x1080 and 1280x720 to the drop-down list of "default" base/canvas resolutions rather than just the user's monitor resolutions, in case the user wants to set the canvas to 1920x1080 or 1280x720 without having to manually type it in. Added as a minor convenience. --- UI/window-basic-settings.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 8c27939ce..e9ed0c6ef 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -1217,12 +1217,21 @@ void OBSBasicSettings::LoadResolutionLists() ui->baseResolution->clear(); + auto addRes = [this] (int cx, int cy) + { + QString res = ResString(cx, cy).c_str(); + if (ui->baseResolution->findText(res) == -1) + ui->baseResolution->addItem(res); + }; + for (QScreen* screen: QGuiApplication::screens()) { QSize as = screen->size(); - string res = ResString(as.width(), as.height()); - ui->baseResolution->addItem(res.c_str()); + addRes(as.width(), as.height()); } + addRes(1920, 1080); + addRes(1280, 720); + string outputResString = ResString(out_cx, out_cy); ui->baseResolution->lineEdit()->setText(ResString(cx, cy).c_str());