Skip to content

fix: improve tab display for long file names#463

Merged
RazinShaikh merged 1 commit intozxcalc:masterfrom
turazashvili:fix/461-improve-tab-display-long-filenames
Mar 4, 2026
Merged

fix: improve tab display for long file names#463
RazinShaikh merged 1 commit intozxcalc:masterfrom
turazashvili:fix/461-improve-tab-display-long-filenames

Conversation

@turazashvili
Copy link
Contributor

Fixes #461

Problem

When file names are long, tab text gets clipped at both the beginning and end due to the max-width: 200px CSS constraint. The * unsaved indicator (appended to the end) becomes invisible.

Changes

  1. Prepend * instead of appending — Changed "filename*" to "*filename" so the unsaved indicator is always visible at the start of the tab, even when the name is truncated.

  2. Set ElideRight on CustomTabBar — Qt now properly truncates long names from the right with ... instead of clipping from both sides.

  3. Add tooltips — Every tab now shows the full file name (including * if unsaved) on hover, so users can always see the complete name.

  4. Increase max-width from 200px to 250px — Gives slightly more room for file names while still preventing excessively wide tabs.

Files changed

  • zxlive/mainwindow.py — All changes in a single file

Behavior

  • Long file names now display as *my_long_filen... (unsaved) or my_long_filena... (saved)
  • Hovering over any tab shows the full name
  • Short file names behave exactly as before
  • Tab name comparisons (notebook integration) updated to match the new * prefix convention

- Prepend '*' instead of appending so unsaved indicator is always visible
- Set ElideRight on CustomTabBar to properly truncate long names with '...'
- Add tooltips to all tabs showing the full name on hover
- Increase max-width from 200px to 250px for more room
@RazinShaikh RazinShaikh merged commit d10f4ec into zxcalc:master Mar 4, 2026
4 checks passed
@turazashvili turazashvili deleted the fix/461-improve-tab-display-long-filenames branch March 4, 2026 18:12
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.

Improve the display of the tabs with longer file names

2 participants