Skip to content

Commit a50b3d3

Browse files
FiveTechSoftclaude
andcommitted
layout(win): trim the IDE bar ~70px, generically (DPI + width scale)
Replaces nBarH = Max(200, Int(200*nUIScale)) with a two-part model: nBarH = Max(120, Int(64 * nDPI/96) + Int(66 * nUIScale)) - 64 * nDPI/96 — Windows chrome (caption + menu + palette tab strip); this part does grow with DPI. - 66 * nUIScale — content rows (2 toolbars of 28x28 icons + the 48x48 palette button row); fixed-size bitmaps, so they track the width-based UI scale, not DPI. Was ~136 in the old 200 reference; the ~70px the owner wants off the bar comes off here, kept proportional — no flat "-70", no per-resolution branch. Examples: 1920@96 -> 130, 2048@96 -> 134, 1366@96 -> 120 (floor), 1920@144 -> 162. bin/hbbuilder_win.exe rebuilt (MSVC x64). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5cc605b commit a50b3d3

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

bin/hbbuilder_win.exe

0 Bytes
Binary file not shown.

source/hbbuilder_win.prg

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,18 @@ 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 must fit: title + menu + 2 stacked toolbars + the
108-
// component-palette tab strip + the palette button row.
109-
//
110-
// Why this is NOT "200 * DPI/96": the bar does NOT scale linearly with
111-
// DPI. Going 96->144 DPI, only the Windows-drawn chrome scales — caption
112-
// (~22->33), menu (~20->30), the palette tab strip (~22->33): ~+30px
113-
// total. The bulk of the bar is the toolbar buttons (28x28 *fixed* bitmap
114-
// icons) and the palette button row (48x48 *fixed* bitmap icons) — those
115-
// don't grow with DPI at all. So "200 * 1.5 = 300" over-allocates by
116-
// ~100px of dead space below the palette. nDPI is read (W32_GetScreenDPI)
117-
// and available, but the height is governed by the *content*, which is
118-
// mostly DPI-independent — hence just the width-based nUIScale here.
119-
nBarH := Max( 200, Int( 200 * nUIScale ) )
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+
nBarH := Max( 120, Int( 64 * nDPI / 96 ) + Int( 66 * nUIScale ) )
120119
// Inspector: wide enough for the 230-px property/event name column plus a
121120
// usable value column. Grows with screen size.
122121
nInsW := Max( 330, Max( Int( 360 * nUIScale ), Int( nScreenW * 0.21 ) ) )

0 commit comments

Comments
 (0)