From 9feefa3e3045e5f5d0f739e6505062308c4f5009 Mon Sep 17 00:00:00 2001 From: Arnar Mar Sig Date: Thu, 2 Feb 2017 18:55:00 +0000 Subject: 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(). --- .../core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | 8 +++----- .../panel-plugins/taskmanager/LTaskManagerPlugin.cpp | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src-qt5/core/lumina-desktop') 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())); -- cgit From c6e60d06cb7b257eb5382dea53a72fcc83b4d997 Mon Sep 17 00:00:00 2001 From: Arnar Mar Sig Date: Thu, 2 Feb 2017 19:06:09 +0000 Subject: Add missing call to this->setText(). --- src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop') 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 8e2b1377..ab4e786f 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -133,7 +133,7 @@ void LTaskButton::UpdateButton(){ //multiple windows this->setPopupMode(QToolButton::InstantPopup); this->setMenu(winMenu); - if(noicon || showText){ "("+QString::number(WINLIST.length())+") "+cname; } + if(noicon || showText){ this->setText("("+QString::number(WINLIST.length())+") "+cname); } else{ this->setText("("+QString::number(WINLIST.length())+")"); } } this->setState(showstate); //Make sure this is after the button setup so that it properly sets the margins/etc -- cgit