@@ -739,6 +739,7 @@ SearchResultItem::SearchResultItem(const QString& text, const QColor& color, std
739739 : FloatingTextItem(text, action, parent)
740740{
741741 setDefaultTextColor (color);
742+ setHtml (" <div style='background:rgba(150, 150, 150, 30%);'>" + toPlainText () + " </div>" );
742743 items_.insert (this );
743744}
744745
@@ -805,10 +806,11 @@ class NetworkSearchEngine
805806 auto id = mod->getModuleWidget ()->getModuleId ();
806807 if (boost::ifind_first (id, text.toStdString ()))
807808 {
809+ auto tag = mod->data (TagDataKey).toInt ();
808810 results.emplace_back (" Module" ,
809811 QString::fromStdString (id),
810812 [mod]() { mod->showAndColor (Qt::green); },
811- tagColor_ (mod-> data (TagDataKey). toInt ()) );
813+ tag != NoTag ? tagColor_ (tag) : Qt::white );
812814 }
813815
814816 auto metadata = mod->getModuleWidget ()->metadataToString ();
@@ -855,7 +857,6 @@ class NetworkSearchEngine
855857 auto doc = note->document ();
856858 QTextCursor cur (doc->find (text));
857859 note->setTextCursor (cur);
858- // QTimer::singleShot(4000, &cur, SLOT(networkTimedOut()));
859860 }
860861
861862 QGraphicsScene* scene_;
@@ -875,18 +876,21 @@ void NetworkEditor::searchTextChanged(const QString& text)
875876
876877 NetworkSearchEngine engine (scene (), tagColor_);
877878 auto results = engine.search (text);
879+ auto textScale = 1.0 / currentScale_;
878880 if (!results.empty ())
879881 {
880882 auto title = new SearchResultItem (" Search results:" , Qt::green, {});
881- title->setPos (positionOfFloatingText (title->num (), true , 20 , 30 ));
883+ title->setPos (positionOfFloatingText (title->num (), true , 20 , textScale * 20 ));
882884 scene ()->addItem (title);
885+ title->scale (textScale, textScale);
883886 }
884887 for (const auto & result : results)
885888 {
886889 auto searchItem = new SearchResultItem (std::get<ItemType>(result) + " : " + std::get<ItemName>(result),
887890 std::get<ItemColor>(result), std::get<ItemAction>(result));
888- searchItem->setPos (positionOfFloatingText (searchItem->num (), true , 50 , 30 ));
891+ searchItem->setPos (positionOfFloatingText (searchItem->num (), true , 50 , textScale * 20 ));
889892 scene ()->addItem (searchItem);
893+ searchItem->scale (textScale, textScale);
890894 }
891895 }
892896}
0 commit comments