mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Qt 5.14 hi-res adjustments, as HI-DPI screen handling has changed
* see // https://lists.qt-project.org/pipermail/development/2019-September/037434.html * qss adjustemnts * larger default sizes for core/launcher/client for 1920x1080 screens
This commit is contained in:
committed by
Mat Sutcliffe
parent
2a3fd0e94c
commit
8eaa4f7f15
File diff suppressed because it is too large
Load Diff
@@ -29,19 +29,19 @@ namespace BlackGui
|
||||
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())
|
||||
);
|
||||
const QString tt = 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());
|
||||
|
||||
this->setToolTip(tt);
|
||||
}
|
||||
|
||||
CScaleScreenFactor::~CScaleScreenFactor()
|
||||
@@ -53,9 +53,10 @@ namespace BlackGui
|
||||
ui->hs_Factor->setMaximum(max);
|
||||
ui->le_Factor->setValidator(new QIntValidator(min, max, ui->le_Factor));
|
||||
|
||||
ui->le_Factor->setToolTip(QStringLiteral("%1-%2").arg(min).arg(max));
|
||||
ui->le_Factor->setPlaceholderText(QStringLiteral("%1-%2").arg(min).arg(max));
|
||||
ui->hs_Factor->setToolTip(QStringLiteral("%1-%2").arg(min, max));
|
||||
const QString tt = QStringLiteral("%1-%2").arg(min).arg(max);
|
||||
ui->le_Factor->setToolTip(tt);
|
||||
ui->le_Factor->setPlaceholderText(tt);
|
||||
ui->hs_Factor->setToolTip(tt);
|
||||
|
||||
const int v = (min + max) / 2;
|
||||
ui->hs_Factor->setValue(v);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>220</width>
|
||||
<height>225</height>
|
||||
<width>298</width>
|
||||
<height>269</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -105,6 +105,12 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>0-100%</string>
|
||||
</property>
|
||||
@@ -179,7 +185,7 @@
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
||||
@@ -328,9 +328,11 @@ namespace BlackGui
|
||||
|
||||
void CGuiApplication::highDpiScreenSupport(double scaleFactor)
|
||||
{
|
||||
// https://lists.qt-project.org/pipermail/development/2019-September/037434.html
|
||||
if (scaleFactor < 0)
|
||||
{
|
||||
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||
// qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1"); // until 5.14
|
||||
qputenv("QT_ENABLE_HIGHDPI_SCALING", "1");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -374,7 +374,7 @@ QGroupBox::title {
|
||||
subcontrol-origin: margin;
|
||||
subcontrol-position: middle left; /* position at the top center */
|
||||
padding: 0px 2em 0px 2em;
|
||||
min-width: 15em;
|
||||
min-width: 10em;
|
||||
background-color: darkblue;
|
||||
border: 1px solid green;
|
||||
border-radius: 5px;
|
||||
|
||||
Reference in New Issue
Block a user