Skip to content
Snippets Groups Projects

Feature 2798

Closed konstantin.kukharenko requested to merge feature-2798 into master
3 files
+ 105
0
Compare changes
  • Side-by-side
  • Inline
Files
3
DapButton.qml 0 → 100644
+ 73
0
 
import QtQuick 2.0
 
import QtQuick.Controls 2.0
 
 
///@heightButton and @widthButton - height and width button
 
///@normalImageButton and @hoverImageButton - mouseover image in normal state
 
///@widthImageButton and @heightImageButton - size image
 
///@indentImageLeftButton - Indentation of the image from the left edge
 
///@colorBackgroundNormal and @colorBackgroundHover - mouseover background color in normal state
 
///@textButton - text button
 
///@colorButtonTextNormal and @colorButtonTextHover - mouseover text color in normal state
 
///@indentTextRight - Indentation of the text from the right edge
 
///@fontSizeButton - font size
 
///@existenceImage - indicates a picture
 
///@horizontalAligmentText - horizontal alignment
 
Button {
 
property int heightButton: 36 * pt
 
property int widthButton: 120 * pt
 
 
property string normalImageButton: "qrc:/res/icons/new-wallet_icon_dark.png"
 
property string hoverImageButton: "qrc:/res/icons/new-wallet_icon_dark_hover.png"
 
property int widthImageButton: 28 * pt
 
property int heightImageButton: 28 * pt
 
property int indentImageLeftButton: 10 * pt
 
 
property string colorBackgroundNormal:"#070023"
 
property string colorBackgroundHover: "#D51F5D"
 
 
property string textButton: "New Wallet"
 
property string colorButtonTextNormal: "#FFFFFF"
 
property string colorButtonTextHover: "#FFFFFF"
 
 
property int indentTextRight: 20 * pt
 
property int fontSizeButton: 14 * pt
 
 
property bool existenceImage:true
 
 
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
 
}
 
}
 
}
Loading