Skip to content
Snippets Groups Projects
Commit 9dbc91ee authored by Peter Albrecht's avatar Peter Albrecht
Browse files

Copy from skills gui; use icon from ArmarXGui

parent 26b6a639
No related branches found
No related tags found
1 merge request!96Add StatusLabel
Pipeline #17085 passed
......@@ -28,6 +28,7 @@ set(FILES ArmarXWidgetController.cpp
widgets/InfixCompleter.cpp
widgets/RegExpValidatedInputDialog.cpp
widgets/PeriodicUpdateWidget.cpp
widgets/StatusLabel.cpp
)
set(HEADERS ArmarXGuiInterface.h
......@@ -55,6 +56,7 @@ set(HEADERS ArmarXGuiInterface.h
SpinBoxToPose.h
SpinBoxToVector.h
widgets/PeriodicUpdateWidget.h
widgets/StatusLabel.h
)
set(GUI_UIS
......
......@@ -8,15 +8,16 @@ namespace armarx::skills::gui
StatusLabel::StatusLabel()
{
this->label = new QLabel("");
this->resetButton = new QPushButton("Clear");
this->resetButton = new QPushButton("");
this->setupUi();
}
void
StatusLabel::handleMessage(const std::string& message)
StatusLabel::handleMessage(const std::string& message, std::string const& error)
{
this->label->setText(QString::fromStdString(message));
this->resetButton->setHidden(false);
label->setToolTip(QString::fromStdString(error));
}
void
......@@ -30,11 +31,20 @@ namespace armarx::skills::gui
StatusLabel::setupUi()
{
QHBoxLayout* layout = new QHBoxLayout();
layout->addWidget(label);
layout->addWidget(resetButton);
layout->addWidget(label);
this->setLayout(layout);
layout->setStretch(0, 2);
layout->setStretch(1, 2);
label->setStyleSheet("QLabel { color : red; }");
this->resetButton->setHidden(true);
label->setMinimumHeight(35);
label->setMaximumHeight(35);
QPixmap pixmap(":/icons/delete.ico");
QIcon ButtonIcon(pixmap);
resetButton->setIcon(ButtonIcon);
resetButton->setIconSize(pixmap.rect().size() / 2);
connect(this->resetButton, &QPushButton::clicked, this, &StatusLabel::resetLabel);
}
......
......@@ -17,7 +17,7 @@ namespace armarx::skills::gui
/**
* @brief Display a message to indicate an update.
*/
void handleMessage(std::string const& message);
void handleMessage(std::string const& message, std::string const& error);
private slots:
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment