From 6a4f918a3fbe5b71121ca684dded8575d068a044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Sat, 4 Apr 2015 16:49:16 +0300 Subject: [PATCH] UI|Client: Added "Pixel Density" slider to the Renderer Settings Now that there is room in the Renderer Settings dialog, the global pixel density setting can be placed there. It is now available on all platforms regardless of whether a HiDPI display is in use. --- .../src/ui/dialogs/renderersettingsdialog.cpp | 17 ++++++++------ .../src/ui/dialogs/videosettingsdialog.cpp | 23 ------------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/doomsday/client/src/ui/dialogs/renderersettingsdialog.cpp b/doomsday/client/src/ui/dialogs/renderersettingsdialog.cpp index 12095ca67d..c78d98e801 100644 --- a/doomsday/client/src/ui/dialogs/renderersettingsdialog.cpp +++ b/doomsday/client/src/ui/dialogs/renderersettingsdialog.cpp @@ -31,6 +31,7 @@ #include #include #include +#include using namespace de; using namespace ui; @@ -133,10 +134,6 @@ RendererSettingsDialog::RendererSettingsDialog(String const &name) appearLabel->setName("appearance-label"); // for lookup from tutorial LabelWidget *fovLabel = LabelWidget::newWithText(tr("Field of View:"), &area()); - /*LabelWidget *capLabel = LabelWidget::newWithText(_E(D) + tr("Behavior"), &area()); - capLabel->setFont("separator.label"); - capLabel->margins().setTop("gap");*/ - // Layout. GridLayout layout(area().contentRule().left(), area().contentRule().top()); layout.setGridSize(2, 0); @@ -148,9 +145,15 @@ RendererSettingsDialog::RendererSettingsDialog(String const &name) layout << *fovLabel << *d->fov; - // Label for the tech caps. - //layout.setCellAlignment(Vector2i(0, 2), ui::AlignLeft); - //layout.append(*capLabel, 2); + // Slider for modifying the global pixel density factor. This allows slower + // GPUs to compensate for large resolutions. + { + auto *pd = new VariableSliderWidget(App::config("render.pixelDensity"), Ranged(0, 1), .05); + pd->setPrecision(2); + area().add(pd); + + layout << *LabelWidget::newWithText(tr("Pixel Density:"), &area()) << *pd; + } area().setContentSize(layout.width(), layout.height()); diff --git a/doomsday/client/src/ui/dialogs/videosettingsdialog.cpp b/doomsday/client/src/ui/dialogs/videosettingsdialog.cpp index 1e4e9aa45f..e91da21bf0 100644 --- a/doomsday/client/src/ui/dialogs/videosettingsdialog.cpp +++ b/doomsday/client/src/ui/dialogs/videosettingsdialog.cpp @@ -254,29 +254,6 @@ VideoSettingsDialog::VideoSettingsDialog(String const &name) modeLayout.setGridSize(2, 0); modeLayout.setColumnAlignment(0, ui::AlignRight); -#ifdef DENG2_QT_5_0_OR_NEWER - // With HiDPI, allow specifying a global pixel density factor. This allows slower - // GPUs to generally compensate for the large resolution. This is always shown on - // OS X because there the native video mode is not configurable. -# ifndef MACOSX - if(ClientApp::app().devicePixelRatio() > 1) -# endif - { - // Overall pixel density adjustment replaces the distinct display modes. - auto *pd = new VariableSliderWidget(App::config("render.pixelDensity"), Ranged(0, 1), .05); - pd->setPrecision(2); - area().add(pd); - - auto *note = LabelWidget::newWithText(tr("Only affects the game view."), &area()); - note->margins().setTop(""); - note->setTextColor("label.altaccent"); - note->setFont("separator.annotation"); - - modeLayout << *LabelWidget::newWithText(tr("Pixel Density:"), &area()) << *pd - << Const(0) << *note; - } -#endif - if(gotDisplayMode) { modeLayout << *LabelWidget::newWithText(tr("Resolution:"), &area());