mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Add search term highlighting to EditGCodeDialog
Now leaves text stored in ParamsNode un-formatted and uses flags to determine the formatting. The GetFormattedText function now returns the markup text.
This commit is contained in:
@@ -113,6 +113,10 @@ class ParamsNode
|
||||
bool m_expanded_before_search{false};
|
||||
bool m_enabled{true};
|
||||
|
||||
bool m_bold{false};
|
||||
// first is pos, second is length
|
||||
std::unique_ptr<std::pair<int, int>> m_highlight_index{nullptr};
|
||||
|
||||
public:
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -139,6 +143,8 @@ public:
|
||||
const std::string& param_key,
|
||||
wxDataViewCtrl* ctrl);
|
||||
|
||||
wxString GetFormattedText();
|
||||
|
||||
bool IsContainer() const { return m_container; }
|
||||
bool IsGroupNode() const { return m_parent == nullptr; }
|
||||
bool IsParamNode() const { return m_param_type != ParamType::Undef; }
|
||||
@@ -257,11 +263,6 @@ public:
|
||||
void set_em_unit(int em) { m_em_unit = em; }
|
||||
};
|
||||
|
||||
static std::string unbold(const std::string& text) {
|
||||
return text.substr(text.find("<b>")+3, text.find("</b>")-3);
|
||||
}
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
|
||||
Reference in New Issue
Block a user