Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Custom font for clock plugin applied correctly

  • Loading branch information...
commit 3d46e7ad5ad00c96ede60a320e22eb9624d9cbcc 1 parent b51ae4d
@kuzmas kuzmas authored
Showing with 8 additions and 12 deletions.
  1. +8 −12 razorqt-panel/plugin-clock/razorclock.cpp
View
20 razorqt-panel/plugin-clock/razorclock.cpp
@@ -28,9 +28,6 @@
* END_COMMON_COPYRIGHT_HEADER */
-#ifndef RAZORCLOCK_CPP
-#define RAZORCLOCK_CPP
-
#include "razorclock.h"
#include "calendar_utils.h"
@@ -92,12 +89,13 @@ RazorClock::RazorClock(const RazorPanelPluginStartInfo* startInfo, QWidget* pare
content->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
this->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
- settingsChanged();
connect(fakeThemedLabel, SIGNAL(fontChanged()), this, SLOT(fontChanged()));
clocktimer = new QTimer(this);
connect (clocktimer, SIGNAL(timeout()), this, SLOT(updateTime()));
clocktimer->start(1000);
+
+ QTimer::singleShot(0, this, SLOT(settingsChanged()));
}
/**
@@ -169,22 +167,22 @@ void RazorClock::fontChanged()
{
{
QFont font(timeLabel->font());
- timeLabel->setFont(QFont(
+ font = QFont(
settings().value("timeFont/family", font.family()).toString(),
settings().value("timeFont/pointSize", font.pointSize()).toInt(),
settings().value("timeFont/weight", font.weight()).toInt(),
- settings().value("timeFont/italic", font.italic()).toBool() ));
- font = timeLabel->font();
+ settings().value("timeFont/italic", font.italic()).toBool() );
+ timeLabel->setFont(font);
}
{
QFont font(dateLabel->font());
- dateLabel->setFont(QFont(
+ font = QFont(
settings().value("dateFont/family", font.family()).toString(),
settings().value("dateFont/pointSize", font.pointSize()).toInt(),
settings().value("dateFont/weight", font.weight()).toInt(),
- settings().value("dateFont/italic", font.italic()).toBool() ));
- font = dateLabel->font();
+ settings().value("dateFont/italic", font.italic()).toBool() );
+ dateLabel->setFont(font);
}
}
@@ -382,5 +380,3 @@ bool ClockLabel::event(QEvent *event)
return QLabel::event(event);
}
-
-#endif

0 comments on commit 3d46e7a

Please sign in to comment.
Something went wrong with that request. Please try again.