[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kicker/applets/clock
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2004-11-25 1:47:07
Message-ID: 20041125014707.D46CA17086 () office ! kde ! org
[Download RAW message or body]
CVS commit by aseigo:
allow scrolling on clock even when the date string is hidden; show the
timezone string in that case. inspired by a patch by Gregorio Guidi.
BUG:86437
M +22 -25 clock.cpp 1.192
--- kdebase/kicker/applets/clock/clock.cpp #1.191:1.192
@@ -902,5 +902,6 @@ int ClockApplet::widthForHeight(int h) c
int shareDateHeight = 0, shareDayOfWeekHeight = 0;
bool dateToSide = false;
- if (showDate) {
+ bool mustShowDate = showDate || (zone->zoneIndex() != 0);
+ if (mustShowDate) {
if (h < 32)
dateToSide = true;
@@ -914,5 +915,5 @@ int ClockApplet::widthForHeight(int h) c
int w;
- if (!showDate && !showDayOfWeek) {
+ if (!mustShowDate && !showDayOfWeek) {
w = clockWidth;
if (applyGeometry) {
@@ -920,5 +921,5 @@ int ClockApplet::widthForHeight(int h) c
}
} else {
- int dateWidth = showDate ? _date->sizeHint().width() + 4 : 0;
+ int dateWidth = mustShowDate ? _date->sizeHint().width() + 4 : 0;
int dayOfWeekWidth = showDayOfWeek ? _dayOfWeek->sizeHint().width() + 4 : 0;
if (dateToSide)
@@ -930,5 +931,5 @@ int ClockApplet::widthForHeight(int h) c
bool dateFirst = false;
- if (showDate)
+ if (mustShowDate)
{
// if the date format STARTS with a year, assume it's in descending
@@ -961,5 +962,5 @@ int ClockApplet::widthForHeight(int h) c
}
- if (showDate)
+ if (mustShowDate)
{
_date->setFixedSize(dateWidth, h);
@@ -979,5 +980,5 @@ int ClockApplet::widthForHeight(int h) c
_dayOfWeek->move(0, _clock->widget()->height());
}
- if (showDate) {
+ if (mustShowDate) {
_date->setFixedSize(w, _date->sizeHint().height());
_date->move(0, _clock->widget()->height() + shareDayOfWeekHeight);
@@ -994,4 +995,5 @@ int ClockApplet::heightForWidth(int w) c
bool applyGeometry = (position() == pLeft) || (position() == pRight);
int clockHeight = _clock->preferedHeightForWidth(w);
+ bool mustShowDate = showDate || (zone->zoneIndex() != 0);
if (applyGeometry)
@@ -1020,5 +1022,5 @@ int ClockApplet::heightForWidth(int w) c
}
- if (showDate)
+ if (mustShowDate)
{
if (applyGeometry)
@@ -1140,6 +1142,4 @@ void ClockApplet::slotApplySettings()
// See if the clock wants to show the date.
showDate = _clock->showDate();
- if (showDate)
- {
_date->setBackgroundColor(dateBackColor);
_date->setFont(dateFont);
@@ -1148,5 +1148,4 @@ void ClockApplet::slotApplySettings()
pal.setColor(QColorGroup::Background, dateBackColor);
_date->setPalette(pal);
- }
TZoffset = zone->calc_TZ_offset(zone->zone(), true);
updateDateLabel();
@@ -1170,5 +1169,5 @@ void ClockApplet::slotApplySettings()
}
- if (showDate)
+ if (showDate || (zone->zoneIndex() != 0))
{
_date->show();
@@ -1460,6 +1459,4 @@ void ClockApplet::showZone(int z)
void ClockApplet::nextZone()
{
- if (!showDate)
- return;
zone->nextZone();
showZone(zone->zoneIndex());
@@ -1468,6 +1465,4 @@ void ClockApplet::nextZone()
void ClockApplet::prevZone()
{
- if (!showDate)
- return;
zone->prevZone();
showZone(zone->zoneIndex());
@@ -1529,4 +1524,5 @@ void ClockApplet::updateDateLabel(bool r
QString zone_s = i18n(zone->zone().utf8());
_date->setText(zone_s.mid(zone_s.find('/') + 1).replace("_", " "));
+ _date->setShown(true);
}
else
@@ -1534,4 +1530,5 @@ void ClockApplet::updateDateLabel(bool r
QString dateStr = KGlobal::locale()->formatDate(_lastDate, true);
_date->setText(dateStr);
+ _date->setShown(showDate);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic