diff options
author | Ken Moore <ken@ixsystems.com> | 2017-05-03 09:35:31 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-05-03 09:35:31 -0400 |
commit | b7283bcd87e54643320164d724d7179732a26523 (patch) | |
tree | e5ef664aa6ed013d9ac022135cd4caf7be8dcf1c /src-qt5/core/lumina-desktop/panel-plugins | |
parent | Clean up how the high-DPI settings for lumina are detected/enabled. (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-b7283bcd87e54643320164d724d7179732a26523.tar.gz lumina-b7283bcd87e54643320164d724d7179732a26523.tar.bz2 lumina-b7283bcd87e54643320164d724d7179732a26523.zip |
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins')
3 files changed, 18 insertions, 22 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 b370c536..c96d0c45 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -89,23 +89,19 @@ void LClock::updateTime(bool adjustformat){ } if(adjustformat){ //Check the font/spacing for the display and adjust as necessary - /*double efflines = label.count("\n")+1; //effective lines (with wordwrap) - if( (button->fontMetrics().height()*efflines) > button->height() ){ - //Force a pixel metric font size to fit everything - int szH = qRound( (button->height() - button->fontMetrics().lineSpacing() )/efflines ); - //Need to supply a *width* pixel, not a height metric - int szW = qRound( (szH*button->fontMetrics().maxWidth())/( (double) button->fontMetrics().height()) ); - qDebug() << "Change Clock font:" << button->height() << szH << szW << efflines << button->fontMetrics().height() << button->fontMetrics().lineSpacing(); - button->setStyleSheet("font-weight: bold; font-size: "+QString::number(szW)+"px;"); - }else{ - button->setStyleSheet("font-weight: bold;"); - }*/ + QStringList lines = label.split("/n"); if(this->layout()->direction()==QBoxLayout::LeftToRight){ //horizontal layout - this->setFixedWidth( this->sizeHint().width() +6); + int wid = 0; + int lwid; + for(int i=0; i<lines.length(); i++){ + int lwid = button->fontMetrics().width(lines[i]); + if(lwid>wid){ wid = lwid; } + } + this->setFixedWidth( wid ); }else{ //vertical layout - this->setMaximumWidth(100000); + this->setMaximumWidth(button->fontMetrics().lineSpacing() * lines.length()); } } button->setText(label); diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.ui b/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.ui index 26c32c74..59854d94 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.ui +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.ui @@ -47,7 +47,7 @@ font: bold; <item> <widget class="QGroupBox" name="group_volume"> <property name="title"> - <string>System Volume</string> + <string>Volume</string> </property> <property name="flat"> <bool>false</bool> diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui index 74f61d7f..d374bfce 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui @@ -143,7 +143,7 @@ <x>0</x> <y>0</y> <width>179</width> - <height>177</height> + <height>208</height> </rect> </property> </widget> @@ -439,7 +439,7 @@ <x>0</x> <y>0</y> <width>179</width> - <height>284</height> + <height>299</height> </rect> </property> </widget> @@ -921,7 +921,7 @@ <enum>Qt::NoFocus</enum> </property> <property name="text"> - <string>Suspend System</string> + <string>Suspend</string> </property> <property name="iconSize"> <size> @@ -986,7 +986,7 @@ <enum>Qt::NoFocus</enum> </property> <property name="text"> - <string>Restart System</string> + <string>Restart</string> </property> <property name="iconSize"> <size> @@ -1014,7 +1014,7 @@ <enum>Qt::NoFocus</enum> </property> <property name="text"> - <string>Power Off System</string> + <string>Power Off</string> </property> <property name="iconSize"> <size> @@ -1062,7 +1062,7 @@ <enum>Qt::NoFocus</enum> </property> <property name="text"> - <string>Sign Out User</string> + <string>Log Out</string> </property> <property name="iconSize"> <size> @@ -1099,8 +1099,8 @@ <rect> <x>0</x> <y>0</y> - <width>161</width> - <height>332</height> + <width>167</width> + <height>345</height> </rect> </property> </widget> |