user interface for attach & detach

Andreas Naumann Andreas-Naumann at gmx.net
Sat Apr 30 20:28:09 BST 2022


I am working on the detach and re-attach of a tab in okular.

The current implementation in MR 616
(https://invent.kde.org/graphics/okular/-/merge_requests/616) allows to
detach a tab into a new okular instance. If tabs are enabled, an
existing tab can be moved to another instance.

However, if exactly one file is open, then we do not see the tab bar,
but only one window. That raises the question, how can a user move that
instance/file to another instance?

Until now I have the following workflows / user interfaces in mind:

   (1) Drag the window (at the title) with the single file above another
instance: From my perspective, this feels most intuitive.
   (2) Drag the "page" (click with the mouse somewhere next to the text)
and move into another window: This feels also intuitive, but is in
conflict with the page movement of a zoomed page.
   (3) Insert some button/icon in the toolbar: How should that button
look like and intuitively like "attach some where else".
   (4) Use a shortcut, to show other okular instances in a dialog: That
feels less intuitive. In particular, it is inconsistent with the
detaching from a multi-tab.

I implemented the interface (1), but have some trouble with Qt. The
basic idea was to overload the member function "Shell::moveEvent", check
if the main window was moved on top of another okular window and if so,
than open the file in the other instance and close the single-file-window.
This approach has one big drawback: the function moveEvent is also
called, when the new window starts. Thus, if one detaches, or creates a
new okular instance, which (by possibility or accident) starts above
another window, it will be closed and attached to that.

Finally I have two questions:

1. Which interface/workflow would you prefer?

2. Do you have any other suggestion for the implementation of (1)?

All best,
Andreas




More information about the Okular-devel mailing list