Commit 617e795a authored by Ronan Abhamon's avatar Ronan Abhamon

feat(scrollBar): use style file

parent f3855dfc
...@@ -36,10 +36,11 @@ ...@@ -36,10 +36,11 @@
<file>ui/components/invertedMouseArea/InvertedMouseArea.qml</file> <file>ui/components/invertedMouseArea/InvertedMouseArea.qml</file>
<file>ui/scripts/utils.js</file> <file>ui/scripts/utils.js</file>
<file>ui/style/components/qmldir</file> <file>ui/style/components/qmldir</file>
<file>ui/style/components/Dialog.qml</file> <file>ui/style/components/DialogStyle.qml</file>
<file>ui/style/components/Collapse.qml</file> <file>ui/style/components/ScrollBarStyle.qml</file>
<file>ui/style/components/SearchBox.qml</file> <file>ui/style/components/SearchBoxStyle.qml</file>
<file>ui/style/components/Popup.qml</file> <file>ui/style/components/CollapseStyle.qml</file>
<file>ui/style/components/PopupStyle.qml</file>
<file>ui/style/global/qmldir</file> <file>ui/style/global/qmldir</file>
<file>ui/style/global/Colors.qml</file> <file>ui/style/global/Colors.qml</file>
<file>ui/style/global/Constants.qml</file> <file>ui/style/global/Constants.qml</file>
......
...@@ -12,10 +12,6 @@ Rectangle { ...@@ -12,10 +12,6 @@ Rectangle {
property int maxMenuHeight property int maxMenuHeight
border {
color: '#CCCCCC'
width: 2
}
implicitHeight: { implicitHeight: {
var height = model.count * entryHeight var height = model.count * entryHeight
return height > maxMenuHeight ? maxMenuHeight : height return height > maxMenuHeight ? maxMenuHeight : height
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import 'qrc:/ui/style/components'
// =================================================================== // ===================================================================
ScrollBar { ScrollBar {
background: Rectangle { background: ScrollBarStyle.background
color: '#F4F4F4'
}
contentItem: Rectangle { contentItem: Rectangle {
color: scrollBar.pressed ? '#5E5E5F' : '#C5C5C5' color: pressed
implicitHeight: 100 ? ScrollBarStyle.pressedColor
implicitWidth: 8 : ScrollBarStyle.color
radius: 10 implicitHeight: ScrollBarStyle.contentItem.implicitHeight
implicitWidth: ScrollBarStyle.contentItem.implicitWidth
radius: ScrollBarStyle.contentItem.radius
} }
id: scrollBar
} }
pragma Singleton
import QtQuick 2.7
import 'qrc:/ui/style/global'
QtObject {
property string color: Colors.c
property string pressedColor: Colors.b
property Rectangle background: Rectangle {
color: Colors.d
}
property Rectangle contentItem: Rectangle {
implicitHeight: 100
implicitWidth: 8
radius: 10
}
}
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
module Style module Style
singleton CollapseStyle 1.0 Collapse.qml singleton CollapseStyle 1.0 CollapseStyle.qml
singleton DialogStyle 1.0 Dialog.qml singleton DialogStyle 1.0 DialogStyle.qml
singleton PopupStyle 1.0 Popup.qml singleton PopupStyle 1.0 PopupStyle.qml
singleton SearchBoxStyle 1.0 SearchBox.qml singleton SearchBoxStyle 1.0 SearchBoxStyle.qml
singleton ScrollBarStyle 1.0 ScrollBarStyle.qml
...@@ -2,5 +2,8 @@ pragma Singleton ...@@ -2,5 +2,8 @@ pragma Singleton
import QtQuick 2.7 import QtQuick 2.7
QtObject { QtObject {
property string a: '#800000' property string a: '#808080'
property string b: '#5E5E5F'
property string c: '#C5C5C5'
property string d: '#F4F4F4'
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment