ui: Improved style of error label in status bar

* use utf8 circle instead of dot.png
* underline on hover
This commit is contained in:
Eberhard Graether
2016-04-21 14:47:58 +02:00
parent 2417d27069
commit 3fe3bcb25d
+5 -7
View File
@@ -2,7 +2,6 @@
#include <QMovie>
#include "qt/utility/utilityQt.h"
#include "utility/messaging/type/MessageSearch.h"
#include "utility/ResourcePaths.h"
@@ -27,11 +26,10 @@ QtStatusBar::QtStatusBar()
m_errorButton.hide();
m_errorButton.setFlat(true);
m_errorButton.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_errorButton.setStyleSheet("QPushButton { color: #D00000; margin-right: 0; spacing: none; }");
m_errorButton.setIcon(utility::colorizePixmap(
QPixmap((ResourcePaths::getGuiPath() + "statusbar_view/dot.png").c_str()),
"#D00000"
).scaledToHeight(12));
m_errorButton.setStyleSheet(
"QPushButton { color: #D00000; background: none; border: none; margin-right: 0; spacing: none; } "
"QPushButton:hover { text-decoration: underline; }"
);
addPermanentWidget(&m_errorButton);
connect(&m_errorButton, SIGNAL(clicked()), this, SLOT(showErrors()));
@@ -69,7 +67,7 @@ void QtStatusBar::setErrorCount(ErrorCountInfo errorCount)
if (errorCount.total > 0)
{
m_errorButton.setText(
QString::number(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : "") +
QString::fromStdString("\u25CF ") + QString::number(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : "") +
(errorCount.fatal > 0 ? " (" + QString::number(errorCount.fatal) + " fatal)" : ""));
m_errorButton.show();
}