From e8392dd5ff520177f80725c31e6a192b035e43eb Mon Sep 17 00:00:00 2001 From: Evgeny Demchenko Date: Thu, 4 Jun 2026 09:30:11 +0100 Subject: [PATCH] =?UTF-8?q?Phase=2011b:=20=D1=81=D0=B5=D1=80=D1=8B=D0=B5?= =?UTF-8?q?=20=D1=80=D0=B0=D0=BC=D0=BA=D0=B8=202px=20=D0=B2=D0=BE=D0=BA?= =?UTF-8?q?=D1=80=D1=83=D0=B3=20=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=B9=20cel?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User: "ячейки не имеют границ, сделай их серым цветом". В Layout::apply() для каждого Cell (CameraCell/BlankCell/WidgetCell) добавлен BorderDecoration: - thickness 2px - Y=180, U=128, V=128 (нейтральный серый в BT.709 limited) - alpha 220 (слегка полупрозрачный — видно контент за рамкой) Decoration рисуется поверх content (после draw_content) — поверх любого кадра/widget'а. Co-Authored-By: Claude Opus 4.7 --- src/cpp/layout.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cpp/layout.cpp b/src/cpp/layout.cpp index 883b276..493219c 100644 --- a/src/cpp/layout.cpp +++ b/src/cpp/layout.cpp @@ -2,6 +2,7 @@ #include "../../include/cuframes_composer/cpp/layout.hpp" #include "../../include/cuframes_composer/cpp/blank_cell.hpp" +#include "../../include/cuframes_composer/cpp/border_decoration.hpp" #include "../../include/cuframes_composer/cpp/camera_cell.hpp" #include "../../include/cuframes_composer/cpp/label_decoration.hpp" #include "../../include/cuframes_composer/cpp/widget_cell.hpp" @@ -32,11 +33,20 @@ void Layout::apply(const LayoutTemplate& tpl, return a->order < b->order; }); + /* Серая рамка по умолчанию — отделяет ячейки друг от друга. */ + BorderStyle border_style; + border_style.thickness = 2; + border_style.color_y = 180; + border_style.color_u = 128; + border_style.color_v = 128; + border_style.alpha = 220; + /* CameraCells */ for (std::size_t i = 0; i < camera_templates.size(); ++i) { Rect r = to_pixels(*camera_templates[i], frame_w, frame_h); if (i < active_sorted.size() && active_sorted[i] && active_sorted[i]->source) { auto cell = std::make_unique(r, active_sorted[i]->source); + cell->add_decoration(std::make_unique(border_style)); /* Label с именем камеры и приоритетом. */ char label_buf[96]; std::snprintf(label_buf, sizeof(label_buf), "%s prio=%d", @@ -46,7 +56,9 @@ void Layout::apply(const LayoutTemplate& tpl, cells_.push_back(std::move(cell)); } else { /* Нет active под этот слот → blank. */ - cells_.push_back(std::make_unique(r)); + auto cell = std::make_unique(r); + cell->add_decoration(std::make_unique(border_style)); + cells_.push_back(std::move(cell)); } } @@ -54,6 +66,7 @@ void Layout::apply(const LayoutTemplate& tpl, for (auto* wt : widget_templates) { Rect r = to_pixels(*wt, frame_w, frame_h); auto cell = std::make_unique(r, wt->widget); + cell->add_decoration(std::make_unique(border_style)); if (!wt->widget.empty()) { cell->add_decoration(std::make_unique(wt->widget, LabelStyle{})); }