2import Ubuntu.Components 1.3
3import Unity.Application 0.1
4import Unity.ApplicationMenu 0.1
5import Unity.Indicators 0.1 as Indicators
9 property alias surfaceManager: sMgrHandler.target
15 var fakeMenuPath = "/" + surface.persistentId.replace(/\W+/g, "");
17 ApplicationMenuRegistry.RegisterSurfaceMenu(surface.persistentId, fakeMenuPath, fakeMenuPath, ":1");
18 Indicators.UnityMenuModelCache.setCachedModelData(fakeMenuPath, generateTestData(4, 3, 2, 3, "menu"));
21 ApplicationMenuRegistry.UnregisterSurfaceMenu(persistentSurfaceId, "/app");
25 function generateTestData(length, depth, submenuInterval, separatorInterval, prefix, root) {
27 if (root === undefined) root = true;
29 for (var i = 0; i < length; i++) {
31 var menuName = prefix;
32 if (menuName === undefined) {
33 var chars = Math.random() * 20;
35 for (var x = 0; x < chars; x++) {
36 menuName += String.fromCharCode((Math.random() * 26) + 65);
40 var menuCode = String.fromCharCode(i+65);
42 var isSeparator = !root && separatorInterval > 0 && ((i+1) % separatorInterval == 0);
45 "label": menuName + "&" + menuCode,
47 "isSeparator": isSeparator,
50 "action": menuName + menuCode,
58 var isSubmenu = root === undefined || root === true || (submenuInterval > 0 && ((i+1) % submenuInterval == 0));
59 if (isSubmenu && !isSeparator && depth > 1) {
60 row["submenu"] = generateTestData(length, depth-1, submenuInterval, separatorInterval,prefix, false);
68 property var singleCheckable: [{
70 "label": "checkable1",
75 "action": "checkable1",
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list