impr: Added more fine-grained colors to themes

This commit is contained in:
WerWolv
2023-10-20 12:30:21 +02:00
parent d07d36f784
commit 5227887dbf
12 changed files with 125 additions and 39 deletions

View File

@@ -131,11 +131,11 @@ namespace hex::plugin::builtin::ui {
const auto [decoded, advance] = encodingFile.getEncodingFor(buffer);
const ImColor color = [&]{
if (decoded.length() == 1 && std::isalnum(decoded[0]))
return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarBlue);
return ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingASCII);
else if (decoded.length() == 1 && advance == 1)
return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarRed);
return ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingSingleChar);
else if (decoded.length() > 1 && advance == 1)
return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarYellow);
return ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingMultiChar);
else if (advance > 1)
return ImGui::GetColorU32(ImGuiCol_Text);
else
@@ -527,7 +527,7 @@ namespace hex::plugin::builtin::ui {
if (y < this->m_encodingLineStartAddresses.size()) {
if (this->m_encodingLineStartAddresses[y] >= this->m_bytesPerRow) {
encodingData.emplace_back(y * this->m_bytesPerRow + this->m_provider->getBaseAddress() + this->m_provider->getCurrentPageAddress(), CustomEncodingData(".", 1, ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarRed)));
encodingData.emplace_back(y * this->m_bytesPerRow + this->m_provider->getBaseAddress() + this->m_provider->getCurrentPageAddress(), CustomEncodingData(".", 1, ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingUnknown)));
this->m_encodingLineStartAddresses.push_back(0);
} else {
u32 offset = this->m_encodingLineStartAddresses[y];

View File

@@ -58,7 +58,7 @@ namespace hex::plugin::builtin::ui {
auto selected = isPatternSelected(address, size);
if (selected)
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_HeaderActive));
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetCustomColorVec4(ImGuiCustomCol_PatternSelected));
if constexpr (HasReturn) {
auto result = callback();