Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/TabBar.qml
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 59 | StylePrivate.StyleItem { | |||
---|---|---|---|---|---|
61 | control: controlRoot | 61 | control: controlRoot | ||
62 | visible: false | 62 | visible: false | ||
63 | elementType: "tabframe" | 63 | elementType: "tabframe" | ||
64 | properties: { | 64 | properties: { | ||
65 | "orientation" : controlRoot.position == T.TabBar.Header ? "Top" : "Bottom" | 65 | "orientation" : controlRoot.position == T.TabBar.Header ? "Top" : "Bottom" | ||
66 | } | 66 | } | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | background: Item { | 69 | background: MouseArea { | ||
70 | acceptedButtons: Qt.NoButton | ||||
71 | onWheel: { | ||||
72 | if (wheel.pixelDelta.y < 0 || wheel.angleDelta.y < 0) { | ||||
73 | controlRoot.currentIndex = Math.min(controlRoot.currentIndex + 1, controlRoot.contentModel.count -1); | ||||
74 | } else { | ||||
75 | controlRoot.currentIndex = Math.max(controlRoot.currentIndex - 1, 0); | ||||
76 | } | ||||
77 | } | ||||
78 | | ||||
70 | Rectangle { | 79 | Rectangle { | ||
71 | anchors { | 80 | anchors { | ||
72 | left: parent.left | 81 | left: parent.left | ||
73 | right: parent.right | 82 | right: parent.right | ||
74 | bottom : controlRoot.position == T.TabBar.Header ? parent.bottom : undefined | 83 | bottom : controlRoot.position == T.TabBar.Header ? parent.bottom : undefined | ||
75 | top : controlRoot.position == T.TabBar.Header ? undefined : parent.top | 84 | top : controlRoot.position == T.TabBar.Header ? undefined : parent.top | ||
76 | } | 85 | } | ||
77 | height: 1 | 86 | height: 1 | ||
78 | color: Kirigami.Theme.textColor | 87 | color: Kirigami.Theme.textColor | ||
79 | opacity: 0.4 | 88 | opacity: 0.4 | ||
80 | } | 89 | } | ||
81 | } | 90 | } | ||
82 | } | 91 | } |