Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Merge branch 'panel-clock-font-fix' of git://github.com/kuzmas/razor-…
Browse files Browse the repository at this point in the history
…qt (#438)
  • Loading branch information
amoskvin committed Oct 15, 2012
2 parents 0fd99f3 + 74dfe02 commit 48fa066
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions razorqt-panel/plugin-clock/razorclock.cpp
Expand Up @@ -28,9 +28,6 @@
* END_COMMON_COPYRIGHT_HEADER */ * END_COMMON_COPYRIGHT_HEADER */




#ifndef RAZORCLOCK_CPP
#define RAZORCLOCK_CPP

#include "razorclock.h" #include "razorclock.h"
#include "calendar_utils.h" #include "calendar_utils.h"


Expand Down Expand Up @@ -65,7 +62,7 @@ RazorClock::RazorClock(const RazorPanelPluginStartInfo* startInfo, QWidget* pare
setObjectName("Clock"); setObjectName("Clock");
clockFormat = "hh:mm"; clockFormat = "hh:mm";


fakeThemedLabel = new ClockLabel(this); fakeThemedLabel = new ClockLabel(content);
fakeThemedLabel->setVisible(false); fakeThemedLabel->setVisible(false);


timeLabel = new QLabel(this); timeLabel = new QLabel(this);
Expand All @@ -92,12 +89,13 @@ RazorClock::RazorClock(const RazorPanelPluginStartInfo* startInfo, QWidget* pare
content->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); content->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
this->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); this->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));


settingsChanged();
connect(fakeThemedLabel, SIGNAL(fontChanged()), this, SLOT(fontChanged())); connect(fakeThemedLabel, SIGNAL(fontChanged()), this, SLOT(fontChanged()));


clocktimer = new QTimer(this); clocktimer = new QTimer(this);
connect (clocktimer, SIGNAL(timeout()), this, SLOT(updateTime())); connect (clocktimer, SIGNAL(timeout()), this, SLOT(updateTime()));
clocktimer->start(1000); clocktimer->start(1000);

QTimer::singleShot(0, this, SLOT(settingsChanged()));
} }


/** /**
Expand Down Expand Up @@ -169,22 +167,22 @@ void RazorClock::fontChanged()
{ {
{ {
QFont font(timeLabel->font()); QFont font(timeLabel->font());
timeLabel->setFont(QFont( font = QFont(
settings().value("timeFont/family", font.family()).toString(), settings().value("timeFont/family", font.family()).toString(),
settings().value("timeFont/pointSize", font.pointSize()).toInt(), settings().value("timeFont/pointSize", font.pointSize()).toInt(),
settings().value("timeFont/weight", font.weight()).toInt(), settings().value("timeFont/weight", font.weight()).toInt(),
settings().value("timeFont/italic", font.italic()).toBool() )); settings().value("timeFont/italic", font.italic()).toBool() );
font = timeLabel->font(); timeLabel->setFont(font);
} }


{ {
QFont font(dateLabel->font()); QFont font(dateLabel->font());
dateLabel->setFont(QFont( font = QFont(
settings().value("dateFont/family", font.family()).toString(), settings().value("dateFont/family", font.family()).toString(),
settings().value("dateFont/pointSize", font.pointSize()).toInt(), settings().value("dateFont/pointSize", font.pointSize()).toInt(),
settings().value("dateFont/weight", font.weight()).toInt(), settings().value("dateFont/weight", font.weight()).toInt(),
settings().value("dateFont/italic", font.italic()).toBool() )); settings().value("dateFont/italic", font.italic()).toBool() );
font = dateLabel->font(); dateLabel->setFont(font);
} }
} }


Expand Down Expand Up @@ -382,5 +380,3 @@ bool ClockLabel::event(QEvent *event)


return QLabel::event(event); return QLabel::event(event);
} }

#endif

0 comments on commit 48fa066

Please sign in to comment.