github dheerajshenoy/lektra v0.7.3

4 hours ago

Features

  • Add Comment to the text selection context menu. Selecting text and choosing Comment
    now opens an input dialog, then creates a highlight annotation with the comment embedded
    as a single undoable operation — no need to first highlight and then right-click the
    annotation to add a comment.
  • Add Copy Text to the highlight annotation context menu. Copies the exact highlighted
    text to the clipboard by testing each character's centre against the annotation's quad
    points, using the cached stext page so no extra parsing is needed.
  • Ability to open multiple files using file dialog to open in new tab, vsplit or hsplit.
  • DocumentView no longer inherits QOpenGLWidget — it is a plain QWidget that hosts
    the GraphicsView; all GPU work goes through the view's own QOpenGLWidget viewport.
  • Touch events are now correctly re-applied to the new viewport after applyBackend()
    replaces it.
  • A global QSurfaceFormat (depth 24, stencil 8) is set before QApplication
    construction to ensure a well-formed OpenGL context on all platforms.

Lua API

  • New dispatch event
    • OnShutdown - Dispatched when the application is shutting down
  • Event callbacks now receive typed arguments instead of a raw Lektra pointer for
    events where more specific data is available:
    • OnScreenChanged — callback receives a ScreenInfo table with fields:
      name, dpr, logical_dpi, physical_dpi, refresh_rate, and
      geometry ({x, y, w, h})
    • OnTabChanged, OnTabRemoved — callback receives the tab index as an integer
  • Lua stubs: ScreenInfo class added with full field annotations

Bug Fixes

  • Save File menu action is now enabled only when the document has unsaved changes,
    providing a clear visual signal of modified state. A new modifiedChanged(bool) signal
    on DocumentView drives the update so the menu reacts immediately on each edit.
  • File Properties menu action is now enabled for all open file types, not just PDF.
  • Back / Forward history navigation actions are now enabled only when there is actually
    somewhere to navigate: canGoBack() and canGoForward() methods were added to
    DocumentView, a historyChanged() signal is emitted from addToHistory,
    GoBackHistory, and GoForwardHistory, and a dedicated
    updateHistoryNavigationActions() keeps the menu items in sync on every history change
    and on tab switch.
  • Invert Colour menu item checked state is now synced on tab switch. Previously
    switching between tabs with different invert states left the checkbox stale; it is now
    updated in updateUiEnabledState.
  • Fix annotation comment edits (right-click annotation → Add Comment) not being tracked by
    the undo stack. Comments are now pushed as AnnotCommentCommand entries, so they can be
    undone/redone correctly and the modified indicator stays in sync.
  • Fix save being available after a save → undo → redo cycle. The undo stack correctly
    returns to its clean index on redo, but MuPDF's internal mutation tracker still reported
    unsaved changes because it sees the undo and redo as two separate edits. SaveFile now
    uses m_is_modified (driven by the undo stack's clean state) rather than
    pdf_has_unsaved_changes to decide whether a save is needed.
  • Fix zoom glitch in multi-page document mode: interactive zoom (pinch/scroll) now uses an
    O(1) GPU view-transform (QGraphicsView::scale) for each step, deferring the O(n)
    repositionPages() call until the scroll-debounce timer settles. This eliminates the
    jarring per-page resize flash that was visible during zoom.
  • Fix multi-page text selection breaking when scrolling: pages within the active selection
    range are now protected from eviction by removeUnusedPageItems, preventing gaps in the
    rendered quads and pageAtScenePos failures on the anchor page.
  • Fix fit mode not working properly for images/djvu files after rotating
  • Fix pickers (command palette, outline, bookmarks, etc.) leaking key events and shortcuts
    to the focused DocumentView while open. Pickers now grab the keyboard on launch and
    install an application-level event filter to swallow QShortcutEvents, both of which
    are released on dismiss or item acceptance.
  • Fix InputDialog ok and cancel buttons looking flat and weird.
  • Render highlight annotations spanning multiple lines correctly by splitting the annotation quad into separate quads
    for each line. Previously, single rectangular quad spanning the multi-line highlight was rendered.

Don't miss a new lektra release

NewReleases is sending notifications on new releases.