fix(gui): give the log panes a text margin so text isn't flush to the frame - #707
Merged
Merged
Conversation
got3nks
force-pushed
the
fix/log-pane-text-margin
branch
from
July 30, 2026 09:24
10af573 to
358bc7e
Compare
… frame CMuleLogCtrl zeroes Scintilla's three numbered margins to look like a plain log pane rather than a code editor. That also removed the only inset the control had, so the text rendered hard against the frame with no padding at all. Horizontally, restore it with the text-area margins (SCI_SETMARGINLEFT / SETMARGINRIGHT), which are a separate concept from the numbered margins, so the gutters stay gone. Scintilla's own default there is 1px, so the value has to be visibly above the default to be worth anything. Vertically, Scintilla has no counterpart to those margins, so the first line otherwise sits directly on the frame. extraAscent is the only vertical knob and it feeds lineHeight (ViewStyle::Refresh: maxAscent += extraAscent), so it is line spacing rather than a one-off top gap. That is the better fit here: the log tails to the bottom, so a fixed band at the viewport top would only ever show above a partially scrolled line, whereas uniform spacing reads correctly both when the content scrolls and when it is short enough not to. Both values are DIP-scaled so the gaps hold their size on HiDPI displays. The tail-scroll logic is unaffected: AtBottom() and OnInternalIdle() reason in display lines, never pixels, and Scintilla derives LinesOnScreen() from the same lineHeight it lays out with, so both sides of the comparison move together. Covers all three CMuleLogCtrl panes: aMule Log, Server Info, and amulegui's aMuleGUI Log. The ED2K Info and Kad Info panes in the same notebook are native wxListCtrl, not Scintilla, so they are untouched by this and need a separate approach.
got3nks
force-pushed
the
fix/log-pane-text-margin
branch
from
July 30, 2026 09:35
358bc7e to
0acd43b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #702. The log and Server Info panes render their text hard against the control's frame, with no padding at all — most obvious on themes that draw a tight, high-contrast border, which is how it was reported on Debian/MATE.
Root cause
Not a theme issue, and not Linux-specific.
CMuleLogCtrlis awxStyledTextCtrl, and its constructor zeroes Scintilla's three numbered margins so the pane reads as a plain log rather than a code editor:Those gutters were the only inset the control had, so removing them left the text starting at x=0. Scintilla draws its own text area, so this happens identically on every platform — it just reads as fine on Adwaita, macOS and Windows, where the frame is softer or slightly inset, and jumps out on a tighter border.
Fix
Horizontally, set the text-area margins, which are a distinct concept from the numbered margins, so the code-editor gutters stay gone:
Scintilla's own default here is 1px (
ViewStyle::Init), which is what made the text look flush — so the value has to be visibly above the default rather than a nudge past it.Vertically, Scintilla has no counterpart to those margins, so the first line otherwise sits directly on the frame.
extraAscentis the only vertical knob, and it feedslineHeight(ViewStyle::Refresh:maxAscent += extraAscent), so it is line spacing rather than a one-off top gap:That is the better fit here rather than a limitation worked around: the log tails to the bottom, so a fixed band at the viewport top would only ever appear above a partially scrolled line, whereas uniform spacing reads correctly both when the content scrolls and when it is short enough not to.
Both values are DIP-scaled so the gaps hold their size on HiDPI.
Tail-scroll is unaffected
Worth stating explicitly, since
extraAscentchangeslineHeight: the auto-scroll path reasons in display lines and never in pixels.AtBottom()comparesGetFirstVisibleLine() + LinesOnScreen()against the display-line count, andOnInternalIdle()only comparesGetFirstVisibleLine()values. Scintilla derivesLinesOnScreen()from the samelineHeightit lays out with, so both sides of the comparison move together, and the existing- 1slack inAtBottom()already absorbs partial-row rounding. The batch replay path (m_batchTailing) inherits the same reasoning.Scope
Covers all three
CMuleLogCtrlpanes: aMule Log, Server Info, and amulegui's aMuleGUI Log.The ED2K Info and Kad Info panes in the same notebook are native two-column
wxListCtrls, not Scintilla, so they're untouched by this. Their cell padding comes from the platform theme andwxListCtrloffers no portable equivalent, so if they need the same treatment it's a separate change — either a GTK-only style tweak or converting those panes toCMuleLogCtrllike the other two already are. Deliberately not using a closing keyword for #702 so the issue stays open pending @mifritscher2's word on whether the Info lists still look wrong.Testing
Built monolithic clean on macOS ARM64 and Ubuntu ARM64 (wxGTK3), and checked visually on both.
git clang-format origin/masterreports no deviation, and the diff-scoped Tier-2 clang-tidy run is clean with zero compiler errors. The previous horizontal-only revision passed all 14 CI checks.