aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ui_layer.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-24 17:07:54 +0200
committerhachem <im@hachem.wtf>2026-08-24 17:07:54 +0200
commit06398a7a176e123506de6e8851866a8bec0b3427 (patch)
tree7167ef4818f2c224840122961882efb5ec26c80b /src/ui/ui_layer.h
parent1c85c2ecaa826afd8bf80f93741cf1b2deba5798 (diff)
[chore]: cleanup shaders
Diffstat (limited to 'src/ui/ui_layer.h')
-rw-r--r--src/ui/ui_layer.h60
1 files changed, 47 insertions, 13 deletions
diff --git a/src/ui/ui_layer.h b/src/ui/ui_layer.h
index 67c9d8f..15b5ff8 100644
--- a/src/ui/ui_layer.h
+++ b/src/ui/ui_layer.h
@@ -1,27 +1,61 @@
#pragma once
-#include "workspace.h"
+#include "workspace.h" // AppActions, UIContext
#include "rendering/view.h"
-#include "core/memory.h"
-
-#include <vector>
namespace Donut
{
- // The Dorico-style tab strip. Owns the workspaces (Setup / Scene / Simulation
- // / Export); each frame it draws the dock space, the shared header, the tab
- // bar, and delegates the active tab's panels. Returns the active workspace's
- // View so the Application knows what the RenderPath should draw.
+ // The application's docking shell. Draws a main menu bar and a full-viewport
+ // dock space with a pass-through centre (the live 3D render shows through the
+ // middle), then a set of dockable tool panels. Ships a few default layouts
+ // built with the DockBuilder API and lets the user rearrange, hide, or restore
+ // panels like a normal desktop app. draw() returns the View the RenderPath
+ // should draw this frame.
class UILayer
{
public:
- UILayer();
+ UILayer() = default;
auto draw(const UIContext& ctx) -> View;
private:
- std::vector<Scope<Workspace>> m_workspaces;
- int m_active = 0;
- int m_landing = 0; // tab selected on the first frame
- bool m_landed = false;
+ // Which 3D view fills the pass-through centre.
+ enum class Mode { Scene, Simulation };
+ // A named default arrangement of the panels.
+ enum class Layout { Simulation, SceneEditing, Export };
+
+ auto draw_menu_bar(const UIContext& ctx) -> void;
+ auto build_layout(unsigned int dockspace_id) -> void; // DockBuilder tree
+ auto apply_layout(Layout layout) -> void; // preset: view + panels
+
+ auto panel_outliner(const UIContext& ctx) -> void;
+ auto panel_properties(const UIContext& ctx) -> void;
+ auto panel_black_hole(const UIContext& ctx) -> void;
+ auto panel_settings(const UIContext& ctx) -> void;
+ auto panel_export(const UIContext& ctx) -> void;
+ auto panel_stats(const UIContext& ctx) -> void;
+
+ Mode m_mode = Mode::Simulation;
+ Layout m_layout = Layout::Simulation;
+ bool m_rebuild_layout = false; // rebuild the dock tree next frame
+ bool m_first_frame = true; // seed the default layout once, if no saved one
+
+ // Panel visibility (defaults match the Simulation layout the app opens in).
+ bool m_show_outliner = false;
+ bool m_show_properties = false;
+ bool m_show_black_hole = true;
+ bool m_show_settings = false;
+ bool m_show_export = false;
+ bool m_show_stats = true;
+
+ // Properties-panel gizmo op (0 = translate, 1 = scale); cast in the .cpp.
+ int m_gizmo_op = 0;
+
+ // Settings panel.
+ float m_ui_scale = 1.0f;
+
+ // Export panel.
+ bool m_exp_color = true, m_exp_redshift = false, m_exp_temperature = false, m_exp_impact = false;
+ int m_exp_resolution = 1, m_exp_format = 0;
+ int m_exp_written = 0; bool m_exp_reported = false;
};
}