Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
FileBrowserWidget.h
1#pragma once
2
3#include "Widget.h"
4
5#include <cstdint>
6
7enum class ButtonState
8{
9 NONE = 0,
10 HOVERED,
11 CLICKED
12};
13
15{
16 WIDGET_CONSTRUCT(FileBrowserWidget)
17
18public:
19 virtual void Start() override;
20 virtual void Render() override;
21
22 const std::string& GetSelectedFileName() const
23 {
24 return m_selectedFileString;
25 }
26
27private:
28 void UnselectItem() noexcept;
29 ButtonState DrawWideButton(bool selected,
30 uint32_t hoveredColor,
31 uint32_t activeColor) const noexcept;
32 void ShowItemContextMenu(const std::filesystem::path& path) const noexcept;
33 void ShowNavMenu() noexcept;
34 void ShowDirectoryBrowserList() noexcept;
35
36private:
37 std::string m_selectedFile;
38 std::string m_draggingFile;
39 std::filesystem::path m_currentDirectory;
40 std::filesystem::path m_topDir; // cannot go higher than this dir
41 uint32_t m_selectedItemID = 0;
42 std::string m_selectedFileString;
43};
Definition FileBrowserWidget.h:15
Definition Widget.h:16