Skip to content

Commit

Permalink
[editor] updated the icon for the info, warning and error buttons in …
Browse files Browse the repository at this point in the history
…the console, no more pixelation
  • Loading branch information
PanosK92 committed Oct 9, 2024
1 parent 252c2c1 commit f136225
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Binary file added data/icons/console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/icons/console_error.png
Binary file not shown.
Binary file removed data/icons/console_info.png
Binary file not shown.
Binary file removed data/icons/console_warning.png
Binary file not shown.
18 changes: 11 additions & 7 deletions editor/Widgets/Console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,19 @@ Console::~Console()

void Console::OnTickVisible()
{
// clear Button
if (ImGuiSp::button("Clear")) { Clear();} ImGui::SameLine();
// clear button
if (ImGuiSp::button("Clear"))
{
Clear();
}
ImGui::SameLine();

// lambda for info, warning, error filter buttons
const auto button_log_type_visibility_toggle = [this](const IconType icon, uint32_t index)
const auto button_log_type_visibility_toggle = [this](uint32_t index)
{
bool& visibility = m_log_type_visibility[index];
ImGui::PushStyleColor(ImGuiCol_Button, visibility ? ImGui::GetStyle().Colors[ImGuiCol_Button] : ImGui::GetStyle().Colors[ImGuiCol_FrameBg]);
if (ImGuiSp::image_button(0, nullptr, icon, 15.0f * Spartan::Window::GetDpiScale(), false,m_log_type_color[index]))
if (ImGuiSp::image_button(0, nullptr, IconType::Console, 15.0f * Spartan::Window::GetDpiScale(), false,m_log_type_color[index]))
{
visibility = !visibility;
}
Expand All @@ -78,9 +82,9 @@ void Console::OnTickVisible()
};

// log category visibility buttons
button_log_type_visibility_toggle(IconType::Console_Info, 0);
button_log_type_visibility_toggle(IconType::Console_Warning, 1);
button_log_type_visibility_toggle(IconType::Console_Error, 2);
button_log_type_visibility_toggle(0);
button_log_type_visibility_toggle(1);
button_log_type_visibility_toggle(2);

// text filter
const float label_width = 37.0f * Spartan::Window::GetDpiScale();
Expand Down
4 changes: 1 addition & 3 deletions editor/WidgetsDeferred/IconLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ void IconLoader::Initialize()
IconLoader::LoadFromFile(data_dir + "Icons\\component_transform.png" , IconType::Component_Transform);
IconLoader::LoadFromFile(data_dir + "Icons\\component_terrain.png" , IconType::Component_Terrain);
IconLoader::LoadFromFile(data_dir + "Icons\\component_environment.png" , IconType::Component_Environment);
IconLoader::LoadFromFile(data_dir + "Icons\\console_info.png" , IconType::Console_Info);
IconLoader::LoadFromFile(data_dir + "Icons\\console_warning.png" , IconType::Console_Warning);
IconLoader::LoadFromFile(data_dir + "Icons\\console_error.png" , IconType::Console_Error);
IconLoader::LoadFromFile(data_dir + "Icons\\console.png" , IconType::Console);
IconLoader::LoadFromFile(data_dir + "Icons\\file.png" , IconType::Directory_File_Default);
IconLoader::LoadFromFile(data_dir + "Icons\\folder.png" , IconType::Directory_Folder);
IconLoader::LoadFromFile(data_dir + "Icons\\audio.png" , IconType::Directory_File_Audio);
Expand Down
4 changes: 1 addition & 3 deletions editor/WidgetsDeferred/IconLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ enum class IconType
Component_Terrain,
Component_Environment,
Component_Transform,
Console_Info,
Console_Warning,
Console_Error,
Console,
Button_Play,
Button_Profiler,
Button_ResourceCache,
Expand Down

0 comments on commit f136225

Please sign in to comment.