Merge lp:~saviq/unity-2d/abstract-scrollbar into lp:unity-2d

Proposed by Michał Sawicz
Status: Merged
Approved by: Florian Boucault
Approved revision: 799
Merged at revision: 824
Proposed branch: lp:~saviq/unity-2d/abstract-scrollbar
Merge into: lp:unity-2d
Diff against target: 99 lines (+23/-13)
4 files modified
libunity-2d-private/Unity2d/AbstractScrollbar.qml (+5/-12)
libunity-2d-private/Unity2d/CMakeLists.txt (+2/-0)
libunity-2d-private/Unity2d/qmldir (+1/-0)
places/ListViewWithScrollbar.qml (+15/-1)
To merge this branch: bzr merge lp:~saviq/unity-2d/abstract-scrollbar
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+83813@code.launchpad.net

Commit message

[lib] make Scrollbar abstracted

Description of the change

[lib] make Scrollbar abstracted

To post a comment you must log in.
799. By Michał Sawicz

[lib] move Scrollbar width out of the abstracted one

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'places/Scrollbar.qml' => 'libunity-2d-private/Unity2d/AbstractScrollbar.qml'
2--- places/Scrollbar.qml 2011-07-26 16:57:44 +0000
3+++ libunity-2d-private/Unity2d/AbstractScrollbar.qml 2011-12-07 15:02:25 +0000
4@@ -35,8 +35,9 @@
5 id: scrollbar
6
7 property variant targetFlickable
8-
9- width: 3
10+ property alias sliderSource: sliderImage.source
11+ property alias sliderAnchors: sliderImage.anchors
12+ property alias sliderSmooth: sliderImage.smooth
13
14 MouseArea {
15 id: scrollMouseArea
16@@ -88,17 +89,9 @@
17 Behavior on height {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
18
19 BorderImage {
20+ id: sliderImage
21+
22 anchors.fill: parent
23- /* The glow around the slider is 5 pixels wide on the left and right sides
24- and 10 pixels tall on the top and bottom sides. */
25- anchors.rightMargin: -5
26- anchors.leftMargin: -5
27- anchors.topMargin: -10
28- anchors.bottomMargin: -10
29-
30- smooth: false
31-
32- source: "artwork/scrollbar.sci"
33 }
34
35 MouseArea {
36
37=== modified file 'libunity-2d-private/Unity2d/CMakeLists.txt'
38--- libunity-2d-private/Unity2d/CMakeLists.txt 2011-11-18 10:15:49 +0000
39+++ libunity-2d-private/Unity2d/CMakeLists.txt 2011-12-07 15:02:25 +0000
40@@ -59,5 +59,7 @@
41 #Allow build in different directory
42 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/GnomeBackground.qml"
43 "${CMAKE_CURRENT_BINARY_DIR}/GnomeBackground.qml")
44+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/AbstractScrollbar.qml"
45+ "${CMAKE_CURRENT_BINARY_DIR}/AbstractScrollbar.qml")
46 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
47 "${CMAKE_CURRENT_BINARY_DIR}/qmldir")
48
49=== modified file 'libunity-2d-private/Unity2d/qmldir'
50--- libunity-2d-private/Unity2d/qmldir 2011-05-26 11:44:11 +0000
51+++ libunity-2d-private/Unity2d/qmldir 2011-12-07 15:02:25 +0000
52@@ -1,3 +1,4 @@
53 plugin unity-2d-private-qml
54
55 GnomeBackground 1.0 GnomeBackground.qml
56+AbstractScrollbar 1.0 AbstractScrollbar.qml
57
58=== modified file 'places/ListViewWithScrollbar.qml'
59--- places/ListViewWithScrollbar.qml 2011-11-17 15:26:54 +0000
60+++ places/ListViewWithScrollbar.qml 2011-12-07 15:02:25 +0000
61@@ -17,6 +17,7 @@
62 */
63
64 import QtQuick 1.0
65+import Unity2d 1.0
66
67 FocusScope {
68 property alias scrollbar: scrollbar
69@@ -32,9 +33,11 @@
70 anchors.rightMargin: 15
71 }
72
73- Scrollbar {
74+ AbstractScrollbar {
75 id: scrollbar
76
77+ width: 3
78+
79 anchors.top: parent.top
80 anchors.topMargin: 15
81 anchors.bottom: parent.bottom
82@@ -43,6 +46,17 @@
83
84 targetFlickable: list.flickable
85
86+ /* The glow around the slider is 5 pixels wide on the left and right sides
87+ and 10 pixels tall on the top and bottom sides. */
88+ sliderAnchors.rightMargin: -5
89+ sliderAnchors.leftMargin: -5
90+ sliderAnchors.topMargin: -10
91+ sliderAnchors.bottomMargin: -10
92+
93+ sliderSmooth: false
94+
95+ sliderSource: "artwork/scrollbar.sci"
96+
97 /* Hide the scrollbar if there is less than a page of results */
98 opacity: targetFlickable.visibleArea.heightRatio < 1.0 ? 1.0 : 0.0
99 Behavior on opacity {NumberAnimation {duration: 100}}

Subscribers

People subscribed via source and target branches