From 4edf8f86bd855a3b05eda85f72d41337678845da Mon Sep 17 00:00:00 2001 From: Muse Date: Sat, 5 Dec 2026 21:32:10 +0000 Subject: [PATCH] =?UTF-8?q?Inst*:=20proportions=20fix=20(audit=20Dec=20202?= =?UTF-8?q?6)=20=E2=80=94=20buttons,=20switches,=20panels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- widgets/components/InstBezel/InstBezel.h | 6 ++++-- .../InstCircuitBreaker/InstCircuitBreaker.h | 9 ++++++--- .../InstControlPanel/InstControlPanel.h | 14 +++++++++----- .../InstEmergencyStop/InstEmergencyStop.h | 8 ++++++-- .../InstLampTestButton/InstLampTestButton.h | 15 +++++++++------ .../components/InstPanelPlate/InstPanelPlate.h | 8 +++++--- .../components/InstPushButton/InstPushButton.h | 9 +++++++-- .../InstPushButtonLatching.h | 9 +++++++-- .../InstRockerSwitch/InstRockerSwitch.h | 8 +++++--- .../InstRockerSwitchDouble.h | 10 ++++++---- .../InstRockerSwitchIlluminated.h | 10 ++++++---- .../InstRotarySelector/InstRotarySelector.h | 11 ++++++++--- .../components/InstSlideSwitch/InstSlideSwitch.h | 12 +++++++----- .../InstToggleSwitch/InstToggleSwitch.h | 6 ++++-- .../InstToggleSwitchIlluminated.h | 6 ++++-- 15 files changed, 93 insertions(+), 48 deletions(-) diff --git a/widgets/components/InstBezel/InstBezel.h b/widgets/components/InstBezel/InstBezel.h index c33abc6..0923211 100644 --- a/widgets/components/InstBezel/InstBezel.h +++ b/widgets/components/InstBezel/InstBezel.h @@ -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); diff --git a/widgets/components/InstCircuitBreaker/InstCircuitBreaker.h b/widgets/components/InstCircuitBreaker/InstCircuitBreaker.h index ca6a8a3..cef3eb1 100644 --- a/widgets/components/InstCircuitBreaker/InstCircuitBreaker.h +++ b/widgets/components/InstCircuitBreaker/InstCircuitBreaker.h @@ -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_) { diff --git a/widgets/components/InstControlPanel/InstControlPanel.h b/widgets/components/InstControlPanel/InstControlPanel.h index ad2e631..ef8ff83 100644 --- a/widgets/components/InstControlPanel/InstControlPanel.h +++ b/widgets/components/InstControlPanel/InstControlPanel.h @@ -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); } } } diff --git a/widgets/components/InstEmergencyStop/InstEmergencyStop.h b/widgets/components/InstEmergencyStop/InstEmergencyStop.h index de543cb..abb850a 100644 --- a/widgets/components/InstEmergencyStop/InstEmergencyStop.h +++ b/widgets/components/InstEmergencyStop/InstEmergencyStop.h @@ -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_) { diff --git a/widgets/components/InstLampTestButton/InstLampTestButton.h b/widgets/components/InstLampTestButton/InstLampTestButton.h index 006e264..868a09d 100644 --- a/widgets/components/InstLampTestButton/InstLampTestButton.h +++ b/widgets/components/InstLampTestButton/InstLampTestButton.h @@ -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); diff --git a/widgets/components/InstPanelPlate/InstPanelPlate.h b/widgets/components/InstPanelPlate/InstPanelPlate.h index 3945089..f71a257 100644 --- a/widgets/components/InstPanelPlate/InstPanelPlate.h +++ b/widgets/components/InstPanelPlate/InstPanelPlate.h @@ -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); diff --git a/widgets/components/InstPushButton/InstPushButton.h b/widgets/components/InstPushButton/InstPushButton.h index e4efc4d..643885b 100644 --- a/widgets/components/InstPushButton/InstPushButton.h +++ b/widgets/components/InstPushButton/InstPushButton.h @@ -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_) { diff --git a/widgets/components/InstPushButtonLatching/InstPushButtonLatching.h b/widgets/components/InstPushButtonLatching/InstPushButtonLatching.h index 07f8c40..f5f5073 100644 --- a/widgets/components/InstPushButtonLatching/InstPushButtonLatching.h +++ b/widgets/components/InstPushButtonLatching/InstPushButtonLatching.h @@ -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_) { diff --git a/widgets/components/InstRockerSwitch/InstRockerSwitch.h b/widgets/components/InstRockerSwitch/InstRockerSwitch.h index 6955073..7c9b771 100644 --- a/widgets/components/InstRockerSwitch/InstRockerSwitch.h +++ b/widgets/components/InstRockerSwitch/InstRockerSwitch.h @@ -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_) { diff --git a/widgets/components/InstRockerSwitchDouble/InstRockerSwitchDouble.h b/widgets/components/InstRockerSwitchDouble/InstRockerSwitchDouble.h index 8487d49..8dd5e45 100644 --- a/widgets/components/InstRockerSwitchDouble/InstRockerSwitchDouble.h +++ b/widgets/components/InstRockerSwitchDouble/InstRockerSwitchDouble.h @@ -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_) { diff --git a/widgets/components/InstRockerSwitchIlluminated/InstRockerSwitchIlluminated.h b/widgets/components/InstRockerSwitchIlluminated/InstRockerSwitchIlluminated.h index fdb4090..d3c51ed 100644 --- a/widgets/components/InstRockerSwitchIlluminated/InstRockerSwitchIlluminated.h +++ b/widgets/components/InstRockerSwitchIlluminated/InstRockerSwitchIlluminated.h @@ -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_) { diff --git a/widgets/components/InstRotarySelector/InstRotarySelector.h b/widgets/components/InstRotarySelector/InstRotarySelector.h index 83c5770..e23e8c4 100644 --- a/widgets/components/InstRotarySelector/InstRotarySelector.h +++ b/widgets/components/InstRotarySelector/InstRotarySelector.h @@ -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_) { diff --git a/widgets/components/InstSlideSwitch/InstSlideSwitch.h b/widgets/components/InstSlideSwitch/InstSlideSwitch.h index 09a2660..4e4f6e3 100644 --- a/widgets/components/InstSlideSwitch/InstSlideSwitch.h +++ b/widgets/components/InstSlideSwitch/InstSlideSwitch.h @@ -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_) { diff --git a/widgets/components/InstToggleSwitch/InstToggleSwitch.h b/widgets/components/InstToggleSwitch/InstToggleSwitch.h index 905e3c4..b1df36a 100644 --- a/widgets/components/InstToggleSwitch/InstToggleSwitch.h +++ b/widgets/components/InstToggleSwitch/InstToggleSwitch.h @@ -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_) { diff --git a/widgets/components/InstToggleSwitchIlluminated/InstToggleSwitchIlluminated.h b/widgets/components/InstToggleSwitchIlluminated/InstToggleSwitchIlluminated.h index 359d6a8..76837ea 100644 --- a/widgets/components/InstToggleSwitchIlluminated/InstToggleSwitchIlluminated.h +++ b/widgets/components/InstToggleSwitchIlluminated/InstToggleSwitchIlluminated.h @@ -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_) {