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:
Klaus Basan
2020-01-03 19:12:29 +01:00
committed by Mat Sutcliffe
parent 2a3fd0e94c
commit 8eaa4f7f15
9 changed files with 940 additions and 938 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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);

View File

@@ -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>

View File

@@ -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
{

View File

@@ -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;

View File

@@ -7,13 +7,13 @@
<x>0</x>
<y>0</y>
<width>700</width>
<height>625</height>
<height>710</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>650</width>
<height>625</height>
<height>630</height>
</size>
</property>
<property name="windowTitle">
@@ -600,8 +600,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>646</width>
<height>344</height>
<width>634</width>
<height>353</height>
</rect>
</property>
<layout class="QVBoxLayout" name="vl_LogMessagesScrollArea">
@@ -658,18 +658,18 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>BlackGui::Components::CSettingsSwiftPlugin</class>
<extends>QFrame</extends>
<header>blackgui/components/settingsswiftplugin.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CLogComponent</class>
<extends>QFrame</extends>
<header>blackgui/components/logcomponent.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CSettingsSwiftPlugin</class>
<extends>QFrame</extends>
<header>blackgui/components/settingsswiftplugin.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Editors::CSituationForm</class>
<extends>QFrame</extends>

View File

@@ -6,13 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<width>625</width>
<height>550</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<width>550</width>
<height>550</height>
</size>
</property>
@@ -231,8 +231,8 @@ QTextEdit {
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>19</height>
<width>625</width>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@@ -270,7 +270,7 @@ QTextEdit {
</widget>
<action name="menu_SettingsDialog">
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/pastel/icons/pastel/16/wrench-orange.png</normaloff>:/pastel/icons/pastel/16/wrench-orange.png</iconset>
</property>
<property name="text">
@@ -288,18 +288,18 @@ QTextEdit {
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>BlackGui::Components::CCommandInput</class>
<extends>QLineEdit</extends>
<header>blackgui/components/commandinput.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CDBusServerAddressSelector</class>
<extends>QFrame</extends>
<header>blackgui/components/dbusserveraddressselector.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CCommandInput</class>
<extends>QLineEdit</extends>
<header>blackgui/components/commandinput.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CInfoBarStatusComponent</class>
<extends>QWidget</extends>
@@ -326,6 +326,8 @@ QTextEdit {
<tabstop>pb_Restart</tabstop>
<tabstop>pb_DisconnectNetwork</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../blackmisc/blackmisc.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>375</width>
<height>600</height>
<width>450</width>
<height>750</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>550</height>
<width>375</width>
<height>600</height>
</size>
</property>
<property name="windowTitle">
@@ -202,8 +202,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>375</width>
<height>19</height>
<width>450</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy">
@@ -506,7 +506,7 @@
</action>
<action name="menu_AutoPublish">
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/diagona/icons/diagona/icons/paper-plane--plus.png</normaloff>:/diagona/icons/diagona/icons/paper-plane--plus.png</iconset>
</property>
<property name="text">
@@ -574,7 +574,9 @@
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../blackmisc/blackmisc.qrc"/>
</resources>
<connections/>
<slots>
<slot>setMainPage()</slot>

View File

@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>675</height>
<width>475</width>
<height>750</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>675</height>
<width>425</width>
<height>700</height>
</size>
</property>
<property name="windowTitle">
@@ -88,7 +88,7 @@
<item>
<widget class="QToolBox" name="tb_Launcher">
<property name="currentIndex">
<number>4</number>
<number>2</number>
</property>
<property name="tabSpacing">
<number>6</number>
@@ -98,8 +98,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>334</height>
<width>467</width>
<height>356</height>
</rect>
</property>
<attribute name="label">
@@ -109,7 +109,7 @@
<item>
<widget class="QTabWidget" name="tw_LatestNewsAbout">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tb_LatestNews">
<attribute name="title">
@@ -153,8 +153,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>334</height>
<width>467</width>
<height>356</height>
</rect>
</property>
<attribute name="label">
@@ -214,18 +214,10 @@
</layout>
</widget>
<widget class="QWidget" name="pg_CoreMode">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>334</height>
</rect>
</property>
<attribute name="label">
<string>&amp;Core mode</string>
</attribute>
<layout class="QGridLayout" name="gl_CoreMode" columnstretch="0,0">
<layout class="QGridLayout" name="gl_CoreMode" columnstretch="1,1">
<property name="leftMargin">
<number>4</number>
</property>
@@ -241,28 +233,48 @@
<property name="spacing">
<number>4</number>
</property>
<item row="1" column="1" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_SwiftCoreIcon">
<item row="0" column="0" alignment="Qt::AlignHCenter">
<widget class="QRadioButton" name="rb_SwiftStandalone">
<property name="text">
<string/>
<string>standalone</string>
</property>
<property name="pixmap">
<pixmap resource="swiftlauncher.qrc">:/launcher/icons/swiftGUIandCore115x85.png</pixmap>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">bg_CoreMode</string>
</attribute>
</widget>
</item>
<item row="0" column="1" alignment="Qt::AlignHCenter">
<widget class="QRadioButton" name="rb_SwiftDistributed">
<property name="text">
<string>GUI and core (distributed)</string>
</property>
<attribute name="buttonGroup">
<string notr="true">bg_CoreMode</string>
</attribute>
</widget>
</item>
<item row="9" column="0" colspan="2">
<spacer name="vs_CoreButtomSpace">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QGroupBox" name="gb_AudioDistributed">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Audio distributed</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="vl_AudioDistributed">
<item>
<widget class="QCheckBox" name="cb_DisableCoreAudio">
<property name="text">
@@ -280,6 +292,22 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<widget class="QGroupBox" name="gb_AudioSa">
<property name="title">
<string>Standalone audio</string>
</property>
<layout class="QVBoxLayout" name="vl_AudioStandalone">
<item>
<widget class="QCheckBox" name="cb_DisableSaAfv">
<property name="text">
<string>disable audio (AFV)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_SwiftStandaloneIcon">
<property name="text">
@@ -290,50 +318,18 @@
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<spacer name="vs_CoreButtomSpace">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" alignment="Qt::AlignHCenter">
<widget class="QRadioButton" name="rb_SwiftDistributed">
<item row="1" column="1" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_SwiftCoreIcon">
<property name="text">
<string>GUI and core (distributed)</string>
<string/>
</property>
<property name="pixmap">
<pixmap resource="swiftlauncher.qrc">:/launcher/icons/swiftGUIandCore115x85.png</pixmap>
</property>
<attribute name="buttonGroup">
<string notr="true">bg_CoreMode</string>
</attribute>
</widget>
</item>
<item row="0" column="0" alignment="Qt::AlignHCenter">
<widget class="QRadioButton" name="rb_SwiftStandalone">
<property name="text">
<string>standalone</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">bg_CoreMode</string>
</attribute>
</widget>
</item>
<item row="3" column="0" colspan="2" alignment="Qt::AlignRight">
<item row="2" column="1">
<widget class="QGroupBox" name="gb_DBusServer">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>DBus (core to GUI)</string>
</property>
@@ -362,7 +358,7 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
@@ -372,22 +368,6 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<widget class="QGroupBox" name="gb_AudioSa">
<property name="title">
<string>Audio</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="cb_DisableSaAfv">
<property name="text">
<string>disable audio (AFV)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="pg_Updates">
@@ -395,8 +375,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>334</height>
<width>467</width>
<height>356</height>
</rect>
</property>
<attribute name="label">
@@ -477,8 +457,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>151</height>
<width>451</width>
<height>160</height>
</rect>
</property>
<layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea">
@@ -528,8 +508,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>334</height>
<width>467</width>
<height>356</height>
</rect>
</property>
<attribute name="label">
@@ -623,13 +603,21 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>150</height>
<height>165</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="pg_Start">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>467</width>
<height>134</height>
</rect>
</property>
<attribute name="label">
<string>Start application</string>
</attribute>
@@ -658,7 +646,7 @@
<string>swift GUI</string>
</property>
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/own/icons/own/swift3D/sw3DBlue-256.png</normaloff>:/own/icons/own/swift3D/sw3DBlue-256.png</iconset>
</property>
<property name="iconSize">
@@ -678,7 +666,7 @@
<string>swift core</string>
</property>
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/own/icons/own/swift3D/sw3DOrange-256.png</normaloff>:/own/icons/own/swift3D/sw3DOrange-256.png</iconset>
</property>
<property name="iconSize">
@@ -698,7 +686,7 @@
<string>mapping tool</string>
</property>
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/own/icons/own/swift3D/sw3DGreen-256.png</normaloff>:/own/icons/own/swift3D/sw3DGreen-256.png</iconset>
</property>
<property name="iconSize">
@@ -715,7 +703,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/misc/icons/misc/toolWizard128.png</normaloff>:/misc/icons/misc/toolWizard128.png</iconset>
</property>
<property name="iconSize">
@@ -735,7 +723,7 @@
<string>goto swift database</string>
</property>
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/own/icons/own/swift3D/sw3DGreen-256.png</normaloff>:/own/icons/own/swift3D/sw3DGreen-256.png</iconset>
</property>
<property name="iconSize">
@@ -837,7 +825,7 @@
<string>back to main</string>
</property>
<property name="icon">
<iconset>
<iconset resource="../blackmisc/blackmisc.qrc">
<normaloff>:/diagona/icons/diagona/icons/arrow-180.png</normaloff>:/diagona/icons/diagona/icons/arrow-180.png</iconset>
</property>
<property name="shortcut">
@@ -923,6 +911,7 @@
<tabstop>rb_WindowFrameless</tabstop>
</tabstops>
<resources>
<include location="../blackmisc/blackmisc.qrc"/>
<include location="swiftlauncher.qrc"/>
</resources>
<connections/>