modifying the drawer menus

Tomaz Canabrava tcanabrava at kde.org
Wed Jan 6 20:36:56 UTC 2016


On Wed, Jan 6, 2016 at 6:29 PM, Marco Martin <notmart at gmail.com> wrote:

> On Wednesday 06 January 2016, Dirk Hohndel wrote:
> > I'm sure this email will mostly just expose my ignorance - but I'm OK
> with
> > that :-)   --   I asked on IRC but I think no one was around who knew.
> >
> > I want to be able to change the content of the context menu, depending
> on,
> > err, context. Seems like a reasonable thing to want to do. So I'm sure
> > there must be an easy way to do this. But that's where I'm getting stuck.
>
> I had a particular use case in mind when i designed its api, so perhaps
> yours
> is slightly different.. exactly what would define the "context" you're in
> in
> subsurface?
>
> the contextual actions list at the moment is done by page, ie every page
> (in
> subsurface the dives list would be one, dives details would be another)
>
> so each page would have a different:
>
> Page {
>     contextualActions: [
>         Controls.Action {
>             text:"Action 1"
>             onTriggered: print("Action 1 clicked")
>         },
>         Controls.Action {
>             text:"Action 2"
>             iconName: "folder"
>         }
>     ]
>
> would this be good for your use case or you need something different?
>
> If what you need is something different, you can go in your application
> main
> qml file at the declaration of ContextDrawer
>
> contextDrawer: MobileComponents.ContextDrawer {
>       id: contextDrawer
>       actions: [
>           Controls.Action {
>                    text: "action 1"
>            },
>          Controls.Action {
>                    text: "action 2"
>            },
>          ......
>       ]
> }
>
> that would override the "actions-per-page" behavior.
>
> Lists defined this way in qml can't have elements dinamically added or
> removed, but also because of that it should also support either arrays of
> actions built in javascript, or if you need particular flexibility, a
> QLists<QAction *> arriving from the C++ part.. I have the suspicion that in
> this particular case it *may* be the most immediate way?
>


We need a menu that will change its contents based on whats being displayed
on the main part of the application.

Something like:

contextDrawer: MobileComponents.ContextDrawer {
      id: contextDrawer
      actions: mainDisplay.currentActions
}




>
> --
> Marco Martin
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160106/3c11cf45/attachment.html>


More information about the Plasma-devel mailing list