mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Fonts] Polish font editor accessibility and note text
This commit is contained in:
parent
97ae1b93db
commit
45ec061e4e
2 changed files with 8 additions and 2 deletions
|
|
@ -63,6 +63,8 @@ FontGridWidget::FontGridWidget(QWidget *parent) : QWidget(parent)
|
||||||
grid->addWidget(sizeSpin, i, 2);
|
grid->addWidget(sizeSpin, i, 2);
|
||||||
connect(sizeSpin, &QSpinBox::valueChanged, this, [this] { emit fontsChanged(); });
|
connect(sizeSpin, &QSpinBox::valueChanged, this, [this] { emit fontsChanged(); });
|
||||||
|
|
||||||
|
label->setBuddy(familyCombo);
|
||||||
|
|
||||||
fontRows[role] = {label, familyCombo, sizeSpin};
|
fontRows[role] = {label, familyCombo, sizeSpin};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,6 +128,9 @@ void FontGridWidget::retranslateUi()
|
||||||
row.label->setText(roleDisplayName(role));
|
row.label->setText(roleDisplayName(role));
|
||||||
row.label->setToolTip(tr(APP_FONT_DESCRIPTIONS.value(role, "")));
|
row.label->setToolTip(tr(APP_FONT_DESCRIPTIONS.value(role, "")));
|
||||||
row.familyCombo->setToolTip(tr(APP_FONT_DESCRIPTIONS.value(role, "")));
|
row.familyCombo->setToolTip(tr(APP_FONT_DESCRIPTIONS.value(role, "")));
|
||||||
row.sizeSpin->setToolTip(tr("Point size"));
|
row.familyCombo->setAccessibleName(roleDisplayName(role));
|
||||||
|
row.sizeSpin->setToolTip(tr("Point size for %1").arg(roleDisplayName(role)));
|
||||||
|
row.sizeSpin->setAccessibleName(tr("Point size for %1").arg(roleDisplayName(role)));
|
||||||
|
row.sizeSpin->setSuffix(tr(" pt"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ void PaletteEditorDialog::setupUi()
|
||||||
fontSectionLayout->setSpacing(0);
|
fontSectionLayout->setSpacing(0);
|
||||||
fontNoteLabel = new QLabel(fontSection);
|
fontNoteLabel = new QLabel(fontSection);
|
||||||
fontNoteLabel->setContentsMargins(12, 4, 12, 0);
|
fontNoteLabel->setContentsMargins(12, 4, 12, 0);
|
||||||
|
fontNoteLabel->setWordWrap(true);
|
||||||
fontSectionLayout->addWidget(fontNoteLabel);
|
fontSectionLayout->addWidget(fontNoteLabel);
|
||||||
fontGrid = new FontGridWidget(fontSection);
|
fontGrid = new FontGridWidget(fontSection);
|
||||||
fontSectionLayout->addWidget(fontGrid);
|
fontSectionLayout->addWidget(fontGrid);
|
||||||
|
|
@ -240,7 +241,7 @@ void PaletteEditorDialog::retranslateUi()
|
||||||
paletteGridToggleButton->setToolTip(tr("Show or hide the per-role colour grid for manual tweaks"));
|
paletteGridToggleButton->setToolTip(tr("Show or hide the per-role colour grid for manual tweaks"));
|
||||||
fontToggleButton->setText(fontSection->isVisible() ? tr("▼ Edit Fonts") : tr("▶ Edit Fonts"));
|
fontToggleButton->setText(fontSection->isVisible() ? tr("▼ Edit Fonts") : tr("▶ Edit Fonts"));
|
||||||
fontToggleButton->setToolTip(tr("Show or hide the per-purpose font settings for this theme"));
|
fontToggleButton->setToolTip(tr("Show or hide the per-purpose font settings for this theme"));
|
||||||
fontNoteLabel->setText(tr("Fonts belong to theme %1").arg(themeName));
|
fontNoteLabel->setText(tr("Fonts belong to theme %1 (shared by Light and Dark schemes)").arg(themeName));
|
||||||
fontGrid->retranslateUi();
|
fontGrid->retranslateUi();
|
||||||
revertButton->setText(tr("↺ Revert to theme default"));
|
revertButton->setText(tr("↺ Revert to theme default"));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue