aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-12-22 07:56:56 -0500
committerKen Moore <ken@ixsystems.com>2016-12-22 07:56:56 -0500
commit1c03353d6ecd7796d1c78fa29758d9a0daf9a928 (patch)
tree11b0b36a20ab967083b30474e8e8ba9f5af046ea /src-qt5/core
parentChange the icon used for the interface/menu page so it does not use the same ... (diff)
downloadlumina-1c03353d6ecd7796d1c78fa29758d9a0daf9a928.tar.gz
lumina-1c03353d6ecd7796d1c78fa29758d9a0daf9a928.tar.bz2
lumina-1c03353d6ecd7796d1c78fa29758d9a0daf9a928.zip
Make sure the clock plugin for the panel adjusts to account for 1 or 2 lines of text depending on size limitations.
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp6
1 files changed, 4 insertions, 2 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 0ecef3b2..1b23607a 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
@@ -78,6 +78,8 @@ void LClock::updateTime(bool adjustformat){
if( this->layout()->direction() == QBoxLayout::TopToBottom ){
//different routine for vertical text (need newlines instead of spaces)
label.replace(" ","\n");
+ }else if( this->size().height() < 2*this->fontMetrics().height() ){
+ label.replace("\n",", ");
}
if(adjustformat){
//Check the font/spacing for the display and adjust as necessary
@@ -92,9 +94,9 @@ void LClock::updateTime(bool adjustformat){
}else{
button->setStyleSheet("font-weight: bold;");
}*/
+ this->setFixedWidth( this->sizeHint().width() +6);
}
button->setText(label);
-
}
void LClock::updateFormats(){
@@ -113,7 +115,7 @@ void LClock::updateFormats(){
//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);
+ //this->setFixedWidth( this->sizeHint().width() +6);
}
void LClock::updateMenu(){
bgstack15