Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 3.34 KB | None | 0 0
  1. import QtQuick 2.1
  2. import QtQuick.Controls 2.0 as QQC2
  3. import org.kde.kirigami 2.0 as Kirigami
  4. import libcloudstorage 1.0
  5.  
  6. Kirigami.ApplicationWindow {
  7.     id: root
  8.     header: Kirigami.ApplicationHeader {}
  9.  
  10.     CloudContext {
  11.         id: cloud
  12.     }
  13.  
  14.     globalDrawer: Kirigami.GlobalDrawer {
  15.         title: "Cloud Browser"
  16.         titleIcon: "applications-graphics"
  17.         actions: [
  18.             Kirigami.Action {
  19.                 Component {
  20.                     id: cloud_entry
  21.                     Kirigami.Action { }
  22.                 }
  23.                 function providers() {
  24.                     var lst = [], i;
  25.                     for (i = 0; i < cloud.providers.length; i++) {
  26.                         var prop = {
  27.                             //iconSource: "qrc://resources/" + cloud.providers[i] + ".png",
  28.                             iconSource: "qrc:/resources/directory.png",
  29.                             text: cloud.providers[i]
  30.                         };
  31.                         lst.push(cloud_entry.createObject(provider_action, prop));
  32.                     }
  33.                     return lst;
  34.                 }
  35.  
  36.                 id: provider_action
  37.                 text: "Add Cloud Provider"
  38.                 iconSource: "qrc:/resources/directory.png"
  39.                 children: providers()
  40.             }
  41.         ]
  42.     }
  43. //    contextDrawer: Kirigami.ContextDrawer {
  44. //        id: contextDrawer
  45. //    }
  46.     //pageStack.initialPage: mainPageComponent
  47.     /*Component {
  48.         id: mainPageComponent
  49.         Kirigami.ScrollablePage {
  50.             title: "Hello"
  51.             actions {
  52.                 main: Kirigami.Action {
  53.                     iconName: sheet.sheetOpen ? "dialog-cancel" : "document-edit"
  54.                     onTriggered: {
  55.                         print("Action button in buttons page clicked");
  56.                         sheet.sheetOpen = !sheet.sheetOpen
  57.                     }
  58.                 }
  59.                 left: Kirigami.Action {
  60.                     iconName: "go-previous"
  61.                     onTriggered: {
  62.                         print("Left action triggered")
  63.                     }
  64.                 }
  65.                 right: Kirigami.Action {
  66.                     iconName: "go-next"
  67.                     onTriggered: {
  68.                         print("Right action triggered")
  69.                     }
  70.                 }
  71.                 contextualActions: [
  72.                     Kirigami.Action {
  73.                         text:"Action for buttons"
  74.                         iconName: "bookmarks"
  75.                         onTriggered: print("Action 1 clicked")
  76.                     },
  77.                     Kirigami.Action {
  78.                         text:"Action 2"
  79.                         iconName: "folder"
  80.                         enabled: false
  81.                     },
  82.                     Kirigami.Action {
  83.                         text: "Action for Sheet"
  84.                         visible: sheet.sheetOpen
  85.                     }
  86.                 ]
  87.             }
  88.             Kirigami.OverlaySheet {
  89.                 id: sheet
  90.                 onSheetOpenChanged: page.actions.main.checked = sheetOpen
  91.                 QQC2.Label {
  92.                     wrapMode: Text.WordWrap
  93.                     text: "Lorem ipsum dolor sit amet"
  94.                 }
  95.             }
  96.             //Page contents...
  97.         }
  98.     } */
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement