Changes to accommodate for high DPI

Not sure how this will work on Linux or macOS.
This commit is contained in:
Pengfei
2021-06-27 18:46:08 +08:00
parent 412aeaa0d4
commit 3db1c43fd6
8 changed files with 25 additions and 21 deletions
+5
View File
@@ -6,6 +6,7 @@
#include <cmath>
#include <unordered_map>
#include <QCheckBox>
#include <QDesktopWidget>
#include <QFileDialog>
#include <QFutureWatcher>
#include <QMenu>
@@ -94,6 +95,10 @@ ImportDialog::ImportDialog(QWidget* parent, const Core::Config& config)
qRegisterMetaType<Core::ContentSpecifier>();
ui->setupUi(this);
const double scale = qApp->desktop()->logicalDpiX() / 96.0;
resize(static_cast<int>(width() * scale), static_cast<int>(height() * scale));
if (!importer.IsGood()) {
QMessageBox::critical(
this, tr("Importer Error"),
+2 -2
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>400</height>
<width>560</width>
<height>320</height>
</rect>
</property>
<property name="windowTitle">
+4
View File
@@ -5,6 +5,7 @@
#include <regex>
#include <string>
#include <QApplication>
#include <QDesktopWidget>
#include <QFileDialog>
#include <QMessageBox>
#include <QStorageInfo>
@@ -38,6 +39,9 @@ bool IsConfigGood(const Core::Config& config) {
MainDialog::MainDialog(QWidget* parent) : QDialog(parent), ui(std::make_unique<Ui::MainDialog>()) {
ui->setupUi(this);
const double scale = qApp->desktop()->logicalDpiX() / 96.0;
resize(static_cast<int>(width() * scale), static_cast<int>(height() * scale));
ui->buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::StandardButton::Reset)->setText(tr("Refresh"));
+2 -15
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>320</height>
<width>640</width>
<height>256</height>
</rect>
</property>
<property name="windowTitle">
@@ -79,19 +79,6 @@
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
+4
View File
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <QDesktopWidget>
#include <QFileDialog>
#include <QMessageBox>
#include "frontend/select_files_dialog.h"
@@ -13,6 +14,9 @@ SelectFilesDialog::SelectFilesDialog(QWidget* parent, bool source_is_dir_, bool
ui->setupUi(this);
const double scale = qApp->desktop()->logicalDpiX() / 96.0;
resize(static_cast<int>(width() * scale), static_cast<int>(height() * scale));
connect(ui->buttonBox, &QDialogButtonBox::accepted, [this] {
if (ui->source->text().isEmpty() || ui->destination->text().isEmpty()) {
QMessageBox::warning(this, tr("Warning"), tr("Please fill in all the fields."));
+2 -2
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>120</height>
<width>480</width>
<height>96</height>
</rect>
</property>
<property name="windowTitle">
+4
View File
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <QDesktopWidget>
#include <QFileDialog>
#include <QFutureWatcher>
#include <QMessageBox>
@@ -21,6 +22,9 @@ UtilitiesDialog::UtilitiesDialog(QWidget* parent)
ui->setupUi(this);
const double scale = qApp->desktop()->logicalDpiX() / 96.0;
resize(static_cast<int>(width() * scale), static_cast<int>(height() * scale));
connect(ui->useSdDecryption, &QCheckBox::clicked, [this] {
const bool checked = ui->useSdDecryption->isChecked();
+2 -2
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>480</height>
<width>640</width>
<height>384</height>
</rect>
</property>
<property name="windowTitle">