summaryrefslogtreecommitdiff
path: root/qml/HomePage.qml
blob: fbcfd7086ab1cf15e173283cad0755f276d6b99e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import QtQuick

Rectangle {
  id: homepage
  clip: true
  property string selected: "tests"

  ListView {
    id: category
    anchors.fill: parent
    model: xdgEntries.categories
    delegate: Rectangle {
      Component.onCompleted: {
        console.debug("MANAGE CATEGORY [" + modelData + "]")
      }

      property bool isshow: modelData !== "System" && modelData !== "Debug"
      width: homepage.width
      height: (isshow) ? (entriesView.nbrow > 0 ? entriesView.height + categoryTitle.height : 0) : 0
      color: currentTheme.base
      visible: isshow && entriesView.nbrow > 0

      Rectangle {
        id: categoryTitle
        height: 20
        width: parent.width - 2
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.leftMargin: 4
        anchors.topMargin: 4
        color: currentTheme.mid


        Text {
          anchors.top: parent.top
          anchors.left: parent.left
          anchors.bottom: parent.bottom
          text: modelData
          font.pixelSize: 15
          font.bold: true
          color: currentTheme.windowText
        }
      }

      DesktopGridView {
        id: entriesView
        category: modelData
        anchors.top: categoryTitle.bottom
        anchors.left: parent.left
        anchors.right: parent.right
      }
    }
  }
}