Skip to content

feat: scale panel button font size with window size - #432

Open
shaozk wants to merge 1 commit into
dannagle:developmentfrom
shaozk:feat/scale-panel-font-size
Open

shaozk wants to merge 1 commit into
dannagle:developmentfrom
shaozk:feat/scale-panel-font-size

Conversation

@shaozk

@shaozk shaozk commented Aug 25, 2026

Copy link
Copy Markdown

Before submitting a pull request:

  • Did you fork from the development branch? yes
  • Are you submitting the pull request to the development branch? (not master) yes

Summary

  • Panel button fonts now scale with the window size instead of a fixed 20pt size
  • Font size ranges from baseFontSize (20) to maxFontSize (50), based on the smaller window dimension (reference: 800px)
  • Adds a resizeEvent handler that updates all panel button fonts on window resize
  • Hard-coded font-size: 20pt removed from the dark/light mode stylesheets (font now set via QFont on the label)

Changes

  • src/panelgenerator.h: add static font constants, panelButtons list, panelFontSize()/updatePanelFonts() methods, and resizeEvent() override
  • src/panelgenerator.cpp: implement font scaling, track buttons via panelButtons, clear the list in clearLayout(), and recalc fonts on resize

Notes

  • Co-Authored-By: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>

Co-Authored-By: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
@shaozk
shaozk changed the base branch from master to development August 25, 2026 12:31
@dannagle

Copy link
Copy Markdown
Owner

Qt supports a global zoom factor with the environment variable QT_SCALE_FACTOR. I was once considering looking into ways to support that. Did you ever attempt that in your testing?

Your tweak should scale along with that zoom factor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants