## 1. 边界观感:四角粗、四边细 用户反馈"边框就是实心矩形、粗细不一,效果不佳"。旧实现是四条等宽实心矩形 (层级 0 用 2px、其余 1px),同一元素的角与边粗细不一致,父子矩形共边时还会叠成更粗的一条。 新规则: - 四条边固定 1 设备像素(四条独立实心矩形;不用 DrawRectangle,笔宽奇偶会偏半像素); - 四个角额外加粗:层级 0 = 4px、其余 3px,沿水平/垂直各延伸 cornerLen(≤14px 且 ≤ 短边一半); - 层级 > 0 整体内缩 1px,父子矩形共边不再叠粗; - 绝不填充(几十层嵌套填充会把内容糊住); - 整像素对齐 + PixelOffsetModeNone + 关抗锯齿。 四角粗不只是观感:多条边重合时靠角的形状分辨层次(父=青蓝大包角、子=同位置品红小包角)。 ## 2. 协议:组件"收集 box",宿主统一绘制 UiComponent::CollectDebugBoxes(UiDebugBoxList&) 默认只登记 Area() UiWidget::CollectDebugBoxes(boxes, depth) 递归整棵控件树 Application::PaintLayoutBounds 收集后按 depth 升序一次性描边 刻意保持 box 为**值类型**而不是让它继承控件基类:PlotView 的 4 层位图缓存、 SignalPanel 的 192 槽行位图缓存都要求"绘制由组件自己负责",几何进继承体系会与 缓存键/失效体系打架。box 不参与绘制,因此能让绘制/命中/调试共用同一份几何。 ## 3. 覆盖补齐(此前大量元素被裹在外层单位里) - Toolbar:区域 / 每个按钮 / **按钮内容(文字或齿轮图标,新增 UiButtonWidget::ContentRect())** - TabBar:区域 / 标签条 / 新建按钮 / 每个 ✕ - SignalPanel:4 分区 + 筛选输入框/清空✕/全部显示 + 滚动轨道与滑块 + 样式区 5 行及其 12 色块/自定义/3 模式/3 调整/线宽与透明度轨道和数值 + 目标行/名称/GX 徽标 + **每个可见行**的折起三角/复选框/色块/名称/GX 徽标/✕ (组行另有组名/计数)+ 内联编辑框 - PlotView:区域 / 每个网格 / GX 徽标 / 装饰层矩形 / 图例托底+色块+文本 / **5 类浮动面板全部 20+ 字段**(标题/✕/折起三角/徽标/编辑行/按钮/内容区/滚动轨道与滑块 /透明度轨道与数值/两个开关/各行复选框与数值与滑轨与复位与名称与✕/分组栏/表头/固定点行) - PopupMenu:浮层 / 每个条目 / 可滚动可视区 / 轨道 / 滑块 / 二级子菜单与条目 - ColorPickerPopup:面板 / 标题 / 预览 / 色号 / 色域 / 色相条 / 3 条滑轨与数值 / 输入框 标签增加**尺寸门槛**(< 56×16 逻辑像素不画):复选框/色块/✕ 紧邻,逐个小框贴字会糊成一片。 ## 4. 设置按钮配色 + 齿轮图标 - ToolbarAction::SETTINGS 改为 primary = true,与「导入文件」同为强调色主按钮。 - 齿轮几何重做:齿占最外一圈(0.66R→1.0R)、外环中心线 0.54R/笔宽 0.24R、轴孔 0.17R。 旧版让齿从环中心线伸出,齿被环的描边吃掉 ⇒ 看起来只剩一个"甜甜圈"。 ## 5. 几何同源与性能 - RowRect(row) 原本每次调用都从头累加行高(O(row)),而画一行要调它 **5 次** (✕/徽标/名称/组计数/折起三角各一次)⇒ 200 行只见 30 行时每帧上万次加法, 命中测试(每次鼠标移动)同样走这条路。 新增 m_rowTop 前缀和(由 UpdateAnimGeometry() 统一重建)⇒ **O(1)**; 长度与行集合不一致时自动退回逐行累加(正确性优先)。 - ContentOffsetBeforeRow 同样改用前缀和。 - PanelBounds() 收敛 6 处重复的 (m_clientBounds.Width > 1.0f) ? m_clientBounds : m_area。 ## 6. 验证 - make release / make debug 零 error 零 warning;TargetCheck.exe 910,336 B(889 KiB < 900 KiB)。 - .preflight/lbcheck:21 / 21 PASS(含 bounds-off-restores-pixels:关闭后逐像素回到开启前)。 - Tools/rendercheck:「工具栏带以下」区域哈希 8/8 与上一轮**逐一相同** (证明本轮改动只落在工具栏带内);FUNC 断言 7/7 PASS。 - Tools/uicheck:69 passed / 0 failed。 ## 7. 文档 Documents/UI_Refactor_Plan.md / UI_Refactor_Progress.md / UI_Refactor_Report.md 追加第七阶段; Documents/agent_mem.md 同步变更日志与「2026-10-28 第九轮」硬规则与踩坑记录。
490 lines
14 KiB
C++
490 lines
14 KiB
C++
#include "Toolbar.hpp"
|
||
|
||
#include <algorithm>
|
||
#include <cmath>
|
||
#include <utility>
|
||
|
||
#include "UiDebugBounds.hpp"
|
||
|
||
namespace jdi
|
||
{
|
||
|
||
namespace
|
||
{
|
||
const float kButtonHeight = 30.0f; /**< 按钮高度(逻辑像素)。 */
|
||
const float kButtonGap = 6.0f; /**< 按钮间距。 */
|
||
const float kButtonPadding = 14.0f; /**< 按钮左右内边距。 */
|
||
const float kGroupGap = 18.0f; /**< 分组间距。 */
|
||
const float kSidePadding = 12.0f; /**< 工具栏左右留白。 */
|
||
const float kTopPadding = 8.0f; /**< 工具栏上下留白。 */
|
||
|
||
/**
|
||
* @brief 工具栏的根控件:只负责"整条底色 + 底部分隔线"。
|
||
*
|
||
* 按钮是它的子节点(`UiButtonWidget`),由 `Toolbar::Layout` 逐个 `Arrange`。
|
||
* 之所以把根做成控件而不是让 `Toolbar` 自己遍历按钮绘制:命中 / 悬停 / 按下的仲裁
|
||
* 全部交给 `UiWidget` 的派发链与悬停链,`Toolbar` 只做"规格表 → 控件"的翻译。
|
||
*/
|
||
class ToolbarRootWidget : public UiWidget
|
||
{
|
||
public:
|
||
void Configure(const Theme* theme, float scale)
|
||
{
|
||
m_theme = theme;
|
||
m_scale = scale;
|
||
}
|
||
|
||
/** @brief 根尺寸由宿主(`Toolbar::Layout`)给定,不参与父级测量。 */
|
||
gd::SizeF OnMeasure(const UiMeasureContext& ctx) override
|
||
{
|
||
(void)ctx;
|
||
return gd::SizeF(Bounds().Width, Bounds().Height);
|
||
}
|
||
|
||
void OnPaint(UiPaintContext& ctx) override
|
||
{
|
||
if (m_theme == nullptr || ctx.g == nullptr || !UiRectHasArea(Bounds()))
|
||
{
|
||
return;
|
||
}
|
||
const gd::RectF& area = Bounds();
|
||
UiFillRect(*ctx.g, area, m_theme->toolbarBg);
|
||
// 底部分隔线:按钮不会覆盖到这一行,因此"底色 + 分隔线先画"与旧实现像素一致。
|
||
UiDrawLine(*ctx.g, area.X, area.Y + area.Height - 1.0f, area.X + area.Width,
|
||
area.Y + area.Height - 1.0f, m_theme->border, 1.0f);
|
||
}
|
||
|
||
private:
|
||
const Theme* m_theme = nullptr; /**< 主题。 */
|
||
float m_scale = 1.0f; /**< 缩放系数。 */
|
||
};
|
||
|
||
/** @brief 按钮规格(顺序即绘制顺序)。 */
|
||
struct ButtonSpec
|
||
{
|
||
ToolbarAction action; /**< 动作。 */
|
||
const wchar_t* label; /**< 默认文本(图标按钮留空)。 */
|
||
bool primary; /**< 是否主按钮。 */
|
||
bool needsDocument; /**< 是否依赖已加载数据。 */
|
||
bool toggle; /**< 是否可切换。 */
|
||
UiButtonIcon icon; /**< 图标(`NONE` = 纯文本按钮)。 */
|
||
};
|
||
|
||
// ⚠️ **前两项构成"左侧固定簇"**(设置齿轮 + 导入文件),其余按钮作为整体靠右。
|
||
// `Layout` 里用 `kLeftClusterCount` 引用这个约定的长度,增删左侧按钮时必须同步。
|
||
// 齿轮与「导入文件」**同为强调色主按钮**(用户 2026-10-28 要求配色一致),
|
||
// 两者视觉上构成一组"文件/设置"入口,因此 primary 都为 true。
|
||
const ButtonSpec kButtonSpecs[] = {
|
||
{ToolbarAction::SETTINGS, L"", true, false, false, UiButtonIcon::GEAR},
|
||
{ToolbarAction::OPEN_FILE, L"导入文件", true, false, false, UiButtonIcon::NONE},
|
||
{ToolbarAction::FIT_ALL, L"适应视图", false, true, false, UiButtonIcon::NONE},
|
||
{ToolbarAction::AUTO_FIT_Y, L"Y 轴自适应", false, true, true, UiButtonIcon::NONE},
|
||
{ToolbarAction::ZOOM_SELECT, L"选区放大", false, true, true, UiButtonIcon::NONE},
|
||
{ToolbarAction::CURSOR, L"光标", false, true, true, UiButtonIcon::NONE},
|
||
{ToolbarAction::MERGE_LANES, L"合并网格", false, true, false, UiButtonIcon::NONE},
|
||
{ToolbarAction::SPLIT_LANES, L"拆分网格", false, true, false, UiButtonIcon::NONE},
|
||
{ToolbarAction::CLEAR_ALL, L"清空网格", false, true, false, UiButtonIcon::NONE},
|
||
};
|
||
|
||
/** @brief 左侧固定簇的按钮数量(从 `kButtonSpecs` 开头算起)。 */
|
||
constexpr std::size_t kLeftClusterCount = 2;
|
||
} // namespace
|
||
|
||
Toolbar::Toolbar() = default;
|
||
|
||
// 控件树用 `std::unique_ptr<UiWidget>` 持有,而具体根类型只在本 TU 可见
|
||
// ⇒ 析构函数必须在这里显式定义(否则其它 TU 里实例化会因类型不完整而编译失败)。
|
||
Toolbar::~Toolbar() = default;
|
||
|
||
void Toolbar::Setup(const UiFonts* fonts, const Theme* theme)
|
||
{
|
||
m_fonts = fonts;
|
||
m_theme = theme;
|
||
m_treeDirty = true;
|
||
}
|
||
|
||
void Toolbar::SetScale(float scale)
|
||
{
|
||
const float next = (scale > 0.1f) ? scale : 1.0f;
|
||
if (next == m_scale)
|
||
{
|
||
return;
|
||
}
|
||
m_scale = next;
|
||
// 控件里缓存了旧的缩放(字体实测宽度、图标尺寸)⇒ 必须重建。
|
||
m_treeDirty = true;
|
||
}
|
||
|
||
void Toolbar::SetDocumentLoaded(bool hasDocument)
|
||
{
|
||
if (m_documentLoaded == hasDocument)
|
||
{
|
||
return;
|
||
}
|
||
m_documentLoaded = hasDocument;
|
||
SyncEnabledState();
|
||
}
|
||
|
||
float Toolbar::DesiredHeight() const
|
||
{
|
||
return (kButtonHeight + kTopPadding * 2.0f) * m_scale;
|
||
}
|
||
|
||
bool Toolbar::IsEnabled(const Button& button) const
|
||
{
|
||
return button.needsDocument ? m_documentLoaded : true;
|
||
}
|
||
|
||
void Toolbar::SyncEnabledState()
|
||
{
|
||
for (Button& button : m_buttons)
|
||
{
|
||
if (button.widget != nullptr)
|
||
{
|
||
button.widget->SetEnabled(IsEnabled(button));
|
||
}
|
||
}
|
||
}
|
||
|
||
void Toolbar::RebuildWidgets()
|
||
{
|
||
m_root = std::make_unique<ToolbarRootWidget>();
|
||
static_cast<ToolbarRootWidget*>(m_root.get())->Configure(m_theme, m_scale);
|
||
|
||
m_buttons.clear();
|
||
const std::size_t specCount = sizeof(kButtonSpecs) / sizeof(kButtonSpecs[0]);
|
||
m_buttons.reserve(specCount);
|
||
|
||
for (std::size_t index = 0; index < specCount; ++index)
|
||
{
|
||
const ButtonSpec& spec = kButtonSpecs[index];
|
||
// 动态文本覆盖(例如「光标」按当前模式显示 光标 / 光标x1 / 光标x2)。
|
||
std::wstring label = spec.label;
|
||
for (const std::pair<ToolbarAction, std::wstring>& entry : m_labelOverrides)
|
||
{
|
||
if (entry.first == spec.action)
|
||
{
|
||
label = entry.second;
|
||
break;
|
||
}
|
||
}
|
||
|
||
Button button;
|
||
button.action = spec.action;
|
||
button.primary = spec.primary;
|
||
button.needsDocument = spec.needsDocument;
|
||
button.toggle = spec.toggle;
|
||
button.icon = spec.icon;
|
||
button.checked = false;
|
||
|
||
auto widget = std::make_unique<UiButtonWidget>();
|
||
UiButtonWidget* raw = widget.get();
|
||
raw->Configure(m_fonts, m_theme, m_scale, label, spec.primary, spec.toggle, kButtonPadding,
|
||
kButtonHeight);
|
||
raw->SetIcon(spec.icon);
|
||
if (m_theme != nullptr)
|
||
{
|
||
raw->SetCanvasColor(m_theme->toolbarBg);
|
||
}
|
||
raw->SetEnabled(IsEnabled(button));
|
||
// 点击回调只登记动作,由宿主在鼠标抬起后统一执行(与旧语义一致)。
|
||
raw->onClick = [this, action = spec.action]() { m_pendingAction = action; };
|
||
|
||
button.widget = raw;
|
||
m_root->AddChild(std::move(widget));
|
||
m_buttons.push_back(button);
|
||
}
|
||
}
|
||
|
||
void Toolbar::Layout(const gd::RectF& area)
|
||
{
|
||
m_area = area;
|
||
|
||
if (m_fonts == nullptr || m_fonts->ui == nullptr || m_theme == nullptr)
|
||
{
|
||
return;
|
||
}
|
||
|
||
// 控件树**只在必要时重建**(先记下各 toggle 的勾选状态,否则重建会把选中态清掉)。
|
||
// 纯粹的尺寸变化不走重建:按钮几何由 `Arrange` 决定,与树结构无关。
|
||
std::vector<std::pair<ToolbarAction, bool>> previousChecked;
|
||
if (m_treeDirty || m_root == nullptr)
|
||
{
|
||
previousChecked.reserve(m_buttons.size());
|
||
for (const Button& button : m_buttons)
|
||
{
|
||
previousChecked.emplace_back(button.action, button.checked);
|
||
}
|
||
RebuildWidgets();
|
||
m_treeDirty = false;
|
||
}
|
||
m_root->Arrange(area);
|
||
|
||
UiMeasureContext measure;
|
||
measure.theme = m_theme;
|
||
measure.fonts = m_fonts;
|
||
measure.scale = m_scale;
|
||
|
||
// 宽度由控件实测(`内边距 × 2 + 文本宽`),与旧公式完全一致;中文标签因此不会被裁切。
|
||
for (Button& button : m_buttons)
|
||
{
|
||
button.width = button.widget->Measure(measure).Width;
|
||
for (const std::pair<ToolbarAction, bool>& entry : previousChecked)
|
||
{
|
||
if (entry.first == button.action)
|
||
{
|
||
button.checked = entry.second;
|
||
button.widget->SetChecked(entry.second);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 左侧固定簇(设置齿轮 + 导入文件)靠左,其余按钮作为整体靠右。
|
||
const float top = area.Y + kTopPadding * m_scale;
|
||
const float height = kButtonHeight * m_scale;
|
||
const float leftX = area.X + kSidePadding * m_scale;
|
||
|
||
float leftWidth = 0.0f;
|
||
for (std::size_t index = 0; index < kLeftClusterCount && index < m_buttons.size(); ++index)
|
||
{
|
||
leftWidth += m_buttons[index].width;
|
||
if (index > 0)
|
||
{
|
||
leftWidth += kButtonGap * m_scale;
|
||
}
|
||
}
|
||
|
||
float cursorX = leftX;
|
||
for (std::size_t index = 0; index < kLeftClusterCount && index < m_buttons.size(); ++index)
|
||
{
|
||
m_buttons[index].widget->Arrange(gd::RectF(cursorX, top, m_buttons[index].width, height));
|
||
cursorX += m_buttons[index].width + kButtonGap * m_scale;
|
||
}
|
||
|
||
float groupWidth = 0.0f;
|
||
for (std::size_t index = kLeftClusterCount; index < m_buttons.size(); ++index)
|
||
{
|
||
groupWidth += m_buttons[index].width;
|
||
if (index + 1 < m_buttons.size())
|
||
{
|
||
groupWidth += kButtonGap * m_scale;
|
||
}
|
||
}
|
||
|
||
const float rightEdge = area.X + area.Width - kSidePadding * m_scale;
|
||
cursorX = std::max(leftX + leftWidth + kGroupGap * m_scale, rightEdge - groupWidth);
|
||
for (std::size_t index = kLeftClusterCount; index < m_buttons.size(); ++index)
|
||
{
|
||
m_buttons[index].widget->Arrange(gd::RectF(cursorX, top, m_buttons[index].width, height));
|
||
cursorX += m_buttons[index].width + kButtonGap * m_scale;
|
||
}
|
||
}
|
||
|
||
bool Toolbar::ButtonRect(ToolbarAction action, gd::RectF& rect) const
|
||
{
|
||
for (const Button& button : m_buttons)
|
||
{
|
||
if (button.action == action && button.widget != nullptr)
|
||
{
|
||
rect = button.widget->Bounds();
|
||
return UiRectHasArea(rect);
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
void Toolbar::SetToggleState(ToolbarAction action, bool checked)
|
||
{
|
||
for (Button& button : m_buttons)
|
||
{
|
||
if (button.action == action && button.toggle)
|
||
{
|
||
button.checked = checked;
|
||
if (button.widget != nullptr)
|
||
{
|
||
button.widget->SetChecked(checked);
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
|
||
bool Toolbar::SetActionLabel(ToolbarAction action, const std::wstring& label)
|
||
{
|
||
// ⚠️ 只更新**唯一权威来源**(`m_labelOverrides`)并置树脏,不再逐个回写控件:
|
||
// 旧实现既要写覆盖表又要写控件,两处一旦不同步,下一次重建就会把文本退回去。
|
||
// 调用方拿到 true 后会重排(`Relayout`),届时由 `RebuildWidgets` 统一生效。
|
||
for (std::pair<ToolbarAction, std::wstring>& entry : m_labelOverrides)
|
||
{
|
||
if (entry.first == action)
|
||
{
|
||
if (entry.second == label)
|
||
{
|
||
return false;
|
||
}
|
||
entry.second = label;
|
||
m_treeDirty = true;
|
||
return true;
|
||
}
|
||
}
|
||
m_labelOverrides.emplace_back(action, label);
|
||
m_treeDirty = true;
|
||
return true;
|
||
}
|
||
|
||
void Toolbar::Paint(gd::Graphics& g)
|
||
{
|
||
if (m_theme == nullptr || m_fonts == nullptr || m_root == nullptr)
|
||
{
|
||
return;
|
||
}
|
||
|
||
UiPaintContext ctx;
|
||
ctx.g = &g;
|
||
ctx.clip = m_area;
|
||
ctx.scale = m_scale;
|
||
m_root->Paint(ctx);
|
||
}
|
||
|
||
bool Toolbar::HitTest(int x, int y) const
|
||
{
|
||
return UiPointInRect(m_area, static_cast<float>(x), static_cast<float>(y));
|
||
}
|
||
|
||
void Toolbar::CollectDebugBoxes(UiDebugBoxList& boxes)
|
||
{
|
||
UiComponent::CollectDebugBoxes(boxes);
|
||
if (m_root == nullptr)
|
||
{
|
||
return;
|
||
}
|
||
// ⚠️ 跳过根控件:它的矩形与工具栏区域完全重合(已经被上一层登记过)。
|
||
for (const std::unique_ptr<UiWidget>& button : m_root->Children())
|
||
{
|
||
if (button == nullptr)
|
||
{
|
||
continue;
|
||
}
|
||
boxes.Add(button->Bounds(), 1);
|
||
// 按钮**内容**(文本或齿轮图标)单独上报:它是居中绘制的,与按钮矩形不同。
|
||
const UiButtonWidget* raw = dynamic_cast<const UiButtonWidget*>(button.get());
|
||
if (raw != nullptr)
|
||
{
|
||
boxes.Add(raw->ContentRect(), 2);
|
||
}
|
||
}
|
||
}
|
||
|
||
bool Toolbar::OnMouseMove(int x, int y)
|
||
{
|
||
if (m_root == nullptr)
|
||
{
|
||
return false;
|
||
}
|
||
UiEvent event;
|
||
event.kind = UiEventKind::MOUSE_MOVE;
|
||
event.x = x;
|
||
event.y = y;
|
||
// 悬停链切换会通过 `Invalidate` 把矩形冒泡到根 ⇒ 用脏区判断"是否需要重绘"
|
||
//(与旧实现"悬停下标变化才重绘"等价,但不再手工维护下标)。
|
||
return m_root->DispatchRedraw(event);
|
||
}
|
||
|
||
bool Toolbar::OnLButtonDown(int x, int y, ToolbarAction& action)
|
||
{
|
||
action = ToolbarAction::NONE;
|
||
if (m_root == nullptr)
|
||
{
|
||
return false;
|
||
}
|
||
UiEvent event;
|
||
event.kind = UiEventKind::MOUSE_DOWN;
|
||
event.x = x;
|
||
event.y = y;
|
||
event.button = UiMouseButton::LEFT;
|
||
m_root->Dispatch(event);
|
||
(void)m_root->TakeDirty();
|
||
|
||
for (const Button& button : m_buttons)
|
||
{
|
||
if (button.widget != nullptr && button.widget->Pressed())
|
||
{
|
||
action = button.action;
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
|
||
bool Toolbar::OnLButtonUp(int x, int y, ToolbarAction& action)
|
||
{
|
||
action = ToolbarAction::NONE;
|
||
if (m_root == nullptr)
|
||
{
|
||
return false;
|
||
}
|
||
|
||
// 旧语义:没有按下过就不进入抬起处理。
|
||
bool hadPressed = false;
|
||
for (const Button& button : m_buttons)
|
||
{
|
||
if (button.widget != nullptr && button.widget->Pressed())
|
||
{
|
||
hadPressed = true;
|
||
break;
|
||
}
|
||
}
|
||
if (!hadPressed)
|
||
{
|
||
return false;
|
||
}
|
||
|
||
m_pendingAction = ToolbarAction::NONE;
|
||
UiEvent event;
|
||
event.kind = UiEventKind::MOUSE_UP;
|
||
event.x = x;
|
||
event.y = y;
|
||
event.button = UiMouseButton::LEFT;
|
||
m_root->Dispatch(event);
|
||
|
||
// 旧实现会在抬起时按落点重算悬停态;派发一条 MOUSE_MOVE 让悬停链同步。
|
||
UiEvent sync;
|
||
sync.kind = UiEventKind::MOUSE_MOVE;
|
||
sync.x = x;
|
||
sync.y = y;
|
||
m_root->Dispatch(sync);
|
||
(void)m_root->TakeDirty();
|
||
|
||
action = m_pendingAction;
|
||
m_pendingAction = ToolbarAction::NONE;
|
||
return true;
|
||
}
|
||
|
||
bool Toolbar::OnMouseLeave()
|
||
{
|
||
if (m_root == nullptr)
|
||
{
|
||
return false;
|
||
}
|
||
UiEvent event;
|
||
event.kind = UiEventKind::MOUSE_LEAVE;
|
||
event.x = 0;
|
||
event.y = 0;
|
||
m_root->Dispatch(event);
|
||
|
||
// 指针离开窗口后不会再收到 MOUSE_UP ⇒ 在这里放弃"按下"(与旧实现一致)。
|
||
bool changed = false;
|
||
for (Button& button : m_buttons)
|
||
{
|
||
if (button.widget != nullptr && button.widget->Pressed())
|
||
{
|
||
button.widget->CancelPress();
|
||
changed = true;
|
||
}
|
||
}
|
||
changed = UiRectHasArea(m_root->TakeDirty()) || changed;
|
||
return changed;
|
||
}
|
||
|
||
} // namespace jdi
|