summaryrefslogtreecommitdiff
path: root/Button/Sm.ui.qml
blob: 4df9bb73bb527429f9bcbbaac1a42cd06b0f8b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15
import Eduport 1.4

Button {
	id: button
	horizontalPadding: 12.8
	verticalPadding: 6.4
	font {
		family: Eduport.haveRoboto
				? "Roboto" : Eduport.robotoMedium.name
		weight: Font.Medium
		pointSize: 13
	}
	contentItem: RowLayout {

		Image {
			source: button.icon.source
			sourceSize {
				width: button.icon.width
				height: button.icon.height
			}

			ColorOverlay {
				color: checked
					? Eduport.bsGray800 : Eduport.bsBtnColor
				source: parent
				anchors.fill: parent
			}
		}

		Text {
			text: button.text
			font: button.font
			color: checked ? Eduport.bsGray800 : Eduport.bsBtnColor
			horizontalAlignment: Text.AlignHCenter
			verticalAlignment: Text.AlignVCenter
		}
	}
	background: Rectangle {
		color: checked ? Eduport.bsBodyBg : Eduport.bsBtnBg
		radius: 3.2
	}
}