From 4df77cff317d0cdc1bfb3e13bf547daaca415fad Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 18 Feb 2016 18:10:58 +1300 Subject: [PATCH] Add scrollbars to running scripts and available scripts tables --- .../resources/qml/controls-uit/Table.qml | 54 ++++++++++++++++++- interface/resources/qml/controls-uit/Tree.qml | 54 ++++++++++++++++++- .../qml/styles-uit/HifiConstants.qml | 2 + 3 files changed, 106 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/controls-uit/Table.qml b/interface/resources/qml/controls-uit/Table.qml index 481705166d..77434acd0d 100644 --- a/interface/resources/qml/controls-uit/Table.qml +++ b/interface/resources/qml/controls-uit/Table.qml @@ -44,10 +44,60 @@ TableView { backgroundVisible: true + horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff + verticalScrollBarPolicy: Qt.ScrollBarAsNeeded + style: TableViewStyle { // Needed in order for rows to keep displaying rows after end of table entries. - backgroundColor: treeView.isLightColorScheme ? hifi.colors.tableRowLightEven : hifi.colors.tableRowDarkEven - alternateBackgroundColor: treeView.isLightColorScheme ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd + backgroundColor: parent.isLightColorScheme ? hifi.colors.tableRowLightEven : hifi.colors.tableRowDarkEven + alternateBackgroundColor: parent.isLightColorScheme ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd + + handle: Item { + id: scrollbarHandle + implicitWidth: 8 + Rectangle { + radius: 4 + color: hifi.colors.tableScrollHandle + anchors { + fill: parent + leftMargin: 4 // Finesse size and position. + rightMargin: -1 + topMargin: 2 + bottomMargin: 3 + } + } + } + + scrollBarBackground: Item { + implicitWidth: 10 + + Rectangle { + color: hifi.colors.baseGrayHighlight + anchors { + fill: parent + leftMargin: 1 // Finesse size and position. + topMargin: -2 + bottomMargin: -2 + } + } + + Rectangle { + radius: 4 + color: hifi.colors.tableScrollBackground + anchors { + fill: parent + leftMargin: 3 // Finesse position. + } + } + } + + incrementControl: Item { + visible: false + } + + decrementControl: Item { + visible: false + } } rowDelegate: Rectangle { diff --git a/interface/resources/qml/controls-uit/Tree.qml b/interface/resources/qml/controls-uit/Tree.qml index 6a52641bbb..759e69ea66 100644 --- a/interface/resources/qml/controls-uit/Tree.qml +++ b/interface/resources/qml/controls-uit/Tree.qml @@ -45,10 +45,60 @@ TreeView { backgroundVisible: true + horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff + verticalScrollBarPolicy: Qt.ScrollBarAsNeeded + style: TreeViewStyle { // Needed in order for rows to keep displaying rows after end of table entries. - backgroundColor: treeView.isLightColorScheme ? hifi.colors.tableRowLightEven : hifi.colors.tableRowDarkEven - alternateBackgroundColor: treeView.isLightColorScheme ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd + backgroundColor: parent.isLightColorScheme ? hifi.colors.tableRowLightEven : hifi.colors.tableRowDarkEven + alternateBackgroundColor: parent.isLightColorScheme ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd + + handle: Item { + id: scrollbarHandle + implicitWidth: 8 + Rectangle { + radius: 4 + color: hifi.colors.tableScrollHandle + anchors { + fill: parent + leftMargin: 4 // Finesse size and position. + rightMargin: -1 + topMargin: 2 + bottomMargin: 3 + } + } + } + + scrollBarBackground: Item { + implicitWidth: 10 + + Rectangle { + color: hifi.colors.baseGrayHighlight + anchors { + fill: parent + leftMargin: 1 // Finesse size and position. + topMargin: -2 + bottomMargin: -2 + } + } + + Rectangle { + radius: 4 + color: hifi.colors.tableScrollBackground + anchors { + fill: parent + leftMargin: 3 // Finesse position. + } + } + } + + incrementControl: Item { + visible: false + } + + decrementControl: Item { + visible: false + } } rowDelegate: Rectangle { diff --git a/interface/resources/qml/styles-uit/HifiConstants.qml b/interface/resources/qml/styles-uit/HifiConstants.qml index 9f7ee10dac..9896cb57c2 100644 --- a/interface/resources/qml/styles-uit/HifiConstants.qml +++ b/interface/resources/qml/styles-uit/HifiConstants.qml @@ -52,6 +52,8 @@ Item { readonly property color tableRowLightEven: "#1a575757" readonly property color tableRowDarkOdd: "#80393939" readonly property color tableRowDarkEven: "#a6181818" + readonly property color tableScrollHandle: "#707070" + readonly property color tableScrollBackground: "#323232" } Item {