Skip to content

Commit

Permalink
Scaling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
uglide committed Oct 16, 2019
1 parent 9aee4b2 commit 83abef8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
23 changes: 19 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <QDir>
#include <QFileInfo>
#include <QGuiApplication>
#include <QScreen>

#ifdef CRASHPAD_INTEGRATION
#include "crashpad/handler.h"
Expand All @@ -15,10 +16,7 @@
#define RESTART_CODE 1000

int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
{
int returnCode = 0;

#ifdef CRASHPAD_INTEGRATION
Expand All @@ -27,10 +25,27 @@ int main(int argc, char *argv[])
startCrashpad(appDir);
#endif

bool scalingSetup = false;

do
{
Application a(argc, argv);

#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
if (!scalingSetup) {
if (QGuiApplication::primaryScreen() && QGuiApplication::primaryScreen()->availableSize().width() <= 1920
&& QGuiApplication::primaryScreen()->devicePixelRatio() > 1
&& !QGuiApplication::testAttribute(Qt::AA_DisableHighDpiScaling)) {
QGuiApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
} else {
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
}
returnCode = RESTART_CODE;
scalingSetup = true;
continue;
}
#endif

#ifdef LINUX_SIGNALS
UnixSignalWatcher sigwatch;
sigwatch.watchForSignal(SIGINT);
Expand Down
4 changes: 3 additions & 1 deletion src/qml/ConnectionSettignsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ Dialog {
width: settingsTabs.width - 20
height: settingsTabs.height

horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff

ColumnLayout {
width: mainSettingsScrollView.width - 20
width: mainSettingsScrollView.width - 25
height: children.height

GridLayout {
Expand Down
3 changes: 2 additions & 1 deletion src/qml/GlobalSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ Dialog {
id: globalSettingsScrollView
width: parent.width
height: parent.height
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff

ColumnLayout {
id: innerLayout
width: globalSettingsScrollView.width - 20
width: globalSettingsScrollView.width - 25
height: (dialogRoot.height - 50 > implicitHeight) ? dialogRoot.height - 50 : implicitHeight

SettingsGroupTitle {
Expand Down

0 comments on commit 83abef8

Please sign in to comment.