Skip to content

Commit

Permalink
Update font size and set minimum label width for readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
firstcryptoman committed May 31, 2024
1 parent ea88eac commit 302ef0c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/qt/masternodelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void MasternodeList::resizeEvent(QResizeEvent* event)
}
void MasternodeList::adjustTextSize(int width,int height){

int fontSize = std::max(12, std::min(width, height) / 60);
int fontSize = std::max(12, std::min(width, height) / 70);
QFont font = this->font();
font.setPointSize(fontSize);

Expand Down
19 changes: 18 additions & 1 deletion src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,27 @@ void OverviewPage::resizeEvent(QResizeEvent* event)
ui->anonymizeButton->setMaximumWidth(buttonWidth * 2);
ui->anonymizeButton->setMinimumHeight(buttonMinHeight);
ui->anonymizeButton->setMaximumHeight(buttonMaxHeight);

// Set the minimum width for all label widgets to ensure they maintain a consistent and readable size regardless of window resizing
ui->labelAnonymizable->setMinimumWidth(labelMinWidth);
ui->labelAlerts->setMinimumWidth(labelMinWidth);
ui->label->setMinimumWidth(labelMinWidth);
ui->labelWatchPending->setMinimumWidth(labelMinWidth);
ui->labelBalance->setMinimumWidth(labelMinWidth);
ui->labelSpendable->setMinimumWidth(labelMinWidth);
ui->labelWatchAvailable->setMinimumWidth(labelMinWidth);
ui->labelUnconfirmedPrivate->setMinimumWidth(labelMinWidth);
ui->labelWatchonly->setMinimumWidth(labelMinWidth);
ui->labelTotal->setMinimumWidth(labelMinWidth);
ui->labelWatchTotal->setMinimumWidth(labelMinWidth);
ui->labelUnconfirmed->setMinimumWidth(labelMinWidth);
ui->labelImmature->setMinimumWidth(labelMinWidth);
ui->labelPrivate->setMinimumWidth(labelMinWidth);
ui->label_4->setMinimumWidth(labelMinWidth);
}
void OverviewPage::adjustTextSize(int width, int height){

int baseFontSize = std::max(12, std::min(width, height) / 60);
int baseFontSize = std::max(12, std::min(width, height) / 70);

// Font for regular text components
QFont textFont = ui->labelBalance->font();
Expand Down
2 changes: 1 addition & 1 deletion src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void ReceiveCoinsDialog::resizeEvent(QResizeEvent* event)
}
void ReceiveCoinsDialog::adjustTextSize(int width,int height){

int fontSize = std::max(12, std::min(width, height) / 60);
int fontSize = std::max(12, std::min(width, height) / 70);
QFont font = this->font();
font.setPointSize(fontSize);

Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ void SendCoinsDialog::resizeEvent(QResizeEvent* event) {
}

void SendCoinsDialog::adjustTextSize(int width, int height) {
int baseFontSize = std::max(12, std::min(width, height) / 60);
int baseFontSize = std::max(12, std::min(width, height) / 70);

QFont font = this->font();
font.setPointSize(baseFontSize);
Expand Down
3 changes: 1 addition & 2 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ void TransactionView::resizeEvent(QResizeEvent* event)
}
void TransactionView::adjustTextSize(int width,int height){

int fontSize = std::max(12, std::min(width, height) / 60);
int fontSize = std::max(12, std::min(width, height) / 70);
QFont font = this->font();
font.setPointSize(fontSize);

Expand All @@ -768,5 +768,4 @@ void TransactionView::adjustTextSize(int width,int height){
amountWidget->setFont(font);
instantsendWidget->setFont(font);
addressWidget->setFont(font);
amountWidget->setFont(font);
}

0 comments on commit 302ef0c

Please sign in to comment.