diff --git a/DapButton.qml b/DapButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..a0ef3882f19736783d2d68cdcd2879408b23b013 --- /dev/null +++ b/DapButton.qml @@ -0,0 +1,4 @@ +import QtQuick 2.4 + +DapButtonForm { +} diff --git a/DapButtonForm.ui.qml b/DapButtonForm.ui.qml new file mode 100644 index 0000000000000000000000000000000000000000..a193d6ef4b61aa28953e8f0e67ff5b7af70d28b1 --- /dev/null +++ b/DapButtonForm.ui.qml @@ -0,0 +1,78 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Button { + ///@detalis heightButton and widthButton: sets the height and width of the button. + property int heightButton: 36 * pt + property int widthButton: 120 * pt + + ///@detalis normalImageButton and hoverImageButton: the picture on the button is in normal + ///condition and when you hover + property string normalImageButton: "qrc:/res/icons/new-wallet_icon_dark.png" + property string hoverImageButton: "qrc:/res/icons/new-wallet_icon_dark_hover.png" + + ///@detalis widthImageButton and heightImageButton: image width and height + property int widthImageButton: 28 * pt + property int heightImageButton: 28 * pt + + ///@detalis indentImageLeftButton: indentation of the image from the left edge + property int indentImageLeftButton: 10 * pt + + ///@detalis colorBackgroundNormal and colorBackgroundHover: button background color in normal state and on hover + property string colorBackgroundNormal:"#070023" + property string colorBackgroundHover: "#D51F5D" + + ///@detalis textButton: text button + property string textButton: "New Wallet" + + ///@detalis colorButtonTextNormal and colorButtonTextHover: button text color in normal state and on hover + property string colorButtonTextNormal: "#FFFFFF" + property string colorButtonTextHover: "#FFFFFF" + + ///@detalis indentTextRight: indentation of the text from the right edge + property int indentTextRight: 20 * pt + + ///@detalis fontSizeButton: font size + property int fontSizeButton: 14 * pt + + ///@detalis existenceImage: indicates the presence of an image + property bool existenceImage:true + + ///@detalis horizontalAligmentText: horizontal alignment + property alias horizontalAligmentText:templateText.horizontalAlignment + + id: dapButton + + contentItem: Rectangle { + id: dapBackgroundButton + anchors.fill: parent + color: dapButton.hovered ? colorBackgroundHover : colorBackgroundNormal + implicitWidth: widthButton + implicitHeight: heightButton + + ///button text + Text { + id: templateText + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignRight + anchors.rightMargin: indentTextRight + font.pixelSize: fontSizeButton + font.family: "Roboto" + font.weight: Font.Normal + 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 + } + } +} diff --git a/DapComboBox.qml b/DapComboBox.qml index 27e6e79ca8cfec3164c1902ee3f8256b4cf21844..dfab3744f00b3d59f552107a762df4f88d870dca 100644 --- a/DapComboBox.qml +++ b/DapComboBox.qml @@ -5,76 +5,80 @@ import QtGraphicalEffects 1.0 ///About property -///@hilightColor - color of the selected item -///@normalColor - color of item -///@normalColorText and @hilightColorText - normal and selected text color -///@normalColorTopText and @hilightColorTopText - text color in the main line in normal and active state -///@fontSizeComboBox - font size for the entire widget (px). -///@widthPopupComboBoxActive and @widthPopupComboBoxNormal - width of the combo box -/// in the active state and in the normal state -///@heightComboBoxNormal and @heightComboBoxActive - height of the combo box -/// in the active state and in the normal state -///@sidePaddingActive and @sidePaddingNormal - padding width of the combo box in the active state -/// and in the normal state -///@sidePaddingActive and @sidePaddingNormal - sets the indent from the edge of the right and left -/// edges of the parent in the active and normal state -///@topIndentActive and @topIndentNormal -///@bottomIndentActive and @bottomIndentNormal -/// - sets the indent from the edge of the upper and lower edges of the parent in the active and normal state -///@indicatorImageNormal and @indicatorImageActive - indicator picture address for active and normal state -///@indicatorWidth and @indicatorHeight - indicator width and height -///@heightListElement - List item height -///@intervalListElement - spacing between items in a list -///@bottomIntervalListElement - spacing from bottom to bottom -///@topEffect - Using an effect for the top element -///@colorTopNormalDropShadow - Color of the shadow effect of the combo box when minimized -///@colorDropShadow - Unboxed shadow color in expanded state -///@paddingTopItemDelegate - indent above and below from item delegate -ComboBox { + + + + + +///@sidePaddingActive and @sidePaddingNormal - + + + + + + + + + + + +ComboBox { + ///@detalis normalColorText and hilightColorText: text color in selected state and in normal property string normalColorText: "#070023" property string hilightColorText: "#FFFFFF" - + ///@detalis normalColorTopText and hilightColorTopText: text color in the main line in normal and active state property string normalColorTopText:normalColorText property string hilightColorTopText:normalColorText - + ///@detalis normalColor and hilightColor: item color in selected state and in normal property string normalColor: "#FFFFFF" property string hilightColor: "#330F54" + ///@detalis normalTopColor and hilightTopColor: top string color in selected state and in normal property string normalTopColor: normalColor property string hilightTopColor: normalColor - + ///@detalis fontSizeComboBox: font size for the entire widget (px). property int fontSizeComboBox: 16*pt - + ///@detalis widthPopupComboBoxActive and widthPopupComboBoxNormal: width of the combo box + /// in the active state and in the normal state property int widthPopupComboBoxNormal: parent.width property int widthPopupComboBoxActive: widthPopupComboBoxNormal - + ///@detalis heightComboBoxNormal and heightComboBoxActive: height of the combo box + /// in the active state and in the normal state property int heightComboBoxNormal: parent.height property int heightComboBoxActive: heightComboBoxNormal - + ///@detalis sidePaddingActive and sidePaddingNormal: sets the indent from the edge of the right and left + /// edges of the parent in the active and normal state property int sidePaddingNormal:16 * pt property int sidePaddingActive:sidePaddingNormal - + ///@detalis + ///topIndentActive and topIndentNormal + ///bottomIndentActive and bottomIndentNormal: + ///sets the indent from the edge of the upper and lower edges of the parent in the active and normal state property int topIndentNormal:12 * pt property int topIndentActive:topIndentNormal - property int bottomIndentNormal:14 * pt property int bottomIndentActive:bottomIndentNormal - + ///@detalis paddingTopItemDelegate and paddingBottomItemDelegate: indent above and below from item delegate property int paddingTopItemDelegate:8 * pt property int paddingBottomItemDelegate:paddingTopItemDelegate - + ///@detalis heightListElement: list item height property int heightListElement: 32 * pt + ///@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 bool topEffect: true - + ///@detalis indicatorImageNormal and indicatorImageActive: indicator picture address for active and normal state property string indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png" property string indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png" + ///@detalis indicatorWidth and indicatorHeight: indicator width and height property int indicatorWidth: 24*pt 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" id: customComboBox @@ -124,10 +128,7 @@ ComboBox { if (index == customComboBox.count - 1) return bottomIntervalListElement return intervalListElement } - color: hovered ? hilightColor : normalColor - //the list text - } highlighted: parent.highlightedIndex === index } diff --git a/DapComboBoxDelegate.qml b/DapComboBoxDelegate.qml deleted file mode 100644 index 55db1e52970e9696bf893f6693352bbb4655b0d5..0000000000000000000000000000000000000000 --- a/DapComboBoxDelegate.qml +++ /dev/null @@ -1,31 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.5 - -ItemDelegate { - property string delegateContentText: "" - width: parent.width - height:{ - if(index == currentIndex) return 0 - else return 42*pt - } - contentItem: Text { - id:textDelegateComboBox - anchors.fill: parent - anchors.topMargin: 8 * pt - anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal - verticalAlignment: Qt.AlignTop - font.family: fontRobotoRegular.name - font.pixelSize: fontSizeComboBox - text: {if(index != currentIndex) return delegateContentText;} - color: hovered ? hilightColorText : normalColorText - } - - background: Rectangle { - anchors.fill: parent - anchors.bottomMargin: 10 * pt - color: hovered ? hilightColor : normalColor - } - - highlighted: parent.highlightedIndex === index - -} diff --git a/libdap-qt-ui-qml.qrc b/libdap-qt-ui-qml.qrc index 65d307156f338686a0c54190b738e3404e41aa33..b9f0103d2f56562d86b4a18b223ff48672e137f9 100644 --- a/libdap-qt-ui-qml.qrc +++ b/libdap-qt-ui-qml.qrc @@ -1,5 +1,7 @@ <RCC> <qresource prefix="/"> <file>DapComboBox.qml</file> + <file>DapButton.qml</file> + <file>DapButtonForm.ui.qml</file> </qresource> </RCC>