mirror of
https://github.com/joel16/VITA-Homebrew-Sorter.git
synced 2024-11-26 21:00:27 +00:00
applist: Display folder/app icons for bubbles
This commit is contained in:
parent
4be0e433b4
commit
cdbcbb0938
@ -82,5 +82,7 @@ vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self
|
||||
FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
|
||||
FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
|
||||
FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
|
||||
FILE res/app.png res/app.png
|
||||
FILE res/folder.png res/folder.png
|
||||
FILE res/splashscreen.png res/splashscreen.png
|
||||
)
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define _VITA_HB_SORTER_TEXTURES_H_
|
||||
|
||||
#include <vitaGL.h>
|
||||
#include <vector>
|
||||
|
||||
typedef struct {
|
||||
GLuint id = 0;
|
||||
@ -10,6 +11,7 @@ typedef struct {
|
||||
} Tex;
|
||||
|
||||
extern Tex splash;
|
||||
extern std::vector<Tex> icons;
|
||||
|
||||
namespace Textures {
|
||||
bool Init(void);
|
||||
|
BIN
res/app.png
Normal file
BIN
res/app.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
res/folder.png
Normal file
BIN
res/folder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
@ -79,6 +79,11 @@ namespace GUI {
|
||||
SortAsc,
|
||||
SortDesc
|
||||
};
|
||||
|
||||
enum IconType {
|
||||
App,
|
||||
Folder,
|
||||
};
|
||||
|
||||
static int sort = 0;
|
||||
ImGuiTableFlags tableFlags = ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter |
|
||||
@ -129,7 +134,8 @@ namespace GUI {
|
||||
|
||||
ImGui::Dummy(ImVec2(0.0f, 5.0f)); // Spacing
|
||||
|
||||
if (ImGui::BeginTable("AppEntries", 4, tableFlags)) {
|
||||
if (ImGui::BeginTable("AppEntries", 5, tableFlags)) {
|
||||
ImGui::TableSetupColumn(" ");
|
||||
ImGui::TableSetupColumn("Title");
|
||||
ImGui::TableSetupColumn("Page ID");
|
||||
ImGui::TableSetupColumn("Page Number");
|
||||
@ -139,6 +145,9 @@ namespace GUI {
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::Image(reinterpret_cast<ImTextureID>(entries[i].folder? icons[Folder].id : icons[App].id), ImVec2(20, 20));
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::Selectable(entries[i].title.c_str(), false, ImGuiSelectableFlags_SpanAllColumns);
|
||||
|
||||
|
@ -13,6 +13,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
int _newlib_heap_size_user = 192 * 1024 * 1024;
|
||||
//204, 59, 69
|
||||
|
||||
namespace Services {
|
||||
void SetDefaultTheme(void) {
|
||||
@ -20,7 +21,7 @@ namespace Services {
|
||||
ImGui::GetStyle().GrabRounding = 4.0f;
|
||||
|
||||
ImVec4 *colors = ImGui::GetStyle().Colors;
|
||||
colors[ImGuiCol_Text] = ImVec4(0.74f, 0.74f, 0.75f, 1.00f);
|
||||
colors[ImGuiCol_Text] = ImVec4(0.85f, 0.85f, 0.85f, 1.00f);
|
||||
colors[ImGuiCol_TextDisabled] = ImVec4(0.36f, 0.42f, 0.47f, 1.00f);
|
||||
colors[ImGuiCol_WindowBg] = ImVec4(0.05f, 0.07f, 0.13f, 1.00f);
|
||||
colors[ImGuiCol_ChildBg] = ImVec4(0.15f, 0.18f, 0.22f, 1.00f);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "textures.h"
|
||||
|
||||
Tex splash;
|
||||
std::vector<Tex> icons;
|
||||
|
||||
namespace Textures {
|
||||
static bool LoadImage(unsigned char *data, GLint format, Tex *texture, void (*free_func)(void *)) {
|
||||
@ -65,12 +66,23 @@ namespace Textures {
|
||||
}
|
||||
|
||||
bool Init(void) {
|
||||
bool ret = Textures::LoadImagePNG("app0:res/splashscreen.png", &splash);
|
||||
icons.resize(2);
|
||||
|
||||
bool ret = Textures::LoadImagePNG("app0:res/app.png", &icons[0]);
|
||||
IM_ASSERT(ret);
|
||||
|
||||
ret = Textures::LoadImagePNG("app0:res/folder.png", &icons[1]);
|
||||
IM_ASSERT(ret);
|
||||
|
||||
ret = Textures::LoadImagePNG("app0:res/splashscreen.png", &splash);
|
||||
IM_ASSERT(ret);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Exit(void) {
|
||||
glDeleteTextures(1, &icons[0].id);
|
||||
glDeleteTextures(1, &icons[1].id);
|
||||
glDeleteTextures(1, &splash.id);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user