diff options
author | Arnar Mar Sig <antab@antab.is> | 2017-02-02 18:55:00 +0000 |
---|---|---|
committer | Arnar Mar Sig <antab@antab.is> | 2017-02-02 18:55:00 +0000 |
commit | 9feefa3e3045e5f5d0f739e6505062308c4f5009 (patch) | |
tree | 14e14c663f8f5df67899384ddf254a2d29d2b3da /src-qt5/core | |
parent | Another large batch of work on Lumina2: (diff) | |
download | lumina-9feefa3e3045e5f5d0f739e6505062308c4f5009.tar.gz lumina-9feefa3e3045e5f5d0f739e6505062308c4f5009.tar.bz2 lumina-9feefa3e3045e5f5d0f739e6505062308c4f5009.zip |
Remove calls to setToolButtonStyle() from LTaskButton.
Add calls to setToolButtonStyle() when LTaskButton is created.
LTaskManagerPlugin::OrientationChange() already has calls to set the button style when orientation is changed, but this is overwritten in LTaskButton::UpdateButton().
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | 8 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp index 0dd68bb0..8e2b1377 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -16,7 +16,6 @@ LTaskButton::LTaskButton(QWidget *parent, bool smallDisplay) : LTBWidget(parent) winMenu = new QMenu(this); UpdateMenus(); showText = !smallDisplay; - this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->setAutoRaise(false); //make sure these always look like buttons this->setContextMenuPolicy(Qt::CustomContextMenu); this->setFocusPolicy(Qt::NoFocus); @@ -126,15 +125,14 @@ void LTaskButton::UpdateButton(){ QString txt = WINLIST[0].text(); if(txt.length()>30){ txt.truncate(27); txt.append("..."); } else if(txt.length()<30){ txt = txt.leftJustified(30, ' '); } - this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->setText(txt); - }else if(noicon){ this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->setText( cname ); } - else{ this->setToolButtonStyle(Qt::ToolButtonIconOnly); this->setText(""); } + this->setText(txt); + }else if(noicon){ this->setText( cname ); } + else{ this->setText(""); } this->setToolTip(WINLIST[0].text()); }else if(WINLIST.length() > 1){ //multiple windows this->setPopupMode(QToolButton::InstantPopup); this->setMenu(winMenu); - this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); if(noicon || showText){ "("+QString::number(WINLIST.length())+") "+cname; } else{ this->setText("("+QString::number(WINLIST.length())+")"); } } diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp index 79c5dd36..c8e24702 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp @@ -116,8 +116,10 @@ void LTaskManagerPlugin::UpdateButtons(){ but->addWindow( winlist[i] ); if(this->layout()->direction()==QBoxLayout::LeftToRight){ but->setIconSize(QSize(this->height(), this->height())); + but->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); }else{ but->setIconSize(QSize(this->width(), this->width())); + but->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); } this->layout()->addWidget(but); connect(but, SIGNAL(MenuClosed()), this, SIGNAL(MenuClosed())); |