on xenial help sign in
Added CheckableMenu
f9a875bNick Dedekind
plugins/Unity/Indicators/qml/HLine.qmldeleted−29
@@ -1,29 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Renato Araujo Oliveira Filho <renato@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−
23−Rectangle {
24− height: units.dp(1)
25− anchors {
26− left: parent.left
27− right: parent.right
28− }
29−}
plugins/Unity/Indicators/qml/MenuItemFactory.qml+24
@@ -174,6 +174,25 @@ Item {
174 }
174 }
175 }
175 }
176
176
177+ Component {
178+ id: checkableMenu;
179+ Menus.CheckableMenu {
180+ objectName: "checkableMenu"
181+ property QtObject menuData: null
182+ property int menuIndex: -1
183+
184+ text: menuData && menuData.label || ""
185+ enabled: menuData && menuData.sensitive || false
186+ checked: menuData && menuData.isToggled || false
187+
188+ onTriggered: {
189+ menuModel.activate(menuIndex);
190+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
191+ }
192+ }
193+ }
194+
195+
177 Component {
196 Component {
178 id: switchMenu;
197 id: switchMenu;
179 Menus.SwitchMenu {
198 Menus.SwitchMenu {
@@ -386,6 +405,7 @@ Item {
386 Component {
405 Component {
387 id: mediaPayerMenu;
406 id: mediaPayerMenu;
388 Menus.MediaPlayerMenu {
407 Menus.MediaPlayerMenu {
408+ objectName: "mediaPayerMenu"
389 property QtObject menuData: null
409 property QtObject menuData: null
390 property var menuModel: menuFactory.menuModel
410 property var menuModel: menuFactory.menuModel
391 property int menuIndex: -1
411 property int menuIndex: -1
@@ -410,6 +430,7 @@ Item {
410 Component {
430 Component {
411 id: playbackItemMenu;
431 id: playbackItemMenu;
412 Menus.PlaybackItemMenu {
432 Menus.PlaybackItemMenu {
433+ objectName: "playbackItemMenu"
413 property var menuModel: menuFactory.menuModel
434 property var menuModel: menuFactory.menuModel
414 property int menuIndex: -1
435 property int menuIndex: -1
415 property var extendedData: menuData && menuData.ext || undefined
436 property var extendedData: menuData && menuData.ext || undefined
@@ -467,6 +488,9 @@ Item {
467 return component;
488 return component;
468 }
489 }
469 }
490 }
491+ if (modelData.isCheck || modelData.isRadio) {
492+ return checkableMenu;
493+ }
470 if (modelData.isSeparator) {
494 if (modelData.isSeparator) {
471 return separatorMenu;
495 return separatorMenu;
472 }
496 }
plugins/Unity/Indicators/qml/qmldir+1−12
@@ -2,20 +2,9 @@ module Unity.Indicators
2plugin IndicatorsQml
2plugin IndicatorsQml
3typeinfo plugin.qmltypes
3typeinfo plugin.qmltypes
4
4
5−BaseMenuItem 0.1 BaseMenuItem.qml
6−ButtonMenuItem 0.1 ButtonMenuItem.qml
7CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
5CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
8−DivMenuItem 0.1 DivMenuItem.qml
9−FramedMenuItem 0.1 FramedMenuItem.qml
10−HLine 0.1 HLine.qml
11IndicatorBase 0.1 IndicatorBase.qml
6IndicatorBase 0.1 IndicatorBase.qml
12−MenuActionBinding 0.1 MenuActionBinding.qml
13MenuItemFactory 0.1 MenuItemFactory.qml
7MenuItemFactory 0.1 MenuItemFactory.qml
14−ProgressMenuItem 0.1 ProgressMenuItem.qml
15−SectionMenuItem 0.1 SectionMenuItem.qml
16−SliderMenuItem 0.1 SliderMenuItem.qml
17−StandardMenuItem 0.1 StandardMenuItem.qml
18−SwitchMenuItem 0.1 SwitchMenuItem.qml
19−
20
8
9+internal MessageMenuItemFactory MessageMenuItemFactory.qml
21internal RemoveBackground RemoveBackground.qml
10internal RemoveBackground RemoveBackground.qml