import QtQuick 1.1\r
\r
Item {\r
- id: container\r
-\r
property string buttonName: "NOT SET"\r
property string target: "NOT SET"\r
property string text: "NOT SET"\r
\r
property bool active: false\r
\r
- property string bgImage: theme_manager.theme.datepicker.button\r
- property string bgImagePressed: theme_manager.theme.datepicker.button_pressed\r
- property string bgImageActive: theme_manager.theme.datepicker.button_active\r
-\r
- // These Component properties can be used to modify the Button's LaF\r
- // from the calling component. They have to define a BorderImage component.\r
- property Component bg: defaultBackground\r
- property Component bgPressed: defaultPressedBackground\r
- property Component bgActive: defaultActiveBackground\r
-\r
signal clicked(string target, string button)\r
\r
width: 140\r
height: 60\r
- opacity: enabled ? 1.0 : 0.5 \r
+ opacity: enabled ? 1.0 : 0.5\r
\r
- Loader {\r
- id: background\r
- sourceComponent: container.bg\r
+ Rectangle{\r
anchors.fill: parent\r
- }\r
-\r
- Component {\r
- id: defaultBackground\r
- BorderImage {\r
- border { top: 8; bottom: 8; left: 8; right: 8 }\r
- source: bgImage\r
- }\r
- }\r
- Component {\r
- id: defaultPressedBackground\r
- BorderImage {\r
- border { top: 8; bottom: 8; left: 8; right: 8 }\r
- source: bgImagePressed\r
- }\r
- }\r
-\r
- Component {\r
- id: defaultActiveBackground\r
- BorderImage {\r
- border { top: 8; bottom: 8; left: 8; right: 8 }\r
- source: bgImageActive\r
- }\r
+ width: container.width\r
+ height: container.height\r
+ color:"white"\r
+ border.color: "black"\r
+ radius: 8\r
}\r
\r
Text {\r
}\r
color: container.fontColor\r
}\r
-\r
- MouseArea {\r
- id: mouseArea\r
- anchors.fill: parent\r
-\r
- }\r
-\r
- states: [\r
- State {\r
- name: 'pressed'; when: mouseArea.pressed\r
- PropertyChanges { target: background; sourceComponent: container.bgPressed }\r
- },\r
- State {\r
- name: 'active'; when: container.active\r
- PropertyChanges { target: background; sourceComponent: container.defaultActiveBackground; }\r
- }\r
- ]\r
-\r
}\r
// Spacing between items
property int spacing: 8
- property Component itemBackground: Component {
- BorderImage {
- border { top: 8; bottom: 8; left: 8; right: 8 }
- source: theme_manager.theme.datepicker.button
- }
- }
- property Component itemBackgroundPressed: Component {
- BorderImage {
- border { top: 8; bottom: 8; left: 8; right: 8 }
- source: theme_manager.theme.datepicker.button_pressed
- }
- }
width: 240
height: 90
fontColor: container.fontColor
fontName: container.fontName
fontSize: container.fontSize
- bg: itemBackground
- bgPressed: itemBackgroundPressed
opacity: (index+1 < days.start || index+1 > days.end) ? 0.5 : 1.0
}
}
fontColor: container.fontColor
fontName: container.fontName
fontSize: container.fontSize
- bg: itemBackground
- bgPressed: itemBackgroundPressed
}
}
fontColor: container.fontColor
fontName: container.fontName
fontSize: container.fontSize
- bg: itemBackground
- bgPressed: itemBackgroundPressed
}
}
function open() { focus = true; clip = false }
function close() { clip = true }
- function toggle() { clip ? open() : close() }
+
function shiftZ(obj, delta) {
if (typeof obj.z != 'undefined') obj.z += delta
if (obj.parent) shiftZ(obj.parent, delta) // Set z recursively to parent
// Close reel when the focus is lost
onFocusChanged: if (!focus) close()
// Bring to front if not clipped
- onClipChanged: { clip ? shiftZ(reel, -500) : shiftZ(reel, 500) }
+
onIndexChanged: path.currentIndex = reel.index
Text {
id: txtDMY
- x: 140
+ x: 151
y: 77
- width: 80
height: 20
color: "#29d999"
- textFormat: Text.RichText
text: "Tháng <b>"+screen.curMonth+"</b> Năm <b>"+screen.curYear+"</b>"
+ horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
font.bold: false
font.family: "Tahoma"
smooth: true
- horizontalAlignment: Text.AlignHCenter
font.pixelSize: 28
}
id: txtTHU
x: 151
y: 210
- width: 80
height: 20
color: "#f0f0f5"
text: Script.__txtTHU_format()
id: txtInfo
x: 151
y: (screen.is_holiday ? 270 : 250)
- width: 80
height: 20
color: (Script.is_holiday ? theme_manager.theme.markdate.holidays : theme_manager.theme.markdate.not_holidays)
text: Script.__txtInfo_format()
id: txtDAYAmLich
x: 151
y: 330
- width: 80
height: 20
color: "#f0f0f5"
text: Script.__txtDAYAmLich_format()