mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Move various settings from settings window to hex editor and pattern data view
This commit is contained in:
@@ -38,7 +38,7 @@ namespace hex::plugin::builtin {
|
||||
template<std::integral T>
|
||||
class DataVisualizerHexadecimal : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerHexadecimal() : DataVisualizer(ByteCount, CharCount) { }
|
||||
DataVisualizerHexadecimal(const std::string &name) : DataVisualizer(name, ByteCount, CharCount) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address);
|
||||
@@ -76,7 +76,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
class DataVisualizerHexii : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerHexii() : DataVisualizer(ByteCount, CharCount) { }
|
||||
DataVisualizerHexii() : DataVisualizer("hex.builtin.visualizer.hexii", ByteCount, CharCount) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address);
|
||||
@@ -130,7 +130,7 @@ namespace hex::plugin::builtin {
|
||||
template<std::integral T>
|
||||
class DataVisualizerDecimal : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerDecimal() : DataVisualizer(ByteCount, CharCount) { }
|
||||
DataVisualizerDecimal(const std::string &name) : DataVisualizer(name, ByteCount, CharCount) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address, upperCase);
|
||||
@@ -171,7 +171,7 @@ namespace hex::plugin::builtin {
|
||||
template<typename T>
|
||||
class DataVisualizerFloatingPoint : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerFloatingPoint() : DataVisualizer(ByteCount, CharCount) { }
|
||||
DataVisualizerFloatingPoint(const std::string &name) : DataVisualizer(name, ByteCount, CharCount) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address);
|
||||
@@ -210,7 +210,7 @@ namespace hex::plugin::builtin {
|
||||
template<>
|
||||
class DataVisualizerFloatingPoint<Float16> : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerFloatingPoint() : DataVisualizer(ByteCount, CharCount) { }
|
||||
DataVisualizerFloatingPoint(const std::string &name) : DataVisualizer(name, ByteCount, CharCount) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address);
|
||||
@@ -245,7 +245,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
class DataVisualizerRGBA8 : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerRGBA8() : DataVisualizer(4, 2) { }
|
||||
DataVisualizerRGBA8() : DataVisualizer("hex.builtin.visualizer.rgba8", 4, 2) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address, upperCase);
|
||||
@@ -285,7 +285,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
class DataVisualizerBinary : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerBinary() : DataVisualizer(1, 8) { }
|
||||
DataVisualizerBinary() : DataVisualizer("hex.builtin.visualizer.binary", 1, 8) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool) override {
|
||||
hex::unused(address);
|
||||
@@ -335,10 +335,10 @@ namespace hex::plugin::builtin {
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerFloatingPoint<float>>("hex.builtin.visualizer.floating_point.32bit");
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerFloatingPoint<double>>("hex.builtin.visualizer.floating_point.64bit");
|
||||
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerRGBA8>("hex.builtin.visualizer.rgba8");
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerHexii>("hex.builtin.visualizer.hexii");
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerRGBA8>();
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerHexii>();
|
||||
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerBinary>("hex.builtin.visualizer.binary");
|
||||
ContentRegistry::HexEditor::addDataVisualizer<DataVisualizerBinary>();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -264,23 +264,6 @@ namespace hex::plugin::builtin {
|
||||
return false;
|
||||
}, true);
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.interface", "hex.builtin.setting.interface.pattern_tree_style", 0, [](auto name, nlohmann::json &setting) {
|
||||
static int selection = static_cast<int>(setting);
|
||||
|
||||
const char *style[] = {
|
||||
"hex.builtin.setting.interface.pattern_tree_style.tree"_lang,
|
||||
"hex.builtin.setting.interface.pattern_tree_style.auto_expanded"_lang,
|
||||
"hex.builtin.setting.interface.pattern_tree_style.flattened"_lang,
|
||||
};
|
||||
|
||||
if (ImGui::Combo(name.data(), &selection, style, IM_ARRAYSIZE(style))) {
|
||||
setting = selection;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.highlight_color", 0x60C08080, [](auto name, nlohmann::json &setting) {
|
||||
static auto color = static_cast<color_t>(setting);
|
||||
|
||||
@@ -317,71 +300,6 @@ namespace hex::plugin::builtin {
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.ascii", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool ascii = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &ascii)) {
|
||||
setting = static_cast<int>(ascii);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.advanced_decoding", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool advancedDecoding = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &advancedDecoding)) {
|
||||
setting = static_cast<int>(advancedDecoding);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.grey_zeros", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool greyZeros = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &greyZeros)) {
|
||||
setting = static_cast<int>(greyZeros);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.uppercase_hex", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool upperCaseHex = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &upperCaseHex)) {
|
||||
setting = static_cast<int>(upperCaseHex);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.visualizer", "hex.builtin.visualizer.hexadecimal.8bit", [](auto name, nlohmann::json &setting) {
|
||||
auto &visualizers = ContentRegistry::HexEditor::impl::getVisualizers();
|
||||
|
||||
auto selectedVisualizer = setting;
|
||||
|
||||
bool result = false;
|
||||
if (ImGui::BeginCombo(name.data(), LangEntry(selectedVisualizer))) {
|
||||
|
||||
for (const auto &[unlocalizedName, visualizer] : visualizers) {
|
||||
if (ImGui::Selectable(LangEntry(unlocalizedName))) {
|
||||
setting = unlocalizedName;
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.sync_scrolling", 0, [](auto name, nlohmann::json &setting) {
|
||||
static bool syncScrolling = static_cast<int>(setting);
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace hex::plugin::builtin {
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::IsItemHovered()) {
|
||||
if (ImGui::InfoTooltip()) {
|
||||
ImGui::BeginTooltip();
|
||||
|
||||
ImGui::TextFormatted("{}", tabProvider->getName().c_str());
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace hex::plugin::builtin::ui {
|
||||
|
||||
class DataVisualizerAscii : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerAscii() : DataVisualizer(1, 1) { }
|
||||
DataVisualizerAscii() : DataVisualizer("ASCII", 1, 1) { }
|
||||
|
||||
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
|
||||
hex::unused(address, upperCase);
|
||||
@@ -71,44 +71,12 @@ namespace hex::plugin::builtin::ui {
|
||||
/* Hex Editor */
|
||||
|
||||
HexEditor::HexEditor(prv::Provider *provider) : m_provider(provider) {
|
||||
this->m_currDataVisualizer = ContentRegistry::HexEditor::impl::getVisualizers()["hex.builtin.visualizer.hexadecimal.8bit"];
|
||||
|
||||
this->m_grayZeroHighlighter = ImHexApi::HexEditor::addForegroundHighlightingProvider([this](u64 address, const u8 *data, size_t size, bool hasColor) -> std::optional<color_t> {
|
||||
hex::unused(address);
|
||||
|
||||
if (hasColor)
|
||||
return std::nullopt;
|
||||
|
||||
if (!this->m_grayOutZero)
|
||||
return std::nullopt;
|
||||
|
||||
for (u32 i = 0; i < size; i++)
|
||||
if (data[i] != 0x00)
|
||||
return std::nullopt;
|
||||
|
||||
return ImGui::GetColorU32(ImGuiCol_TextDisabled);
|
||||
});
|
||||
|
||||
EventManager::subscribe<EventSettingsChanged>(this, [this] {
|
||||
{
|
||||
this->m_bytesPerRow = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", 16);
|
||||
this->m_encodingLineStartAddresses.clear();
|
||||
}
|
||||
|
||||
{
|
||||
auto &visualizers = ContentRegistry::HexEditor::impl::getVisualizers();
|
||||
auto selectedVisualizer = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.visualizer", "hex.builtin.visualizer.hexadecimal.8bit");
|
||||
|
||||
if (visualizers.contains(selectedVisualizer))
|
||||
this->m_currDataVisualizer = visualizers[selectedVisualizer];
|
||||
else
|
||||
this->m_currDataVisualizer = visualizers["hex.builtin.visualizer.hexadecimal.8bit"];
|
||||
}
|
||||
|
||||
this->m_showAscii = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.ascii", 1);
|
||||
this->m_showCustomEncoding = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.advanced_decoding", 1);
|
||||
this->m_grayOutZero = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.grey_zeros", 1);
|
||||
this->m_upperCaseHex = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.uppercase_hex", 1);
|
||||
this->m_selectionColor = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.highlight_color", 0x60C08080);
|
||||
this->m_syncScrolling = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.sync_scrolling", 0);
|
||||
this->m_byteCellPadding = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.byte_padding", 0);
|
||||
@@ -117,7 +85,6 @@ namespace hex::plugin::builtin::ui {
|
||||
}
|
||||
|
||||
HexEditor::~HexEditor() {
|
||||
ImHexApi::HexEditor::removeForegroundHighlightingProvider(this->m_grayZeroHighlighter);
|
||||
EventManager::unsubscribe<EventSettingsChanged>(this);
|
||||
}
|
||||
|
||||
@@ -393,8 +360,21 @@ namespace hex::plugin::builtin::ui {
|
||||
|
||||
// Query cell colors
|
||||
if (x < std::ceil(float(validBytes) / bytesPerCell)) {
|
||||
const auto foregroundColor = this->m_foregroundColorCallback(byteAddress, &bytes[x * cellBytes], cellBytes);
|
||||
const auto backgroundColor = this->m_backgroundColorCallback(byteAddress, &bytes[x * cellBytes], cellBytes);
|
||||
auto foregroundColor = this->m_foregroundColorCallback(byteAddress, &bytes[x * cellBytes], cellBytes);
|
||||
auto backgroundColor = this->m_backgroundColorCallback(byteAddress, &bytes[x * cellBytes], cellBytes);
|
||||
|
||||
if (this->m_grayOutZero && !foregroundColor.has_value()) {
|
||||
bool allZero = true;
|
||||
for (u64 i = 0; i < cellBytes; i++) {
|
||||
if (bytes[x * cellBytes + i] != 0x00) {
|
||||
allZero = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allZero)
|
||||
foregroundColor = ImGui::GetColorU32(ImGuiCol_TextDisabled);
|
||||
}
|
||||
|
||||
cellColors.emplace_back(
|
||||
foregroundColor,
|
||||
@@ -728,6 +708,115 @@ namespace hex::plugin::builtin::ui {
|
||||
);
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 2_scaled);
|
||||
|
||||
// Upper/lower case hex
|
||||
{
|
||||
bool pushed = false;
|
||||
|
||||
if (this->m_upperCaseHex) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
if (ImGui::DimmedIconButton(ICON_VS_CASE_SENSITIVE, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
||||
this->m_upperCaseHex = !this->m_upperCaseHex;
|
||||
}
|
||||
|
||||
if (pushed)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::InfoTooltip("hex.builtin.hex_editor.uppercase_hex"_lang);
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
// Grayed out zeros
|
||||
{
|
||||
bool pushed = false;
|
||||
|
||||
if (this->m_grayOutZero) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
if (ImGui::DimmedIconButton(ICON_VS_LIGHTBULB, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
||||
this->m_grayOutZero = !this->m_grayOutZero;
|
||||
EventManager::post<EventHighlightingChanged>();
|
||||
}
|
||||
|
||||
if (pushed)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::InfoTooltip("hex.builtin.hex_editor.gray_out_zero"_lang);
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
// ASCII view
|
||||
{
|
||||
bool pushed = false;
|
||||
|
||||
if (this->m_showAscii) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
if (ImGui::DimmedIconButton(ICON_VS_SYMBOL_KEY, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
||||
this->m_showAscii = !this->m_showAscii;
|
||||
}
|
||||
|
||||
if (pushed)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::InfoTooltip("hex.builtin.hex_editor.ascii_view"_lang);
|
||||
}
|
||||
|
||||
ImGui::SameLine(0, 1_scaled);
|
||||
|
||||
// Custom encoding view
|
||||
{
|
||||
bool pushed = false;
|
||||
|
||||
if (this->m_showCustomEncoding) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
if (ImGui::DimmedIconButton(ICON_VS_WHITESPACE, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
||||
this->m_showCustomEncoding = !this->m_showCustomEncoding;
|
||||
}
|
||||
|
||||
if (pushed)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::InfoTooltip("hex.builtin.hex_editor.custom_encoding_view"_lang);
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
// Visualizer
|
||||
{
|
||||
auto &visualizers = ContentRegistry::HexEditor::impl::getVisualizers();
|
||||
|
||||
ImGui::TextFormatted("{}: ", "hex.builtin.hex_editor.visualizer"_lang);
|
||||
ImGui::SameLine(0, 0);
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
if (ImGui::BeginCombo("##visualizer", LangEntry(this->m_currDataVisualizer->getUnlocalizedName()))) {
|
||||
|
||||
for (const auto &[unlocalizedName, visualizer] : visualizers) {
|
||||
if (ImGui::Selectable(LangEntry(unlocalizedName))) {
|
||||
this->m_currDataVisualizer = visualizer;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
}
|
||||
@@ -760,7 +849,7 @@ namespace hex::plugin::builtin::ui {
|
||||
void HexEditor::draw(float height) {
|
||||
const auto width = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
const auto FooterSize = ImVec2(width, ImGui::GetTextLineHeightWithSpacing() * 2.3F);
|
||||
const auto FooterSize = ImVec2(width, ImGui::GetTextLineHeightWithSpacing() * 3.6F);
|
||||
const auto TableSize = ImVec2(width, height - FooterSize.y);
|
||||
|
||||
this->drawEditor(TableSize);
|
||||
|
||||
@@ -89,12 +89,8 @@ namespace hex::plugin::builtin::ui {
|
||||
|
||||
ImGui::TextFormatted("{}", name);
|
||||
|
||||
if (ImGui::IsItemHovered()) {
|
||||
if (ImGui::CalcTextSize(name.c_str()).x > ImGui::GetColumnWidth()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextFormatted(name);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
if (ImGui::CalcTextSize(name.c_str()).x > ImGui::GetColumnWidth()) {
|
||||
ImGui::InfoTooltip(name.c_str());
|
||||
}
|
||||
|
||||
});
|
||||
@@ -147,12 +143,8 @@ namespace hex::plugin::builtin::ui {
|
||||
}
|
||||
|
||||
void drawCommentTooltip(const pl::ptrn::Pattern &pattern) {
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
|
||||
if (auto comment = pattern.getComment(); !comment.empty()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextUnformatted(pattern.getComment().c_str());
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
if (auto comment = pattern.getComment(); !comment.empty()) {
|
||||
ImGui::InfoTooltip(comment.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,12 +273,8 @@ namespace hex::plugin::builtin::ui {
|
||||
ImGui::TextFormatted("{}", value);
|
||||
}
|
||||
|
||||
if (ImGui::IsItemHovered()) {
|
||||
if (ImGui::CalcTextSize(value.c_str()).x > width) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextFormatted("{}", value);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
if (ImGui::CalcTextSize(value.c_str()).x > width) {
|
||||
ImGui::InfoTooltip(value.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1001,16 +989,41 @@ namespace hex::plugin::builtin::ui {
|
||||
}
|
||||
|
||||
void PatternDrawer::draw(const std::vector<std::shared_ptr<pl::ptrn::Pattern>> &patterns, float height) {
|
||||
const auto treeStyleButton = [this](auto icon, TreeStyle style, const char *tooltip) {
|
||||
bool pushed = false;
|
||||
|
||||
if (this->m_treeStyle == style) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
if (ImGui::DimmedIconButton(icon, ImGui::GetStyleColorVec4(ImGuiCol_Text)))
|
||||
this->m_treeStyle = style;
|
||||
|
||||
if (pushed)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::InfoTooltip(tooltip);
|
||||
};
|
||||
|
||||
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left) && !ImGui::IsAnyItemHovered()) {
|
||||
this->resetEditing();
|
||||
}
|
||||
|
||||
ImGui::PushItemWidth(-1);
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - ImGui::GetTextLineHeightWithSpacing() * 5.5);
|
||||
if (ImGui::InputTextIcon("##Search", ICON_VS_FILTER, this->m_filterText)) {
|
||||
this->m_filter = parseRValueFilter(this->m_filterText);
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
treeStyleButton(ICON_VS_SYMBOL_KEYWORD, TreeStyle::Default, "hex.builtin.pattern_drawer.tree_style.tree"_lang);
|
||||
ImGui::SameLine(0, 0);
|
||||
treeStyleButton(ICON_VS_LIST_TREE, TreeStyle::AutoExpanded, "hex.builtin.pattern_drawer.tree_style.auto_expanded"_lang);
|
||||
ImGui::SameLine(0, 0);
|
||||
treeStyleButton(ICON_VS_LIST_FLAT, TreeStyle::Flattened, "hex.builtin.pattern_drawer.tree_style.flattened"_lang);
|
||||
|
||||
if (!this->m_favoritesUpdated) {
|
||||
this->m_favoritesUpdated = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user