mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-19 00:20:12 +00:00
FullscreenUI: Improve icons in file selector
This commit is contained in:
parent
3bb67c785e
commit
43543ddedc
@ -23,7 +23,9 @@
|
||||
#define ICON_EMOJI_MEDIUM_VOLUME_SPEAKER "\xf0\x9f\x94\x89"
|
||||
#define ICON_EMOJI_HIGH_VOLUME_SPEAKER "\xf0\x9f\x94\x8a"
|
||||
#define ICON_EMOJI_FILE_FOLDER "\xf0\x9f\x93\x81"
|
||||
#define ICON_EMOJI_OPEN_THE_FOLDER "\xf0\x9f\x93\x82"
|
||||
#define ICON_EMOJI_FILE_FOLDER_OPEN "\xf0\x9f\x93\x82"
|
||||
#define ICON_EMOJI_PAGE_WITH_CURL "\xf0\x9f\x93\x83"
|
||||
#define ICON_EMOJI_PAGE_FACING_UP "\xf0\x9f\x93\x84"
|
||||
#define ICON_EMOJI_MAGNIFIYING_GLASS_TILTED_LEFT "\xf0\x9f\x94\x8d"
|
||||
#define ICON_EMOJI_LOCKED "\xf0\x9f\x94\x92"
|
||||
#define ICON_EMOJI_UNLOCKED "\xf0\x9f\x94\x93"
|
||||
@ -37,3 +39,5 @@
|
||||
#define ICON_EMOJI_STAR "\xe2\xad\x90"
|
||||
#define ICON_EMOJI_RULER "\xf0\x9f\x93\x8f"
|
||||
#define ICON_EMOJI_CLOCK_FIVE_OCLOCK "\xf0\x9f\x95\x94"
|
||||
#define ICON_EMOJI_DESKTOP_COMPUTER "\xf0\x9f\x96\xa5"
|
||||
#define ICON_EMOJI_INDEX_DIVIDERS "\xf0\x9f\x97\x82"
|
||||
|
@ -1546,7 +1546,7 @@ void FullscreenUI::DoStartFile()
|
||||
DoStartPath(path);
|
||||
};
|
||||
|
||||
OpenFileSelector(FSUI_ICONVSTR(ICON_FA_COMPACT_DISC, "Select Disc Image"), false, std::move(callback),
|
||||
OpenFileSelector(FSUI_ICONVSTR(ICON_EMOJI_OPTICAL_DISK, "Select Disc Image"), false, std::move(callback),
|
||||
GetDiscImageFilters());
|
||||
}
|
||||
|
||||
@ -8305,7 +8305,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
|
||||
if (selected_entry->file_size >= 0)
|
||||
{
|
||||
ImGui::PushFont(UIStyle.Font, UIStyle.MediumFontSize, UIStyle.BoldFontWeight);
|
||||
ImGuiFullscreen::TextUnformatted(FSUI_ICONSTR(ICON_EMOJI_OPEN_THE_FOLDER, FSUI_VSTR("Size: ")));
|
||||
ImGuiFullscreen::TextUnformatted(FSUI_ICONSTR(ICON_EMOJI_FILE_FOLDER_OPEN, FSUI_VSTR("Size: ")));
|
||||
ImGui::PopFont();
|
||||
ImGui::SameLine();
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, subtitle_text_color);
|
||||
|
@ -2875,7 +2875,7 @@ bool System::LoadState(const char* path, Error* error, bool save_undo_state, boo
|
||||
INFO_LOG("Loading state from '{}'...", path);
|
||||
|
||||
Host::AddIconOSDMessage(
|
||||
"LoadState", ICON_EMOJI_OPEN_THE_FOLDER,
|
||||
"LoadState", ICON_EMOJI_FILE_FOLDER_OPEN,
|
||||
fmt::format(TRANSLATE_FS("OSDMessage", "Loading state from '{}'..."), Path::GetFileName(path)),
|
||||
Host::OSD_QUICK_DURATION);
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "fmt/core.h"
|
||||
|
||||
#include "IconsFontAwesome6.h"
|
||||
#include "IconsEmoji.h"
|
||||
#include "imgui_internal.h"
|
||||
#include "imgui_stdlib.h"
|
||||
|
||||
@ -168,6 +169,7 @@ private:
|
||||
|
||||
bool m_is_directory = false;
|
||||
bool m_directory_changed = false;
|
||||
bool m_first_item_is_parent_directory = false;
|
||||
};
|
||||
|
||||
class InputStringDialog : public PopupDialog
|
||||
@ -2949,11 +2951,12 @@ ImGuiFullscreen::FileSelectorDialog::Item::Item(std::string display_name_, std::
|
||||
void ImGuiFullscreen::FileSelectorDialog::PopulateItems()
|
||||
{
|
||||
m_items.clear();
|
||||
m_first_item_is_parent_directory = false;
|
||||
|
||||
if (m_current_directory.empty())
|
||||
{
|
||||
for (std::string& root_path : FileSystem::GetRootDirectoryList())
|
||||
m_items.emplace_back(fmt::format(ICON_FA_FOLDER " {}", root_path), std::move(root_path), false);
|
||||
m_items.emplace_back(fmt::format(ICON_EMOJI_FILE_FOLDER " {}", root_path), std::move(root_path), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2968,7 +2971,8 @@ void ImGuiFullscreen::FileSelectorDialog::PopulateItems()
|
||||
if (sep_pos != std::string::npos)
|
||||
parent_path = Path::Canonicalize(m_current_directory.substr(0, sep_pos));
|
||||
|
||||
m_items.emplace_back(ICON_FA_FOLDER_OPEN " <Parent Directory>", std::move(parent_path), false);
|
||||
m_items.emplace_back(ICON_EMOJI_FILE_FOLDER_OPEN " <Parent Directory>", std::move(parent_path), false);
|
||||
m_first_item_is_parent_directory = true;
|
||||
|
||||
for (const FILESYSTEM_FIND_DATA& fd : results)
|
||||
{
|
||||
@ -2976,7 +2980,7 @@ void ImGuiFullscreen::FileSelectorDialog::PopulateItems()
|
||||
|
||||
if (fd.Attributes & FILESYSTEM_FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
std::string title = fmt::format(ICON_FA_FOLDER " {}", fd.FileName);
|
||||
std::string title = fmt::format(ICON_EMOJI_FILE_FOLDER " {}", fd.FileName);
|
||||
m_items.emplace_back(std::move(title), std::move(full_path), false);
|
||||
}
|
||||
else
|
||||
@ -2988,7 +2992,7 @@ void ImGuiFullscreen::FileSelectorDialog::PopulateItems()
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string title = fmt::format(ICON_FA_FILE " {}", fd.FileName);
|
||||
std::string title = fmt::format(ICON_EMOJI_PAGE_FACING_UP " {}", fd.FileName);
|
||||
m_items.emplace_back(std::move(title), std::move(full_path), true);
|
||||
}
|
||||
}
|
||||
@ -3037,7 +3041,7 @@ void ImGuiFullscreen::FileSelectorDialog::Draw()
|
||||
|
||||
if (m_is_directory && !m_current_directory.empty())
|
||||
{
|
||||
if (MenuButtonWithoutSummary(ICON_FA_FOLDER_PLUS " <Use This Directory>"))
|
||||
if (MenuButtonWithoutSummary(ICON_EMOJI_FILE_FOLDER_OPEN " <Use This Directory>"))
|
||||
directory_selected = true;
|
||||
}
|
||||
|
||||
@ -3078,7 +3082,7 @@ void ImGuiFullscreen::FileSelectorDialog::Draw()
|
||||
{
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Backspace, false) || ImGui::IsKeyPressed(ImGuiKey_NavGamepadMenu, false))
|
||||
{
|
||||
if (!m_items.empty() && m_items.front().display_name == ICON_FA_FOLDER_OPEN " <Parent Directory>")
|
||||
if (!m_items.empty() && m_first_item_is_parent_directory)
|
||||
SetDirectory(std::move(m_items.front().full_path));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user