Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
file_browser_widget.h
1#pragma once
2
3#include "gluten/widgets/widget.h"
4
5#include <cstdint>
6
7enum class ButtonState
8{
9 NONE = 0,
10 HOVERED,
11 CLICKED
12};
13
14class file_browser_widget : public gluten::widget
15{
16 WIDGET_CONSTRUCT(file_browser_widget)
17
18public:
19 virtual void start() override;
20 virtual void render() override;
21
22 const std::string& get_selected_filename() const { return m_selectedFileString; }
23
24private:
25 void unselect_item() noexcept;
26 ButtonState draw_wide_button(bool selected, uint32_t hoveredColor, uint32_t activeColor) const noexcept;
27 void show_item_context_menu(const std::filesystem::path& path) const noexcept;
28 void show_nav_menu() noexcept;
29 void show_directory_browser_list() noexcept;
30
31private:
32 std::string m_selectedFile;
33 std::string m_draggingFile;
34 std::filesystem::path m_currentDirectory;
35 std::filesystem::path m_topDir; // cannot go higher than this dir
36 uint32_t m_selectedItemID = 0;
37 std::string m_selectedFileString;
38};
Definition file_browser_widget.h:15