撒發射點發生下功夫大師法國德國感
import QtQuick 2.15
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 1.4 as QtQuickCtrl1_4
Component {
TableViewStyle {
scrollBarBackground: Rectangle {
color: "#F1F1F1"
height: 17
width: 17
}
corner : Component {
Rectangle {
width: 17
height: 17
color: "#F1F1F1"
}
}
decrementControl : Component {
Rectangle {
id: control
x: 0
y: 0
width: 17
height: 17
property var hovered: styleData.hovered
property var pressed: styleData.pressed
color: control.pressed ? "#787878" : control.hovered ?
"#D2D2D2" : "#F1F1F1"
Canvas {
id: canvas
anchors.centerIn: parent
width: 12
height: 8
contextType: "2d"
Connections {
target: control
function onPressedChanged() { canvas.requestPaint() }
}
function drawHorizontalIndicator() {
canvas.height = 12
canvas.width = 8
context.reset()
context.moveTo(0, height / 2)
context.lineTo(width, 0)
context.lineTo(width, height)
context.closePath()
context.fillStyle = control.pressed ? "#FFFFFF" : "#505050"
context.fill()
}
function drawVerticalIndicator() {
canvas.height = 8
canvas.width = 12
context.reset()
context.moveTo(width / 2, 0)
context.lineTo(0, height)
context.lineTo(width, height)
context.closePath()
context.fillStyle = control.pressed ? "#FFFFFF" : "#505050"
context.fill()
}
onPaint: {
styleData.horizontal ? drawHorizontalIndicator() : drawVerticalIndicator()
}
}
}
}
incrementControl : Component {
Rectangle {
id: control
x: 0
y: 0
width: 17
height: 17
property var hovered: styleData.hovered
property var pressed: styleData.pressed
color: control.pressed ? "#787878" : control.hovered ?
"#D2D2D2" : "#F1F1F1"
Canvas {
id: canvas
anchors.centerIn: parent
width: 12
height: 8
contextType: "2d"
Connections {
target: control
function onPressedChanged() { canvas.requestPaint() }
}
function drawHorizontalIndicator() {
canvas.height = 12
canvas.width = 8
context.reset()
context.moveTo(0, 0)
context.lineTo(0, height)
context.lineTo(width, height / 2)
context.closePath()
context.fillStyle = control.pressed ? "#FFFFFF" : "#505050"
context.fill()
}
function drawVerticalIndicator() {
canvas.height = 8
canvas.width = 12
context.reset()
context.moveTo(0, 0)
context.lineTo(width, 0)
context.lineTo(width / 2, height)
context.closePath()
context.fillStyle = control.pressed ? "#FFFFFF" : "#505050"
context.fill()
}
onPaint: {
styleData.horizontal ? drawHorizontalIndicator() : drawVerticalIndicator()
}
}
}
}
handle: Rectangle {
color: "transparent"
implicitHeight: 17
implicitWidth: 17
anchors.centerIn: parent
QtQuickCtrl1_4.Button {
id: button
implicitHeight: parent.height - 4
implicitWidth: parent.width - 4
property var hovered: styleData.hovered
property var pressed: styleData.pressed
anchors.centerIn: parent
style: ButtonStyle {
background: Rectangle {
color: button.pressed ? "#787878" : button.hovered ?
"#A9A9A9" : "#C1C1C1"
}
}
}
}
}
}
到翻跟斗雙方的