refactor: Update CMake Configuration and EditorCard Constructor

- Modified CMake configuration to include additional proto files for gRPC services, enhancing the build process for canvas automation features.
- Adjusted the number of buttons in the Toolset to improve UI layout.
- Introduced a new constructor for EditorCard to manage open state, enhancing flexibility in editor card management.
This commit is contained in:
scawful
2025-10-05 23:43:48 -04:00
parent 7e2f0454d3
commit 13af75e924
3 changed files with 10 additions and 2 deletions

View File

@@ -260,7 +260,8 @@ if(YAZE_WITH_GRPC)
if(NOT YAZE_USE_MODULAR_BUILD)
# Generate C++ code from .proto using the helper function from cmake/grpc.cmake
target_add_protobuf(yaze
${CMAKE_SOURCE_DIR}/src/app/core/proto/imgui_test_harness.proto)
${CMAKE_SOURCE_DIR}/src/protos/imgui_test_harness.proto
${CMAKE_SOURCE_DIR}/src/protos/canvas_automation.proto)
# Add service implementation sources
target_sources(yaze PRIVATE

View File

@@ -49,7 +49,7 @@ void Toolset::BeginModeGroup() {
// Use a frameless child with exact button height to avoid scrolling
const float button_size = 28.0f; // Smaller buttons to match toolbar height
const float padding = 4.0f;
const int num_buttons = 8;
const int num_buttons = 2;
const float item_spacing = ImGui::GetStyle().ItemSpacing.x;
float total_width = (num_buttons * button_size) +
@@ -231,6 +231,11 @@ bool Toolset::AddUsageStatsButton(const char* tooltip) {
EditorCard::EditorCard(const char* title, const char* icon)
: title_(title), icon_(icon ? icon : ""), default_size_(400, 300) {}
EditorCard::EditorCard(const char* title, const char* icon, bool* p_open)
: title_(title), icon_(icon ? icon : ""), default_size_(400, 300) {
p_open_ = p_open;
}
void EditorCard::SetDefaultSize(float width, float height) {
default_size_ = ImVec2(width, height);
}

View File

@@ -114,6 +114,7 @@ class EditorCard {
};
EditorCard(const char* title, const char* icon = nullptr);
EditorCard(const char* title, const char* icon, bool* p_open);
// Set card properties
void SetDefaultSize(float width, float height);
@@ -140,6 +141,7 @@ class EditorCard {
bool closable_ = true;
bool minimized_ = false;
bool first_draw_ = true;
bool* p_open_ = nullptr;
};
/**