#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 );
}
// draw meetings
- QBrush brush( ScheduleWidget::sBusyBackground );
- painter.setBrush( brush );
painter.setRenderHint( QPainter::Antialiasing );
painter.setPen( ScheduleWidget::sFrameColor );
populateMeetingList();
{
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 );
}
}
ScheduleWidget::~ScheduleWidget()
{
- delete iScheduleTable;
+ if ( iScheduleTable )
+ {
+ delete iScheduleTable;
+ iScheduleTable = 0;
+ }
}
QDate ScheduleWidget::beginningOfShownWeek()