mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 22:15:34 +08:00
Info about scaling and screen resolution
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
|
||||
#include "aboutdialog.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -27,10 +29,13 @@ namespace BlackGui
|
||||
|
||||
void CAboutDialog::init()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
ui->lbl_VersionValue->setText(sGui->getApplicationNameVersionDetailed());
|
||||
ui->pte_Info->setPlainText(sGui->getInfoString("\n"));
|
||||
ui->pte_Info->appendPlainText("\nSetup follows:\n----");
|
||||
ui->pte_Info->appendPlainText(sGui->getGlobalSetup().convertToQString("\n", true));
|
||||
ui->pte_Info->appendPlainText("\nScreen info follows:\n----");
|
||||
ui->pte_Info->appendPlainText(CGuiUtility::screenInformation("\n"));
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BlackGui
|
||||
explicit CScaleScreenFactor(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CScaleScreenFactor();
|
||||
virtual ~CScaleScreenFactor() override;
|
||||
|
||||
//! Minimum/maximum values
|
||||
void setMinMax(int min, int max);
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
<property name="windowTitle">
|
||||
<string>Scale screen factor</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Scaling works only on High DPI screens</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_ScaleScreenFactor" stretch="0,1,5">
|
||||
<property name="leftMargin">
|
||||
<number>1</number>
|
||||
|
||||
Reference in New Issue
Block a user