Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Fix fractional scaling for dialog sizes #2189

Merged
merged 2 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/qt/aboutdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "aboutdialog.h"
#include "qt/decoration.h"
#include "ui_aboutdialog.h"
#include "clientmodel.h"

Expand All @@ -8,6 +9,8 @@ AboutDialog::AboutDialog(QWidget *parent) :
{
ui->setupUi(this);
ui->copyrightLabel->setText("Copyright 2009-2021 The Bitcoin/Peercoin/Black-Coin/Gridcoin developers");

resize(GRC::ScaleSize(this, width(), height()));
}

void AboutDialog::setModel(ClientModel *model)
Expand Down
5 changes: 4 additions & 1 deletion src/qt/addressbookpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "editaddressdialog.h"
#include "csvmodelwriter.h"
#include "guiutil.h"
#include "qt/decoration.h"

#include <QSortFilterProxyModel>
#include <QClipboard>
Expand All @@ -17,7 +18,7 @@
#include "qrcodedialog.h"
#endif

AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget* parent)
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget* parent)
: QDialog(parent)
, ui(new Ui::AddressBookPage)
, model(nullptr)
Expand All @@ -27,6 +28,8 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget* parent)
{
ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));

#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
ui->newAddressButton->setIcon(QIcon());
ui->copyToClipboardButton->setIcon(QIcon());
Expand Down
6 changes: 5 additions & 1 deletion src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "ui_askpassphrasedialog.h"

#include "guiconstants.h"
#include "qt/decoration.h"
#include "walletmodel.h"

#include <QMessageBox>
Expand All @@ -10,14 +11,17 @@

extern bool fWalletUnlockStakingOnly;

AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget* parent)
AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget* parent)
: QDialog(parent)
, ui(new Ui::AskPassphraseDialog)
, mode(mode)
, model(nullptr)
, fCapsLock(false)
{
ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));

ui->oldPassphraseEdit->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->newPassphraseEdit->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->repeatNewPassphraseEdit->setMaxLength(MAX_PASSPHRASE_SIZE);
Expand Down
3 changes: 3 additions & 0 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "validation.h"
#include "wallet/coincontrol.h"
#include "consolidateunspentdialog.h"
#include "qt/decoration.h"

#include <QApplication>
#include <QCheckBox>
Expand Down Expand Up @@ -38,6 +39,8 @@ CoinControlDialog::CoinControlDialog(QWidget* parent, CCoinControl* coinControl,

ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));

// context menu actions
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
Expand Down
3 changes: 3 additions & 0 deletions src/qt/consolidateunspentdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "consolidateunspentdialog.h"
#include "qt/decoration.h"
#include "ui_consolidateunspentdialog.h"

#include "util.h"
Expand All @@ -12,6 +13,8 @@ ConsolidateUnspentDialog::ConsolidateUnspentDialog(QWidget *parent, size_t input
{
ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));

ui->addressTableWidget->setSelectionMode(QAbstractItemView::SingleSelection);

// ok button
Expand Down
3 changes: 3 additions & 0 deletions src/qt/consolidateunspentwizard.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "coincontroldialog.h"
#include "consolidateunspentwizard.h"
#include "consolidateunspentdialog.h"
#include "qt/decoration.h"
#include "ui_consolidateunspentwizard.h"

#include "util.h"
Expand All @@ -15,6 +16,8 @@ ConsolidateUnspentWizard::ConsolidateUnspentWizard(QWidget *parent,
payAmounts(payAmounts)
{
ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));
this->setStartId(SelectInputsPage);

ui->selectInputsPage->setCoinControl(coinControl);
Expand Down
2 changes: 2 additions & 0 deletions src/qt/diagnosticsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ DiagnosticsDialog::DiagnosticsDialog(QWidget *parent, ResearcherModel* researche
{
ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));

GRC::ScaleFontPointSize(ui->diagnosticsLabel, 14);
GRC::ScaleFontPointSize(ui->overallResultLabel, 12);
GRC::ScaleFontPointSize(ui->overallResultResultLabel, 12);
Expand Down
3 changes: 3 additions & 0 deletions src/qt/editaddressdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "ui_editaddressdialog.h"
#include "addresstablemodel.h"
#include "guiutil.h"
#include "qt/decoration.h"

#include <QDataWidgetMapper>
#include <QMessageBox>
Expand All @@ -15,6 +16,8 @@ EditAddressDialog::EditAddressDialog(Mode mode, QWidget* parent)
{
ui->setupUi(this);

resize(GRC::ScaleSize(this, width(), height()));

GUIUtil::setupAddressWidget(ui->addressEdit, this);

switch(mode)
Expand Down
4 changes: 2 additions & 2 deletions src/qt/forms/askpassphrasedialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<height>216</height>
<width>600</width>
<height>215</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down
4 changes: 2 additions & 2 deletions src/qt/forms/coincontroldialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1172</width>
<height>547</height>
<width>960</width>
<height>550</height>
</rect>
</property>
<property name="windowTitle">
Expand Down
4 changes: 2 additions & 2 deletions src/qt/forms/consolidateunspentdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>819</width>
<height>513</height>
<width>820</width>
<height>515</height>
</rect>
</property>
<property name="windowTitle">
Expand Down
20 changes: 19 additions & 1 deletion src/qt/forms/consolidateunspentwizard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>933</width>
<width>930</width>
<height>700</height>
</rect>
</property>
Expand All @@ -29,16 +29,34 @@
<enum>QWizard::ClassicStyle</enum>
</property>
<widget class="ConsolidateUnspentWizardSelectInputsPage" name="selectInputsPage">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="pageId">
<string notr="true">0</string>
</attribute>
</widget>
<widget class="ConsolidateUnspentWizardSelectDestinationPage" name="selectDestinationPage">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="pageId">
<string notr="true">1</string>
</attribute>
</widget>
<widget class="ConsolidateUnspentWizardSendPage" name="sendPage">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="pageId">
<string notr="true">2</string>
</attribute>
Expand Down
Loading