diff options
author | Ken Moore <moorekou@gmail.com> | 2016-02-19 11:52:42 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-02-19 11:52:42 -0500 |
commit | 317a32eb55d2c5984c9246c774035e36af4015e4 (patch) | |
tree | 02ae894ef26172e35404dd9ad291c77cb48fc6ad /lumina-desktop/panel-plugins/clock/LClock.cpp | |
parent | Change around the X property notification requested for standard windows (non... (diff) | |
download | lumina-317a32eb55d2c5984c9246c774035e36af4015e4.tar.gz lumina-317a32eb55d2c5984c9246c774035e36af4015e4.tar.bz2 lumina-317a32eb55d2c5984c9246c774035e36af4015e4.zip |
Fix up a couple other small bugs:
1) Ensure the clock plugin does not resize smaller than the time display.
2) Enforce a 40 character limit for task manager button text.
Diffstat (limited to 'lumina-desktop/panel-plugins/clock/LClock.cpp')
-rw-r--r-- | lumina-desktop/panel-plugins/clock/LClock.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp index 9f392831..0ecef3b2 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -16,6 +16,8 @@ LClock::LClock(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, button->setStyleSheet("font-weight: bold;"); button->setPopupMode(QToolButton::DelayedPopup); //make sure it runs the update routine first button->setMenu(new QMenu()); + //button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); + //this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); connect(button, SIGNAL(clicked()), this, SLOT(openMenu())); connect(button->menu(), SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); calendar = new QCalendarWidget(this); @@ -101,7 +103,6 @@ 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) @@ -109,7 +110,10 @@ void LClock::updateFormats(){ else if(timefmt.contains("m")){ timer->setInterval(2000); } //2 seconds else{ timer->setInterval(1000); } //unknown format - use 1 second interval datetimeorder = LSession::handle()->sessionSettings()->value("DateTimeOrder", "timeonly").toString().toLower(); + //this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); updateTime(true); + //Now fix the size of the widget with the new size hint + this->setFixedWidth( this->sizeHint().width() +6); } void LClock::updateMenu(){ |