aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/clock
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-05-04 09:48:42 -0400
committerKen Moore <ken@ixsystems.com>2017-05-04 09:48:42 -0400
commit63e9a93215d41882fb4632bac155102635145a4f (patch)
treea05e25cb699f1175b1f4bc17f1497a6b3b37ff7f /src-qt5/core/lumina-desktop/panel-plugins/clock
parentFix a syntax error in the resulting .desktop file (diff)
downloadlumina-63e9a93215d41882fb4632bac155102635145a4f.tar.gz
lumina-63e9a93215d41882fb4632bac155102635145a4f.tar.bz2
lumina-63e9a93215d41882fb4632bac155102635145a4f.zip
Clean up some margins on the clock for the horizontal orientation.
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/clock')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
index c96d0c45..a5266bee 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
@@ -95,9 +95,11 @@ void LClock::updateTime(bool adjustformat){
int wid = 0;
int lwid;
for(int i=0; i<lines.length(); i++){
- int lwid = button->fontMetrics().width(lines[i]);
+ lwid = button->fontMetrics().width(lines[i]);
if(lwid>wid){ wid = lwid; }
}
+ if(lines.length()==1){ wid+=6; } //need some extra margins for single-line
+ else{ wid-=6; } // need to remove some margins for multi-line
this->setFixedWidth( wid );
}else{
//vertical layout
bgstack15