Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.4
- import QtQuick.Controls.Styles 1.3
- import QtQuick.Controls.Private 1.0
- import QtGraphicalEffects 1.0
- ComboBoxStyle {
- background: Rectangle {
- radius: 2
- color: control.enabled ? "#fafafa": "#c7c7c7"
- border.width: 1
- border.color: control.enabled ? "#000000" : "#c7c7c7"
- }
- label: Item {
- implicitHeight: 42 - padding.top - padding.bottom
- anchors.rightMargin: 10
- Text {
- text: control.currentText
- font.pixelSize: 17
- font.family: "Ubuntu"
- verticalAlignment: Text.AlignVCenter
- anchors.verticalCenter: parent.verticalCenter
- color: control.enabled ? "#000000" : "#484848"
- }
- Image {
- id: downIcon
- width: source != "" ? 15 : 0
- height: width
- source: "qrc:/icons/down-arrow.svg"
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- }
- ColorOverlay {
- anchors.fill: downIcon
- source: downIcon
- color: "#000000"
- }
- }
- property Component __dropDownStyle: MenuStyle {
- __maxPopupHeight: 228
- __menuItemType: "comboboxitem"
- frame: Rectangle {
- radius: 2
- color: "#fafafa"
- border.width: 1
- border.color: "#000000"
- }
- itemDelegate.label: Text {
- text: styleData.text
- font.family: "Ubuntu"
- font.pixelSize: 17
- verticalAlignment: Text.AlignVCenter
- color: styleData.selected ? "#000000" : "#000000"
- height: 42 - padding.top - padding.bottom
- }
- itemDelegate.background: Rectangle {
- radius: 1
- color: styleData.selected ? "#00897b" : "transparent"
- }
- scrollIndicator: Rectangle {
- id: scroll
- height: 21
- color: "#fafafa"
- anchors.margins: 10
- Image {
- id: scrollImage
- anchors.centerIn: parent
- width: source != "" ? 20 : 0
- height: width
- source: styleData.scrollerDirection === Qt.UpArrow ? "qrc:/icons/up-arrow.svg" :
- styleData.scrollerDirection === Qt.DownArrow ? "qrc:/icons/down-arrow.svg" : ""
- }
- ColorOverlay {
- anchors.fill: scrollImage
- source: scrollImage
- color: "#000000"
- }
- MouseArea {
- id: scrollMouseArea
- anchors.fill: parent
- hoverEnabled: true
- visible: false
- onEntered: parent.color = "#42a5f5"
- onExited: parent.color = "#fafafa"
- onPressed: parent.color = "#42a5f5"
- onReleased: parent.color = "#fafafa"
- Timer {
- interval: 10; running: true
- onTriggered: parent.visible = true
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement