About using the Advanced Docking System for Qt

Andy Sardina andysardina22 at gmail.com
Mon May 11 19:58:40 BST 2020


Hi David,

  Thanks for the answerback!  I agree with the split part, I think that the
implementation of Kate is really good. But I still think that the tab
system is too rigid. You can split but you cannot re-arrange after you make
the splits, which means that if you change your mind and you want (or need)
a different layout, you will need to start over again.



> To implement split view, we need to separate data and presentation. We
> also need to separate commands and presentation, because currently many
> menu actions are handled by the single PageView. It is not good to have
> actions twice, because the second PageView kicks all actions of the first
> PageView from the menus, and when you remove the second PageView all
> actions are lost.
>

That's a good point, I have tried to understand deeply the code for the
PageView and still not succeded. There is a lot of stuff happening there
and it is difficult to understand how all the pieces fit together.

Anyway, what I would like is a combination of both things: something like
ADS and Kate's functionality! Maybe it is just overcomplicating things!


On Sat, May 9, 2020 at 6:59 PM David Hurka <david.hurka at mailbox.org> wrote:

> > On 9 May 2020 15:04 okular-devel-request at kde.org wrote:
> > El dissabte, 2 de maig de 2020, a les 16:50:16 CEST, Andy Sardina va
> escriure:
> > > Hi,
> > >
> > >   There are many users who would like to have a split view in Okular.
> > > Currently, using a QTabWidget I think implementing such a feature
> could be
> > > difficult. My proposal is to start using the Advanced Docking System
> for Qt
> > > <https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System>
> (ADS) to
> > > replace the QTabWidget and from that point work in the split view
> > > functionality.
> >
> > It seems indeed powerful :)
> >
> > I wonder if maybe "too" poweful that may get some people lost trying to
> use it.
> >
> > One "problem" is that it seems that no distribution is packaging this at
> the moment from what i can see.
> >
> > Have you tried looking at what other KDE software like for example kate
> do for their split screen functionality?
> > [...]
>
> Kate does it much simpler. The central widget can be divided with
> splitters, while the extra panels are docked to the window edges. Unlike
> the sidebar in Okular, panels can be moved to other edges, and be shown
> simultaneously. Unlike with QDockWidget (or ADS), panels can not be nested.
>
> QDockWidget or ADS would be nice in Okular to show e. g. Table of Contents
> and Annotation panels at the same time. For split view it is probably
> useless, because we just want to divide the central widget into multiple
> central widgets of the same type. In other words, there are not enough
> widgets to use QDockWidget or ADS.
>
> I think a split view implementation should follow the Kate UI, where you
> click “Split Horizontal”, and you get a second view next to the first view.
> To close the second view, you move the splitter until it collapses.
>
> The split view UI is actually not the difficult part. Append PageView
> objects to the Sidebar object, and you have split view, you can easily try
> that. They even show synchronized annotations and everything. The difficult
> part is the DocumentObserver structure, which communicates the viewport
> through the Document object. This makes all PageViews scroll
> simultaneously, so you always just see the same page twice.
>
> To implement split view, we need to separate data and presentation. We
> also need to separate commands and presentation, because currently many
> menu actions are handled by the single PageView. It is not good to have
> actions twice, because the second PageView kicks all actions of the first
> PageView from the menus, and when you remove the second PageView all
> actions are lost.
>
> Anyway, thanks for your link, it’s an interesting project.
>
> Cheers, David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20200511/55124d87/attachment-0001.htm>


More information about the Okular-devel mailing list