Core: Improve readability of searchresult error messages

Task-number: QTCREATORBUG-29824
Change-Id: Ic26a6671b886d74ab2aac1d8e1baa66bd9fe7f8d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2023-11-09 12:41:00 +01:00
parent 74a089f3ea
commit 3ef343bbf8
2 changed files with 6 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
#include <utils/qtcassert.h>
#include <utils/theme/theme.h>
#include <utils/fancylineedit.h>
#include <utils/infolabel.h>
#include <QFrame>
#include <QLabel>
@@ -93,8 +94,6 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
topLayout->addWidget(m_topReplaceWidget);
m_messageWidget = new QFrame;
pal.setColor(QPalette::WindowText, creatorTheme()->color(Theme::TextColorError));
m_messageWidget->setPalette(pal);
if (creatorTheme()->flag(Theme::DrawSearchResultWidgetFrame)) {
m_messageWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
m_messageWidget->setLineWidth(1);
@@ -103,8 +102,9 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
auto messageLayout = new QHBoxLayout(m_messageWidget);
messageLayout->setContentsMargins(2, 2, 2, 2);
m_messageWidget->setLayout(messageLayout);
m_messageLabel = new QLabel;
m_messageLabel->setPalette(pal);
m_messageLabel = new InfoLabel;
m_messageLabel->setType(InfoLabel::Error);
m_messageLabel->setFilled(true);
messageLayout->addWidget(m_messageLabel);
layout->addWidget(m_messageWidget);
m_messageWidget->setVisible(false);

View File

@@ -18,6 +18,7 @@ class QToolButton;
class QCheckBox;
QT_END_NAMESPACE
namespace Utils { class InfoLabel; }
namespace Core {
namespace Internal {
@@ -123,7 +124,7 @@ private:
QWidget *m_descriptionContainer = nullptr;
QLabel *m_label = nullptr;
QLabel *m_searchTerm = nullptr;
QLabel *m_messageLabel = nullptr;
Utils::InfoLabel *m_messageLabel = nullptr;
QToolButton *m_cancelButton = nullptr;
QLabel *m_matchesFoundLabel = nullptr;
bool m_preserveCaseSupported = true;