Skip to content

Commit 56bd86b

Browse files
FiveTechSoftclaude
andcommitted
layout(win): split nBarH into icon vs DPI-scaled-frame terms (−~20px @ 100%)
The flat "content budget 66 -> 86" bump over-allocated ~20px at standard DPI: the clipping it fixed only happens once the BUTTON FRAMES grow at high DPI. Replace the single 86*nUIScale term with two: nBarH = Max(110, Int(64*nDPI/96) // Windows chrome, DPI-scaled + Int(66*nUIScale) // fixed-size toolbar/palette icons + Int(20*Max(0,nDPI-96)/48)) // button-frame slack: 0 @ 96, +20 @ 144 So at 96 DPI the bar is ~20px shorter (2048px screen: 155 -> 134; 1920px: 130) while 1920@144 stays 182 — i.e. the high-DPI anti-clip behaviour the 86 bump introduced is preserved, just expressed as a DPI ramp instead of a constant. No flat constants, no per-resolution branch. bin/hbbuilder_win.exe rebuilt (MSVC x64). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b74cc3b commit 56bd86b

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

bin/hbbuilder_win.exe

0 Bytes
Binary file not shown.

source/hbbuilder_win.prg

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,23 @@ function Main()
104104
nUIScale := Max( 0.85, Min( 1.20, nScreenW / 1920.0 ) )
105105
nUIFont := Max( 9, Int( 11 * nUIScale ) )
106106

107-
// Main IDE bar = two independently-scaled parts:
108-
// 1. Windows-drawn chrome caption + menu + the component-palette tab
109-
// strip. ~64px @ 96 DPI; this DOES grow with DPI (96->144 ≈ +32px),
110-
// so it scales by nDPI/96.
111-
// 2. Content rows — 2 stacked toolbars (28x28 icons) + the palette
112-
// button row (48x48 icons). These are fixed-size bitmaps, so they
113-
// track the width-based UI scale, not DPI.
114-
// The old reference was ~200px (64 chrome + ~136 content). Per the owner
115-
// the bar should lose ~70px; that comes off the content budget (136->66)
116-
// and is kept proportional — no flat "-70", no per-resolution branch — so
117-
// it generalises across resolution and DPI while preserving proportions.
118-
// ...except 66 was a touch too tight: the toolbar/palette icons are
119-
// fixed-size bitmaps, but the BUTTON FRAME around them is DPI-scaled, so
120-
// at 150% DPI a 28x28-icon button is ~38px and two rows + the 48x48
121-
// palette button row spill past 66px and clip the bottom of the palette.
122-
// Bumped the content budget back up ~20px (66 -> 86) — still proportional.
123-
nBarH := Max( 120, Int( 64 * nDPI / 96 ) + Int( 86 * nUIScale ) )
107+
// Main IDE bar = three terms, each scaled by what actually drives it:
108+
// 1. 64 * nDPI/96 — Windows-drawn chrome (caption + menu +
109+
// the component-palette tab strip). Pure GDI metrics, grows with DPI.
110+
// 2. 66 * nUIScale — the toolbar/palette ICONS themselves
111+
// (28x28 and 48x48 *fixed-size* bitmaps, two toolbar rows + the
112+
// palette button row). Bitmaps don't grow with DPI, so they track
113+
// the width-based UI scale.
114+
// 3. 20 * max(0,nDPI-96)/48 — extra slack for the BUTTON FRAMES around
115+
// those icons, which ARE DPI-scaled: at 100% a 28px-icon button is
116+
// ~30px and fits inside term 2, but by 150% it's ~38px and the rows
117+
// would clip the palette — so this ramps from 0 at 96 DPI to +20px
118+
// at 144 DPI. (This is what the earlier flat "66 -> 86" bump was
119+
// compensating for; folding it into a DPI ramp gives back ~20px at
120+
// standard DPI without re-introducing the high-DPI clipping.)
121+
// No flat constants, no per-resolution branch — generalises across
122+
// resolution and DPI while keeping the proportions.
123+
nBarH := Max( 110, Int( 64 * nDPI / 96 ) + Int( 66 * nUIScale ) + Int( 20 * Max( 0, nDPI - 96 ) / 48 ) )
124124
// Inspector: wide enough for the 230-px property/event name column plus a
125125
// usable value column. Grows with screen size.
126126
nInsW := Max( 330, Max( Int( 360 * nUIScale ), Int( nScreenW * 0.21 ) ) )

0 commit comments

Comments
 (0)