WIP: DropDown Menu.

This commit is contained in:
StackZ
2020-03-11 16:18:54 +01:00
parent 696612757f
commit 95cb91cc5d
10 changed files with 942 additions and 607 deletions
+18 -3
View File
@@ -44,12 +44,16 @@ private:
mutable int screenPos = 0;
mutable int screenPosList = 0;
mutable int Selection = 0;
int dropSelection = 0;
int mode = 0;
bool dropDownMenu = false;
// Draws.
void DrawBrowse(void) const;
void DrawGlossary(void) const;
void DropDownLogic(u32 hDown, u32 hHeld, touchPosition touch);
nlohmann::json infoJson;
int maxScripts;
@@ -58,15 +62,26 @@ private:
int fastMode = false;
std::vector<DirEntry> dirContents;
void refresh();
void downloadAll();
// Button | Icon struct.
std::vector<Structs::ButtonPos> arrowPos = {
{295, 0, 25, 25}, // Arrow Up.
{295, 215, 25, 25}, // Arrow Down.
{0, 215, 25, 25}, // Back Arrow.
{5, 0, 25, 25}, // Download All.
{45, 0, 25, 25}, // ViewMode Change.
{80, 0, 25, 25}, // Search.
{5, 0, 25, 25} // Dropdown Menu.
};
// DropDownMenu.
std::vector<Structs::ButtonPos> dropPos = {
{5, 30, 25, 25}, // Download All.
{5, 70, 25, 25}, // Refresh.
{5, 110, 25, 25} // ViewMode.
};
std::vector<Structs::ButtonPos> dropPos2 = {
{0, 28, 140, 30}, // Download All.
{0, 68, 140, 30}, // Refresh.
{0, 108, 140, 30} // ViewMode.
};
};
+14 -3
View File
@@ -80,6 +80,8 @@ private:
mutable int screenPos = 0;
mutable int screenPosList = 0;
mutable int Selection = 0;
int dropSelection = 0;
bool dropDownMenu = false;
// Browse stuff.
int keyRepeatDelay = 0;
@@ -92,14 +94,23 @@ private:
{295, 0, 25, 25}, // Arrow Up.
{295, 215, 25, 25}, // Arrow Down.
{0, 215, 25, 25}, // Back Arrow.
{5, 0, 25, 25}, // viewMode Change
{45, 0, 25, 25}, // Delete.
{5, 0, 25, 25} // Dropdown Menu.
};
std::vector<Structs::ButtonPos> subPos = {
{10, 70, 140, 40}, // Script list.
{170, 70, 140, 40}, // Get Scripts.
{10, 145, 140, 40}, // Script Creator.
{170, 145, 140, 40}, // Script path change.
{170, 145, 140, 40} // Script path change.
};
// DropDownMenu.
std::vector<Structs::ButtonPos> dropPos = {
{5, 30, 25, 25}, // Delete.
{5, 70, 25, 25} // ViewMode.
};
std::vector<Structs::ButtonPos> dropPos2 = {
{0, 28, 140, 30}, // Delete.
{0, 68, 140, 30} // ViewMode.
};
};
+18 -6
View File
@@ -80,6 +80,8 @@ private:
mutable int Selection = 0;
int screenPos = 0;
mutable int screenPosList = 0;
bool dropDownMenu = false;
int dropSelection = 0;
// Browse stuff.
int keyRepeatDelay = 0;
@@ -99,25 +101,35 @@ private:
{295, 0, 25, 25}, // Arrow Up.
{295, 215, 25, 25}, // Arrow Down.
{0, 215, 25, 25}, // Back Arrow.
{5, 0, 25, 25}, // ViewMode Change.
{45, 0, 25, 25}, // Delete.
{85, 0, 25, 25}, // Update.
{5, 0, 25, 25}, // Dropdown Menu.
};
std::vector<Structs::ButtonPos> URLBtn = {
{10, 70, 140, 40}, // FULL URL.
{170, 70, 140, 40}, // Github.
{10, 145, 140, 40}, // TinyDB.
{170, 145, 140, 40}, // QR Code?
{170, 145, 140, 40} // QR Code?
};
std::vector<Structs::ButtonPos> GitHubPos = {
{30, 50, 260, 30}, // Owner & Repo.
{30, 130, 260, 30}, // Filename.
{135, 180, 50, 30}, // OK.
{135, 180, 50, 30} // OK.
};
std::vector<Structs::ButtonPos> subPos = {
{90, 40, 140, 35}, // StoreList.
{90, 100, 140, 35}, // storeSearch.
{90, 160, 140, 35}, // storePathChange.
{90, 160, 140, 35} // storePathChange.
};
// DropDownMenu.
std::vector<Structs::ButtonPos> dropPos = {
{5, 30, 25, 25}, // Delete.
{5, 70, 25, 25}, // Update.
{5, 110, 25, 25} // ViewMode.
};
std::vector<Structs::ButtonPos> dropPos2 = {
{0, 28, 140, 30}, // Delete.
{0, 68, 140, 30}, // Update.
{0, 108, 140, 30} // ViewMode.
};
};