@@ -55,23 +55,85 @@ MessageDialogInternal{
5555 aitem .forceActiveFocus ()
5656 }
5757
58- MessageDialogButton{
58+ property Component buttonStyle: Rectangle{
59+ id: dialogButton
60+
61+ property alias text: buttonLabel .text
62+ property var callback : function (){}
63+
64+ signal clicked ()
65+ onClicked: parent .clicked ()
66+
67+ color: buttonMouseArea .containsMouse ? " #11212c" : " #0b151c"
68+ width: 100
69+ height: 30
70+
71+ Text {
72+ id: buttonLabel
73+ anchors .centerIn : parent
74+ text: " "
75+ color: " #ccc"
76+ font .pixelSize : 12
77+ font .family : " Open Sans, sans-serif"
78+ font .weight : Font .Light
79+ }
80+ MouseArea{
81+ id: buttonMouseArea
82+ anchors .fill : parent
83+ hoverEnabled: true
84+ onClicked: {
85+ dialogButton .clicked ()
86+ }
87+ }
88+ }
89+
90+ Loader{
5991 id: messageBoxButton1
92+
93+ property string text: ' '
94+ property var callback : function (){}
95+ signal clicked ()
96+
6097 visible : text !== ' '
98+ sourceComponent: root .buttonStyle
99+ onItemChanged: {
100+ if ( item )
101+ item .text = Qt .binding (function (){ return messageBoxButton1 .text } )
102+ }
61103 onClicked: messageBoxButton1 .callback (root)
62104 }
63105
64- MessageDialogButton {
106+ Loader {
65107 id: messageBoxButton2
66- anchors .centerIn : parent
108+
109+ property string text: ' '
110+ property var callback : function (){}
111+ signal clicked ()
112+
113+ anchors .horizontalCenter : parent .horizontalCenter
67114 visible : text !== ' '
115+ sourceComponent: root .buttonStyle
116+ onItemChanged: {
117+ if ( item )
118+ item .text = Qt .binding (function (){ return messageBoxButton2 .text } )
119+ }
68120 onClicked: messageBoxButton2 .callback (root)
69121 }
70122
71- MessageDialogButton {
123+ Loader {
72124 id: messageBoxButton3
125+
126+ property string text: ' '
127+ property var callback : function (){}
128+ signal clicked ()
129+
73130 anchors .right : parent .right
74131 visible : text !== ' '
132+ sourceComponent: root .buttonStyle
133+ onItemChanged: {
134+ if ( item )
135+ item .text = Qt .binding (function (){ return messageBoxButton3 .text } )
136+ }
75137 onClicked: messageBoxButton3 .callback (root)
76138 }
77139}
0 commit comments