fix(theme): panel element headings clipped — only top ~60% visible #325

Closed
opened 2026-02-24 18:38:15 +00:00 by forbes · 0 comments
Owner

Description

Panel element headings (e.g., QGroupBox titles, QSint::ActionGroup headers in the task panel) are being clipped by the content area below them, so only the top ~60% of the heading text is visible.

Root Cause Analysis

There are several likely contributing factors in the KindredCreate (Catppuccin Mocha) theme:

QGroupBox titles

In KindredCreate.qss (line ~732), the QGroupBox has:

QGroupBox {
    margin-top: 12px;
    padding-top: 8px;
}

The upstream FreeCAD.qss uses margin-top: 18px to leave space for the title. The KindredCreate theme reduces this to 12px, which may not leave enough room for the title to render fully — especially at larger font sizes or higher DPI.

Task panel headers (QSint::ActionGroup)

The header height is calculated in C++ (ActionPanelScheme):

headerSize = fm.height() + 10;

The task header layout uses tight margins:

hbl->setContentsMargins(4, 2, 8, 2);  // only 2px top/bottom

And the header frame gets setFixedHeight(scheme->headerSize). If the QSS padding or border adds height that isn't accounted for in the C++ calculation, the text gets clipped.

QDockWidget title bars

The min-height: 18px in KindredCreate.qss (line ~254) may be too small when combined with padding: 8px 6px — the total needed height is font-height + 16px (padding) + border, but the min-height doesn't account for this.

Proposed Fix

  1. QGroupBox: Increase margin-top to at least 16px (or back to 18px) to match the space needed by the title. Consider also adding padding-top to ensure content doesn't overlap.
  2. Task panel headers: Either increase the C++ headerSize calculation to account for QSS padding/borders, or ensure the QSS styling for QSint--ActionGroup QSint--ActionLabel[class="header"] doesn't add height beyond what the C++ code allocates.
  3. QDockWidget: Increase min-height or remove it and let Qt auto-size based on padding + font metrics.

Files to Modify

  • src/Gui/Stylesheets/KindredCreate.qss — primary theme stylesheet
  • Possibly src/Gui/QSint/actionpanel/actionpanelscheme.cpp — header size calculation
  • Possibly src/Gui/QSint/actionpanel/taskheader_p.cpp — header layout margins
## Description Panel element headings (e.g., QGroupBox titles, QSint::ActionGroup headers in the task panel) are being clipped by the content area below them, so only the top ~60% of the heading text is visible. ## Root Cause Analysis There are several likely contributing factors in the KindredCreate (Catppuccin Mocha) theme: ### QGroupBox titles In `KindredCreate.qss` (line ~732), the QGroupBox has: ```qss QGroupBox { margin-top: 12px; padding-top: 8px; } ``` The upstream `FreeCAD.qss` uses `margin-top: 18px` to leave space for the title. The KindredCreate theme reduces this to 12px, which may not leave enough room for the title to render fully — especially at larger font sizes or higher DPI. ### Task panel headers (QSint::ActionGroup) The header height is calculated in C++ (`ActionPanelScheme`): ```cpp headerSize = fm.height() + 10; ``` The task header layout uses tight margins: ```cpp hbl->setContentsMargins(4, 2, 8, 2); // only 2px top/bottom ``` And the header frame gets `setFixedHeight(scheme->headerSize)`. If the QSS padding or border adds height that isn't accounted for in the C++ calculation, the text gets clipped. ### QDockWidget title bars The `min-height: 18px` in KindredCreate.qss (line ~254) may be too small when combined with `padding: 8px 6px` — the total needed height is font-height + 16px (padding) + border, but the min-height doesn't account for this. ## Proposed Fix 1. **QGroupBox**: Increase `margin-top` to at least `16px` (or back to `18px`) to match the space needed by the title. Consider also adding `padding-top` to ensure content doesn't overlap. 2. **Task panel headers**: Either increase the C++ `headerSize` calculation to account for QSS padding/borders, or ensure the QSS styling for `QSint--ActionGroup QSint--ActionLabel[class="header"]` doesn't add height beyond what the C++ code allocates. 3. **QDockWidget**: Increase `min-height` or remove it and let Qt auto-size based on padding + font metrics. ## Files to Modify - `src/Gui/Stylesheets/KindredCreate.qss` — primary theme stylesheet - Possibly `src/Gui/QSint/actionpanel/actionpanelscheme.cpp` — header size calculation - Possibly `src/Gui/QSint/actionpanel/taskheader_p.cpp` — header layout margins
forbes added the bug label 2026-02-24 18:38:15 +00:00
forbes added the high-priority label 2026-02-24 20:59:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#325