Skip to content

pop_comments (Edit > About this dataset): match the resizable EEGLAB figure and its editor #925

Done

Description

@arnodelorme

The Edit > About this dataset window opens at 1394 × 456 px in EEGPrep on jamming. EEGLAB opens its figure at 1394 × 840 px. The editor, caption and buttons also move differently when the window is resized.

EEGLAB at left and EEGPrep before the change at right

Reference and verification

Additional finding from #727, pop_comments (Edit > About this dataset): graphical and numerical parity with EEGLAB. Part of #875. Compare the native figure at opening and at 950 × 620 px, including the axes title, the font and wrapping of the sample comments, SAVE, CANCEL, and the returned text.

Activity

  1. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    CollaboratorAuthor

    🤖 PR #929, stacked on #908, now includes native MATLAB and Qt captures on jamming for two figure sizes. The editor and button rectangles matched within 0.5 px at both sizes. SAVE and CANCEL returned matching comment text. The focused suite passed 47 tests.

  2. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    CollaboratorAuthor

    Done: Matched the resizable dataset comments figure and verified SAVE, CANCEL and control rectangles on jamming

    Pull request: #929

    — eegprep, reported with orch done

  3. claude commented on Dec 1, 2026

    @claude
    Contributor

    🤖 Plan:

    • Read the issue, pop_comments.py, the Qt sizing code and EEGLAB pop_comments.m (d0963be9)
    • Check for overlapping work: no open PR. pop_comments (Edit > About this dataset): graphical and numerical parity with EEGLAB #727 F9 (text reflow) and F22 (title, colors) overlap and are waiting on Arno
    • Root cause analysis and proposed approach (below)
    • No PR: this needs a renderer layout change and an EEGLAB capture on jamming to check it, so it is more than a small fix. Waiting for a human decision on the approach and on the open questions

    Research

    EEGLAB does not use inputgui here. pop_comments.m#L91-L135 opens a plain figure (default size) and places the axes title, the edit box and both buttons in Normalized units, relative to the default axes pos = [.13 .11 .775 .815]. So every element, buttons included, scales with the window. EEGPrep renders an inputgui spec with fixed pixel margins (170/35/170/50), 18 px spacing and fixed 150×45 buttons. The 456 px height has a separate cause: when the dialog has a QTextEdit, _apply_spec_size sizes it to the text and skips the spec.size height floor.

    Relevant code

    Proposed approach

    EEGLAB geometry as figure fractions, with s = pos(3:4)/100 and q = pos(1:2):

    element x y (from bottom) w h px at 1394×840
    edit [0 10 105 85] 0.130 0.192 0.814 0.693 1134×582
    CANCEL [0 -5 20 10] 0.130 0.069 0.155 0.082 216×68
    SAVE [80 -5 20 10] 0.750 0.069 0.155 0.082 216×68
    title top of axes, y ≈ 0.925
    1. Opening size (smallest fix, about 5 lines): in _apply_spec_size, apply the spec.size[1] floor to editor dialogs too. pop_comments is the only textarea user, so no other window changes. This fixes the 1394 × 456 part only.
    2. Resize behavior: give pop_comments a small QDialog, or a normalized_geometry option on DialogSpec, whose resizeEvent sets each child's geometry from the fractions above, so the title, editor and buttons scale as in MATLAB. The inputgui row layout cannot do this because its margins and buttons are in pixels. I suggest a dedicated helper in guifunc used only by pop_comments. Estimate: about 80–120 lines plus a Qt test that resizes to 950×620 and checks the button and editor rectangles against the fractions.
    3. Add a tools/visual_parity case at opening and at 950×620 and capture it against EEGLAB on jamming (eeglab-gui-visual-parity skill).

    Open questions

    1. Should the font and wrapping of the sample comments follow strmultiline(comments, 53) (53-column hard wrap, monospace?) or keep Qt soft wrap? This is pop_comments (Edit > About this dataset): graphical and numerical parity with EEGLAB #727 F9, which also changes the returned text, so it needs Arno's decision first.
    2. The window title (F22, plottitle vs the fixed Read/Enter text -- pop_comments()) and the pale BACKCOLOR: fix them in the same PR as this one or separately under pop_comments (Edit > About this dataset): graphical and numerical parity with EEGLAB #727?
    3. Is step 1 alone worth merging now, with step 2 after the questions above are settled?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions