User interface update
[qtmeetings] / src / UserInterface / Components / ScheduleWidget.cpp
index 0d68da6..65ca353 100644 (file)
@@ -9,11 +9,12 @@
 #include <QPainter>
 #include "Meeting.h"
 
-const QColor ScheduleWidget::sFreeBackground = QColor( 192, 238, 189 );
+const QColor ScheduleWidget::sFreeBackground = QColor( Qt::white );
 const QColor ScheduleWidget::sBusyBackground = QColor( 238, 147, 17 );
+const QColor ScheduleWidget::sBusyBackgroundStart = QColor( 254, 193, 104 );
 const QColor ScheduleWidget::sHeaderBackground = QColor( Qt::white );
 const QColor ScheduleWidget::sDayHighlightColor = QColor( 255, 235, 160 );
-const QColor ScheduleWidget::sTimeHighlightColor = QColor( Qt::blue );
+const QColor ScheduleWidget::sTimeHighlightColor = QColor( Qt::black );
 const QColor ScheduleWidget::sMainGridColor = QColor( 140, 140, 140 );
 const QColor ScheduleWidget::sHalfGridColor = QColor( 195, 195, 195 );
 const QColor ScheduleWidget::sFrameColor = QColor( Qt::black );
@@ -94,8 +95,6 @@ void ScheduleTableWidget::paintEvent( QPaintEvent* aEvent )
        }
 
        // draw meetings
-       QBrush brush( ScheduleWidget::sBusyBackground );
-       painter.setBrush( brush );
        painter.setRenderHint( QPainter::Antialiasing );
        painter.setPen( ScheduleWidget::sFrameColor );
        populateMeetingList();
@@ -104,6 +103,11 @@ void ScheduleTableWidget::paintEvent( QPaintEvent* aEvent )
        {
                for ( int i = 0; i < iMeetingsByDay[day].size(); ++i )
                {
+                       QLinearGradient linearGrad( QPoint(iMeetingsByDay[day][i].rect.x(),iMeetingsByDay[day][i].rect.y()) , QPoint(iMeetingsByDay[day][i].rect.x(),iMeetingsByDay[day][i].rect.bottom()) );
+                       linearGrad.setColorAt(0, ScheduleWidget::sBusyBackgroundStart);
+                       linearGrad.setColorAt(1, ScheduleWidget::sBusyBackground);
+                       painter.setBrush(linearGrad);
+
                        painter.drawRoundRect( iMeetingsByDay[day][i].rect, 20, 20 );
                }
        }
@@ -346,7 +350,11 @@ ScheduleWidget::ScheduleWidget( QDateTime aCurrentDateTime, DisplaySettings *aSe
 
 ScheduleWidget::~ScheduleWidget()
 {
-       delete iScheduleTable;
+       if ( iScheduleTable )
+       {
+               delete iScheduleTable;
+               iScheduleTable = 0;
+       }
 }
 
 QDate ScheduleWidget::beginningOfShownWeek()