Skip to content

Commit

Permalink
Add some support of hi-res displays
Browse files Browse the repository at this point in the history
  • Loading branch information
aivve committed Dec 20, 2021
1 parent 43f29f3 commit f242864
Show file tree
Hide file tree
Showing 75 changed files with 577 additions and 53 deletions.
24 changes: 17 additions & 7 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,23 @@ void MainWindow::initUi() {
statusBar()->addPermanentWidget(m_connectionStateIconLabel);
statusBar()->addPermanentWidget(m_encryptionStateIconLabel);
statusBar()->addPermanentWidget(m_synchronizationStateIconLabel);


m_synchronizationStateIconLabel->setFixedSize(16,16);
m_synchronizationStateIconLabel->setScaledContents( true );
m_connectionStateIconLabel->setFixedSize(16,16);
m_encryptionStateIconLabel->setFixedSize(16,16);
m_encryptionStateIconLabel->setScaledContents( true );
m_trackingModeIconLabel->setFixedSize(16,16);
m_trackingModeIconLabel->setScaledContents( true );
m_remoteModeIconLabel->setFixedSize(16,16);
m_remoteModeIconLabel->setScaledContents( true );

m_ui->m_overviewAction->toggle();
encryptedFlagChanged(false);

qobject_cast<AnimatedLabel*>(m_synchronizationStateIconLabel)->setSprite(QPixmap(":icons/sync_sprite"), QSize(16, 16), 5, 24);
m_connectionStateIconLabel->setIcon(QPixmap(":icons/disconnected").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
m_trackingModeIconLabel->setPixmap(QPixmap(":icons/tracking").scaledToHeight(16, Qt::SmoothTransformation));
m_connectionStateIconLabel->setIcon(QPixmap(":icons/disconnected").scaled(96, 96, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
m_trackingModeIconLabel->setPixmap(QPixmap(":icons/tracking").scaledToHeight(96, Qt::SmoothTransformation));
m_remoteModeIconLabel->hide();
m_trackingModeIconLabel->hide();
m_trackingModeIconLabel->setToolTip(tr("Tracking wallet. Spending unavailable"));
Expand All @@ -206,7 +216,7 @@ void MainWindow::initUi() {
QString connection = Settings::instance().getConnection();
if(connection.compare("remote") == 0) {
m_remoteModeIconLabel->show();
m_remoteModeIconLabel->setPixmap(QPixmap(":icons/remote_mode").scaledToHeight(16, Qt::SmoothTransformation));
m_remoteModeIconLabel->setPixmap(QPixmap(":icons/remote_mode").scaledToHeight(96, Qt::SmoothTransformation));
}

m_ui->m_showMnemonicSeedAction->setEnabled(false);
Expand Down Expand Up @@ -1105,7 +1115,7 @@ void MainWindow::encryptedFlagChanged(bool _encrypted) {
m_ui->m_encryptWalletAction->setEnabled(!_encrypted);
m_ui->m_changePasswordAction->setEnabled(_encrypted);
QString encryptionIconPath = _encrypted ? ":icons/encrypted" : ":icons/decrypted";
QPixmap encryptionIcon = QPixmap(encryptionIconPath).scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPixmap encryptionIcon = QPixmap(encryptionIconPath).scaled(96, 96, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
m_encryptionStateIconLabel->setPixmap(encryptionIcon);
QString encryptionLabelTooltip = _encrypted ? tr("Encrypted") : tr("Not encrypted");
m_encryptionStateIconLabel->setToolTip(encryptionLabelTooltip);
Expand All @@ -1114,7 +1124,7 @@ void MainWindow::encryptedFlagChanged(bool _encrypted) {

void MainWindow::peerCountUpdated(quint64 _peerCount) {
QString connectionIconPath = _peerCount > 0 ? ":icons/connected" : ":icons/disconnected";
QPixmap connectionIcon = QPixmap(connectionIconPath).scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPixmap connectionIcon = QPixmap(connectionIconPath).scaled(96, 96, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
m_connectionStateIconLabel->setIcon(connectionIcon);
m_connectionStateIconLabel->setToolTip(QString(tr("%n active connection(s)", "", _peerCount)));
}
Expand All @@ -1139,7 +1149,7 @@ void MainWindow::walletSynchronizationInProgress(uint32_t _current, uint32_t _to
}

void MainWindow::walletSynchronized(int _error, const QString& _error_text) {
QPixmap syncIcon = QPixmap(":icons/synced").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPixmap syncIcon = QPixmap(":icons/synced").scaled(96, 96, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
qobject_cast<AnimatedLabel*>(m_synchronizationStateIconLabel)->stopAnimation();
m_synchronizationStateIconLabel->setPixmap(syncIcon);
QString syncLabelTooltip = _error > 0 ? tr("Not synchronized") : tr("Synchronized");
Expand Down
6 changes: 3 additions & 3 deletions src/gui/TransactionsModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ QVariant TransactionsModel::getDecorationRole(const QModelIndex& _index) const {
TransactionState transactionState = static_cast<TransactionState>(_index.data(ROLE_STATE).value<quint8>());

if (transactionState != TransactionState::ACTIVE && transactionState != TransactionState::SENDING) {
return QPixmap(":icons/cancel");
return QPixmap(":icons/cancel").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
} else if (numberOfConfirmations == 0) {
return QPixmap(":icons/unconfirmed");
return QPixmap(":icons/unconfirmed").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
} else if(numberOfConfirmations < 2) {
return QPixmap(":icons/clock1");
} else if(numberOfConfirmations < 4) {
Expand All @@ -388,7 +388,7 @@ QVariant TransactionsModel::getDecorationRole(const QModelIndex& _index) const {
} else if(numberOfConfirmations < 10) {
return QPixmap(":icons/clock5");
} else {
return QPixmap(":icons/transaction");
return QPixmap(":icons/transaction").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
}
} else if (_index.column() == COLUMN_ADDRESS) {
return _index.data(ROLE_ICON).value<QPixmap>().scaled(20, 20, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
Expand Down
7 changes: 1 addition & 6 deletions src/gui/ui/accountframe.ui
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -179,7 +178,7 @@
</property>
<property name="icon">
<iconset resource="../../resources.qrc">
<normaloff>:/icons/qrcode_white</normaloff>:/icons/qrcode_white</iconset>
<normaloff>:/icons/qrcode</normaloff>:/icons/qrcode</iconset>
</property>
</widget>
</item>
Expand Down Expand Up @@ -254,7 +253,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -314,7 +312,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -374,7 +371,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -431,7 +427,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/ui/receiveframe.ui
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
</property>
<property name="icon">
<iconset resource="../../resources.qrc">
<normaloff>:/icons/btn-receive</normaloff>:/icons/btn-receive</iconset>
<normaloff>:/icons/qrcode</normaloff>:/icons/qrcode</iconset>
</property>
</widget>
</item>
Expand Down
Binary file removed src/icons/add.png
Binary file not shown.
10 changes: 10 additions & 0 deletions src/icons/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/add_recepient.png
Binary file not shown.
12 changes: 12 additions & 0 deletions src/icons/add_recepient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/address-book.png
Binary file not shown.
14 changes: 14 additions & 0 deletions src/icons/address-book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/broom.png
Binary file not shown.
12 changes: 12 additions & 0 deletions src/icons/broom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/cancel.png
Binary file not shown.
10 changes: 10 additions & 0 deletions src/icons/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/coins.png
Binary file not shown.
16 changes: 16 additions & 0 deletions src/icons/coins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/connected.png
Binary file not shown.
11 changes: 11 additions & 0 deletions src/icons/connected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/copy.png
Binary file not shown.
15 changes: 15 additions & 0 deletions src/icons/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/disconnected.png
Binary file not shown.
11 changes: 11 additions & 0 deletions src/icons/disconnected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/edit.png
Binary file not shown.
15 changes: 15 additions & 0 deletions src/icons/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/editcopy.png
Binary file not shown.
Binary file removed src/icons/editpaste.png
Binary file not shown.
Binary file removed src/icons/export.png
Binary file not shown.
Binary file removed src/icons/lock_closed.png
Binary file not shown.
12 changes: 12 additions & 0 deletions src/icons/lock_closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/lock_open.png
Diff not rendered.
12 changes: 12 additions & 0 deletions src/icons/lock_open.svg
Binary file removed src/icons/mining.png
Diff not rendered.
16 changes: 16 additions & 0 deletions src/icons/mining.svg
Binary file removed src/icons/overview.png
Diff not rendered.
15 changes: 15 additions & 0 deletions src/icons/overview.svg
Binary file removed src/icons/paste.png
Diff not rendered.
15 changes: 15 additions & 0 deletions src/icons/paste.svg
Binary file removed src/icons/qrcode.png
Diff not rendered.
Loading

0 comments on commit f242864

Please sign in to comment.