From f8471b6eed597e5cbf58e032eac3d800ae37fdac Mon Sep 17 00:00:00 2001 From: Joel16 Date: Thu, 30 Jul 2020 22:31:10 -0400 Subject: [PATCH] Bump version and hide resize button until the feature is ready --- CMakeLists.txt | 2 +- source/gui.cpp | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ddf723..1d4cff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ set(VITA_APP_NAME "VITAlbum") # unique string of developer and Y = a unique number for this app set(VITA_TITLEID "VITALBUM0") # Optional version string to show in LiveArea's more info screen -set(VITA_VERSION "01.01") +set(VITA_VERSION "01.10") ## Flags and includes for building # Note that we make sure not to overwrite previous flags diff --git a/source/gui.cpp b/source/gui.cpp index 0e03b67..66a59e6 100644 --- a/source/gui.cpp +++ b/source/gui.cpp @@ -3,6 +3,7 @@ #include "fs.h" #include "imgui_internal.h" +#include "keyboard.h" #include "textures.h" #include "utils.h" @@ -60,6 +61,7 @@ namespace GUI { static void PropertiesWindow(bool *window, const std::string &cwd, SceIoDirent *entry, Tex *texture) { ImGui::OpenPopup("Properties"); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(20, 20)); + std::string new_width, new_height; if (ImGui::BeginPopupModal("Properties", window, ImGuiWindowFlags_AlwaysAutoResize)) { std::string parent_text = "Parent: "; parent_text.append(cwd); @@ -88,7 +90,9 @@ namespace GUI { width_text.append("px"); ImGui::Text(width_text.c_str()); ImGui::SameLine(0.0f, 10.0f); - ImGui::Button("Edit width"); + if (ImGui::Button("Edit width")) { + new_width = Keyboard::GetText("Enter width", std::to_string(texture->width)); + } ImGui::Dummy(ImVec2(0.0f, 5.0f)); // Spacing @@ -97,14 +101,29 @@ namespace GUI { height_text.append("px"); ImGui::Text(height_text.c_str()); ImGui::SameLine(0.0f, 10.0f); - ImGui::Button("Edit height"); + if (ImGui::Button("Edit height")) { + new_height = Keyboard::GetText("Enter height", std::to_string(texture->height)); + } ImGui::Dummy(ImVec2(0.0f, 5.0f)); // Spacing + + /*if (ImGui::Button("Apply changes", ImVec2(120, 0))) { + // int new_width_int = std::stoi(new_width); + // int new_height_int = std::stoi(new_height); + if ((!new_height.empty()) || (!new_width.empty())) { + if (new_width != std::to_string(texture->width)) + else if (new_height != std::to_string(texture->height)) + + } + }*/ + + ImGui::SameLine(); if (ImGui::Button("OK", ImVec2(120, 0))) { *window = false; ImGui::CloseCurrentPopup(); } + ImGui::EndPopup(); } ImGui::PopStyleVar();