Fix light mode issues
This commit is contained in:
parent
8a40f3e5f8
commit
e1bcb7085c
2 changed files with 8 additions and 5 deletions
|
@ -227,6 +227,7 @@ public:
|
||||||
const float inner_spacing = ImGui::GetStyle().ItemInnerSpacing.x;
|
const float inner_spacing = ImGui::GetStyle().ItemInnerSpacing.x;
|
||||||
|
|
||||||
const auto frame_color = ImGui::GetStyle().Colors[ImGuiCol_FrameBg];
|
const auto frame_color = ImGui::GetStyle().Colors[ImGuiCol_FrameBg];
|
||||||
|
const auto text_color = ImGui::GetStyle().Colors[ImGuiCol_Text];
|
||||||
|
|
||||||
const ImRect edit_rect = ImRect(window_pos, ImVec2(window_pos.x + thumbnail_size, window_pos.y + thumbnail_size));
|
const ImRect edit_rect = ImRect(window_pos, ImVec2(window_pos.x + thumbnail_size, window_pos.y + thumbnail_size));
|
||||||
|
|
||||||
|
@ -235,7 +236,7 @@ public:
|
||||||
|
|
||||||
ImRect path_rect = ImRect(ImVec2(window_pos.x + thumbnail_size + 10.0f, window_pos.y), ImVec2(window_pos.x + item_width - inner_spacing, window_pos.y + 20.0f));
|
ImRect path_rect = ImRect(ImVec2(window_pos.x + thumbnail_size + 10.0f, window_pos.y), ImVec2(window_pos.x + item_width - inner_spacing, window_pos.y + 20.0f));
|
||||||
|
|
||||||
draw_list->AddText(ImVec2(window_pos.x + item_width, window_pos.y + (thumbnail_size / 2.0f) - (line_height / 2.0f)), ImColor(255, 255, 255, 255), name);
|
draw_list->AddText(ImVec2(window_pos.x + item_width, window_pos.y + (thumbnail_size / 2.0f) - (line_height / 2.0f)), ImColor(text_color), name);
|
||||||
|
|
||||||
draw_list->AddRectFilled(path_rect.Min, path_rect.Max, ImColor(frame_color), 3.0f);
|
draw_list->AddRectFilled(path_rect.Min, path_rect.Max, ImColor(frame_color), 3.0f);
|
||||||
|
|
||||||
|
@ -251,7 +252,7 @@ public:
|
||||||
|
|
||||||
ImGui::PushClipRect(path_rect.Min, path_rect.Max, false);
|
ImGui::PushClipRect(path_rect.Min, path_rect.Max, false);
|
||||||
|
|
||||||
draw_list->AddText(ImVec2(window_pos.x + thumbnail_size + 10.0f, window_pos.y), ImColor(255, 255, 255, 255), path.c_str());
|
draw_list->AddText(ImVec2(window_pos.x + thumbnail_size + 10.0f, window_pos.y), ImColor(text_color), path.c_str());
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(thumbnail_size, thumbnail_size + 10.0f));
|
ImGui::Dummy(ImVec2(thumbnail_size, thumbnail_size + 10.0f));
|
||||||
|
|
||||||
|
@ -270,9 +271,8 @@ public:
|
||||||
|
|
||||||
ImGui::ItemAdd(edit_rect, ImGui::GetID("edit"));
|
ImGui::ItemAdd(edit_rect, ImGui::GetID("edit"));
|
||||||
|
|
||||||
if(ImGui::IsItemClicked()) {
|
if(ImGui::IsItemClicked())
|
||||||
asset_selected(asset->path, get_asset_type<T>());
|
asset_selected(asset->path, get_asset_type<T>());
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::ItemAdd(clear_rect, ImGui::GetID("clear"));
|
ImGui::ItemAdd(clear_rect, ImGui::GetID("clear"));
|
||||||
|
|
||||||
|
|
|
@ -345,7 +345,10 @@ void CommonEditor::walkObject(Object object, Object) {
|
||||||
if(data.editor_object)
|
if(data.editor_object)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, selected_object == object ? ImVec4(0.0, 0.0, 1.0, 1.0) : ImVec4(1.0, 1.0, 1.0, 1.0));
|
const auto text_color = ImGui::GetStyle().Colors[ImGuiCol_Text];
|
||||||
|
const auto active_color = ImGui::GetStyle().Colors[ImGuiCol_ButtonActive];
|
||||||
|
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, selected_object == object ? active_color : text_color);
|
||||||
|
|
||||||
bool is_open = ImGui::TreeNodeEx((void*)object, base_flags, "%s", data.name.c_str());
|
bool is_open = ImGui::TreeNodeEx((void*)object, base_flags, "%s", data.name.c_str());
|
||||||
|
|
||||||
|
|
Reference in a new issue