diff --git a/DapButtonForm.ui.qml b/DapButtonForm.ui.qml index 1090045548d4c88927e87331debf86f989d995fd..1401a91f1c4b10a2cd162e204679f08d0b0e4806 100644 --- a/DapButtonForm.ui.qml +++ b/DapButtonForm.ui.qml @@ -2,13 +2,13 @@ import QtQuick 2.0 import QtQuick.Controls 2.0 Button { - ///@detalis heightButton button height + ///@detalis heightButton Button height property int heightButton: 36 * pt - ///@detalis widthButton button width + ///@detalis widthButton Button width property int widthButton: 120 * pt - ///@detalis normalImageButton the picture on the button is in normal state + ///@detalis normalImageButton the picture on the Button is in normal state property string normalImageButton: "qrc:/res/icons/new-wallet_icon_dark.png" - ///@detalis hoverImageButton the image on the button is in the mouseover state + ///@detalis hoverImageButton the image on the Button is in the mouseover state property string hoverImageButton: "qrc:/res/icons/new-wallet_icon_dark_hover.png" ///@detalis widthImageButton image width property int widthImageButton: 28 * pt @@ -16,15 +16,15 @@ Button { property int heightImageButton: 28 * pt ///@detalis indentImageLeftButton: indentation of the image from the left edge property int indentImageLeftButton: 10 * pt - ///@detalis colorBackgroundNormal button background color in normal state + ///@detalis colorBackgroundNormal Button background color in normal state property string colorBackgroundNormal:"#070023" - ///@detalis colorBackgroundHover button background color in hover state + ///@detalis colorBackgroundHover Button background color in hover state property string colorBackgroundHover: "#D51F5D" - ///@detalis textButton: text button + ///@detalis textButton: text Button property string textButton: "New Wallet" - ///@detalis colorButtonTextNormal button text color in normal state + ///@detalis colorButtonTextNormal Button text color in normal state property string colorButtonTextNormal: "#FFFFFF" - ///@detalis colorButtonTextHover button text color in hover state + ///@detalis colorButtonTextHover Button text color in hover state property string colorButtonTextHover: "#FFFFFF" ///@detalis indentTextRight: indentation of the text from the right edge property int indentTextRight: 20 * pt diff --git a/DapComboBox.qml b/DapComboBox.qml index 2cfd55478ec9aa2e8be50186769773eac78cfdbe..cd4761512524b1628c7859fb5ef51d0f0cb232f4 100644 --- a/DapComboBox.qml +++ b/DapComboBox.qml @@ -1,5 +1,53 @@ -import QtQuick 2.4 +import QtQuick 2.0 +import QtQuick.Controls 2.0 DapComboBoxForm { +delegate:ItemDelegate { + width: parent.width + + ///Adjusting the height of the line, taking into account that the second element from the end may be the last. + height:{ + if(index != currentIndex) + { + if(index == customComboBox.count - 2) + { + if(index+1 == currentIndex) return heightListElement + bottomIntervalListElement + else return heightListElement + intervalListElement + } + if (index == customComboBox.count - 1) return heightListElement + bottomIntervalListElement + return heightListElement + intervalListElement + } + else return 0 + } + ///Text item + contentItem: Text { + id:textDelegateComboBox + anchors.fill: parent + anchors.topMargin: paddingTopItemDelegate + anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal + font.family: fontRobotoRegular.name + font.pixelSize: fontSizeComboBox + text: {if(index != currentIndex) return modelData;} + color: hovered ? hilightColorText : normalColorText + } + + + //Indent from the bottom edge or the next line that will not stand out when you hover over the mouse + background: Rectangle { + anchors.fill: parent + anchors.bottomMargin: { + if(index == countComboBox - 2) + { + if(index+1 == currentIndex) return bottomIntervalListElement + else return intervalListElement + } + if (index == countComboBox - 1) return bottomIntervalListElement + return intervalListElement + } + color: hovered ? hilightColor : normalColor + } + highlighted: parent.highlightedIndex === index +} + } diff --git a/DapComboBoxDelegate.qml b/DapComboBoxDelegate.qml deleted file mode 100644 index a3f90845392cf9bebc8eb5eb6082b26ca90dac6e..0000000000000000000000000000000000000000 --- a/DapComboBoxDelegate.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.0 - -ItemDelegate { - width: parent.width - - ///Adjusting the height of the line, taking into account that the second element from the end may be the last. - height:{ - if(index != currentIndex) - { - if(index == customComboBox.count - 2) - { - if(index+1 == currentIndex) return heightListElement + bottomIntervalListElement - else return heightListElement + intervalListElement - } - if (index == customComboBox.count - 1) return heightListElement + bottomIntervalListElement - return heightListElement + intervalListElement - } - else return 0 - } - ///Text item - contentItem: Text { - id:textDelegateComboBox - anchors.fill: parent - anchors.topMargin: paddingTopItemDelegate - anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal - font.family: fontRobotoRegular.name - font.pixelSize: fontSizeComboBox - text: {if(index != currentIndex) return modelData;} - color: hovered ? hilightColorText : normalColorText - } - - - //Indent from the bottom edge or the next line that will not stand out when you hover over the mouse - background: Rectangle { - anchors.fill: parent - anchors.bottomMargin: { - if(index == customComboBox.count - 2) - { - if(index+1 == currentIndex) return bottomIntervalListElement - else return intervalListElement - } - if (index == customComboBox.count - 1) return bottomIntervalListElement - return intervalListElement - } - color: hovered ? hilightColor : normalColor - } - highlighted: parent.highlightedIndex === index - } diff --git a/DapComboBoxForm.ui.qml b/DapComboBoxForm.ui.qml index 35709dbc167b74aa80ae4cb95edaf2e43f0de9a8..4e9e8e31de08bc8f8bc9cf54f891ab7e0581040f 100644 --- a/DapComboBoxForm.ui.qml +++ b/DapComboBoxForm.ui.qml @@ -9,9 +9,9 @@ ComboBox { ///@detalis hilightColorText text color in selected state property string hilightColorText: "#FFFFFF" ///@detalis normalColorTopText text color in the main line in normal state - property string normalColorTopText:normalColorText + property string normalColorTopText: normalColorText ///@detalis hilightColorTopText text color in the main line in active state - property string hilightColorTopText:normalColorText + property string hilightColorTopText: normalColorText ///@detalis normalColor item color in normal state property string normalColor: "#FFFFFF" ///@detalis hilightColor item color in selected state @@ -20,60 +20,62 @@ ComboBox { property string normalTopColor: normalColor ///@detalis hilightTopColor top string color in selected state property string hilightTopColor: normalColor - ///@detalis fontSizeComboBox: font size for the entire widget (px). - property int fontSizeComboBox: 16*pt + ///@detalis fontSizeComboBox font size for the entire widget + property int fontSizeComboBox: 16 * pt ///@detalis widthPopupComboBoxNormal: width of the combo box in the normal state property int widthPopupComboBoxNormal: parent.width - ///@detalis widthPopupComboBoxActive width of the combo box in the active state + ///@detalis widthPopupComboBoxActive width of the ComboBox in the active state property int widthPopupComboBoxActive: widthPopupComboBoxNormal - ///@detalis heightComboBoxNormal height of the combo box in the normal state + ///@detalis heightComboBoxNormal height of the ComboBox in the normal state property int heightComboBoxNormal: parent.height - ///@detalis heightComboBoxActive height of the combo box in the active state + ///@detalis heightComboBoxActive height of the ComboBox in the active state property int heightComboBoxActive: heightComboBoxNormal ///@detalis sidePaddingNormal: sets the indent from the edge of the right and left edges of the parent in the normal state - property int sidePaddingNormal:16 * pt + property int sidePaddingNormal: 16 * pt ///@detalis sidePaddingActive sets the indent from the edge of the right and left edges of the parent in the active state - property int sidePaddingActive:sidePaddingNormal + property int sidePaddingActive: sidePaddingNormal ///@detalis topIndentNormal sets the indent from the edge of the upper of the parent in the normal state - property int topIndentNormal:12 * pt + property int topIndentNormal: 12 * pt ///@detalis topIndentActive sets the indent from the edge of the upper of the parent in the active state - property int topIndentActive:topIndentNormal + property int topIndentActive: topIndentNormal ///@detalis bottomIndentNormal sets the indent from the edge of the lower of the parent in the normal state - property int bottomIndentNormal:14 * pt + property int bottomIndentNormal: 14 * pt ///@detalis bottomIndentActive sets the indent from the edge of the lower of the parent in the active state - property int bottomIndentActive:bottomIndentNormal + property int bottomIndentActive: bottomIndentNormal ///@detalis paddingTopItemDelegate indent above from item delegate - property int paddingTopItemDelegate:8 * pt + property int paddingTopItemDelegate: 8 * pt ///@detalis paddingBottomItemDelegate indent below from item delegate - property int paddingBottomItemDelegate:paddingTopItemDelegate - ///@detalis heightListElement: list item height + property int paddingBottomItemDelegate: paddingTopItemDelegate + ///@detalis heightListElement list item height property int heightListElement: 32 * pt - ///@detalis intervalListElement: spacing between items in a list + ///@detalis intervalListElement spacing between items in a list property int intervalListElement: 10 * pt ///@detalis bottomIntervalListElement: spacing from bottom to bottom - property int bottomIntervalListElement:intervalListElement - ///@detalis topEffect: using an effect for the top element + property int bottomIntervalListElement: intervalListElement + ///@detalis topEffect using an effect for the top element property bool topEffect: true - ///@detalis indicatorImageNormal indicator picture address for normal state + ///@detalis indicatorImageNormal Indicator picture address for normal state property string indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png" - ///@detalis indicatorImageActive indicator picture address for active state + ///@detalis indicatorImageActive Indicator picture address for active state property string indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png" - ///@detalis indicatorWidth indicator width - property int indicatorWidth: 24*pt - ///@detalis indicatorHeight indicator height + ///@detalis indicatorWidth Indicator width + property int indicatorWidth: 24 * pt + ///@detalis indicatorHeight Indicator height property int indicatorHeight: indicatorWidth - /// colorTopNormalDropShadow: color of the shadow effect of the combo box when minimized - property string colorTopNormalDropShadow:"#00000000" - ///@detalis colorDropShadow: unboxed shadow color in expanded state - property string colorDropShadow:"#40ABABAB" + /// colorTopNormalDropShadow color of the shadow effect of the combo box when minimized + property string colorTopNormalDropShadow: "#00000000" + ///@detalis colorDropShadow unboxed shadow color in expanded state + property string colorDropShadow: "#40ABABAB" + + ///@detalis countComboBox this variable indicates the number of lines in the list for + ///the delegate in the file DapComboBox.qml + property int countComboBox: customComboBox.count id: customComboBox width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal height: popup.visible ? heightComboBoxActive : heightComboBoxNormal anchors.verticalCenter: parent.verticalCenter - delegate:DapComboBoxDelegate{} - //Icon icon near the text (arrow) indicator: Image { source: parent.popup.visible ? indicatorImageActive : indicatorImageNormal @@ -90,7 +92,6 @@ ComboBox { color: parent.popup.visible ? hilightTopColor : normalTopColor radius: 2 * pt height: parent.height - } ///Main line text settings contentItem: Text { @@ -112,7 +113,7 @@ ComboBox { clip: true implicitHeight: contentHeight model: customComboBox.popup.visible ? customComboBox.delegateModel : null - ScrollIndicator.vertical: ScrollIndicator { } + ScrollIndicator.vertical: ScrollIndicator {} } background: Rectangle { @@ -135,10 +136,15 @@ ComboBox { ///Shadow effect for the top element. DropShadow { - anchors.fill: if(topEffect) parent - source: if(topEffect) background - verticalOffset: if(topEffect) 9 * pt - samples: if(topEffect) 13 * pt - color: if(topEffect) customComboBox.popup.visible ? colorDropShadow : colorTopNormalDropShadow + anchors.fill: if (topEffect) + parent + source: if (topEffect) + background + verticalOffset: if (topEffect) + 9 * pt + samples: if (topEffect) + 13 * pt + color: if (topEffect) + customComboBox.popup.visible ? colorDropShadow : colorTopNormalDropShadow } } diff --git a/libdap-qt-ui-qml.qrc b/libdap-qt-ui-qml.qrc index c85410535186163a8306070f2d20ca1a6600ec47..9868b819c9c09cdbe6c222696a09178af25484c6 100644 --- a/libdap-qt-ui-qml.qrc +++ b/libdap-qt-ui-qml.qrc @@ -4,6 +4,5 @@ <file>DapButtonForm.ui.qml</file> <file>DapComboBox.qml</file> <file>DapComboBoxForm.ui.qml</file> - <file>DapComboBoxDelegate.qml</file> </qresource> </RCC>