Permalink
Browse files

Merge branch 'panel-clock-font-fix' of git://github.com/kuzmas/razor-…

…qt (#438)
  • Loading branch information...
2 parents 0fd99f3 + 74dfe02 commit 48fa066b9f5608f159272b3882fdab9037dec054 @amoskvin amoskvin committed Oct 15, 2012
Showing with 9 additions and 13 deletions.
  1. +9 −13 razorqt-panel/plugin-clock/razorclock.cpp
View
22 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"
@@ -65,7 +62,7 @@ RazorClock::RazorClock(const RazorPanelPluginStartInfo* startInfo, QWidget* pare
setObjectName("Clock");
clockFormat = "hh:mm";
- fakeThemedLabel = new ClockLabel(this);
+ fakeThemedLabel = new ClockLabel(content);
fakeThemedLabel->setVisible(false);
timeLabel = new QLabel(this);
@@ -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 48fa066

Please sign in to comment.