Adjustments for theme.textColor

textColor is now used from the theme, there it is made grey, similar
effect, less code, more consistency.
This commit is contained in:
Sebastian Kügler 2013-12-28 01:05:09 +01:00
parent 9524193545
commit 84b6e6a245
3 changed files with 13 additions and 52 deletions

View File

@ -27,26 +27,17 @@ Item {
width: cellWidth
height: cellHeight
//property int borderWidth: root.borderWidth
property real borderOpacity: root.borderOpacity
property bool showtop: false
property bool showright: true
property bool showleft: false
property bool showbottom: true
property real borderOpacity: daysCalendar.borderOpacity
Rectangle {
id: todayRect
x: 0
y: 0
//z: -1
width: parent.width - (borderWidth)
height: parent.height - (borderWidth)
// anchors.fill: parent
opacity: isToday(new Date(yearNumber, monthNumber - 1, dayNumber)) ? 0.8 : 0
Behavior on opacity { NumberAnimation {} }
color: theme.highlightColor
//border.color: isToday(dayNumber+"/"+monthNumber+"/"+yearNumber) ? theme.highlightColor : "transparent"
}
Rectangle {
@ -63,29 +54,13 @@ Item {
Behavior on opacity { NumberAnimation {} }
color: theme.viewBackgroundColor
z: todayRect.z - 1
//border.color: isToday(dayNumber+"/"+monthNumber+"/"+yearNumber) ? theme.highlightColor : "transparent"
}
// Rectangle {
// id: frameTop
// height: borderWidth
// color: theme.textColor
// opacity: borderOpacity
// visible: showtop
//
// anchors {
// top: parent.top
// left: parent.left
// right: parent.right
// }
// }
Rectangle {
id: frameRight
width: borderWidth
color: theme.textColor
opacity: borderOpacity
visible: showright
anchors {
top: parent.top
@ -99,7 +74,6 @@ Item {
height: borderWidth
color: theme.textColor
opacity: borderOpacity
visible: showbottom
anchors {
bottom: parent.bottom
@ -108,27 +82,11 @@ Item {
}
}
// Rectangle {
// id: frameLeft
// width: borderWidth
// color: theme.textColor
// opacity: borderOpacity
// visible: showleft
//
// anchors {
// top: parent.top
// left: parent.left
// bottom: parent.bottom
// }
// }
Components.Label {
id: label
anchors.centerIn: parent
//anchors.topMargin: 10
font.pixelSize: Math.max(theme.defaultFont.pixelSize, cellHeight / 3)
text: dayNumber
//z: 99
//font.bold: (containsEventItems)||(containsTodoItems) ? true: false
opacity: (isPreviousMonth || isNextMonth) ? 0.5: 1.0
}
@ -141,11 +99,9 @@ Item {
//z: label.z + 1
hoverEnabled: true
onClicked: {
print("Click");
print("date change:" + dayNumber + monthNumber)
var rowNumber = Math.floor ( index / 7) ;
week = 1+monthCalendar.weeksModel[rowNumber];
//date = dayNumber + "/" + monthNumber + "/" + yearNumber
root.date = model
calendarDays.selectedItem = dayStyle
}

View File

@ -21,7 +21,9 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as Components
import org.kde.plasma.extras 2.0 as PlasmaExtras
Item {
property real borderOpacity: root.borderOpacity
id: daysCalendar
property real borderOpacity: 1.0
Rectangle {
id: frameTop
@ -102,8 +104,6 @@ Item {
Components.Label {
text: Qt.locale().dayName(monthCalendar.firstDayOfWeek + index, Locale.ShortFormat)
font.pixelSize: Math.max(theme.smallestFont.pixelSize, root.cellHeight / 6)
//font: theme.smallestFont
opacity: 0.2
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
anchors.horizontalCenter: parent.horizontalCenter
@ -117,7 +117,9 @@ Item {
id: repeater
model: monthCalendar.daysModel
DayDelegate {}
DayDelegate {
borderOpacity: daysCalendar.borderOpacity
}
}
}
}

View File

@ -29,7 +29,7 @@ Item {
property QtObject date
property date showDate: new Date()
property real borderOpacity: 0.2
property real borderOpacity: 0.4
property alias calendar: monthCalendar
@ -112,15 +112,18 @@ Item {
DaysCalendar {
id: calendarGrid
anchors {
fill: parent
leftMargin: borderWidth
}
borderOpacity: root.borderOpacity
PlasmaComponents.Label {
text: "◀"
//x: spacing / 2
opacity: leftmouse.containsMouse ? 0.5 : 0.2
opacity: leftmouse.containsMouse ? 1 : 0.4
Behavior on opacity { NumberAnimation {} }
anchors {
top: parent.top
@ -139,7 +142,7 @@ Item {
}
PlasmaComponents.Label {
text: "▶"
opacity: rightmouse.containsMouse ? 0.5 : 0.2
opacity: rightmouse.containsMouse ? 1 : 0.4
Behavior on opacity { NumberAnimation {} }
anchors {
top: parent.top