沙發舒服的44444

  style: 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"
                            }
                        }
                    }
                }
            }
    }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值