summaryrefslogtreecommitdiff
path: root/Button/Btn.ui.qml
blob: e672537c2fd4e745a4787f793a127197492205f5 (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
47
import QtQuick 2.15
import QtQuick.Controls 2.15
import Eduport 1.4

Button {
	property color bsBtnColor: Eduport.bsBtnColor
	property color bsBtnBg: Eduport.bsBtnBg
	property color bsBtnBorderColor: Eduport.bsBtnBorderColor
	property color bsBtnActiveColor: Eduport.bsBtnColor
	property color bsBtnActiveBg: Eduport.bsBtnBg
	property color bsBtnActiveBorderColor: Eduport.bsBtnBorderColor
	property color bsBtnDisabledColor: Eduport.bsBtnColor
	property color bsBtnDisabledBg: Eduport.bsBtnBg
	property color bsBtnDisabledBorderColor: Eduport.bsBtnBorderColor
	property real bsBtnBorderRadius: Eduport.bsBtnBorderRadius
	id: button
	horizontalPadding: Eduport.bsBtnPaddingX
	verticalPadding: Eduport.bsBtnPaddingY
	font: Eduport.bsBtnFont
	contentItem: Text {
		text: button.text
		font: button.font
		color: button.down
			? bsBtnActiveColor
			: button.enabled
				? bsBtnColor
				: bsBtnDisabledColor
		horizontalAlignment: Text.AlignHCenter
		verticalAlignment: Text.AlignVCenter
	}
	background: Rectangle {
		color: button.down
			? bsBtnActiveBg
			: button.enabled
				? bsBtnBg
				: bsBtnDisabledBg
		border {
			width: Eduport.bsBtnBorderWidth
			color: button.down
				? bsBtnActiveBorderColor
				: button.enabled
					? bsBtnBorderColor
					: bsBtnDisabledBorderColor
		}
		radius: bsBtnBorderRadius
	}
}