ui: Colors in SearchView
Show the right colors in SearchView for the different NodeTypes or QueryNodeTyps Note: add colors to your Applcationsettings like in the template fortune cookie message = recognition will come from unexpected sources
This commit is contained in:
@@ -8,6 +8,7 @@ QtSearchView::QtSearchView(ViewLayout* viewLayout)
|
||||
: SearchView(viewLayout)
|
||||
, m_refreshViewFunctor(std::bind(&QtSearchView::doRefreshView, this))
|
||||
, m_setTextFunctor(std::bind(&QtSearchView::doSetText, this, std::placeholders::_1))
|
||||
, m_setMatchFunctor(std::bind(&QtSearchView::doSetMatch, this, std::placeholders::_1))
|
||||
, m_setFocusFunctor(std::bind(&QtSearchView::doSetFocus, this))
|
||||
, m_setAutocompletionListFunctor(std::bind(&QtSearchView::doSetAutocompletionList, this, std::placeholders::_1))
|
||||
{
|
||||
@@ -38,6 +39,11 @@ void QtSearchView::setText(const std::string& text)
|
||||
m_setTextFunctor(text);
|
||||
}
|
||||
|
||||
void QtSearchView::setMatch(const SearchMatch& match)
|
||||
{
|
||||
m_setMatchFunctor(match);
|
||||
}
|
||||
|
||||
void QtSearchView::setFocus()
|
||||
{
|
||||
m_setFocusFunctor();
|
||||
@@ -53,6 +59,11 @@ void QtSearchView::doRefreshView()
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
void QtSearchView::doSetMatch(const SearchMatch& match)
|
||||
{
|
||||
m_widget->setMatch(match);
|
||||
}
|
||||
|
||||
void QtSearchView::doSetText(const std::string& text)
|
||||
{
|
||||
m_widget->setText(text);
|
||||
|
||||
@@ -20,11 +20,13 @@ public:
|
||||
|
||||
// SearchView implementation
|
||||
virtual void setText(const std::string& text);
|
||||
virtual void setMatch(const SearchMatch& match);
|
||||
virtual void setFocus();
|
||||
virtual void setAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
|
||||
|
||||
private:
|
||||
void doRefreshView();
|
||||
void doSetMatch(const SearchMatch& match);
|
||||
void doSetText(const std::string& text);
|
||||
void doSetFocus();
|
||||
void doSetAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
|
||||
@@ -33,6 +35,7 @@ private:
|
||||
|
||||
QtThreadedFunctor<> m_refreshViewFunctor;
|
||||
QtThreadedFunctor<const std::string&> m_setTextFunctor;
|
||||
QtThreadedFunctor<const SearchMatch&> m_setMatchFunctor;
|
||||
QtThreadedFunctor<> m_setFocusFunctor;
|
||||
QtThreadedFunctor<const std::vector<SearchMatch>&> m_setAutocompletionListFunctor;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <QGraphicsSceneEvent>
|
||||
#include <QPen>
|
||||
|
||||
#include "ApplicationSettings.h"
|
||||
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeMove.h"
|
||||
|
||||
@@ -337,7 +339,7 @@ void QtGraphNode::setStyle()
|
||||
m_rect->setShadow(QColor(0, 0, 0, 128), 5);
|
||||
}
|
||||
|
||||
color = "#ededed";
|
||||
color = ApplicationSettings::getInstance()->getNodeTypeColor(m_data->getType()).c_str();
|
||||
if (m_subNodes.size())
|
||||
{
|
||||
radius = 20.0f;
|
||||
@@ -359,12 +361,12 @@ void QtGraphNode::setStyle()
|
||||
case Node::NODE_METHOD:
|
||||
if (m_isActive || m_isHovering)
|
||||
{
|
||||
color = "#ffcc00";
|
||||
color = ApplicationSettings::getInstance()->getNodeTypeColor(m_data->getType(), "hover").c_str();
|
||||
font.setWeight(QFont::Bold);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = "#ffe47a";
|
||||
color = ApplicationSettings::getInstance()->getNodeTypeColor(m_data->getType()).c_str();
|
||||
}
|
||||
|
||||
radius = 8.0f;
|
||||
@@ -380,12 +382,12 @@ void QtGraphNode::setStyle()
|
||||
case Node::NODE_ENUM_CONSTANT:
|
||||
if (m_isActive || m_isHovering)
|
||||
{
|
||||
color = "#62b29d";
|
||||
color = ApplicationSettings::getInstance()->getNodeTypeColor(m_data->getType(), "hover").c_str();
|
||||
font.setWeight(QFont::Bold);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = "#9ab4ad";
|
||||
color = ApplicationSettings::getInstance()->getNodeTypeColor(m_data->getType()).c_str();
|
||||
}
|
||||
|
||||
radius = 8.0f;
|
||||
|
||||
Reference in New Issue
Block a user