aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins/applauncher
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-10 02:35:11 -0400
committerKen Moore <moorekou@gmail.com>2015-07-10 02:35:11 -0400
commitfb8955c15a73911e53fdf1e7a7ada2630272ffd5 (patch)
treee73df3ba004f52539be9f57758123309d1764f3c /lumina-desktop/desktop-plugins/applauncher
parentUpdate lumina-config to list all desktop plugins on the screen, and only make... (diff)
downloadlumina-fb8955c15a73911e53fdf1e7a7ada2630272ffd5.tar.gz
lumina-fb8955c15a73911e53fdf1e7a7ada2630272ffd5.tar.bz2
lumina-fb8955c15a73911e53fdf1e7a7ada2630272ffd5.zip
Ok, NOW the desktop plugins layout methodology is consistent/reliable. Had to implement my own tiling algorithm for initial plugin placements (and adjust a lot of the plugins to have better auto-set default sizes depending on font settings)
Diffstat (limited to 'lumina-desktop/desktop-plugins/applauncher')
-rw-r--r--lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index 52c82556..ea42f151 100644
--- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -8,7 +8,7 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
button = new QToolButton(this);
button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
button->setAutoRaise(true);
- button->setText("..."); //Need to set something here so that initial sizing works properly
+ button->setText("...\n..."); //Need to set something here so that initial sizing works properly
lay->addWidget(button, 0, Qt::AlignCenter);
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) );
@@ -27,8 +27,9 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
//qDebug() << "Button Size:" << button->size();
//qDebug() << "Calculated:" << icosize+4 << icosize+8+qRound(2.15*button->fontMetrics().height());
//qDebug() << "Preferred Size:" << button->sizeHint();
- this->setInitialSize(qRound(1.1*icosize)+4, icosize+8+qRound(2.5*button->fontMetrics().height()));
-
+ QSize sz(qRound(1.1*icosize), icosize+qRound(2.7*button->fontMetrics().height()) );
+ button->setFixedSize(sz); //make sure to adjust the button on first show.
+ this->setInitialSize(this->sizeHint().width()+2, this->sizeHint().height()+2); //give the container a bit of a buffer
QTimer::singleShot(100,this, SLOT(loadButton()) );
}
@@ -76,7 +77,7 @@ void AppLauncherPlugin::loadButton(bool onchange){
button->setToolTip(txt);
int icosize = this->readSetting("iconsize",64).toInt();
int bwid = qRound(1.1*icosize);
- button->setFixedSize(bwid, icosize+qRound(2.5*button->fontMetrics().height()) ); //make sure to adjust the button on first show.
+ this->setFixedSize(bwid, icosize+qRound(2.5*button->fontMetrics().height()) ); //make sure to adjust the button on first show.
if(onchange){ this->adjustSize( bwid+4, icosize+8+qRound(2.5*button->fontMetrics().height())); }
//qDebug() << "Initial Button Text:" << txt << icosize;
if(button->fontMetrics().width(txt) > (bwid-2) ){
@@ -97,6 +98,7 @@ void AppLauncherPlugin::loadButton(bool onchange){
txt.insert( (txt.count()/2), "\n");
}
}
+ if(!txt.contains("\n")){ txt.append("\n "); } //always use two lines
//qDebug() << " - Setting Button Text:" << txt;
button->setText(txt);
//Now setup the menu again
bgstack15