Port ScrollingWindow and TabletDebugWindow

This commit is contained in:
vladest 2017-11-18 20:18:17 +01:00
parent c8d864465f
commit 41f338e6ad
2 changed files with 28 additions and 32 deletions

View file

@ -8,8 +8,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
import QtQuick 2.5 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.2
import Hifi 1.0 as Hifi import Hifi 1.0 as Hifi
import "../../styles-uit" import "../../styles-uit"
@ -69,9 +69,8 @@ Rectangle {
id: textArea id: textArea
width: parent.width width: parent.width
height: parent.height height: parent.height
backgroundVisible: false background: Item {}
textColor: hifi.colors.white color: hifi.colors.white
text:"" text:""
} }
} }

View file

@ -10,8 +10,7 @@
// //
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Controls 1.4 import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import "." import "."
@ -78,17 +77,21 @@ Window {
ScrollView { ScrollView {
id: scrollView id: scrollView
contentItem: content contentItem: content
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff clip: true
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: parent.isScrolling ? 1 : 0 anchors.rightMargin: parent.isScrolling ? 1 : 0
anchors.bottomMargin: footerPane.height anchors.bottomMargin: footerPane.height
style: ScrollViewStyle { ScrollBar.vertical: ScrollBar {
parent: scrollView
padding.right: -7 // Move to right away from content. policy: ScrollBar.AsNeeded
orientation: Qt.Vertical
handle: Item { x: scrollView.mirrored ? 0 : scrollView.width - width
y: scrollView.topPadding
height: scrollView.availableHeight
active: scrollView.ScrollBar.horizontal.active
contentItem: Item {
implicitWidth: 8 implicitWidth: 8
Rectangle { Rectangle {
radius: 4 radius: 4
@ -101,30 +104,24 @@ Window {
} }
} }
} }
}
scrollBarBackground: Item { background: Item {
implicitWidth: 10 implicitWidth: 10
Rectangle { Rectangle {
color: hifi.colors.darkGray30 color: hifi.colors.darkGray30
radius: 4 radius: 4
anchors { anchors {
fill: parent fill: parent
topMargin: -1 // Finesse size topMargin: -1 // Finesse size
bottomMargin: -2 bottomMargin: -2
}
} }
} }
incrementControl: Item {
visible: false
}
decrementControl: Item {
visible: false
}
} }
} }
function scrollBy(delta) { function scrollBy(delta) {
scrollView.flickableItem.contentY += delta; scrollView.flickableItem.contentY += delta;
} }