Inst*: proportions fix (audit Dec 2026) — buttons, switches, panels

Face/state labels white on coloured faces at 16-18 px (G6);
rocker/toggle/slide/rotary numerals and state labels 16 px with
widened boxes; panel header bars taller for 19 px titles.
This commit is contained in:
Muse committed 2026-12-05 21:32:10 +00:00
1 parent 2b3d82a726
commit 4edf8f86bd
15 files changed
+93 -48

No files matched your search

+4 -2
View File
@@ -86,6 +86,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: "GAUGE" 16 px bold, 14 px above the bottom edge.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 15);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long ink = styles_->get_color_rgb(ink_color_.r, ink_color_.g, ink_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
@@ -101,8 +103,8 @@ public:
XSetForeground(display_, gc_, ink);
XDrawRectangle(display_, window_, gc_, ix, iy, iw, ih);
XDrawRectangle(display_, window_, gc_, ix + 3, iy + 3, iw - 6, ih - 6);
int tw = xf::text_width(st, text_);
xf::draw_text_at(display_, window_, gc_, st, x1_ + (width() - tw) / 2, y2_ - 12, text_);
int tw = xf::text_width(stLab, text_);
xf::draw_text_at(display_, window_, gc_, stLab, x1_ + (width() - tw) / 2, y2_ - 14, text_);
draw_screw(x1_ + 16, y1_ + 16);
draw_screw(x2_ - 16, y1_ + 16);
draw_screw(x1_ + 16, y2_ - 16);
@@ -91,6 +91,9 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: banner + state + title 16 px bold; banner text white.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
SStyle stLabWhite = stLab; stLabWhite.text_color_ = styles_->get_color_rgb(255, 255, 255);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
@@ -114,7 +117,7 @@ public:
if (tripped) {
XSetForeground(display_, gc_, red);
XFillRectangle(display_, window_, gc_, bx + 20, by + 16, bw - 40, 34);
xf::draw_text_centered(display_, window_, gc_, st, bx + 20, by + 16, bx + bw - 20, by + 50, "TRIPPED");
xf::draw_text_centered(display_, window_, gc_, stLabWhite, bx + 20, by + 16, bx + bw - 20, by + 50, "TRIPPED");
}
int hx = cx, hy = cy + (on ? -52 : (tripped ? 0 : 52));
xf::set_line_width(display_, gc_, lever_line_width_);
@@ -128,8 +131,8 @@ public:
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - 30, cy + 10, 60, 60, 0, 360 * 64);
std::string lab = on ? "ON" : (tripped ? "TRIPPED" : "OFF");
xf::draw_text_centered(display_, window_, gc_, st, bx, by + bh - 52, bx + bw, by + bh - 28, lab);
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by + bh - 56, bx + bw, by + bh - 24, lab);
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -119,6 +119,10 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: grid labels 14 px bold.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 14);
// Audit: header title 18-20 px bold.
SStyle stTitle = st; stTitle.font_ = xframe::inst_cap_font_prop(display_, 19);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long face = styles_->get_color_rgb(face_color_.r, face_color_.g, face_color_.b);
unsigned long ink = styles_->get_color_rgb(ink_color_.r, ink_color_.g, ink_color_.b);
@@ -128,13 +132,13 @@ public:
XFillRectangle(display_, window_, gc_, x1_, y1_, width(), height());
XSetForeground(display_, gc_, panel);
XFillRectangle(display_, window_, gc_, x1_ + 2, y1_ + 2, width() - 4, height() - 4);
int sx = x1_ + 10, sy = y1_ + 10, sw = width() - 20, sh = 30;
int sx = x1_ + 10, sy = y1_ + 10, sw = width() - 20, sh = 38; // audit: header bar taller for the 19 px title
XSetForeground(display_, gc_, amber);
XFillRectangle(display_, window_, gc_, sx, sy, sw, sh);
XSetForeground(display_, gc_, ink);
XDrawRectangle(display_, window_, gc_, sx, sy, sw, sh);
int tw = xf::text_width(st, text_);
xf::draw_text_at(display_, window_, gc_, st, sx + (sw - tw) / 2, sy + 20, text_);
int tw = xf::text_width(stTitle, text_);
xf::draw_text_at(display_, window_, gc_, stTitle, sx + (sw - tw) / 2, sy + 27, text_);
if (labels_.size() != (size_t)(rows_ * cols_)) labels_.assign((size_t)(rows_ * cols_), "");
int gx = x1_ + 16, gy = y1_ + 52, gw = width() - 32, gh = height() - 68;
int cw = gw / cols_, ch = gh / rows_;
@@ -148,8 +152,8 @@ public:
XDrawRectangle(display_, window_, gc_, cx0 + 3, cy0 + 3, cw - 6, ch - 6);
std::string lab = labels_[(size_t)(r * cols_ + c)];
if (!lab.empty()) {
int lw = xf::text_width(st, lab);
xf::draw_text_at(display_, window_, gc_, st, cx0 + (cw - lw) / 2, cy0 + ch / 2 + 4, lab);
int lw = xf::text_width(stLab, lab);
xf::draw_text_at(display_, window_, gc_, stLab, cx0 + (cw - lw) / 2, cy0 + ch / 2 + 7, lab);
}
}
}
@@ -77,6 +77,10 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit G6: "E-STOP"/"STOPPED" white on red, 18 px; title 16 px.
SStyle stFace = st; stFace.font_ = xframe::inst_cap_font(display_, 18);
stFace.text_color_ = styles_->get_color_rgb(255, 255, 255);
SStyle stTitle = st; stTitle.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long dark = styles_->get_color_rgb(dark_color_.r, dark_color_.g, dark_color_.b);
unsigned long amber = styles_->get_color_rgb(amber_color_.r, amber_color_.g, amber_color_.b);
@@ -98,8 +102,8 @@ public:
XFillArc(display_, window_, gc_, cx - r + 18, cy - r + 18 + dy, 2 * r - 36, 2 * r - 36, 0, 180 * 64);
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - r, cy - r + dy, 2 * r, 2 * r, 0, 360 * 64);
xf::draw_text_centered(display_, window_, gc_, st, cx - r, cy - 12 + dy, cx + r, cy + 12 + dy, latched_ ? "STOPPED" : "E-STOP");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stFace, cx - r, cy - 16 + dy, cx + r, cy + 16 + dy, latched_ ? "STOPPED" : "E-STOP");
xf::draw_text_centered(display_, window_, gc_, stTitle, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -98,6 +98,9 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: LAMP/TEST 16 px bold (face is light grey, dark text is
// fine), title 16 px.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
unsigned long face = styles_->get_color_rgb(face_color_.r, face_color_.g, face_color_.b);
@@ -112,12 +115,12 @@ public:
XFillArc(display_, window_, gc_, cx - R, cy - R, 2 * R, 2 * R, 0, 360 * 64);
XSetForeground(display_, gc_, pressed_ ? face_down : face);
XFillArc(display_, window_, gc_, cx - ir, cy - ir, 2 * ir, 2 * ir, 0, 360 * 64);
int tw1 = xf::text_width(st, "LAMP");
int tw2 = xf::text_width(st, "TEST");
xf::draw_text_at(display_, window_, gc_, st, cx - tw1 / 2, cy - 2, "LAMP");
xf::draw_text_at(display_, window_, gc_, st, cx - tw2 / 2, cy + 16, "TEST");
int tw = xf::text_width(st, text_);
xf::draw_text_at(display_, window_, gc_, st, cx - tw / 2, y2_ - 6, text_);
int tw1 = xf::text_width(stLab, "LAMP");
int tw2 = xf::text_width(stLab, "TEST");
xf::draw_text_at(display_, window_, gc_, stLab, cx - tw1 / 2, cy - 2, "LAMP");
xf::draw_text_at(display_, window_, gc_, stLab, cx - tw2 / 2, cy + 16, "TEST");
int tw = xf::text_width(stLab, text_);
xf::draw_text_at(display_, window_, gc_, stLab, cx - tw / 2, y2_ - 8, text_);
if (hovered_ || focused_) {
XSetForeground(display_, gc_, styles_->get_color_rgb(hover_color_.r, hover_color_.g, hover_color_.b));
XDrawRectangle(display_, window_, gc_, x1_ + 1, y1_ + 1, width() - 2, height() - 2);
@@ -89,6 +89,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: header title 18-20 px bold.
SStyle stTitle = st; stTitle.font_ = xframe::inst_cap_font_prop(display_, 19);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long ink = styles_->get_color_rgb(ink_color_.r, ink_color_.g, ink_color_.b);
unsigned long amber = styles_->get_color_rgb(amber_color_.r, amber_color_.g, amber_color_.b);
@@ -99,13 +101,13 @@ public:
XFillRectangle(display_, window_, gc_, x1_ + 2, y1_ + 2, width() - 4, height() - 4);
XSetForeground(display_, gc_, ink);
XDrawRectangle(display_, window_, gc_, x1_ + 8, y1_ + 8, width() - 16, height() - 16);
int sx = x1_ + 10, sy = y1_ + 10, sw = width() - 20, sh = 30;
int sx = x1_ + 10, sy = y1_ + 10, sw = width() - 20, sh = 38; // audit: header bar taller for the 19 px title
XSetForeground(display_, gc_, amber);
XFillRectangle(display_, window_, gc_, sx, sy, sw, sh);
XSetForeground(display_, gc_, ink);
XDrawRectangle(display_, window_, gc_, sx, sy, sw, sh);
int tw = xf::text_width(st, text_);
xf::draw_text_at(display_, window_, gc_, st, sx + (sw - tw) / 2, sy + 20, text_);
int tw = xf::text_width(stTitle, text_);
xf::draw_text_at(display_, window_, gc_, stTitle, sx + (sw - tw) / 2, sy + 27, text_);
draw_screw(x1_ + 20, y1_ + 20);
draw_screw(x2_ - 20, y1_ + 20);
draw_screw(x1_ + 20, y2_ - 20);
@@ -82,6 +82,11 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit G6: face label white on the red/green/amber face, 18 px;
// title 16 px at the foot.
SStyle stFace = st; stFace.font_ = xframe::inst_cap_font(display_, 18);
stFace.text_color_ = styles_->get_color_rgb(255, 255, 255);
SStyle stTitle = st; stTitle.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
unsigned long dark = styles_->get_color_rgb(dark_color_.r, dark_color_.g, dark_color_.b);
@@ -104,8 +109,8 @@ public:
XFillArc(display_, window_, gc_, cx - r + 16, cy - r + 16 + dy, 2 * r - 32, 2 * r - 32, 0, 360 * 64);
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - r, cy - r + dy, 2 * r, 2 * r, 0, 360 * 64);
xf::draw_text_centered(display_, window_, gc_, st, cx - r, cy - 12 + dy, cx + r, cy + 12 + dy, on_ ? "ON" : "PUSH");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stFace, cx - r, cy - 16 + dy, cx + r, cy + 16 + dy, on_ ? "ON" : "PUSH");
xf::draw_text_centered(display_, window_, gc_, stTitle, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -80,6 +80,11 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit G6: face label white on the red/green/amber face, 18 px;
// title 16 px at the foot.
SStyle stFace = st; stFace.font_ = xframe::inst_cap_font(display_, 18);
stFace.text_color_ = styles_->get_color_rgb(255, 255, 255);
SStyle stTitle = st; stTitle.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
unsigned long dark = styles_->get_color_rgb(dark_color_.r, dark_color_.g, dark_color_.b);
@@ -101,8 +106,8 @@ public:
XFillArc(display_, window_, gc_, cx - r + 16, cy - r + 16 + dy, 2 * r - 32, 2 * r - 32, 0, 360 * 64);
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - r, cy - r + dy, 2 * r, 2 * r, 0, 360 * 64);
xf::draw_text_centered(display_, window_, gc_, st, cx - r, cy - 12 + dy, cx + r, cy + 12 + dy, on_ ? "IN" : "OUT");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stFace, cx - r, cy - 16 + dy, cx + r, cy + 16 + dy, on_ ? "IN" : "OUT");
xf::draw_text_centered(display_, window_, gc_, stTitle, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -83,6 +83,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: state labels 16 px bold, boxes widened to fit.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
@@ -110,9 +112,9 @@ public:
XDrawRectangle(display_, window_, gc_, bx, by + shift, bw, bh);
XSetForeground(display_, gc_, amber);
XDrawLine(display_, window_, gc_, bx + 8, by + bh / 2 + shift, bx + bw - 8, by + bh / 2 + shift);
xf::draw_text_centered(display_, window_, gc_, st, bx, by - 34, bx + bw, by - 10, "I ON");
xf::draw_text_centered(display_, window_, gc_, st, bx, by + bh + 12, bx + bw, by + bh + 36, "O OFF");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by - 36, bx + bw, by - 8, "I ON");
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by + bh + 10, bx + bw, by + bh + 38, "O OFF");
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -96,6 +96,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: state labels 16 px bold, boxes widened to fit.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
unsigned long rocker = styles_->get_color_rgb(rocker_color_.r, rocker_color_.g, rocker_color_.b);
@@ -119,10 +121,10 @@ public:
XSetForeground(display_, gc_, amber);
XDrawLine(display_, window_, gc_, bx + 8, by + bh / 2 + shift, bx + bw - 8, by + bh / 2 + shift);
std::string pos = (pos_ > 0) ? "UP ON" : (pos_ < 0) ? "DOWN ON" : "CENTRE OFF";
xf::draw_text_centered(display_, window_, gc_, st, bx, by + shift + 100, bx + bw, by + shift + 126, pos);
xf::draw_text_centered(display_, window_, gc_, st, bx, by - 34, bx + bw, by - 10, "UP");
xf::draw_text_centered(display_, window_, gc_, st, bx, by + bh + 12, bx + bw, by + bh + 36, "DOWN");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by + shift + 100, bx + bw, by + shift + 126, pos);
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by - 36, bx + bw, by - 8, "UP");
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by + bh + 10, bx + bw, by + bh + 38, "DOWN");
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -86,6 +86,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: state labels 16 px bold, boxes widened to fit.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
unsigned long rocker = styles_->get_color_rgb(rocker_color_.r, rocker_color_.g, rocker_color_.b);
@@ -117,10 +119,10 @@ public:
XSetForeground(display_, gc_, green);
XDrawRectangle(display_, window_, gc_, lx - 4, ly - 4, lw + 8, lh + 8);
}
xf::draw_text_centered(display_, window_, gc_, st, bx, by + shift + 90, bx + bw, by + shift + 116, on_ ? "ON" : "OFF");
xf::draw_text_centered(display_, window_, gc_, st, bx, by - 34, bx + bw, by - 10, "I ON");
xf::draw_text_centered(display_, window_, gc_, st, bx, by + bh + 12, bx + bw, by + bh + 36, "O OFF");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by + shift + 90, bx + bw, by + shift + 116, on_ ? "ON" : "OFF");
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by - 36, bx + bw, by - 8, "I ON");
xf::draw_text_centered(display_, window_, gc_, stLab, bx, by + bh + 10, bx + bw, by + bh + 38, "O OFF");
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -90,6 +90,10 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: position numerals 16 px (was ~10 px), POS + title 16 px.
SStyle stNum = st; stNum.font_ = xframe::inst_cap_font(display_, 16);
int numAsc = stNum.font_ ? stNum.font_->ascent : 13;
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
@@ -110,7 +114,8 @@ public:
int tx = cx + (int)((r + 34) * std::cos(a));
int ty = cy + (int)((r + 34) * std::sin(a)) + 5;
std::string lab = std::to_string(i);
xf::draw_text_at(display_, window_, gc_, st, tx - 4, ty, lab);
int tw = xf::text_width(stNum, lab);
xf::draw_text_at(display_, window_, gc_, stNum, tx - tw / 2, ty + numAsc / 2 - 5, lab);
int mx = cx + (int)((r - 6) * std::cos(a));
int my = cy + (int)((r - 6) * std::sin(a));
XSetForeground(display_, gc_, dark);
@@ -128,8 +133,8 @@ public:
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - 26, cy - 26, 52, 52, 0, 360 * 64);
std::string pos = "POS " + std::to_string(position_) + " / " + std::to_string(positions_);
xf::draw_text_centered(display_, window_, gc_, st, cx - 110, cy + r + 44, cx + 110, cy + r + 68, pos);
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, cx - 110, cy + r + 44, cx + 110, cy + r + 68, pos);
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -81,6 +81,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: OFF/ON 16 px bold, boxes widened; title 16 px.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
@@ -98,17 +100,17 @@ public:
XFillRectangle(display_, window_, gc_, tx - 12, ty - 12, tw + 24, th + 24);
XSetForeground(display_, gc_, panel);
XFillRectangle(display_, window_, gc_, tx, ty, tw, th);
int kw = 90;
int kw = 110; // audit: wider knob to match 16 px OFF/ON labels
int kx = on_ ? tx + tw - kw - 6 : tx + 6;
XSetForeground(display_, gc_, on_ ? green : rocker);
XFillRectangle(display_, window_, gc_, kx, ty + 6, kw, th - 12);
XSetForeground(display_, gc_, dark);
XDrawRectangle(display_, window_, gc_, kx, ty + 6, kw, th - 12);
XSetForeground(display_, gc_, amber);
XDrawLine(display_, window_, gc_, kx + kw / 2 - 14, ty + th / 2, kx + kw / 2 + 14, ty + th / 2);
xf::draw_text_centered(display_, window_, gc_, st, tx, ty - 34, tx + 90, ty - 10, "OFF");
xf::draw_text_centered(display_, window_, gc_, st, tx + tw - 90, ty - 34, tx + tw, ty - 10, "ON");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XDrawLine(display_, window_, gc_, kx + kw / 2 - 20, ty + th / 2, kx + kw / 2 + 20, ty + th / 2); // audit: grip line widened with the 110 px knob
xf::draw_text_centered(display_, window_, gc_, stLab, tx, ty - 36, tx + 110, ty - 8, "OFF");
xf::draw_text_centered(display_, window_, gc_, stLab, tx + tw - 110, ty - 36, tx + tw, ty - 8, "ON");
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -86,6 +86,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: state 16 px, title 16 px bold.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
@@ -120,8 +122,8 @@ public:
XFillArc(display_, window_, gc_, cx - 18, cy - 18, 36, 36, 0, 360 * 64);
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - 26, cy - 26, 52, 52, 0, 360 * 64);
xf::draw_text_centered(display_, window_, gc_, st, cx - 110, cy - 130, cx + 110, cy - 106, on_ ? "ON" : "OFF");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, cx - 110, cy - 132, cx + 110, cy - 104, on_ ? "ON" : "OFF");
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {
@@ -86,6 +86,8 @@ public:
void draw() {
if (!visible_) return;
SStyle st = style();
// Audit: state 16 px, title 16 px bold.
SStyle stLab = st; stLab.font_ = xframe::inst_cap_font_prop(display_, 16);
unsigned long white = styles_->get_color_rgb(white_color_.r, white_color_.g, white_color_.b);
unsigned long panel = styles_->get_color_rgb(panel_color_.r, panel_color_.g, panel_color_.b);
unsigned long bezel = styles_->get_color_rgb(bezel_color_.r, bezel_color_.g, bezel_color_.b);
@@ -120,8 +122,8 @@ public:
XFillArc(display_, window_, gc_, cx - 18, cy - 18, 36, 36, 0, 360 * 64);
XSetForeground(display_, gc_, dark);
XDrawArc(display_, window_, gc_, cx - 26, cy - 26, 52, 52, 0, 360 * 64);
xf::draw_text_centered(display_, window_, gc_, st, cx - 110, cy - 130, cx + 110, cy - 106, on_ ? "ON" : "OFF");
xf::draw_text_centered(display_, window_, gc_, st, x1_, y2_ - 28, x2_, y2_ - 6, text_);
xf::draw_text_centered(display_, window_, gc_, stLab, cx - 110, cy - 132, cx + 110, cy - 104, on_ ? "ON" : "OFF");
xf::draw_text_centered(display_, window_, gc_, stLab, x1_, y2_ - 28, x2_, y2_ - 6, text_);
XSetForeground(display_, gc_, st.lineColor_);
XDrawRectangle(display_, window_, gc_, x1_, y1_, width(), height());
if (focused_) {