Commit f9ca6d5c authored by Rafał Malinowski's avatar Rafał Malinowski

gui: #2819 fixed: do not show empty menu title

Signed-off-by: Rafał Malinowski's avatarRafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent bf9a45e5
......@@ -42,7 +42,7 @@
#include "status-button.h"
StatusButton::StatusButton(StatusContainer *statusContainer, QWidget *parent) :
QToolButton(parent), MyStatusContainer(statusContainer), DisplayStatusName(false)
QToolButton(parent), MyStatusContainer(statusContainer), DisplayStatusName(false), MenuTitleAction{nullptr}
{
Icon = new StatusIcon(MyStatusContainer, this);
......@@ -61,7 +61,8 @@ StatusButton::~StatusButton()
void StatusButton::createGui()
{
QMenu *menu = new QMenu(this);
addTitleToMenu(MyStatusContainer->statusContainerName(), menu);
if (!MyStatusContainer->statusContainerName().isEmpty())
addTitleToMenu(MyStatusContainer->statusContainerName(), menu);
new StatusMenu(MyStatusContainer, false, menu);
setMenu(menu);
......@@ -167,7 +168,8 @@ void StatusButton::setDisplayStatusName(bool displayStatusName)
void StatusButton::iconUpdated(const KaduIcon &icon)
{
setIcon(icon.icon());
MenuTitleAction->setIcon(icon.icon());
if (MenuTitleAction)
MenuTitleAction->setIcon(icon.icon());
}
QString StatusButton::prepareDescription(const QString &description) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment