Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat: Add StatusBar and Drawer system to editor

esenginee58f519d607e
diff --git a/src/esengine/editor/CMakeLists.txt b/src/esengine/editor/CMakeLists.txt
index 40da11695..917ff320d 100644
--- a/src/esengine/editor/CMakeLists.txt
+++ b/src/esengine/editor/CMakeLists.txt
@@ -31,6 +31,11 @@ set(EDITOR_SOURCES
panels/AssetGridItem.cpp
panels/ProjectLauncherPanel.cpp
panels/NewProjectDialog.cpp
+
+ # Editor widgets
+ widgets/StatusBar.cpp
+ widgets/DrawerPanel.cpp
+ widgets/EditorRootContainer.cpp
)
set(EDITOR_HEADERS
@@ -77,6 +82,11 @@ set(EDITOR_HEADERS
panels/AssetGridItem.hpp
panels/ProjectLauncherPanel.hpp
panels/NewProjectDialog.hpp
+
+ # Editor widgets
+ widgets/StatusBar.hpp
+ widgets/DrawerPanel.hpp
+ widgets/EditorRootContainer.hpp
)
# Create editor executable
diff --git a/src/esengine/editor/EditorApplication.cpp b/src/esengine/editor/EditorApplication.cpp
index 3208b08f8..4d25307ff 100644
--- a/src/esengine/editor/EditorApplication.cpp
+++ b/src/esengine/editor/EditorApplication.cpp
@@ -30,6 +30,7 @@
#include "panels/AssetBrowserPanel.hpp"
#include "panels/ProjectLauncherPanel.hpp"
#include "panels/NewProjectDialog.hpp"
+#include "widgets/EditorRootContainer.hpp"
#include "../platform/FileDialog.hpp"
namespace esengine {
@@ -344,51 +345,48 @@ void EditorApplication::setupEventListeners() {
}
void EditorApplication::setupEditorLayout() {
- ES_LOG_INFO("setupEditorLayout: Creating dock area...");
+ ES_LOG_INFO("setupEditorLayout: Creating editor root container...");
+
+ auto editorRoot = makeUnique<EditorRootContainer>(ui::WidgetId("editor.root"));
+ editorRoot_ = editorRoot.get();
- // Create main dock area
auto dockArea = makeUnique<ui::DockArea>(ui::WidgetId("editor.dock_area"));
dockArea_ = dockArea.get();
- // Configure dock area
dockArea_->setMinPanelSize(glm::vec2(150.0f, 100.0f));
dockArea_->setSplitterThickness(4.0f);
dockArea_->setTabBarHeight(26.0f);
ES_LOG_INFO("setupEditorLayout: Creating SceneViewPanel...");
- // Create Scene View panel (center - add first as the main content)
auto sceneViewPanel = makeUnique<SceneViewPanel>(registry_, selection_);
- ES_LOG_INFO("setupEditorLayout: SceneViewPanel created, setting min size...");
sceneViewPanel->setMinSize(glm::vec2(400.0f, 300.0f));
- ES_LOG_INFO("setupEditorLayout: Adding SceneViewPanel to dock...");
dockArea_->addPanel(std::move(sceneViewPanel), ui::DockDropZone::Center);
ES_LOG_INFO("setupEditorLayout: Creating HierarchyPanel...");
- // Create Hierarchy panel (left side)
auto hierarchyPanel = makeUnique<HierarchyPanel>(registry_, selection_);
hierarchyPanel->setMinSize(glm::vec2(200.0f, 200.0f));
- ES_LOG_INFO("setupEditorLayout: Adding HierarchyPanel to dock...");
dockArea_->addPanel(std::move(hierarchyPanel), ui::DockDropZone::Left, nullptr, 0.2f);
ES_LOG_INFO("setupEditorLayout: Creating InspectorPanel...");
- // Create Inspector panel (right side)
auto inspectorPanel = makeUnique<InspectorPanel>(registry_, selection_, commandHistory_);
inspectorPanel->setMinSize(glm::vec2(250.0f, 200.0f));
- ES_LOG_INFO("setupEditorLayout: Adding InspectorPanel to dock...");
dockArea_->addPanel(std::move(inspectorPanel), ui::DockDropZone::Right, nullptr, 0.25f);
- ES_LOG_INFO("setupEditorLayout: Creating AssetBrowserPanel...");
- // Create Asset Browser panel (bottom)
+ editorRoot_->setMainContent(std::move(dockArea));
+
+ ES_LOG_INFO("setupEditorLayout: Creating AssetBrowserPanel for drawer...");
auto assetBrowserPanel = makeUnique<AssetBrowserPanel>(assetDatabase_, thumbnailGenerator_);
assetBrowserPanel->setMinSize(glm::vec2(300.0f, 200.0f));
- ES_LOG_INFO("setupEditorLayout: Adding AssetBrowserPanel to dock...");
- dockArea_->addPanel(std::move(assetBrowserPanel), ui::DockDropZone::Bottom, nullptr, 0.25f);
- ES_LOG_INFO("setupEditorLayout: Setting root widget...");
- // Set dock area as the root widget
- uiContext_->setRoot(std::move(dockArea));
+ editorRoot_->setAssetsDrawerContent(std::move(assetBrowserPanel));
+
+ (void)sink(editorRoot_->getAssetsDrawer()->onDockRequested).connect([this]() {
+ dockAssetBrowser();
+ });
- ES_LOG_INFO("Editor layout initialized with Hierarchy, SceneView, Inspector, and AssetBrowser panels");
+ uiContext_->setRoot(std::move(editorRoot));
+
+ ES_LOG_INFO("Editor layout initialized with StatusBar and Drawer system");
}
void EditorApplication::createDemoScene() {
@@ -521,6 +519,8 @@ void EditorApplication::showLauncher() {
ES_LOG_INFO("Switching to launcher mode");
dockArea_ = nullptr;
+ editorRoot_ = nullptr;
+ dockedAssetBrowser_ = nullptr;
setupLauncherLayout();
}
@@ -574,5 +574,24 @@ void EditorApplication::onOpenProjectRequested() {
}
}
+void EditorApplication::dockAssetBrowser() {
+ if (!dockArea_ || !editorRoot_) {
+ return;
+ }
+
+ ES_LOG_INFO("Docking AssetBrowser to dock area");
+
+ editorRoot_->closeAssetsDrawer();
+
+ if (!dockedAssetBrowser_) {
+ auto assetBrowserPanel = makeUnique<AssetBrowserPanel>(assetDatabase_, thumbnailGenerator_);
+ assetBrowserPanel->setMinSize(glm::vec2(300.0f, 200.0f));
+ dockedAssetBrowser_ = assetBrowserPanel.get();
+ dockArea_->addPanel(std::move(assetBrowserPanel), ui::DockDropZone::Bottom, nullptr, 0.25f);
+ }
+
+ ES_LOG_INFO("AssetBrowser docked successfully");
+}
+
} // namespace editor
} // namespace esengine
diff --git a/src/esengine/editor/EditorApplication.hpp b/src/esengine/editor/EditorApplication.hpp
index f2ae66e33..ef7463226 100644
--- a/src/esengine/editor/EditorApplication.hpp
+++ b/src/esengine/editor/EditorApplication.hpp
@@ -34,6 +34,8 @@ namespace editor {
class ProjectLauncherPanel;
class NewProjectDialog;
+class EditorRootContainer;
+class AssetBrowserPanel;
// =============================================================================
// Editor Mode
@@ -248,6 +250,11 @@ private:
*/
void onOpenProjectRequested();
+ /**
+ * @brief Dock the asset browser from drawer to dock area
+ */
+ void dockAssetBrowser();
+
// =========================================================================
// Constants
// =========================================================================
@@ -268,6 +275,8 @@ private:
Unique<ProjectManager> projectManager_; ///< Project manager
Unique<ui::UIContext> uiContext_; ///< UI system context
ui::DockArea* dockArea_ = nullptr; ///< Main docking area (owned by UIContext)
+ EditorRootContainer* editorRoot_ = nullptr; ///< Editor root container
+ AssetBrowserPanel* dockedAssetBrowser_ = nullptr; ///< Docked asset browser (if any)
ProjectLauncherPanel* launcherPanel_ = nullptr; ///< Launcher panel (owned by UIContext)
NewProjectDialog* newProjectDialog_ = nullptr; ///< New project dialog
diff --git a/src/esengine/editor/panels/AssetBrowserPanel.cpp b/src/esengine/editor/panels/AssetBrowserPanel.cpp
index c109a1049..8e5368ebf 100644
--- a/src/esengine/editor/panels/AssetBrowserPanel.cpp
+++ b/src/esengine/editor/panels/AssetBrowserPanel.cpp
@@ -95,14 +95,23 @@ void AssetBrowserPanel::onActivated() {
// =============================================================================
void AssetBrowserPanel::buildUI() {
+ constexpr glm::vec4 panelBg{0.145f, 0.145f, 0.149f, 1.0f}; // #252526
+ constexpr glm::vec4 toolbarBg{0.176f, 0.176f, 0.188f, 1.0f}; // #2d2d30
+ constexpr glm::vec4 mainBg{0.118f, 0.118f, 0.118f, 1.0f}; // #1e1e1e
+ constexpr glm::vec4 borderColor{0.235f, 0.235f, 0.235f, 1.0f}; // #3c3c3c
+
auto rootPanel = makeUnique<ui::Panel>(ui::WidgetId(getId().path + "_root"));
- rootPanel->setLayout(makeUnique<ui::StackLayout>(ui::StackDirection::Horizontal, 4.0f));
- rootPanel->setDrawBackground(false);
+ rootPanel->setLayout(makeUnique<ui::StackLayout>(ui::StackDirection::Horizontal, 0.0f));
+ rootPanel->setDrawBackground(true);
+ rootPanel->setBackgroundColor(mainBg);
auto leftPanel = makeUnique<ui::Panel>(ui::WidgetId(getId().path + "_left"));
leftPanel->setWidth(ui::SizeValue::px(200.0f));
leftPanel->setHeight(ui::SizeValue::flex(1.0f));
leftPanel->setDrawBackground(true);
+ leftPanel->setBackgroundColor(panelBg);
+ leftPanel->setBorderColor(borderColor);
+ leftPanel->setBorderWidth(ui::BorderWidth(0.0f, 1.0f, 0.0f, 0.0f));
auto leftScrollView = makeUnique<ui::ScrollView>(ui::WidgetId(getId().path + "_left_scroll"));
leftScrollView->setScrollDirection(ui::ScrollDirection::Vertical);
@@ -111,7 +120,7 @@ void AssetBrowserPanel::buildUI() {
auto folderTree = makeUnique<ui::TreeView>(ui::WidgetId(getId().path + "_folder_tree"));
folderTree->setMultiSelect(false);
- folderTree->setRowHeight(22.0f);
+ folderTree->setRowHeight(24.0f);
folderTree->setIndentSize(16.0f);
folderTree->setWidth(ui::SizeValue::flex(1.0f));
folderTree->setHeight(ui::SizeValue::autoSize());
@@ -126,19 +135,23 @@ void AssetBrowserPanel::buildUI() {
auto rightPanel = makeUnique<ui::Panel>(ui::WidgetId(getId().path + "_right"));
rightPanel->setWidth(ui::SizeValue::flex(1.0f));
rightPanel->setHeight(ui::SizeValue::flex(1.0f));
- rightPanel->setLayout(makeUnique<ui::StackLayout>(ui::StackDirection::Vertical, 4.0f));
- rightPanel->setDrawBackground(false);
+ rightPanel->setLayout(makeUnique<ui::StackLayout>(ui::StackDirection::Vertical, 0.0f));
+ rightPanel->setDrawBackground(true);
+ rightPanel->setBackgroundColor(mainBg);
auto toolbar = makeUnique<ui::Panel>(ui::WidgetId(getId().path + "_toolbar"));
- toolbar->setHeight(ui::SizeValue::px(32.0f));
+ toolbar->setHeight(ui::SizeValue::px(38.0f));
toolbar->setWidth(ui::SizeValue::flex(1.0f));
- toolbar->setPadding(ui::Insets::symmetric(4.0f, 4.0f));
+ toolbar->setPadding(ui::Insets(6.0f, 12.0f, 6.0f, 12.0f));
toolbar->setDrawBackground(true);
+ toolbar->setBackgroundColor(toolbarBg);
+ toolbar->setBorderColor(borderColor);
+ toolbar->setBorderWidth(ui::BorderWidth(0.0f, 0.0f, 1.0f, 0.0f));
auto searchField = makeUnique<ui::TextField>(ui::WidgetId(getId().path + "_search"));
- searchField->setPlaceholder("Search...");
+ searchField->setPlaceholder("Search assets...");
searchField->setWidth(ui::SizeValue::px(200.0f));
- searchField->setHeight(ui::SizeValue::px(24.0f));
+ searchField->setHeight(ui::SizeValue::px(26.0f));
searchField_ = searchField.get();
toolbar->addChild(std::move(searchField));
@@ -154,12 +167,23 @@ void AssetBrowserPanel::buildUI() {
gridPanel->setWidth(ui::SizeValue::flex(1.0f));
gridPanel->setHeight(ui::SizeValue::autoSize());
gridPanel->setLayout(makeUnique<ui::WrapLayout>(8.0f, 8.0f));
+ gridPanel->setPadding(ui::Insets::all(12.0f));
assetGridPanel_ = gridPanel.get();
scrollView->setContent(std::move(gridPanel));
assetScrollView_ = scrollView.get();
rightPanel->addChild(std::move(scrollView));
+ auto statusBar = makeUnique<ui::Panel>(ui::WidgetId(getId().path + "_status"));
+ statusBar->setHeight(ui::SizeValue::px(24.0f));
+ statusBar->setWidth(ui::SizeValue::flex(1.0f));
+ statusBar->setPadding(ui::Insets(4.0f, 12.0f, 4.0f, 12.0f));
+ statusBar->setDrawBackground(true);
+ statusBar->setBackgroundColor(panelBg);
+ statusBar->setBorderColor(borderColor);
+ statusBar->setBorderWidth(ui::BorderWidth(1.0f, 0.0f, 0.0f, 0.0f));
+ rightPanel->addChild(std::move(statusBar));
+
rightPanel_ = rightPanel.get();
rootPanel->addChild(std::move(rightPanel));
diff --git a/src/esengine/editor/panels/AssetBrowserTypes.hpp b/src/esengine/editor/panels/AssetBrowserTypes.hpp
index bcc5615e8..ba9185c3e 100644
--- a/src/esengine/editor/panels/AssetBrowserTypes.hpp
+++ b/src/esengine/editor/panels/AssetBrowserTypes.hpp
@@ -88,15 +88,15 @@ inline AssetType getAssetTypeFromExtension(const std::string& ext) {
inline glm::vec4 getAssetTypeColor(AssetType type) {
switch (type) {
- case AssetType::Folder: return {0.9f, 0.8f, 0.3f, 1.0f};
- case AssetType::Texture: return {0.3f, 0.7f, 0.9f, 1.0f};
- case AssetType::Audio: return {0.9f, 0.5f, 0.3f, 1.0f};
- case AssetType::Script: return {0.5f, 0.9f, 0.5f, 1.0f};
- case AssetType::Shader: return {0.8f, 0.5f, 0.9f, 1.0f};
- case AssetType::Scene: return {0.3f, 0.9f, 0.9f, 1.0f};
- case AssetType::Prefab: return {0.9f, 0.3f, 0.6f, 1.0f};
- case AssetType::Font: return {0.7f, 0.7f, 0.7f, 1.0f};
- default: return {0.5f, 0.5f, 0.5f, 1.0f};
+ case AssetType::Folder: return {0.863f, 0.714f, 0.478f, 1.0f}; // #dcb67a
+ case AssetType::Texture: return {0.925f, 0.251f, 0.478f, 1.0f}; // #ec407a
+ case AssetType::Audio: return {1.0f, 0.655f, 0.149f, 1.0f}; // #ffa726
+ case AssetType::Script: return {0.259f, 0.647f, 0.961f, 1.0f}; // #42a5f5
+ case AssetType::Shader: return {0.545f, 0.361f, 0.965f, 1.0f}; // #8b5cf6
+ case AssetType::Scene: return {0.4f, 0.733f, 0.416f, 1.0f}; // #66bb6a
+ case AssetType::Prefab: return {0.149f, 0.651f, 0.604f, 1.0f}; // #26a69a
+ case AssetType::Font: return {0.565f, 0.792f, 0.976f, 1.0f}; // #90caf9
+ default: return {0.565f, 0.792f, 0.976f, 1.0f}; // #90caf9
}
}
diff --git a/src/esengine/editor/panels/AssetGridItem.cpp b/src/esengine/editor/panels/AssetGridItem.cpp
index 610ad0c7c..ad0dffc08 100644
--- a/src/esengine/editor/panels/AssetGridItem.cpp
+++ b/src/esengine/editor/panels/AssetGridItem.cpp
@@ -141,35 +141,32 @@ void AssetGridItem::render(ui::UIBatchRenderer& renderer) {
return;
}
- const auto& theme = ctx->getTheme();
+ constexpr glm::vec4 selectedBg{0.035f, 0.278f, 0.443f, 1.0f}; // #094771
+ constexpr glm::vec4 selectedBorder{0.231f, 0.510f, 0.965f, 1.0f}; // #3b82f6
+ constexpr glm::vec4 hoverBg{0.176f, 0.176f, 0.188f, 1.0f}; // #2d2d30
+ constexpr glm::vec4 textColor{0.878f, 0.878f, 0.878f, 1.0f}; // #e0e0e0
if (selected_) {
- renderer.drawRoundedRect(
- bounds,
- theme.colors.selection,
- ui::CornerRadii::all(4.0f)
- );
+ renderer.drawRoundedRect(bounds, selectedBg, ui::CornerRadii::all(4.0f));
+ renderer.drawRoundedRectOutline(bounds, selectedBorder, ui::CornerRadii::all(4.0f), 1.0f);
} else if (isHovered()) {
- renderer.drawRoundedRect(
- bounds,
- theme.colors.buttonHover,
- ui::CornerRadii::all(4.0f)
- );
+ renderer.drawRoundedRect(bounds, hoverBg, ui::CornerRadii::all(4.0f));
}
f32 iconX = bounds.x + (bounds.width - ICON_SIZE) * 0.5f;
f32 iconY = bounds.y + ICON_PADDING;
ui::Rect iconBounds{iconX, iconY, ICON_SIZE, ICON_SIZE};
- glm::vec4 bgColor = getAssetTypeColor(entry_.type);
- bgColor.a = 0.15f;
- renderer.drawRoundedRect(iconBounds, bgColor, ui::CornerRadii::all(6.0f));
+ constexpr glm::vec4 thumbnailBg{0.102f, 0.102f, 0.102f, 1.0f}; // #1a1a1a
+ constexpr glm::vec4 thumbnailBorder{0.2f, 0.2f, 0.2f, 1.0f}; // #333
+ renderer.drawRoundedRect(iconBounds, thumbnailBg, ui::CornerRadii::all(4.0f));
+ renderer.drawRoundedRectOutline(iconBounds, thumbnailBorder, ui::CornerRadii::all(4.0f), 1.0f);
ui::MSDFFont* iconFont = ctx->getIconMSDFFont();
if (iconFont) {
glm::vec4 iconColor = getAssetTypeColor(entry_.type);
const char* icon = getAssetTypeIcon(entry_.type);
- renderer.drawTextInBounds(icon, iconBounds, *iconFont, 28.0f, iconColor,
+ renderer.drawTextInBounds(icon, iconBounds, *iconFont, 32.0f, iconColor,
ui::HAlign::Center, ui::VAlign::Center);
}
@@ -178,13 +175,12 @@ void AssetGridItem::render(ui::UIBatchRenderer& renderer) {
f32 labelWidth = bounds.width - 8.0f;
ui::Rect labelBounds{
bounds.x + 4.0f,
- bounds.y + ICON_PADDING + ICON_SIZE + 4.0f,
+ bounds.y + ICON_PADDING + ICON_SIZE + 6.0f,
labelWidth,
LABEL_HEIGHT
};
std::string displayName = truncateText(entry_.name, *font, 11.0f, labelWidth);
- glm::vec4 textColor = theme.colors.textPrimary;
renderer.drawTextInBounds(
displayName,
labelBounds,
diff --git a/src/esengine/editor/panels/AssetGridItem.hpp b/src/esengine/editor/panels/AssetGridItem.hpp
index 1b2ced89f..4a2ca7989 100644
--- a/src/esengine/editor/panels/AssetGridItem.hpp
+++ b/src/esengine/editor/panels/AssetGridItem.hpp
@@ -28,11 +28,11 @@ namespace esengine::editor {
class AssetGridItem : public ui::Widget {
public:
- static constexpr f32 ITEM_WIDTH = 80.0f;
- static constexpr f32 ITEM_HEIGHT = 100.0f;
- static constexpr f32 ICON_SIZE = 48.0f;
- static constexpr f32 ICON_PADDING = 16.0f;
- static constexpr f32 LABEL_HEIGHT = 36.0f;
+ static constexpr f32 ITEM_WIDTH = 90.0f;
+ static constexpr f32 ITEM_HEIGHT = 110.0f;
+ static constexpr f32 ICON_SIZE = 64.0f;
+ static constexpr f32 ICON_PADDING = 12.0f;
+ static constexpr f32 LABEL_HEIGHT = 30.0f;
AssetGridItem(const ui::WidgetId& id, const AssetEntry& entry);
diff --git a/src/esengine/editor/widgets/DrawerPanel.cpp b/src/esengine/editor/widgets/DrawerPanel.cpp
new file mode 100644
index 000000000..0a013417b
--- /dev/null
+++ b/src/esengine/editor/widgets/DrawerPanel.cpp
@@ -0,0 +1,243 @@
+/**
+ * @file DrawerPanel.cpp
+ * @brief Bottom drawer panel implementation
+ *
+ * @author ESEngine Team
+ * @date 2026
+ *
+ * @copyright Copyright (c) 2026 ESEngine Team
+ * Licensed under the MIT License.
+ */
+
+#include "DrawerPanel.hpp"
+#include "../../ui/UIContext.hpp"
+#include "../../ui/rendering/UIBatchRenderer.hpp"
+#include "../../ui/icons/Icons.hpp"
+#include "../../math/Math.hpp"
+
+#if ES_FEATURE_SDF_FONT
+#include "../../ui/font/MSDFFont.hpp"
+#endif
+
+namespace esengine::editor {
+
+// =============================================================================
+// Constructor
+// =============================================================================
+
+DrawerPanel::DrawerPanel(const ui::WidgetId& id, const std::string& title)
+ : Widget(id), title_(title) {}
+
+// =============================================================================
+// Configuration
+// =============================================================================
+
+void DrawerPanel::setOpen(bool open) {
+ open_ = open;
+ invalidateLayout();
+}
+
+void DrawerPanel::setDrawerHeight(f32 height) {
+ drawerHeight_ = glm::max(height, MIN_HEIGHT);
+ if (open_) {
+ invalidateLayout();
+ }
+}
+
+void DrawerPanel::setContent(Unique<Widget> content) {
+ if (content_) {
+ removeChild(content_);
+ }
+
+ content_ = content.get();
+ if (content) {
+ addChild(std::move(content));
+ }
+}
+
+// =============================================================================
+// Layout
+// =============================================================================
+
+glm::vec2 DrawerPanel::measure(f32 availableWidth, f32 availableHeight) {
+ (void)availableHeight;
+
+ if (!open_) {
+ return {availableWidth, 0.0f};
+ }
+
+ return {availableWidth, drawerHeight_};
+}
+
+void DrawerPanel::layout(const ui::Rect& bounds) {
+ Widget::layout(bounds);
+ updateContentBounds();
+}
+
+void DrawerPanel::updateContentBounds() {
+ if (!content_ || !open_) {
+ return;
+ }
+
+ const ui::Rect& bounds = getBounds();
+
+ resizeHandleBounds_ = ui::Rect{
+ bounds.x,
+ bounds.y - 4.0f,
+ bounds.width,
+ RESIZE_HANDLE_HEIGHT
+ };
+
+ ui::Rect contentBounds{
+ bounds.x,
+ bounds.y + HEADER_HEIGHT,
+ bounds.width,
+ bounds.height - HEADER_HEIGHT
+ };
+
+ content_->measure(contentBounds.width, contentBounds.height);
+ content_->layout(contentBounds);
+}
+
+// =============================================================================
+// Rendering
+// =============================================================================
+
+void DrawerPanel::render(ui::UIBatchRenderer& renderer) {
+ if (!open_) {
+ return;
+ }
+
+ ui::UIContext* ctx = getContext();
+ if (!ctx) return;
+
+ const ui::Rect& bounds = getBounds();
+
+ constexpr glm::vec4 bgColor{0.118f, 0.118f, 0.118f, 1.0f}; // #1e1e1e
+ constexpr glm::vec4 headerBg{0.145f, 0.145f, 0.149f, 1.0f}; // #252526
+ constexpr glm::vec4 borderColor{0.235f, 0.235f, 0.235f, 1.0f}; // #3c3c3c
+ constexpr glm::vec4 topBorderColor{0.231f, 0.510f, 0.965f, 1.0f}; // #3b82f6
+ constexpr glm::vec4 textColor{0.878f, 0.878f, 0.878f, 1.0f}; // #e0e0e0
+ constexpr glm::vec4 iconColor{0.533f, 0.533f, 0.533f, 1.0f}; // #888
+ constexpr glm::vec4 iconHoverColor{0.878f, 0.878f, 0.878f, 1.0f}; // #e0e0e0
+ constexpr glm::vec4 buttonHoverBg{0.235f, 0.235f, 0.235f, 1.0f}; // #3c3c3c
+ constexpr glm::vec4 resizeHandleColor{0.298f, 0.298f, 0.298f, 1.0f}; // #4c4c4c
+
+ renderer.drawRect(bounds, bgColor);
+
+ ui::Rect topBorder{bounds.x, bounds.y, bounds.width, 2.0f};
+ renderer.drawRect(topBorder, topBorderColor);
+
+ ui::Rect headerBounds{bounds.x, bounds.y, bounds.width, HEADER_HEIGHT};
+ renderer.drawRect(headerBounds, headerBg);
+
+ ui::Rect headerBottomBorder{bounds.x, bounds.y + HEADER_HEIGHT - 1.0f, bounds.width, 1.0f};
+ renderer.drawRect(headerBottomBorder, borderColor);
+
+#if ES_FEATURE_SDF_FONT
+ ui::MSDFFont* iconFont = ctx->getIconMSDFFont();
+ ui::MSDFFont* textFont = ctx->getDefaultMSDFFont();
+
+ f32 headerCenterY = bounds.y + HEADER_HEIGHT * 0.5f;
+
+ if (iconFont) {
+ ui::Rect folderIconBounds{bounds.x + 12.0f, headerCenterY - 7.0f, 14.0f, 14.0f};
+ renderer.drawTextInBounds(ui::icons::FolderOpen, folderIconBounds, *iconFont, 14.0f, textColor,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+
+ if (textFont) {
+ ui::Rect titleBounds{bounds.x + 32.0f, headerCenterY - 6.0f, 200.0f, 12.0f};
+ renderer.drawTextInBounds(title_, titleBounds, *textFont, 12.0f, textColor,
+ ui::HAlign::Left, ui::VAlign::Center);
+ }
+
+ f32 buttonX = bounds.x + bounds.width - 8.0f;
+
+ closeButtonBounds_ = ui::Rect{buttonX - 24.0f, bounds.y + 2.0f, 24.0f, 24.0f};
+ if (closeHovered_) {
+ renderer.drawRoundedRect(closeButtonBounds_, buttonHoverBg, ui::CornerRadii::all(3.0f));
+ }
+ if (iconFont) {
+ renderer.drawTextInBounds(ui::icons::X, closeButtonBounds_, *iconFont, 14.0f,
+ closeHovered_ ? iconHoverColor : iconColor,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+
+ if (showDockButton_) {
+ dockButtonBounds_ = ui::Rect{buttonX - 52.0f, bounds.y + 2.0f, 24.0f, 24.0f};
+ if (dockHovered_) {
+ renderer.drawRoundedRect(dockButtonBounds_, buttonHoverBg, ui::CornerRadii::all(3.0f));
+ }
+ if (iconFont) {
+ renderer.drawTextInBounds(ui::icons::PanelBottom, dockButtonBounds_, *iconFont, 14.0f,
+ dockHovered_ ? iconHoverColor : iconColor,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+ }
+#endif
+
+ if (content_) {
+ content_->renderTree(renderer);
+ }
+}
+
+// =============================================================================
+// Event Handling
+// =============================================================================
+
+bool DrawerPanel::onMouseDown(const ui::MouseButtonEvent& event) {
+ if (!open_ || event.button != ui::MouseButton::Left) {
+ return false;
+ }
+
+ if (closeButtonBounds_.contains(event.x, event.y)) {
+ onClose.publish();
+ return true;
+ }
+
+ if (showDockButton_ && dockButtonBounds_.contains(event.x, event.y)) {
+ onDockRequested.publish();
+ return true;
+ }
+
+ if (resizeHandleBounds_.contains(event.x, event.y)) {
+ resizing_ = true;
+ resizeStartY_ = event.y;
+ resizeStartHeight_ = drawerHeight_;
+ return true;
+ }
+
+ return false;
+}
+
+bool DrawerPanel::onMouseUp(const ui::MouseButtonEvent& event) {
+ if (event.button == ui::MouseButton::Left && resizing_) {
+ resizing_ = false;
+ return true;
+ }
+ return false;
+}
+
+bool DrawerPanel::onMouseMove(const ui::MouseMoveEvent& event) {
+ closeHovered_ = closeButtonBounds_.contains(event.x, event.y);
+ dockHovered_ = showDockButton_ && dockButtonBounds_.contains(event.x, event.y);
+
+ if (resizing_) {
+ f32 delta = resizeStartY_ - event.y;
+ f32 newHeight = resizeStartHeight_ + delta;
+
+ ui::UIContext* ctx = getContext();
+ if (ctx) {
+ f32 maxHeight = ctx->getViewportSize().y * 0.7f;
+ newHeight = glm::clamp(newHeight, MIN_HEIGHT, maxHeight);
+ }
+
+ setDrawerHeight(newHeight);
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace esengine::editor
diff --git a/src/esengine/editor/widgets/DrawerPanel.hpp b/src/esengine/editor/widgets/DrawerPanel.hpp
new file mode 100644
index 000000000..01671e6de
--- /dev/null
+++ b/src/esengine/editor/widgets/DrawerPanel.hpp
@@ -0,0 +1,82 @@
+/**
+ * @file DrawerPanel.hpp
+ * @brief Bottom drawer panel that slides up from status bar
+ *
+ * @author ESEngine Team
+ * @date 2026
+ *
+ * @copyright Copyright (c) 2026 ESEngine Team
+ * Licensed under the MIT License.
+ */
+#pragma once
+
+// =============================================================================
+// Includes
+// =============================================================================
+
+#include "../../ui/widgets/Widget.hpp"
+#include "../../events/Signal.hpp"
+
+#include <string>
+
+namespace esengine::editor {
+
+// =============================================================================
+// DrawerPanel Class
+// =============================================================================
+
+class DrawerPanel : public ui::Widget {
+public:
+ static constexpr f32 DEFAULT_HEIGHT = 300.0f;
+ static constexpr f32 MIN_HEIGHT = 200.0f;
+ static constexpr f32 HEADER_HEIGHT = 28.0f;
+ static constexpr f32 RESIZE_HANDLE_HEIGHT = 8.0f;
+
+ DrawerPanel(const ui::WidgetId& id, const std::string& title);
+
+ void setOpen(bool open);
+ bool isOpen() const { return open_; }
+
+ void setDrawerHeight(f32 height);
+ f32 getDrawerHeight() const { return drawerHeight_; }
+
+ void setTitle(const std::string& title) { title_ = title; }
+ const std::string& getTitle() const { return title_; }
+
+ void setContent(Unique<Widget> content);
+ Widget* getContent() const { return content_; }
+
+ void setShowDockButton(bool show) { showDockButton_ = show; }
+ bool isShowDockButton() const { return showDockButton_; }
+
+ Signal<void()> onClose;
+ Signal<void()> onDockRequested;
+
+ glm::vec2 measure(f32 availableWidth, f32 availableHeight) override;
+ void layout(const ui::Rect& bounds) override;
+ void render(ui::UIBatchRenderer& renderer) override;
+ bool onMouseDown(const ui::MouseButtonEvent& event) override;
+ bool onMouseUp(const ui::MouseButtonEvent& event) override;
+ bool onMouseMove(const ui::MouseMoveEvent& event) override;
+
+private:
+ void updateContentBounds();
+
+ std::string title_;
+ Widget* content_ = nullptr;
+ f32 drawerHeight_ = DEFAULT_HEIGHT;
+ bool open_ = false;
+ bool showDockButton_ = true;
+
+ bool resizing_ = false;
+ f32 resizeStartY_ = 0.0f;
+ f32 resizeStartHeight_ = 0.0f;
+
+ ui::Rect closeButtonBounds_;
+ ui::Rect dockButtonBounds_;
+ ui::Rect resizeHandleBounds_;
+ bool closeHovered_ = false;
+ bool dockHovered_ = false;
+};
+
+} // namespace esengine::editor
diff --git a/src/esengine/editor/widgets/EditorRootContainer.cpp b/src/esengine/editor/widgets/EditorRootContainer.cpp
new file mode 100644
index 000000000..d0b7e552a
--- /dev/null
+++ b/src/esengine/editor/widgets/EditorRootContainer.cpp
@@ -0,0 +1,236 @@
+/**
+ * @file EditorRootContainer.cpp
+ * @brief Root container implementation
+ *
+ * @author ESEngine Team
+ * @date 2026
+ *
+ * @copyright Copyright (c) 2026 ESEngine Team
+ * Licensed under the MIT License.
+ */
+
+#include "EditorRootContainer.hpp"
+#include "../../ui/UIContext.hpp"
+#include "../../ui/rendering/UIBatchRenderer.hpp"
+#include "../../events/Sink.hpp"
+#include "../../core/Log.hpp"
+
+namespace esengine::editor {
+
+// =============================================================================
+// Constructor
+// =============================================================================
+
+EditorRootContainer::EditorRootContainer(const ui::WidgetId& id) : Widget(id) {
+ auto statusBar = makeUnique<StatusBar>(ui::WidgetId(id.path + ".status_bar"));
+ statusBar_ = statusBar.get();
+ addChild(std::move(statusBar));
+
+ auto assetsDrawer = makeUnique<DrawerPanel>(
+ ui::WidgetId(id.path + ".assets_drawer"), "Content Browser");
+ assetsDrawer_ = assetsDrawer.get();
+ assetsDrawer_->setShowDockButton(true);
+ addChild(std::move(assetsDrawer));
+
+ auto outputDrawer = makeUnique<DrawerPanel>(
+ ui::WidgetId(id.path + ".output_drawer"), "Output");
+ outputDrawer_ = outputDrawer.get();
+ outputDrawer_->setShowDockButton(false);
+ addChild(std::move(outputDrawer));
+
+ connections_.add(sink(statusBar_->onAssetsToggle).connect([this]() {
+ toggleAssetsDrawer();
+ }));
+
+ connections_.add(sink(statusBar_->onOutputToggle).connect([this]() {
+ toggleOutputDrawer();
+ }));
+
+ connections_.add(sink(assetsDrawer_->onClose).connect([this]() {
+ closeAssetsDrawer();
+ }));
+
+ connections_.add(sink(outputDrawer_->onClose).connect([this]() {
+ closeOutputDrawer();
+ }));
+}
+
+// =============================================================================
+// Content Management
+// =============================================================================
+
+void EditorRootContainer::setMainContent(Unique<Widget> content) {
+ if (mainContent_) {
+ removeChild(mainContent_);
+ }
+
+ mainContent_ = content.get();
+ if (content) {
+ addChild(std::move(content));
+ }
+
+ invalidateLayout();
+}
+
+void EditorRootContainer::setAssetsDrawerContent(Unique<Widget> content) {
+ if (assetsDrawer_) {
+ assetsDrawer_->setContent(std::move(content));
+ }
+}
+
+void EditorRootContainer::setOutputDrawerContent(Unique<Widget> content) {
+ if (outputDrawer_) {
+ outputDrawer_->setContent(std::move(content));
+ }
+}
+
+// =============================================================================
+// Drawer Control
+// =============================================================================
+
+void EditorRootContainer::openAssetsDrawer() {
+ if (outputDrawer_->isOpen()) {
+ outputDrawer_->setOpen(false);
+ statusBar_->setOutputDrawerOpen(false);
+ }
+ assetsDrawer_->setOpen(true);
+ statusBar_->setAssetsDrawerOpen(true);
+ invalidateLayout();
+}
+
+void EditorRootContainer::closeAssetsDrawer() {
+ assetsDrawer_->setOpen(false);
+ statusBar_->setAssetsDrawerOpen(false);
+ invalidateLayout();
+}
+
+void EditorRootContainer::toggleAssetsDrawer() {
+ ES_LOG_INFO("EditorRootContainer::toggleAssetsDrawer called, isOpen={}", assetsDrawer_->isOpen());
+ if (assetsDrawer_->isOpen()) {
+ closeAssetsDrawer();
+ } else {
+ openAssetsDrawer();
+ }
+ ES_LOG_INFO("After toggle, isOpen={}", assetsDrawer_->isOpen());
+}
+
+bool EditorRootContainer::isAssetsDrawerOpen() const {
+ return assetsDrawer_ && assetsDrawer_->isOpen();
+}
+
+void EditorRootContainer::openOutputDrawer() {
+ if (assetsDrawer_->isOpen()) {
+ assetsDrawer_->setOpen(false);
+ statusBar_->setAssetsDrawerOpen(false);
+ }
+ outputDrawer_->setOpen(true);
+ statusBar_->setOutputDrawerOpen(true);
+ invalidateLayout();
+}
+
+void EditorRootContainer::closeOutputDrawer() {
+ outputDrawer_->setOpen(false);
+ statusBar_->setOutputDrawerOpen(false);
+ invalidateLayout();
+}
+
+void EditorRootContainer::toggleOutputDrawer() {
+ if (outputDrawer_->isOpen()) {
+ closeOutputDrawer();
+ } else {
+ openOutputDrawer();
+ }
+}
+
+bool EditorRootContainer::isOutputDrawerOpen() const {
+ return outputDrawer_ && outputDrawer_->isOpen();
+}
+
+// =============================================================================
+// Layout
+// =============================================================================
+
+glm::vec2 EditorRootContainer::measure(f32 availableWidth, f32 availableHeight) {
+ return {availableWidth, availableHeight};
+}
+
+void EditorRootContainer::layout(const ui::Rect& bounds) {
+ Widget::layout(bounds);
+ updateLayout();
+}
+
+void EditorRootContainer::updateLayout() {
+ const ui::Rect& bounds = getBounds();
+
+ ui::Rect statusBarBounds{
+ bounds.x,
+ bounds.y + bounds.height - StatusBar::HEIGHT,
+ bounds.width,
+ StatusBar::HEIGHT
+ };
+ statusBar_->measure(statusBarBounds.width, statusBarBounds.height);
+ statusBar_->layout(statusBarBounds);
+
+ f32 drawerHeight = 0.0f;
+ DrawerPanel* activeDrawer = nullptr;
+
+ if (assetsDrawer_->isOpen()) {
+ activeDrawer = assetsDrawer_;
+ drawerHeight = assetsDrawer_->getDrawerHeight();
+ } else if (outputDrawer_->isOpen()) {
+ activeDrawer = outputDrawer_;
+ drawerHeight = outputDrawer_->getDrawerHeight();
+ }
+
+ if (activeDrawer) {
+ ui::Rect drawerBounds{
+ bounds.x,
+ bounds.y + bounds.height - StatusBar::HEIGHT - drawerHeight,
+ bounds.width,
+ drawerHeight
+ };
+ activeDrawer->measure(drawerBounds.width, drawerBounds.height);
+ activeDrawer->layout(drawerBounds);
+ }
+
+ if (!assetsDrawer_->isOpen()) {
+ assetsDrawer_->layout(ui::Rect{0, 0, 0, 0});
+ }
+ if (!outputDrawer_->isOpen()) {
+ outputDrawer_->layout(ui::Rect{0, 0, 0, 0});
+ }
+
+ if (mainContent_) {
+ f32 mainContentHeight = bounds.height - StatusBar::HEIGHT - drawerHeight;
+ ui::Rect mainBounds{
+ bounds.x,
+ bounds.y,
+ bounds.width,
+ mainContentHeight
+ };
+ mainContent_->measure(mainBounds.width, mainBounds.height);
+ mainContent_->layout(mainBounds);
+ }
+}
+
+// =============================================================================
+// Rendering
+// =============================================================================
+
+void EditorRootContainer::render(ui::UIBatchRenderer& renderer) {
+ if (mainContent_) {
+ mainContent_->renderTree(renderer);
+ }
+
+ if (assetsDrawer_->isOpen()) {
+ assetsDrawer_->renderTree(renderer);
+ }
+
+ if (outputDrawer_->isOpen()) {
+ outputDrawer_->renderTree(renderer);
+ }
+
+ statusBar_->renderTree(renderer);
+}
+
+} // namespace esengine::editor
diff --git a/src/esengine/editor/widgets/EditorRootContainer.hpp b/src/esengine/editor/widgets/EditorRootContainer.hpp
new file mode 100644
index 000000000..cfcba6e98
--- /dev/null
+++ b/src/esengine/editor/widgets/EditorRootContainer.hpp
@@ -0,0 +1,66 @@
+/**
+ * @file EditorRootContainer.hpp
+ * @brief Root container managing main content, drawers, and status bar
+ *
+ * @author ESEngine Team
+ * @date 2026
+ *
+ * @copyright Copyright (c) 2026 ESEngine Team
+ * Licensed under the MIT License.
+ */
+#pragma once
+
+// =============================================================================
+// Includes
+// =============================================================================
+
+#include "../../ui/widgets/Widget.hpp"
+#include "../../events/Signal.hpp"
+#include "StatusBar.hpp"
+#include "DrawerPanel.hpp"
+
+namespace esengine::editor {
+
+// =============================================================================
+// EditorRootContainer Class
+// =============================================================================
+
+class EditorRootContainer : public ui::Widget {
+public:
+ explicit EditorRootContainer(const ui::WidgetId& id);
+
+ void setMainContent(Unique<Widget> content);
+ Widget* getMainContent() const { return mainContent_; }
+
+ void setAssetsDrawerContent(Unique<Widget> content);
+ void setOutputDrawerContent(Unique<Widget> content);
+
+ void openAssetsDrawer();
+ void closeAssetsDrawer();
+ void toggleAssetsDrawer();
+ bool isAssetsDrawerOpen() const;
+
+ void openOutputDrawer();
+ void closeOutputDrawer();
+ void toggleOutputDrawer();
+ bool isOutputDrawerOpen() const;
+
+ StatusBar* getStatusBar() const { return statusBar_; }
+ DrawerPanel* getAssetsDrawer() const { return assetsDrawer_; }
+ DrawerPanel* getOutputDrawer() const { return outputDrawer_; }
+
+ glm::vec2 measure(f32 availableWidth, f32 availableHeight) override;
+ void layout(const ui::Rect& bounds) override;
+ void render(ui::UIBatchRenderer& renderer) override;
+
+private:
+ void updateLayout();
+
+ Widget* mainContent_ = nullptr;
+ StatusBar* statusBar_ = nullptr;
+ DrawerPanel* assetsDrawer_ = nullptr;
+ DrawerPanel* outputDrawer_ = nullptr;
+ ConnectionHolder connections_;
+};
+
+} // namespace esengine::editor
diff --git a/src/esengine/editor/widgets/StatusBar.cpp b/src/esengine/editor/widgets/StatusBar.cpp
new file mode 100644
index 000000000..8c697fec6
--- /dev/null
+++ b/src/esengine/editor/widgets/StatusBar.cpp
@@ -0,0 +1,271 @@
+/**
+ * @file StatusBar.cpp
+ * @brief Editor status bar implementation
+ *
+ * @author ESEngine Team
+ * @date 2026
+ *
+ * @copyright Copyright (c) 2026 ESEngine Team
+ * Licensed under the MIT License.
+ */
+
+#include "StatusBar.hpp"
+#include "../../ui/UIContext.hpp"
+#include "../../ui/rendering/UIBatchRenderer.hpp"
+#include "../../ui/icons/Icons.hpp"
+#include "../../core/Log.hpp"
+
+#if ES_FEATURE_SDF_FONT
+#include "../../ui/font/MSDFFont.hpp"
+#endif
+
+namespace esengine::editor {
+
+// =============================================================================
+// Constructor
+// =============================================================================
+
+StatusBar::StatusBar(const ui::WidgetId& id) : Widget(id) {
+ setHeight(ui::SizeValue::px(HEIGHT));
+ setWidth(ui::SizeValue::flex(1.0f));
+}
+
+// =============================================================================
+// Layout
+// =============================================================================
+
+glm::vec2 StatusBar::measure(f32 availableWidth, f32 availableHeight) {
+ (void)availableHeight;
+ return {availableWidth, HEIGHT};
+}
+
+// =============================================================================
+// Rendering
+// =============================================================================
+
+void StatusBar::render(ui::UIBatchRenderer& renderer) {
+ ui::UIContext* ctx = getContext();
+ if (!ctx) return;
+
+ const ui::Rect& bounds = getBounds();
+
+ constexpr glm::vec4 bgColor{0.176f, 0.176f, 0.176f, 1.0f}; // #2d2d2d
+ constexpr glm::vec4 borderColor{0.102f, 0.102f, 0.102f, 1.0f}; // #1a1a1a
+ constexpr glm::vec4 dividerColor{0.267f, 0.267f, 0.267f, 1.0f}; // #444
+ constexpr glm::vec4 textColor{0.533f, 0.533f, 0.533f, 1.0f}; // #888
+ constexpr glm::vec4 textHoverColor{0.8f, 0.8f, 0.8f, 1.0f}; // #ccc
+ constexpr glm::vec4 activeColor{1.0f, 1.0f, 1.0f, 1.0f}; // #fff
+ constexpr glm::vec4 activeBg{0.294f, 0.294f, 0.294f, 1.0f}; // #4a4a4a
+ constexpr glm::vec4 activeIndicator{0.0f, 0.471f, 0.831f, 1.0f}; // #0078d4
+ constexpr glm::vec4 hoverBg{1.0f, 1.0f, 1.0f, 0.05f};
+ constexpr glm::vec4 assetsBtnBg{0.227f, 0.227f, 0.227f, 1.0f}; // #3a3a3a
+
+ renderer.drawRect(bounds, bgColor);
+
+ ui::Rect topBorder{bounds.x, bounds.y, bounds.width, 1.0f};
+ renderer.drawRect(topBorder, borderColor);
+
+ updateButtonRects();
+
+#if ES_FEATURE_SDF_FONT
+ ui::MSDFFont* iconFont = ctx->getIconMSDFFont();
+ ui::MSDFFont* textFont = ctx->getDefaultMSDFFont();
+
+ if (assetsButton_.bounds.width > 0) {
+ glm::vec4 btnBg = assetsDrawerOpen_ ? activeBg : assetsBtnBg;
+ glm::vec4 btnText = assetsDrawerOpen_ ? activeColor : textHoverColor;
+
+ if (assetsButton_.hovered && !assetsDrawerOpen_) {
+ btnBg = glm::vec4(0.267f, 0.267f, 0.267f, 1.0f);
+ }
+
+ renderer.drawRect(assetsButton_.bounds, btnBg);
+
+ ui::Rect rightBorder{
+ assetsButton_.bounds.x + assetsButton_.bounds.width - 1.0f,
+ assetsButton_.bounds.y,
+ 1.0f,
+ assetsButton_.bounds.height
+ };
+ renderer.drawRect(rightBorder, borderColor);
+
+ if (assetsDrawerOpen_) {
+ ui::Rect indicator{
+ assetsButton_.bounds.x,
+ assetsButton_.bounds.y + assetsButton_.bounds.height - 2.0f,
+ assetsButton_.bounds.width,
+ 2.0f
+ };
+ renderer.drawRect(indicator, activeIndicator);
+ }
+
+ f32 iconX = assetsButton_.bounds.x + 10.0f;
+ f32 centerY = assetsButton_.bounds.y + assetsButton_.bounds.height * 0.5f;
+
+ if (iconFont) {
+ ui::Rect iconBounds{iconX, centerY - 7.0f, 14.0f, 14.0f};
+ renderer.drawTextInBounds(ui::icons::FolderOpen, iconBounds, *iconFont, 14.0f, btnText,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+
+ if (textFont) {
+ f32 textX = iconX + 20.0f;
+ ui::Rect textBounds{textX, centerY - 6.0f, 50.0f, 12.0f};
+ renderer.drawTextInBounds("Assets", textBounds, *textFont, 11.0f, btnText,
+ ui::HAlign::Left, ui::VAlign::Center);
+ }
+
+ if (iconFont) {
+ const char* chevron = assetsDrawerOpen_ ? ui::icons::ChevronDown : ui::icons::ChevronUp;
+ ui::Rect chevronBounds{assetsButton_.bounds.x + assetsButton_.bounds.width - 18.0f,
+ centerY - 6.0f, 12.0f, 12.0f};
+ renderer.drawTextInBounds(chevron, chevronBounds, *iconFont, 12.0f, btnText,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+ }
+
+ f32 dividerX = assetsButton_.bounds.x + assetsButton_.bounds.width + 2.0f;
+ ui::Rect divider1{dividerX, bounds.y + 5.0f, 1.0f, 14.0f};
+ renderer.drawRect(divider1, dividerColor);
+
+ if (outputButton_.bounds.width > 0) {
+ glm::vec4 btnBg = outputDrawerOpen_ ? activeBg : glm::vec4(0.0f);
+ glm::vec4 btnText = outputDrawerOpen_ ? activeColor : textColor;
+
+ if (outputButton_.hovered && !outputDrawerOpen_) {
+ btnBg = hoverBg;
+ btnText = textHoverColor;
+ }
+
+ if (btnBg.a > 0.0f) {
+ renderer.drawRect(outputButton_.bounds, btnBg);
+ }
+
+ if (outputDrawerOpen_) {
+ ui::Rect indicator{
+ outputButton_.bounds.x,
+ outputButton_.bounds.y + outputButton_.bounds.height - 2.0f,
+ outputButton_.bounds.width,
+ 2.0f
+ };
+ renderer.drawRect(indicator, activeIndicator);
+ }
+
+ f32 centerY = outputButton_.bounds.y + outputButton_.bounds.height * 0.5f;
+
+ if (iconFont) {
+ ui::Rect iconBounds{outputButton_.bounds.x + 8.0f, centerY - 6.0f, 12.0f, 12.0f};
+ renderer.drawTextInBounds(ui::icons::FileText, iconBounds, *iconFont, 12.0f, btnText,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+
+ if (textFont) {
+ ui::Rect textBounds{outputButton_.bounds.x + 24.0f, centerY - 6.0f, 50.0f, 12.0f};
+ renderer.drawTextInBounds("Output", textBounds, *textFont, 11.0f, btnText,
+ ui::HAlign::Left, ui::VAlign::Center);
+ }
+ }
+
+ if (layoutButton_.bounds.width > 0 && iconFont) {
+ glm::vec4 btnText = layoutButton_.hovered ? textHoverColor : textColor;
+ glm::vec4 btnBg = layoutButton_.hovered ? hoverBg : glm::vec4(0.0f);
+
+ if (btnBg.a > 0.0f) {
+ renderer.drawRect(layoutButton_.bounds, btnBg);
+ }
+
+ f32 centerY = layoutButton_.bounds.y + layoutButton_.bounds.height * 0.5f;
+ ui::Rect iconBounds{layoutButton_.bounds.x + 5.0f, centerY - 7.0f, 14.0f, 14.0f};
+ renderer.drawTextInBounds(ui::icons::LayoutGrid, iconBounds, *iconFont, 14.0f, btnText,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+
+ if (textFont) {
+ constexpr glm::vec4 saveIconColor{0.29f, 0.87f, 0.5f, 1.0f}; // #4ade80
+ f32 rightX = bounds.x + bounds.width - 10.0f;
+ f32 centerY = bounds.y + bounds.height * 0.5f;
+
+ if (iconFont) {
+ ui::Rect saveIconBounds{rightX - 80.0f, centerY - 6.0f, 12.0f, 12.0f};
+ renderer.drawTextInBounds(ui::icons::Save, saveIconBounds, *iconFont, 12.0f, saveIconColor,
+ ui::HAlign::Center, ui::VAlign::Center);
+ }
+
+ ui::Rect saveTextBounds{rightX - 65.0f, centerY - 6.0f, 60.0f, 12.0f};
+ renderer.drawTextInBounds("Saved", saveTextBounds, *textFont, 11.0f, textColor,
+ ui::HAlign::Left, ui::VAlign::Center);
+ }
+#endif
+}
+
+// =============================================================================
+// Event Handling
+// =============================================================================
+
+bool StatusBar::onMouseDown(const ui::MouseButtonEvent& event) {
+ ES_LOG_DEBUG("StatusBar::onMouseDown at ({}, {})", event.x, event.y);
+ ES_LOG_DEBUG(" StatusBar bounds: ({}, {}, {}, {})",
+ getBounds().x, getBounds().y, getBounds().width, getBounds().height);
+ ES_LOG_DEBUG(" AssetsButton bounds: ({}, {}, {}, {})",
+ assetsButton_.bounds.x, assetsButton_.bounds.y,
+ assetsButton_.bounds.width, assetsButton_.bounds.height);
+
+ if (event.button != ui::MouseButton::Left) {
+ return false;
+ }
+
+ if (assetsButton_.bounds.contains(event.x, event.y)) {
+ ES_LOG_INFO("StatusBar: Assets button clicked!");
+ onAssetsToggle.publish();
+ return true;
+ }
+
+ if (outputButton_.bounds.contains(event.x, event.y)) {
+ ES_LOG_INFO("StatusBar: Output button clicked!");
+ onOutputToggle.publish();
+ return true;
+ }
+
+ if (layoutButton_.bounds.contains(event.x, event.y)) {
+ ES_LOG_INFO("StatusBar: Layout button clicked!");
+ onResetLayout.publish();
+ return true;
+ }
+
+ return false;
+}
+
+// =============================================================================
+// Private Methods
+// =============================================================================
+
+void StatusBar::updateButtonRects() {
+ const ui::Rect& bounds = getBounds();
+
+ constexpr f32 ASSETS_BTN_WIDTH = 100.0f;
+ constexpr f32 OUTPUT_BTN_WIDTH = 70.0f;
+ constexpr f32 LAYOUT_BTN_WIDTH = 24.0f;
+
+ assetsButton_.bounds = ui::Rect{
+ bounds.x,
+ bounds.y,
+ ASSETS_BTN_WIDTH,
+ bounds.height
+ };
+
+ outputButton_.bounds = ui::Rect{
+ bounds.x + ASSETS_BTN_WIDTH + 5.0f,
+ bounds.y,
+ OUTPUT_BTN_WIDTH,
+ bounds.height
+ };
+
+ layoutButton_.bounds = ui::Rect{
+ bounds.x + bounds.width - LAYOUT_BTN_WIDTH - 100.0f,
+ bounds.y,
+ LAYOUT_BTN_WIDTH,
+ bounds.height
+ };
+}
+
+} // namespace esengine::editor
diff --git a/src/esengine/editor/widgets/StatusBar.hpp b/src/esengine/editor/widgets/StatusBar.hpp
new file mode 100644
index 000000000..e54966584
--- /dev/null
+++ b/src/esengine/editor/widgets/StatusBar.hpp
@@ -0,0 +1,66 @@
+/**
+ * @file StatusBar.hpp
+ * @brief Editor status bar with drawer toggle buttons
+ *
+ * @author ESEngine Team
+ * @date 2026
+ *
+ * @copyright Copyright (c) 2026 ESEngine Team
+ * Licensed under the MIT License.
+ */
+#pragma once
+
+// =============================================================================
+// Includes
+// =============================================================================
+
+#include "../../ui/widgets/Widget.hpp"
+#include "../../events/Signal.hpp"
+
+#include <string>
+
+namespace esengine::editor {
+
+// =============================================================================
+// StatusBar Class
+// =============================================================================
+
+class StatusBar : public ui::Widget {
+public:
+ static constexpr f32 HEIGHT = 24.0f;
+
+ explicit StatusBar(const ui::WidgetId& id);
+
+ void setAssetsDrawerOpen(bool open) { assetsDrawerOpen_ = open; }
+ void setOutputDrawerOpen(bool open) { outputDrawerOpen_ = open; }
+
+ bool isAssetsDrawerOpen() const { return assetsDrawerOpen_; }
+ bool isOutputDrawerOpen() const { return outputDrawerOpen_; }
+
+ Signal<void()> onAssetsToggle;
+ Signal<void()> onOutputToggle;
+ Signal<void()> onResetLayout;
+
+ glm::vec2 measure(f32 availableWidth, f32 availableHeight) override;
+ void render(ui::UIBatchRenderer& renderer) override;
+ bool onMouseDown(const ui::MouseButtonEvent& event) override;
+
+private:
+ struct ButtonRect {
+ ui::Rect bounds;
+ bool hovered = false;
+ };
+
+ void updateButtonRects();
+
+ bool assetsDrawerOpen_ = false;
+ bool outputDrawerOpen_ = false;
+
+ ButtonRect assetsButton_;
+ ButtonRect outputButton_;
+ ButtonRect layoutButton_;
+
+ glm::vec2 lastMousePos_{0.0f};
+};
+
+} // namespace esengine::editor
diff --git a/src/esengine/ui/UIContext.cpp b/src/esengine/ui/UIContext.cpp
index 9d191ca2e..6f64a4899 100644
--- a/src/esengine/ui/UIContext.cpp
+++ b/src/esengine/ui/UIContext.cpp
@@ -320,6 +320,8 @@ void UIContext::processMouseDown(MouseButton button, f32 x, f32 y) {
if (hoveredWidget_->isFocusable()) {
setFocus(hoveredWidget_);
+ } else {
+ setFocus(nullptr);
}
MouseButtonEvent event;
diff --git a/src/esengine/ui/font/MSDFFont.cpp b/src/esengine/ui/font/MSDFFont.cpp
index ec5665f65..43e390967 100644
--- a/src/esengine/ui/font/MSDFFont.cpp
+++ b/src/esengine/ui/font/MSDFFont.cpp
@@ -209,6 +209,7 @@ MSDFGlyphInfo* MSDFFont::loadGlyph(u32 codepoint) {
}
shape.normalize();
+ shape.orientContours();
msdfgen::edgeColoringSimple(shape, 3.0);
msdfgen::Shape::Bounds bounds = shape.getBounds(pixelRange_ / fontSize_);
diff --git a/src/esengine/ui/icons/Icons.hpp b/src/esengine/ui/icons/Icons.hpp
index 273bd0fb9..834f8a8f7 100644
--- a/src/esengine/ui/icons/Icons.hpp
+++ b/src/esengine/ui/icons/Icons.hpp
@@ -110,6 +110,7 @@ constexpr const char* MoreVertical = "\ue129";
constexpr const char* Grid = "\ue0fe";
constexpr const char* List = "\ue110";
constexpr const char* Layout = "\ue109";
+constexpr const char* LayoutGrid = "\ue10a";
constexpr const char* Layers = "\ue106";
constexpr const char* Maximize = "\ue11a";
constexpr const char* Maximize2 = "\ue11b";
diff --git a/src/esengine/ui/widgets/Panel.cpp b/src/esengine/ui/widgets/Panel.cpp
index 20bddfd2c..b75f4073d 100644
--- a/src/esengine/ui/widgets/Panel.cpp
+++ b/src/esengine/ui/widgets/Panel.cpp
@@ -35,6 +35,11 @@ void Panel::setBorderColor(const glm::vec4& color) {
customBorder_ = true;
}
+void Panel::setBorderWidth(const BorderWidth& width) {
+ borderWidth_ = width;
+ drawBorder_ = width.hasAny();
+}
+
// =============================================================================
// Rendering
// =============================================================================
@@ -62,12 +67,32 @@ void Panel::render(UIBatchRenderer& renderer) {
}
}
- if (drawBorder_ && style.borderWidth > 0.0f) {
+ if (drawBorder_) {
glm::vec4 brColor = customBorder_ ? borderColor_ : style.getBorderColor(getState());
- CornerRadii radii = cornerRadii_.isZero() ? style.cornerRadii : cornerRadii_;
-
- renderer.drawRoundedRectOutline(bounds, brColor, radii, style.borderWidth);
+ if (borderWidth_.hasAny()) {
+ if (borderWidth_.top > 0.0f) {
+ Rect topBorder{bounds.x, bounds.y, bounds.width, borderWidth_.top};
+ renderer.drawRect(topBorder, brColor);
+ }
+ if (borderWidth_.right > 0.0f) {
+ Rect rightBorder{bounds.x + bounds.width - borderWidth_.right, bounds.y,
+ borderWidth_.right, bounds.height};
+ renderer.drawRect(rightBorder, brColor);
+ }
+ if (borderWidth_.bottom > 0.0f) {
+ Rect bottomBorder{bounds.x, bounds.y + bounds.height - borderWidth_.bottom,
+ bounds.width, borderWidth_.bottom};
+ renderer.drawRect(bottomBorder, brColor);
+ }
+ if (borderWidth_.left > 0.0f) {
+ Rect leftBorder{bounds.x, bounds.y, borderWidth_.left, bounds.height};
+ renderer.drawRect(leftBorder, brColor);
+ }
+ } else if (style.borderWidth > 0.0f) {
+ CornerRadii radii = cornerRadii_.isZero() ? style.cornerRadii : cornerRadii_;
+ renderer.drawRoundedRectOutline(bounds, brColor, radii, style.borderWidth);
+ }
}
}
diff --git a/src/esengine/ui/widgets/Panel.hpp b/src/esengine/ui/widgets/Panel.hpp
index 6a3ff5642..957f1f2c2 100644
--- a/src/esengine/ui/widgets/Panel.hpp
+++ b/src/esengine/ui/widgets/Panel.hpp
@@ -20,6 +20,23 @@
namespace esengine::ui {
+// =============================================================================
+// BorderWidth Struct
+// =============================================================================
+
+struct BorderWidth {
+ f32 top = 0.0f;
+ f32 right = 0.0f;
+ f32 bottom = 0.0f;
+ f32 left = 0.0f;
+
+ constexpr BorderWidth() = default;
+ constexpr BorderWidth(f32 t, f32 r, f32 b, f32 l) : top(t), right(r), bottom(b), left(l) {}
+ static constexpr BorderWidth all(f32 v) { return {v, v, v, v}; }
+ [[nodiscard]] bool isZero() const { return top == 0 && right == 0 && bottom == 0 && left == 0; }
+ [[nodiscard]] bool hasAny() const { return top > 0 || right > 0 || bottom > 0 || left > 0; }
+};
+
// =============================================================================
// Panel Class
// =============================================================================
@@ -70,6 +87,12 @@ public:
/** @brief Sets a custom border color (overrides theme) */
void setBorderColor(const glm::vec4& color);
+ /** @brief Sets per-side border widths */
+ void setBorderWidth(const BorderWidth& width);
+
+ /** @brief Gets the border width */
+ const BorderWidth& getBorderWidth() const { return borderWidth_; }
+
/** @brief Sets the corner radii */
void setCornerRadii(const CornerRadii& radii) { cornerRadii_ = radii; }
@@ -91,6 +114,7 @@ private:
glm::vec4 backgroundColor_{0.0f};
glm::vec4 borderColor_{0.0f};
CornerRadii cornerRadii_;
+ BorderWidth borderWidth_;
};
} // namespace esengine::ui
diff --git a/src/esengine/ui/widgets/TreeView.cpp b/src/esengine/ui/widgets/TreeView.cpp
index 80938d21a..dc5c0ea7c 100644
--- a/src/esengine/ui/widgets/TreeView.cpp
+++ b/src/esengine/ui/widgets/TreeView.cpp
@@ -273,76 +273,68 @@ void TreeView::renderNode(UIBatchRenderer& renderer, const TreeNode& node, f32 y
const Rect& bounds = getBounds();
const Insets& padding = getPadding();
- f32 x = bounds.x + padding.left + node.depth * indentSize_;
- f32 rowWidth = bounds.width - padding.left - padding.right;
+ constexpr f32 ROW_PADDING_X = 8.0f;
+ constexpr f32 ARROW_SIZE = 16.0f;
+ constexpr f32 FOLDER_ICON_SIZE = 16.0f;
+ constexpr f32 FONT_SIZE = 13.0f;
- Rect rowBounds{bounds.x + padding.left, y, rowWidth, rowHeight_};
+ constexpr glm::vec4 hoverBg{0.165f, 0.176f, 0.180f, 1.0f}; // #2a2d2e
+ constexpr glm::vec4 selectedBg{0.216f, 0.216f, 0.239f, 1.0f}; // #37373d
+ constexpr glm::vec4 textColor{0.8f, 0.8f, 0.8f, 1.0f}; // #cccccc
+ constexpr glm::vec4 arrowColor{0.8f, 0.8f, 0.8f, 1.0f}; // #cccccc
+ constexpr glm::vec4 folderColor{0.863f, 0.714f, 0.478f, 1.0f}; // #dcb67a
- WidgetStyle style;
- if (getContext()) {
- style = getContext()->getTheme().getPanelStyle();
- }
+ f32 rowWidth = bounds.width - padding.left - padding.right;
+ Rect rowBounds{bounds.x + padding.left, y, rowWidth, rowHeight_};
bool isSelected = isNodeSelected(node.id);
if (isSelected) {
- glm::vec4 selectionColor = style.backgroundColor;
- if (getContext()) {
- selectionColor = getContext()->getTheme().colors.selection;
- }
- renderer.drawRect(rowBounds, selectionColor);
+ renderer.drawRect(rowBounds, selectedBg);
} else if (isHovered) {
- glm::vec4 hoverColor = style.getBackgroundColor(
- WidgetState{.hovered = true, .pressed = false, .focused = false, .disabled = false,
- .visible = true});
- renderer.drawRect(rowBounds, hoverColor);
+ renderer.drawRect(rowBounds, hoverBg);
}
- bool hasChild = hasChildren(node);
+ f32 x = bounds.x + padding.left + ROW_PADDING_X + node.depth * indentSize_;
- if (hasChild) {
- Rect iconBounds = getIconBounds(node, y);
+ bool hasChild = hasChildren(node);
- glm::vec4 iconColor = style.textColor;
- if (getContext()) {
- iconColor = getContext()->getTheme().colors.textSecondary;
- }
+ Rect arrowBounds{x, y + (rowHeight_ - ARROW_SIZE) * 0.5f, ARROW_SIZE, ARROW_SIZE};
#if ES_FEATURE_SDF_FONT
- MSDFFont* iconFont = getContext() ? getContext()->getIconMSDFFont() : nullptr;
- if (iconFont) {
- const char* icon = node.expanded ? icons::ChevronDown : icons::ChevronRight;
- renderer.drawTextInBounds(icon, iconBounds, *iconFont, iconSize_, iconColor,
- HAlign::Center, VAlign::Center);
- }
+ MSDFFont* iconFont = getContext() ? getContext()->getIconMSDFFont() : nullptr;
+ if (iconFont && hasChild) {
+ const char* arrowIcon = node.expanded ? icons::ChevronDown : icons::ChevronRight;
+ renderer.drawTextInBounds(arrowIcon, arrowBounds, *iconFont, 12.0f, arrowColor,
+ HAlign::Center, VAlign::Center);
+ }
#endif
- x += iconSize_ + 4.0f;
- } else {
- x += iconSize_ + 4.0f;
- }
+ x += ARROW_SIZE + 4.0f;
- glm::vec4 textColor = style.textColor;
- if (getContext()) {
- textColor = getContext()->getTheme().colors.textPrimary;
+#if ES_FEATURE_SDF_FONT
+ if (iconFont) {
+ Rect folderBounds{x, y + (rowHeight_ - FOLDER_ICON_SIZE) * 0.5f,
+ FOLDER_ICON_SIZE, FOLDER_ICON_SIZE};
+ const char* folderIcon = hasChild && node.expanded ? icons::FolderOpen : icons::Folder;
+ renderer.drawTextInBounds(folderIcon, folderBounds, *iconFont, 14.0f, folderColor,
+ HAlign::Center, VAlign::Center);
}
+#endif
- f32 fontSize = style.fontSize;
- if (getContext()) {
- fontSize = getContext()->getTheme().typography.fontSizeNormal;
- }
+ x += FOLDER_ICON_SIZE + 6.0f;
- f32 textY = y + (rowHeight_ - fontSize) * 0.5f;
+ f32 textY = y + (rowHeight_ - FONT_SIZE) * 0.5f;
#if ES_FEATURE_SDF_FONT
if (getContext() && getContext()->getDefaultMSDFFont()) {
renderer.drawText(node.label, glm::vec2(x, textY), *getContext()->getDefaultMSDFFont(),
- fontSize, textColor);
+ FONT_SIZE, textColor);
}
#elif ES_FEATURE_BITMAP_FONT
if (getContext() && getContext()->getDefaultBitmapFont()) {
renderer.drawText(node.label, glm::vec2(x, textY), *getContext()->getDefaultBitmapFont(),
- fontSize, textColor);
+ FONT_SIZE, textColor);
}
#endif
}
@@ -470,13 +462,16 @@ Rect TreeView::getIconBounds(const TreeNode& node, f32 y) const {
const Rect& bounds = getBounds();
const Insets& padding = getPadding();
- f32 x = bounds.x + padding.left + node.depth * indentSize_;
+ constexpr f32 ROW_PADDING_X = 8.0f;
+ constexpr f32 ARROW_SIZE = 16.0f;
+
+ f32 x = bounds.x + padding.left + ROW_PADDING_X + node.depth * indentSize_;
return Rect{
x,
- y + (rowHeight_ - iconSize_) * 0.5f,
- iconSize_,
- iconSize_
+ y + (rowHeight_ - ARROW_SIZE) * 0.5f,
+ ARROW_SIZE,
+ ARROW_SIZE
};
}