--===============9069003689895842293== Content-Type: multipart/alternative; boundary="===============0487799662934795882==" --===============0487799662934795882== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/123537/#review79598 ----------------------------------------------------------- src/declarativeimports/plasmacomponents/qmenu.cpp (line 196) I added an isVisible check before this (and above), so you could conditionally show sections using bindings, eg. so "Recent documents for" is only shown when documents exist. - Kai Uwe Broulik On April 27, 2015, 8:20 nachm., Kai Uwe Broulik wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/123537/ > ----------------------------------------------------------- > > (Updated April 27, 2015, 8:20 nachm.) > > > Review request for Plasma. > > > Repository: plasma-framework > > > Description > ------- > > QMenuItem now has a "section" property that makes it behave like a section. I did not find a removeSection method, however. > > > Diffs > ----- > > src/declarativeimports/plasmacomponents/qmenu.h a927d12 > src/declarativeimports/plasmacomponents/qmenu.cpp 0b82a99 > src/declarativeimports/plasmacomponents/qmenuitem.h f8629f0 > src/declarativeimports/plasmacomponents/qmenuitem.cpp aa61288 > tests/components/menu.qml PRE-CREATION > > Diff: https://git.reviewboard.kde.org/r/123537/diff/ > > > Testing > ------- > > Seems to work fine, icons are not supported, comes with a manual test. > > > Thanks, > > Kai Uwe Broulik > > --===============0487799662934795882== MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/123537/

src/declarativeimports/plasmacomponents/qmenu.cpp (Diff revision 1)
void QMenuProxy::itemTriggered(QAction *action)
196
            m_menu->addSection(item->text());

I added an isVisible check before this (and above), so you could conditionally show sections using bindings, eg. so "Recent documents for" is only shown when documents exist.


- Kai Uwe Broulik


On April 27th, 2015, 8:20 nachm. UTC, Kai Uwe Broulik wrote:

Review request for Plasma.
By Kai Uwe Broulik.

Updated April 27, 2015, 8:20 nachm.

Repository: plasma-framework

Description

QMenuItem now has a "section" property that makes it behave like a section. I did not find a removeSection method, however.

Testing

Seems to work fine, icons are not supported, comes with a manual test.

Diffs

  • src/declarativeimports/plasmacomponents/qmenu.h (a927d12)
  • src/declarativeimports/plasmacomponents/qmenu.cpp (0b82a99)
  • src/declarativeimports/plasmacomponents/qmenuitem.h (f8629f0)
  • src/declarativeimports/plasmacomponents/qmenuitem.cpp (aa61288)
  • tests/components/menu.qml (PRE-CREATION)

View Diff

--===============0487799662934795882==-- --===============9069003689895842293== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KUGxhc21hLWRl dmVsIG1haWxpbmcgbGlzdApQbGFzbWEtZGV2ZWxAa2RlLm9yZwpodHRwczovL21haWwua2RlLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL3BsYXNtYS1kZXZlbAo= --===============9069003689895842293==--