diff options
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r-- | lumina-desktop/panel-plugins/clock/LClock.cpp | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp index 4035cd13..9f392831 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -101,6 +101,7 @@ void LClock::updateFormats(){ datefmt = LSession::handle()->sessionSettings()->value("DateFormat","").toString(); deftime = timefmt.simplified().isEmpty(); defdate = datefmt.simplified().isEmpty(); + this->setMinimumSize(button->fontMetrics().width(timefmt+"MMM")+10, 5); //Adjust the timer interval based on the smallest unit displayed if(deftime){ timer->setInterval(500); } //1/2 second else if(timefmt.contains("z")){ timer->setInterval(1); } //every millisecond (smallest unit) @@ -190,48 +191,6 @@ void LClock::LocaleChange(){ } } - //qDebug() << "Found Time Zones:" << TZList.length(); - /*QDateTime cur = QDateTime::currentDateTime(); - - QMenu *tmpCM = 0; - QString ccat; //current category - QStringList catAbb; - for(int i=0; i<TZList.length(); i++){ - QTimeZone tmp(TZList[i]); - QString abbr = tmp.abbreviation(cur); - if(abbr.startsWith("UTC")){ continue; } //skip all the manual options at the end of the list - if(QString(tmp.id()).section("/",0,0)!=ccat){ - //New category - save the old one and start a new one - if(!catAbb.isEmpty()){ - catAbb.sort(); - QMenu *tmpM = new QMenu(this); - tmpM->setTitle(ccat); - for(int j=0; j<catAbb.length(); j++){ - QAction *act = new QAction(catAbb[j].section("::::",3,3)+" ("+catAbb[j].section("::::",1,1)+")",this); - act->setWhatsThis(catAbb[j].section("::::",2,2)); - tmpM->addAction(act); - } - TZMenu->addMenu(tmpM); - } - ccat = QString(tmp.id()).section("/",0,0); - catAbb.clear(); - } - if(!catAbb.filter("::::"+abbr+"::::").isEmpty()){ continue; } //duplicate timezone/abbreviation for this cat - catAbb << "::::"+abbr+"::::"+tmp.id()+"::::"+tmp.displayName(QTimeZone::GenericTime, QTimeZone::LongName); //add new abbreviation to the list - } - //Now add the last category to the menu - if(tmpCM!=0 && !catAbb.isEmpty()){ - catAbb.sort(); - QMenu *tmpM = new QMenu(this); - tmpM->setTitle(ccat); - for(int j=0; j<catAbb.length(); j++){ - QAction *act = new QAction(catAbb[j].section("::::",3,3)+" ("+catAbb[j].section("::::",1,1)+")",this); - act->setWhatsThis(catAbb[j].section("::::",2,2)); - tmpM->addAction(act); - } - TZMenu->addMenu(tmpM); - }*/ - } void LClock::ThemeChange(){ |