impr: Only display background color of patterns that have a color
This commit is contained in:
parent
d48acf7fef
commit
5bc8e5c57c
@ -69,6 +69,7 @@ namespace hex::plugin::builtin::ui {
|
||||
void drawValueColumn(pl::ptrn::Pattern& pattern);
|
||||
void drawVisualizer(const std::map<std::string, ContentRegistry::PatternLanguage::impl::Visualizer> &visualizers, const std::vector<pl::core::Token::Literal> &arguments, pl::ptrn::Pattern &pattern, pl::ptrn::IIterable &iterable, bool reset);
|
||||
void drawFavoriteColumn(const pl::ptrn::Pattern& pattern);
|
||||
void drawColorColumn(const pl::ptrn::Pattern& pattern);
|
||||
|
||||
bool beginPatternTable(const std::vector<std::shared_ptr<pl::ptrn::Pattern>> &patterns, std::vector<pl::ptrn::Pattern*> &sortedPatterns, float height) const;
|
||||
bool createTreeNode(const pl::ptrn::Pattern& pattern, bool leaf = false);
|
||||
|
@ -88,13 +88,6 @@ namespace hex::plugin::builtin::ui {
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawColorColumn(const pl::ptrn::Pattern& pattern) {
|
||||
if (pattern.getVisibility() == pl::ptrn::Visibility::Visible)
|
||||
ImGui::ColorButton("color", ImColor(pattern.getColor()), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()));
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawOffsetColumnForBitfieldMember(const pl::ptrn::PatternBitfieldMember &pattern) {
|
||||
if (pattern.isPatternLocal()) {
|
||||
ImGuiExt::TextFormatted("[{}]", "hex.builtin.pattern_drawer.local"_lang);
|
||||
@ -224,9 +217,6 @@ namespace hex::plugin::builtin::ui {
|
||||
}
|
||||
|
||||
void PatternDrawer::drawFavoriteColumn(const pl::ptrn::Pattern& pattern) {
|
||||
if (m_rowColoring)
|
||||
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, (pattern.getColor() & 0x00'FF'FF'FF) | 0x30'00'00'00);
|
||||
|
||||
if (!m_showFavoriteStars) {
|
||||
ImGui::TableNextColumn();
|
||||
return;
|
||||
@ -250,6 +240,17 @@ namespace hex::plugin::builtin::ui {
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawColorColumn(const pl::ptrn::Pattern& pattern) {
|
||||
if (pattern.getVisibility() == pl::ptrn::Visibility::Visible) {
|
||||
ImGui::ColorButton("color", ImColor(pattern.getColor()), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()));
|
||||
|
||||
if (m_rowColoring)
|
||||
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, (pattern.getColor() & 0x00'FF'FF'FF) | 0x30'00'00'00);
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawVisualizer(const std::map<std::string, ContentRegistry::PatternLanguage::impl::Visualizer> &visualizers, const std::vector<pl::core::Token::Literal> &arguments, pl::ptrn::Pattern &pattern, pl::ptrn::IIterable &iterable, bool reset) {
|
||||
auto visualizerName = arguments.front().toString(true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user