summaryrefslogtreecommitdiff
path: root/library/datebookmonth.cpp
Side-by-side diff
Diffstat (limited to 'library/datebookmonth.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/datebookmonth.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp
index 2616b7b..ffdf335 100644
--- a/library/datebookmonth.cpp
+++ b/library/datebookmonth.cpp
@@ -616,97 +616,104 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg,
s_colorNormalLight );
p->fillRect( 0, cr.height() / 2, cr.width(), cr.height() / 2,
colorRepeatLight );
} else {
if (!holidayAllDay) {
p->fillRect( 0, 0, cr.width(), cr.height(),
s_colorNormalLight );
} else {
p->fillRect( 0, 0, cr.width(), cr.height(),
s_colorHolidayLight );
}
} else if (repeatAllDay) {
p->fillRect( 0, 0, cr.width(), cr.height(),
s_colorRepeatLight );
}
} else {
p->fillRect( 0, 0, cr.width(),
cr.height(), selected
? g.brush( QColorGroup::Highlight )
: g.brush( QColorGroup::Base ) );
}
// The lines
// now for the lines.
int h = 5;
int y = cr.height() / 2 - h;
while(normalLine.count() >= 2) {
int x2 = normalLine.pop();
int x1 = normalLine.pop();
if (x2 < x1 + 2)
x2 = x1 + 2;
p->fillRect(x1, y, x2 - x1, h, colorNormal);
}
y += h;
while(repeatLine.count() >= 2) {
int x2 = repeatLine.pop();
int x1 = repeatLine.pop();
if (x2 < x1 + 2)
x2 = x1 + 2;
p->fillRect(x1, y, x2 - x1, h, colorRepeat);
}
// Finally, draw the number.
QFont f = p->font();
- f.setPointSize( ( f.pointSize() / 3 ) * 2 );
+ if(qApp->desktop()->width() >= 480)
+ {
+ f.setPointSize( f.pointSize() - 2 );
+ }
+ else
+ {
+ f.setPointSize( ( f.pointSize() / 3 ) * 2 );
+ }
p->setFont( f );
QFontMetrics fm( f );
p->drawText( 1, 1 + fm.ascent(), QString::number( day() ) );
p->restore();
}
void DayItemMonth::setType( Calendar::Day::Type t )
{
switch ( t ) {
case Calendar::Day::PrevMonth:
case Calendar::Day::NextMonth:
back = QBrush( QColor( 224, 224, 224 ) );
forg = black;
break;
case Calendar::Day::ThisMonth:
back = QBrush( white );
forg = black;
break;
}
typ = t;
}
DateButton::DateButton( bool longDate, QWidget *parent, const char * name )
:QPushButton( parent, name )
{
longFormat = longDate;
df = DateFormat('/', DateFormat::MonthDayYear, DateFormat::MonthDayYear);
setDate( QDate::currentDate() );
connect(this,SIGNAL(pressed()),this,SLOT(pickDate()));
}
void DateButton::pickDate()
{
static QPopupMenu *m1 = 0;
static DateBookMonth *picker = 0;
if ( !m1 ) {
m1 = new QPopupMenu( this );
picker = new DateBookMonth( m1, 0, TRUE );
m1->insertItem( picker );