X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ffontselector.cpp;h=457c1d9bf5c98ef491c38b19665c3a7bcd010823;hp=6330693eddf9652374e2ecf06eeb75b69e18d3da;hb=52cfbc8ee8f4da6f28c6afef089f8179434e717d;hpb=89714033b9b0399f6855eb558217dc549813295d diff --git a/src/uisupport/fontselector.cpp b/src/uisupport/fontselector.cpp index 6330693e..457c1d9b 100644 --- a/src/uisupport/fontselector.cpp +++ b/src/uisupport/fontselector.cpp @@ -18,27 +18,19 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include +#include #include #include #include "fontselector.h" FontSelector::FontSelector(QWidget *parent) : QWidget(parent) { - init(); -} - -FontSelector::FontSelector(const QString &label, QWidget *parent) : QWidget(parent) { - init(label); -} - -void FontSelector::init(const QString &label) { QHBoxLayout *layout = new QHBoxLayout(this); QPushButton *chooseButton = new QPushButton(tr("Choose..."), this); connect(chooseButton, SIGNAL(clicked()), SLOT(chooseFont())); - layout->addWidget(_label = new QLabel(label)); layout->addWidget(_demo = new QLabel("Font")); layout->addWidget(chooseButton); layout->setContentsMargins(0, 0, 0, 0); @@ -49,10 +41,6 @@ void FontSelector::init(const QString &label) { _font = font(); } -void FontSelector::setText(const QString &label) { - _label->setText(label); -} - void FontSelector::setSelectedFont(const QFont &font) { _font = font; _demo->setText(QString("%1 %2pt").arg(font.family()).arg(font.pointSize())); @@ -68,3 +56,10 @@ void FontSelector::chooseFont() { } } +void FontSelector::changeEvent(QEvent *e) { + if(e->type() == QEvent::StyleChange) { + _demo->setFont(_font); + } +} + +