diff --git a/widgets/DapButtonForm.ui.qml b/widgets/DapButtonForm.ui.qml index f9dcd68d620c0ffe547f3f86b44c2a1ae1b7160a..e274195de6c89eb799b600179d7ec60bdc699bb2 100644 --- a/widgets/DapButtonForm.ui.qml +++ b/widgets/DapButtonForm.ui.qml @@ -31,7 +31,7 @@ Button { ///@detalis fontButton Font setting. property alias fontButton:buttonText.font ///@detalis existenceImage Indicates the presence of an image. - property bool existenceImage:true + property bool existenceImage: true ///@detalis horizontalAligmentText Horizontal alignment. property alias horizontalAligmentText:buttonText.horizontalAlignment ///@detalis colorBackgroundButton This property overrides the background color. @@ -45,34 +45,38 @@ Button { id: dapButton - contentItem: Rectangle { - id: dapBackgroundButton - anchors.fill: parent - color: dapButton.hovered ? colorBackgroundHover : colorBackgroundNormal - implicitWidth: widthButton - implicitHeight: heightButton - border.color: borderColorButton - border.width: borderWidthButton - ///button text - Text { - id: buttonText + contentItem: + Rectangle + { + id: dapBackgroundButton anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignRight - anchors.rightMargin: indentTextRight - color: dapButton.hovered ? colorButtonTextHover : colorButtonTextNormal - text: qsTr(textButton) + color: dapButton.hovered ? colorBackgroundHover : colorBackgroundNormal + implicitWidth: widthButton + implicitHeight: heightButton + border.color: borderColorButton + border.width: borderWidthButton + ///button text + Text + { + id: buttonText + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignRight + anchors.rightMargin: indentTextRight + color: dapButton.hovered ? colorButtonTextHover : colorButtonTextNormal + text: qsTr(textButton) + } + + ///button picture + Image + { + id: iconNewWallet + anchors.verticalCenter: if(existenceImage)parent.verticalCenter + anchors.left: if(existenceImage)parent.left + anchors.leftMargin:if(existenceImage) indentImageLeftButton + source: if(existenceImage) dapButton.hovered ? hoverImageButton : normalImageButton + width: if(existenceImage)widthImageButton + height:if(existenceImage) heightImageButton + } } - - ///button picture - Image { - id: iconNewWallet - anchors.verticalCenter: if(existenceImage)parent.verticalCenter - anchors.left: if(existenceImage)parent.left - anchors.leftMargin:if(existenceImage) indentImageLeftButton - source: if(existenceImage) dapButton.hovered ? hoverImageButton : normalImageButton - width: if(existenceImage)widthImageButton - height:if(existenceImage) heightImageButton - } - } } diff --git a/widgets/DapComboBoxForm.ui.qml b/widgets/DapComboBoxForm.ui.qml index 1db01385d72c9cf208bb73c9503e8b9776d31f96..07d7ce0a464b9e2b331cee55d48c833dc2212fd4 100644 --- a/widgets/DapComboBoxForm.ui.qml +++ b/widgets/DapComboBoxForm.ui.qml @@ -3,7 +3,8 @@ import QtQuick.Controls 2.2 import QtQuick.Controls.Styles 1.4 import QtGraphicalEffects 1.0 -ComboBox { +ComboBox +{ ///@detalis normalColorText Text color in normal state. property string normalColorText ///@detalis hilightColorText Text color in selected state. @@ -73,77 +74,92 @@ ComboBox { anchors.verticalCenter: parent.verticalCenter //Icon icon near the text (arrow) - indicator: Image { - source: parent.popup.visible ? indicatorImageActive : indicatorImageNormal - width: indicatorWidth - height: indicatorHeight - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: popup.visible ? sidePaddingActive : sidePaddingNormal - } + indicator: + Image + { + source: parent.popup.visible ? indicatorImageActive : indicatorImageNormal + width: indicatorWidth + height: indicatorHeight + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: popup.visible ? sidePaddingActive : sidePaddingNormal + } //Defining the background for the main line - background: Rectangle { - anchors.fill: parent - color: parent.popup.visible ? hilightTopColor : normalTopColor - radius: 2 * pt - height: parent.height - } + background: + Rectangle + { + anchors.fill: parent + color: parent.popup.visible ? hilightTopColor : normalTopColor + radius: 2 * pt + height: parent.height + } //Main line text settings - contentItem: Text { - id:textTopComboBox - anchors.fill: parent - anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal - text: parent.displayText - font: parent.font - color: popup.visible ? hilightColorTopText : normalColorTopText - verticalAlignment: Text.AlignVCenter - } - - //Customize drop-down list with shadow effect - popup: Popup { - y: parent.height - 1 - width: parent.width + 1 - padding: 1 - contentItem: ListView { - clip: true - implicitHeight: contentHeight - model: customComboBox.popup.visible ? customComboBox.delegateModel : null - ScrollIndicator.vertical: ScrollIndicator {} + contentItem: + Text + { + id:textTopComboBox + anchors.fill: parent + anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal + text: parent.displayText + font: parent.font + color: popup.visible ? hilightColorTopText : normalColorTopText + verticalAlignment: Text.AlignVCenter } - background: Rectangle { - width: customComboBox.background.width - color: normalColor - Rectangle { - id: contentCorner - anchors.fill: parent - } - - DropShadow { - anchors.fill: parent - source: contentCorner - verticalOffset: 9 * pt - samples: 13 * pt - color: colorDropShadow - } + //Customize drop-down list with shadow effect + popup: + Popup + { + y: parent.height - 1 + width: parent.width + 1 + padding: 1 + contentItem: + ListView + { + clip: true + implicitHeight: contentHeight + model: customComboBox.popup.visible ? customComboBox.delegateModel : null + ScrollIndicator.vertical: ScrollIndicator {} + } + + background: + Rectangle + { + width: customComboBox.background.width + color: normalColor + Rectangle + { + id: contentCorner + anchors.fill: parent + } + + DropShadow + { + anchors.fill: parent + source: contentCorner + verticalOffset: 9 * pt + samples: 13 * pt + color: colorDropShadow + } + } } - } - //Shadow effect for the top element. - DropShadow { - anchors.fill: if (topEffect) - parent - source: if (topEffect) - background - verticalOffset: if (topEffect) - 9 * pt + //Shadow effect for the top element. + DropShadow + { + anchors.fill: if (topEffect) + parent + source: if (topEffect) + background + verticalOffset: if (topEffect) + 9 * pt + else 0 + samples: if (topEffect) + 13 * pt else 0 - samples: if (topEffect) - 13 * pt - else 0 - color: if (topEffect) - customComboBox.popup.visible ? colorDropShadow : colorTopNormalDropShadow - else "#00000000" + color: if (topEffect) + customComboBox.popup.visible ? colorDropShadow : colorTopNormalDropShadow + else "#00000000" + } } -}