From 84b6e6a245f8c57bb9dde9e4c8875a37cb71df7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Sat, 28 Dec 2013 01:05:09 +0100 Subject: [PATCH] Adjustments for theme.textColor textColor is now used from the theme, there it is made grey, similar effect, less code, more consistency. --- .../calendar/qml/DayDelegate.qml | 46 +------------------ .../calendar/qml/DaysCalendar.qml | 10 ++-- .../calendar/qml/MonthView.qml | 9 ++-- 3 files changed, 13 insertions(+), 52 deletions(-) diff --git a/src/declarativeimports/calendar/qml/DayDelegate.qml b/src/declarativeimports/calendar/qml/DayDelegate.qml index 00572a3cf..b75b31721 100644 --- a/src/declarativeimports/calendar/qml/DayDelegate.qml +++ b/src/declarativeimports/calendar/qml/DayDelegate.qml @@ -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 } diff --git a/src/declarativeimports/calendar/qml/DaysCalendar.qml b/src/declarativeimports/calendar/qml/DaysCalendar.qml index 478f08a6f..b355cb119 100644 --- a/src/declarativeimports/calendar/qml/DaysCalendar.qml +++ b/src/declarativeimports/calendar/qml/DaysCalendar.qml @@ -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 + } } } } \ No newline at end of file diff --git a/src/declarativeimports/calendar/qml/MonthView.qml b/src/declarativeimports/calendar/qml/MonthView.qml index 832996795..9f3df1747 100644 --- a/src/declarativeimports/calendar/qml/MonthView.qml +++ b/src/declarativeimports/calendar/qml/MonthView.qml @@ -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