Rounded file browser icons

This commit is contained in:
Antoine Pilote
2023-08-31 10:40:27 -04:00
parent a9837fbe1a
commit cddb7caf02
2 changed files with 6 additions and 3 deletions

View File

@@ -62,13 +62,14 @@ namespace Nuake
void FileSystemUI::DrawDirectory(Ref<Directory> directory, uint32_t drawId)
{
ImGui::PushFont(FontManager::GetFont(Icons));
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 4.0f);
const char* icon = ICON_FA_FOLDER;
const std::string id = ICON_FA_FOLDER + std::string("##") + directory->name;
if (ImGui::Button(id.c_str(), ImVec2(100, 100)))
{
m_CurrentDirectory = directory;
}
ImGui::PopStyleVar();
const std::string hoverMenuId = std::string("item_hover_menu") + std::to_string(drawId);
if (ImGui::IsItemHovered() && ImGui::IsMouseReleased(1))
{
@@ -188,6 +189,7 @@ namespace Nuake
void FileSystemUI::DrawFile(Ref<File> file, uint32_t drawId)
{
ImGui::PushFont(EditorInterface::bigIconFont);
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 4.0f);
std::string fileExtension = file->GetExtension();
if (fileExtension == ".png" || fileExtension == ".jpg")
{
@@ -212,7 +214,7 @@ namespace Nuake
Editor->Selection = EditorSelection(file);
}
}
ImGui::PopStyleVar();
if (ImGui::BeginDragDropSource())
{
char pathBuffer[256];
@@ -673,7 +675,7 @@ namespace Nuake
{
int width = avail.x;
ImVec2 buttonSize = ImVec2(80, 80);
int amount = (int)(width / 100);
int amount = (int)(width / 110);
if (amount <= 0) amount = 1;
int i = 1; // current amount of item per row.

View File

@@ -286,6 +286,7 @@ namespace Nuake
s.WindowBorderSize = 0.0f;
s.IndentSpacing = 12.0f;
s.ChildBorderSize = 0.0f;
s.PopupRounding = 4.0f;
ImVec4* colors = ImGui::GetStyle().Colors;
colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);