diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp index 9bb52e00..e53d033d 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace scwx @@ -84,6 +85,7 @@ public: explicit SettingsDialogImpl(SettingsDialog* self) : self_ {self}, radarSiteDialog_ {new RadarSiteDialog(self)}, + fontDialog_ {new QFontDialog(self)}, settings_ {std::initializer_list { &defaultRadarSite_, &fontSizes_, @@ -113,6 +115,9 @@ public: QColor(QString::fromStdString( paletteSettings.alert_color(phenomenon, false).GetDefault()))); } + + // Configure font dialog + fontDialog_->setOptions(QFontDialog::FontDialogOption::ScalableFonts); } ~SettingsDialogImpl() = default; @@ -146,6 +151,7 @@ public: SettingsDialog* self_; PlacefileSettingsWidget* placefileSettingsWidget_ {nullptr}; RadarSiteDialog* radarSiteDialog_; + QFontDialog* fontDialog_; settings::SettingsInterface defaultRadarSite_ {}; settings::SettingsInterface> fontSizes_ {}; @@ -232,6 +238,18 @@ void SettingsDialogImpl::ConnectSignals() } }); + QObject::connect(self_->ui->fontSelectButton, + &QAbstractButton::clicked, + self_, + [this]() { fontDialog_->show(); }); + + QObject::connect( + fontDialog_, + &QFontDialog::fontSelected, + self_, + [this](const QFont& font) + { logger_->debug("Selected font: {}", font.toString().toStdString()); }); + // Update the Radar Site dialog "map" location with the currently selected // radar site auto& defaultRadarSite = *defaultRadarSite_.GetSettingsVariable(); diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.ui b/scwx-qt/source/scwx/qt/ui/settings_dialog.ui index 15d5d1ec..4e40cdb3 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.ui +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.ui @@ -438,6 +438,214 @@ + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Reset All Fonts + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Display Item: + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Tornado Warning expires in 15 minutes + + + Qt::AlignCenter + + + true + + + + + + + + + + ... + + + + + + + [Style] + + + + + + + [Font Name] + + + + + + + ... + + + + :/res/icons/font-awesome-6/rotate-left-solid.svg:/res/icons/font-awesome-6/rotate-left-solid.svg + + + + + + + [Size] + + + + + + + Font: + + + + + + + Style: + + + + + + + Size: + + + + + + + Preview: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + +