Skip to content

Commit

Permalink
UI|Client: Added "Pixel Density" slider to the Renderer Settings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skyjake committed Apr 4, 2015
1 parent 15b91f6 commit 6a4f918
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
17 changes: 10 additions & 7 deletions doomsday/client/src/ui/dialogs/renderersettingsdialog.cpp
Expand Up @@ -31,6 +31,7 @@
#include <de/SignalAction>
#include <de/DialogContentStylist>
#include <de/InputDialog>
#include <de/VariableSliderWidget>

using namespace de;
using namespace ui;
Expand Down Expand Up @@ -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);
Expand All @@ -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());

Expand Down
23 changes: 0 additions & 23 deletions doomsday/client/src/ui/dialogs/videosettingsdialog.cpp
Expand Up @@ -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());
Expand Down

0 comments on commit 6a4f918

Please sign in to comment.