diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp | 6 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp | 2 |
2 files changed, 4 insertions, 4 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 2972ea86..d45853d1 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -79,7 +79,7 @@ void LClock::updateTime(bool adjustformat){ if( this->layout()->direction() == QBoxLayout::TopToBottom ){ //different routine for vertical text (need newlines instead of spaces) for(int i=0; i<label.count("\n")+1; i++){ - if(this->size().width() < (this->fontMetrics().width(label.section("\n",i,i))+10 )&& label.section("\n",i,i).contains(" ")){ + if(this->size().width() < (this->fontMetrics().horizontalAdvance(label.section("\n",i,i))+10 )&& label.section("\n",i,i).contains(" ")){ label.replace(label.section("\n",i,i), label.section("\n",i,i).replace(" ", "\n")); i--; } @@ -100,12 +100,12 @@ void LClock::updateTime(bool adjustformat){ int wid = 0; int lwid = 0; for(int i=0; i<lines.length(); i++){ - lwid = metrics.width(lines[i]); + lwid = metrics.horizontalAdvance(lines[i]); if(lwid>wid){ wid = lwid; } } qDebug() << "Verify Clock width:" << lines.length() << wid << lines; this->setMinimumWidth(wid); - this->setMaximumWidth(wid + (4*metrics.width("O"))); + this->setMaximumWidth(wid + (4*metrics.horizontalAdvance("O"))); }else{ //vertical layout this->setMinimumHeight(metrics.lineSpacing() * lines.length()); diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp index 5acd9721..49fdeeaf 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp @@ -30,7 +30,7 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList))); QRect screenSize = QApplication::desktop()->availableGeometry(this); - QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize",QSize(this->fontMetrics().width("x")*30 ,screenSize.height()/1.8)).toSize(); + QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize",QSize(this->fontMetrics().horizontalAdvance("x")*30 ,screenSize.height()/1.8)).toSize(); //qDebug() << "Got Start Menu Saved Size:" << saved; if(!saved.isNull() && saved.isValid()){ startmenu->setFixedSize(saved); } //re-load the previously saved value menu->setContents(startmenu); |