aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-11 14:02:04 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-11 14:02:04 -0600
commit03f09865e8ef5662ceccb5e1d2353d7511e2e9ab (patch)
tree3ca9f25a6f0f4384654e1e810ba630f9b94b32bd
parent7b10b0b6b79f2ca5b3078c87685216ceed555d23 (diff)
parent84bf8736d7d08e904ee0351fae4b5058a9a30025 (diff)
downloadmonzero-gui-03f09865e8ef5662ceccb5e1d2353d7511e2e9ab.tar.gz
monzero-gui-03f09865e8ef5662ceccb5e1d2353d7511e2e9ab.tar.xz
monzero-gui-03f09865e8ef5662ceccb5e1d2353d7511e2e9ab.zip
Merge pull request #1797
84bf873 MiddlePanel: add scrollbars (mmbyday)
-rw-r--r--MiddlePanel.qml18
-rw-r--r--components/Scroll.qml11
2 files changed, 20 insertions, 9 deletions
diff --git a/MiddlePanel.qml b/MiddlePanel.qml
index 7a2dff31..183dd688 100644
--- a/MiddlePanel.qml
+++ b/MiddlePanel.qml
@@ -29,13 +29,12 @@
import QtQml 2.0
import QtQuick 2.2
-// QtQuick.Controls 2.0 isn't stable enough yet. Needs more testing.
-//import QtQuick.Controls 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import moneroComponents.Wallet 1.0
+import "components" as MoneroComponents
import "./pages"
import "./pages/settings"
@@ -184,12 +183,19 @@ Rectangle {
onFlickingChanged: {
releaseFocus();
+ flickableScroll.flickableContentYChanged();
}
- // Disabled scrollbars, gives crash on startup on windows
-// ScrollIndicator.vertical: ScrollIndicator { }
-// ScrollBar.vertical: ScrollBar { } // uncomment to test
-
+ MoneroComponents.Scroll {
+ id: flickableScroll
+ parent: mainFlickable.parent
+ anchors.left: parent.right
+ anchors.leftMargin: 3
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ flickable: mainFlickable
+ scrollWidth: 6
+ }
// Views container
StackView {
id: stackView
diff --git a/components/Scroll.qml b/components/Scroll.qml
index 43876a49..67b0c304 100644
--- a/components/Scroll.qml
+++ b/components/Scroll.qml
@@ -27,10 +27,14 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.0
+import "." as MoneroComponents
Item {
id: scrollItem
property var flickable
+ property alias scrollColor: scroll.color
+ property alias scrollWidth: scroll.width
+ property alias scrollRadius: scroll.radius
width: 15
z: 1
@@ -52,13 +56,14 @@ Item {
id: scroll
width: 4
+ radius: width / 2
height: {
var t = (flickable.height * flickable.height) / flickable.contentHeight
- return t < 20 ? 20 : t
+ return t < 50 ? 50 : t
}
y: 0; x: 0
- color: "#DBDBDB"
- opacity: flickable.moving || handleArea.pressed || scrollArea.containsMouse ? 0.5 : 0
+ color: MoneroComponents.Style.orange
+ opacity: flickable.moving || handleArea.pressed || scrollArea.containsMouse ? 0.8 : 0
visible: flickable.contentHeight > flickable.height
Behavior on opacity {