Skip to content

Make the mirror panel grow with the window#61

Merged
xroche merged 2 commits into
masterfrom
fix-actions-panel-resize
Jul 26, 2026
Merged

Make the mirror panel grow with the window#61
xroche merged 2 commits into
masterfrom
fix-actions-panel-resize

Conversation

@xroche

@xroche xroche commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Nothing in the chain passed a size down. The splitter resized its pane and CDialogContainer::OnSize threw the number away, so both property sheets kept the size comctl32 gave them at creation and the panel only gained grey space. The frame starts maximized, so that was the first thing a user saw.

The container now fits both sheets to the pane, floored at their natural size so the form view still scrolls when the pane is smaller. Both sheets rather than just the visible one: starting a mirror only toggles WS_VISIBLE between them, so the one left behind would come back at the old size. Wizard-mode sheets have no tab control to stretch, so CWizTab lays out its own children, keeping the button strip at the bottom and letting the active page fill the rest. comctl32 hands a page its creation rect every time it shows it, so that has to be reapplied on every page change and not only on resize.

CWndLayout is the new piece: a control keeps its template rect and takes a percentage of the growth, always recomputed from the template so repeated resizes cannot drift. In the transfer rows the URL and filename columns split the new width, since those are the two that clip, while the progress bar and SKIP anchor right.

Height is left alone deliberately. NStatsBuffer fixes the panel at fourteen rows, so there is nothing to fill vertical space with. Only the transfer page is anchored so far; the five wizard pages grow without moving their contents, which is no worse than today.

Sits on top of #60. Closes xroche/httrack#114 (cross-repo, so it will need closing by hand). CI cannot see layout, so this wants a look on the VM before it lands.

Nothing in the chain passed a size down. The splitter resized its pane, and
CDialogContainer::OnSize threw the number away, so the two property sheets kept
the size comctl32 gave them at creation and the panel just gained grey space.
Since the frame starts maximized, that was the first thing a user saw.

The container now fits both sheets to the pane, floored at their natural size so
the form view still scrolls when the pane is smaller, and offset by the scroll
position because CScrollView moves its children as it scrolls. Both sheets and
not only the visible one: starting a mirror just toggles WS_VISIBLE between them,
so the one left behind would come back at the old size.

Wizard-mode sheets have no tab control to stretch, so CWizTab lays out its own
children: the button strip and the rule above it keep to the bottom, and the
active page fills what is left. comctl32 hands a page the rect it had at
creation every time it shows it, so that has to be reapplied on each page change,
not only on resize.

CWndLayout carries the anchoring itself. Controls keep their template rect and
take a percentage of the growth, which is enough for every case here and always
recomputes from the template, so repeated resizes cannot drift. In the transfer
rows the URL and filename columns split the new width evenly, since those are
the two that clip, while the progress bar and SKIP ride along at the right edge.

Height is left alone on purpose. NStatsBuffer fixes the panel at fourteen rows,
so vertical space has nothing to fill it with, and spreading the rows out would
be worse than leaving the margin.

Only the transfer page is anchored. The five wizard pages grow without moving
their contents, which is no worse than today; they can be given tables later.

CI cannot see layout, so this wants a look on the VM.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HXNEMWtyrkW7xoD8ewcR3
Signed-off-by: Xavier Roche <roche@httrack.com>
xroche added a commit that referenced this pull request Jul 26, 2026
The in-progress panel chopped every URL to 32 characters with a "..." in the
middle before the UI ever saw it, and the 95-dialog-unit cell then clipped what
was left. Because the cell is right-aligned, the clip ate the host end, so the
row could show neither where the file came from nor what it was called. The
filename cell had the same problem with no truncation marker at all.

Store the URL whole and let the statics ellipsize to their own width, so the
text degrades at pixel resolution instead of at an arbitrary character count,
and improves on its own once the panel can grow. Hovering any cell of a row now
shows the full untruncated URL, which the row already kept in url_adr/url_fil.

Deriving the tooltip row from element[][] rather than from the control ID also
covers rows 10 to 13: their SKIP buttons had no tooltip, the per-ID switch
having stopped at 9.

This does not close xroche/httrack#114 on its own. The panel still does not
resize; that is PR #61.

Signed-off-by: Xavier Roche <xroche@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The IDC_* macros are plain ints, so Add(this, IDC_inforun, 0, 100) matched
Add(CWnd*, int, int, int) exactly on every argument while the by-ID overload
needed an int to UINT conversion. It bound to the wrong one silently: the page
anchored itself as one of its own controls, with a move factor of 1173 percent,
and would have shot off to the right on the first resize.

The neighbouring loop reached the right overload only because its table is
declared const UINT[], which is what made the three broken calls look fine.

Rename the by-ID entry point so the two can never be confused again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HXNEMWtyrkW7xoD8ewcR3
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche merged commit 351a534 into master Jul 26, 2026
3 checks passed
xroche added a commit that referenced this pull request Jul 26, 2026
Two real defects from #61, plus a call-site move.

GetActivePage() is m_pages[GetActiveIndex()] with no bounds check outside a
debug ASSERT, and GetActiveIndex() returns -1 when nothing is selected.
FinalInProgress and EndInProgress both empty the array before refilling it, and
RemovePage relayouts synchronously, so a WM_SIZE arriving mid-rebuild read
m_pages[-1] and dereferenced whatever came back. Both call sites now go through
GetActiveIndex and GetPageCount.

DeferWindowPos destroys the HDWP on failure, dropping every position already
queued, and the loop then carried on with SetWindowPos for the remainder so the
earlier controls silently kept their old rects. It now redoes the whole pass.

BuildLayout also moves to CDialogContainer::OnInitialUpdate. There is no
popup-to-WS_CHILD restyle after WM_INITDIALOG, so the recorded rects are the
same either way; what the move buys is that the active page has a window by
then, so m_pageBase is the page rect rather than the hidden tab control
standing in for it.

Signed-off-by: Xavier Roche <xroche@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Actions frame does not expand with window

1 participant