Skip to content

PreviewPanel: anchored EmptyState inside the layout Column permanently breaks the preview once "No file selected" is shown #17

Description

@nocstah

panels/PreviewPanel.qml declares the "No file selected" EmptyState inside the content Column. EmptyState positions itself with anchors.centerIn, and an anchored child inside a positioner doesn't just misplace itself — Qt logs

QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.

and the Column permanently stops laying out its children. Once the empty state has been visible even once, every later text preview renders its Flickable at y:0, painting the file's first line on top of the filename header (reproduced headless with a plain qml runner: navigate so the panel shows "No file selected", then preview any text file):

  • title row shows the filename and the file's first heading overlapped/garbled,
  • the header separator is swallowed,
  • the body is shifted up by title+separator height.

Fix is minimal: move the EmptyState out of the Column (sibling of it, centerOn the column). Working commit on my fork, applies cleanly here: nocstah@8b443fe

Two related notes from the same investigation:

  1. Same bug class in dialogs/CommandPalettePanel.qml:53 — the palette's Column logs the same "Column will not function" warning on every launch (hundreds of occurrences in a few days of journal on my machine). I haven't chased its visible symptom, but the layout is in the same undefined state.
  2. While fixing the preview I also found loadPreview()'s directory branch never clears previewIsText, so the previous file's text stays ghosted behind the third-column directory listing; same fork commit fixes that too.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions