mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Info about scaling and screen resolution
This commit is contained in:
committed by
Mat Sutcliffe
parent
c9846f45ee
commit
d84ec65271
@@ -8,6 +8,10 @@
|
||||
|
||||
#include "scalescreenfactor.h"
|
||||
#include "ui_scalescreenfactor.h"
|
||||
#include "guiutility.h"
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QScreen>
|
||||
#include <QIntValidator>
|
||||
|
||||
namespace BlackGui
|
||||
@@ -21,8 +25,23 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
this->setMinMax(50, 150);
|
||||
|
||||
connect(ui->hs_Factor, &QSlider::valueChanged, this, &CScaleScreenFactor::onSliderChanged);
|
||||
connect(ui->hs_Factor, &QSlider::valueChanged, this, &CScaleScreenFactor::onSliderChanged);
|
||||
connect(ui->le_Factor, &QLineEdit::editingFinished, this, &CScaleScreenFactor::onEditFinished);
|
||||
|
||||
const QDesktopWidget *w = qApp->desktop();
|
||||
this->setToolTip(
|
||||
QStringLiteral(
|
||||
"Scaling only works on High DPI screens\n"
|
||||
"Width/height: %1/%2 Ratio: %3\n"
|
||||
"Logical DPI x/y: %4/%5\n"
|
||||
"Physical DPI x/y: %6/%7\n"
|
||||
"width/height MM: %8/%9"
|
||||
).
|
||||
arg(w->width()).arg(w->height()).arg(QString::number(CGuiUtility::mainApplicationWidgetPixelRatio(), 'f', 2)).
|
||||
arg(w->logicalDpiX()).arg(w->logicalDpiY()).
|
||||
arg(w->physicalDpiX()).arg(w->physicalDpiY()).
|
||||
arg(w->widthMM()).arg(w->heightMM())
|
||||
);
|
||||
}
|
||||
|
||||
CScaleScreenFactor::~CScaleScreenFactor()
|
||||
|
||||
Reference in New Issue
Block a user