From 93e40d43df6ffe4e4fb7e886a5e4fd37c5d719b9 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 7 Oct 2019 13:56:16 -0400 Subject: [PATCH] 2019-10-07 Fred Gleason * Refactored rdpopup(1) to use the 'RDDialog' and 'RDWidget' base classes. --- ChangeLog | 3 +++ lib/rdfontset.cpp | 13 +++++++++++++ lib/rdfontset.h | 1 + utils/rdpopup/rdpopup.cpp | 13 +++++-------- utils/rdpopup/rdpopup.h | 2 +- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d855e76..60bd0019 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19172,3 +19172,6 @@ 2019-10-07 Fred Gleason * Refactored rdgpimon(1) to use the 'RDDialog' and 'RDWidget' base classes. +2019-10-07 Fred Gleason + * Refactored rdpopup(1) to use the 'RDDialog' and 'RDWidget' + base classes. diff --git a/lib/rdfontset.cpp b/lib/rdfontset.cpp index 29509e37..440bfef4 100644 --- a/lib/rdfontset.cpp +++ b/lib/rdfontset.cpp @@ -34,6 +34,19 @@ RDFontSet::RDFontSet(const QFont &default_font,RDConfig *c) } +RDFontSet::RDFontSet(RDConfig *c) +{ + if(c==NULL) { + font_config=rda->config(); + } + else { + font_config=c; + } + MakeFonts(QFont(font_config->fontFamily(),font_config->fontDefaultSize(), + QFont::Normal)); +} + + QFont RDFontSet::buttonFont() const { return font_button_font; diff --git a/lib/rdfontset.h b/lib/rdfontset.h index 43166290..ec6a43ac 100644 --- a/lib/rdfontset.h +++ b/lib/rdfontset.h @@ -29,6 +29,7 @@ class RDFontSet { public: RDFontSet(const QFont &default_font,RDConfig *c=NULL); + RDFontSet(RDConfig *c=NULL); QFont buttonFont() const; QFont bigButtonFont() const; QFont subButtonFont() const; diff --git a/utils/rdpopup/rdpopup.cpp b/utils/rdpopup/rdpopup.cpp index ef26b3e9..58d1474e 100644 --- a/utils/rdpopup/rdpopup.cpp +++ b/utils/rdpopup/rdpopup.cpp @@ -18,19 +18,16 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -#include -#include #include -#include #include -#include +#include #include #include #include #include +#include #include "rdpopup.h" @@ -123,9 +120,9 @@ int main(int argc,char *argv[]) break; } mb->setWindowIcon(QPixmap(rivendell_22x22_xpm)); - QFont font("helvetica",16,QFont::Bold); - font.setPixelSize(16); - mb->setFont(font); + + RDFontSet *fs=new RDFontSet(config); + mb->setFont(fs->progressFont()); mb->exec(); delete mb; diff --git a/utils/rdpopup/rdpopup.h b/utils/rdpopup/rdpopup.h index 1c388569..42f95131 100644 --- a/utils/rdpopup/rdpopup.h +++ b/utils/rdpopup/rdpopup.h @@ -2,7 +2,7 @@ // // A utility for displaying messages on the desktop // -// (C) Copyright 2009-2018 Fred Gleason +// (C) Copyright 2009-2019 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as