修复列表内联编辑(组名/信号名)看不到插入符与选区;把 UI 基础层迁入 Components/Shared
1) 行位图缓存键漏了插入符与选区:信号列表整行走 PaintRowCached,RowCacheKey
在编辑态只混合“是否编辑 + 文本” ⇒ 左右方向键与鼠标框选虽然改变了 TextEdit
状态(caret/anchor),键却不变 ⇒ 贴回旧位图。表现就是“无法部分选择、
鼠标框选无反应、光标不动”,而绘图区的光标时间输入(无行缓存)一直正常。
修法:GROUP_TITLE / SIGNAL_NAME 两个分支编辑态把 Caret / SelectionBegin /
SelectionEnd 一并 mix 进键;新增 SignalPanel::EditFieldFont() 统一
绘制(uiSmall / ui)与鼠标命中、插入符换算所用字体。
2) Theme / PaintUtil / TextEdit / PopupMenu / ColorPickerPopup 由
Utilities/{Inc,Src} git mv 到 Components/Shared/{Inc,Src}:
Utilities 只保留纯数据/逻辑模块(DataModel、DataTable、各 *Loader、MatH5、
Utf8Util),Shared 成为自洽的 UI 基础层(Theme → PaintUtil → UiControls →
PopupMenu / ColorPickerPopup)。依赖方向仍是 Components → Shared → Utilities;
PaintUtil 一并迁移是因为它依赖 Theme(否则构成 Utilities → Shared 反向依赖)。
Makefile 无需改动(include 平铺,两个目录都已在搜索路径),但需清理 Build/*
里对应的旧 .o/.d。
验证(全部离屏,不占用鼠标/键盘/屏幕):
- 新增 .preflight/editcheck 20/20;A/B 修复前 6 项如实失败(键不变 + 屏幕不重绘);
- 既有 .preflight/check 137/137;
- make release / make debug 零警告。
This commit is contained in:
1 parent
f44f8021e3
commit
1e50494c41
15 files changed
+93
-4
No files matched your search
@@ -0,0 +1,83 @@
|
||||
#include "Theme.hpp"
|
||||
|
||||
namespace jdi
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
// Solarised Light 基础色板。
|
||||
const std::uint32_t kBase03 = 0x002B36u; // #002B36
|
||||
const std::uint32_t kBase02 = 0x073642u; // #073642
|
||||
const std::uint32_t kBase01 = 0x586E75u; // #586E75
|
||||
const std::uint32_t kBase00 = 0x657B83u; // #657B83
|
||||
const std::uint32_t kBase0 = 0x839496u; // #839496
|
||||
const std::uint32_t kBase1 = 0x93A1A1u; // #93A1A1
|
||||
const std::uint32_t kBase2 = 0xEEE8D5u; // #EEE8D5
|
||||
const std::uint32_t kBase3 = 0xFDF6E3u; // #FDF6E3
|
||||
|
||||
// Solarised 强调色。
|
||||
const std::uint32_t kYellow = 0xB58900u; // #B58900
|
||||
const std::uint32_t kOrange = 0xCB4B16u; // #CB4B16
|
||||
const std::uint32_t kRed = 0xDC322Fu; // #DC322F
|
||||
const std::uint32_t kMagenta = 0xD33682u; // #D33682
|
||||
const std::uint32_t kViolet = 0x6C71C4u; // #6C71C4
|
||||
const std::uint32_t kBlue = 0x268BD2u; // #268BD2
|
||||
const std::uint32_t kCyan = 0x2AA198u; // #2AA198
|
||||
const std::uint32_t kGreen = 0x859900u; // #859900
|
||||
|
||||
/** @brief 波形默认配色,按视觉对比度排序。 */
|
||||
const std::uint32_t kSignalPalette[] = {
|
||||
MakeArgb(kBlue), MakeArgb(kGreen), MakeArgb(kRed), MakeArgb(kViolet),
|
||||
MakeArgb(kYellow), MakeArgb(kCyan), MakeArgb(kMagenta), MakeArgb(kOrange),
|
||||
MakeArgb(kBase01), MakeArgb(kBase0),
|
||||
};
|
||||
|
||||
/** @brief 全局唯一主题实例。 */
|
||||
const Theme kSolarizedLight = []
|
||||
{
|
||||
Theme theme;
|
||||
theme.windowBg = MakeArgb(kBase3);
|
||||
theme.toolbarBg = MakeArgb(kBase2);
|
||||
theme.panelBg = MakeArgb(kBase2);
|
||||
theme.cardBg = MakeArgb(kBase3);
|
||||
theme.statusBg = MakeArgb(kBase2);
|
||||
theme.plotBg = MakeArgb(kBase3);
|
||||
theme.border = MakeArgb(0xD9D1BCu);
|
||||
theme.borderStrong = MakeArgb(kBase1);
|
||||
|
||||
theme.text = MakeArgb(kBase00);
|
||||
theme.textStrong = MakeArgb(kBase02);
|
||||
theme.textMuted = MakeArgb(kBase1);
|
||||
theme.textOnAccent = MakeArgb(kBase3);
|
||||
|
||||
theme.accent = MakeArgb(kBlue);
|
||||
theme.accentSoft = MakeArgb(0xCFE4F3u);
|
||||
theme.hover = MakeArgb(0xE4DCC6u);
|
||||
theme.pressed = MakeArgb(0xD8CFB6u);
|
||||
theme.selection = MakeArgb(0xDCEAF6u);
|
||||
|
||||
// 网格线需要在绘图区底色(kBase3)上清晰可辨,同时又要与网格边界
|
||||
// (axisLine/borderStrong 的蓝灰)明显区分——因此采用偏暖的加深米色。
|
||||
theme.gridWeak = MakeArgb(0xDDD3B8u);
|
||||
theme.gridStrong = MakeArgb(0xC3B896u);
|
||||
theme.axisLine = MakeArgb(kBase1);
|
||||
theme.cursor = MakeArgb(kOrange);
|
||||
theme.readoutBg = MakeArgb(0xF6EFDCu);
|
||||
theme.danger = MakeArgb(kRed);
|
||||
theme.warning = MakeArgb(kYellow);
|
||||
return theme;
|
||||
}();
|
||||
}
|
||||
|
||||
const Theme& SolarizedLight()
|
||||
{
|
||||
return kSolarizedLight;
|
||||
}
|
||||
|
||||
const std::uint32_t* SignalPalette(int& count)
|
||||
{
|
||||
count = static_cast<int>(sizeof(kSignalPalette) / sizeof(kSignalPalette[0]));
|
||||
return kSignalPalette;
|
||||
}
|
||||
|
||||
} // namespace jdi
|
||||
Reference in new issue
Block a user