author | zautrix <zautrix> | 2005-03-25 13:47:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 13:47:53 (UTC) |
commit | 5a0130ffdbf03fa5b881f856b41d081e91e1958b (patch) (unidiff) | |
tree | c71ac939789927dd9c77f2c6e88b910008db7f9b /korganizer | |
parent | e3b935f4e24086117213662e670ab26cb2ad8822 (diff) | |
download | kdepimpi-5a0130ffdbf03fa5b881f856b41d081e91e1958b.zip kdepimpi-5a0130ffdbf03fa5b881f856b41d081e91e1958b.tar.gz kdepimpi-5a0130ffdbf03fa5b881f856b41d081e91e1958b.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/komonthview.cpp | 72 | ||||
-rw-r--r-- | korganizer/komonthview.h | 1 |
2 files changed, 46 insertions, 27 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 38cfda7..12233ee 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -756,14 +756,3 @@ void MonthViewCell::finishUpdateCell() | |||
756 | setMyPalette(); | 756 | setMyPalette(); |
757 | QString text; | 757 | |
758 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | ||
759 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { | ||
760 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; | ||
761 | mLabel->resize( mLabelBigSize ); | ||
762 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | ||
763 | } else { | ||
764 | mLabel->resize( mLabelSize ); | ||
765 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | ||
766 | } | ||
767 | |||
768 | mLabel->setText( text ); | ||
769 | resizeEvent( 0 ); | 758 | resizeEvent( 0 ); |
@@ -897,2 +886,17 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) | |||
897 | deselect(); | 886 | deselect(); |
887 | mLabel->setMaximumHeight( height() - lineWidth()*2 ); | ||
888 | |||
889 | QString text; | ||
890 | mLabel->setText( text ); | ||
891 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | ||
892 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { | ||
893 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; | ||
894 | mLabel->resize( mLabelBigSize ); | ||
895 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | ||
896 | } else { | ||
897 | mLabel->resize( mLabelSize ); | ||
898 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | ||
899 | } | ||
900 | mLabel->setText( text ); | ||
901 | |||
898 | int size = height() - mLabel->height() - lineWidth()-1; | 902 | int size = height() - mLabel->height() - lineWidth()-1; |
@@ -1450,3 +1454,3 @@ void KOMonthView::updateView() | |||
1450 | processSelectionChange(); | 1454 | processSelectionChange(); |
1451 | qApp->processEvents(); | 1455 | //qApp->processEvents(); |
1452 | for( i = 0; i < timeSpan+1; ++i ) { | 1456 | for( i = 0; i < timeSpan+1; ++i ) { |
@@ -1476,5 +1480,5 @@ void KOMonthView::resizeEvent(QResizeEvent * e) | |||
1476 | { | 1480 | { |
1477 | qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); | 1481 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); |
1478 | if ( isVisible() ) { | 1482 | if ( isVisible() ) { |
1479 | qDebug("KOMonthView::isVisible "); | 1483 | //qDebug("KOMonthView::isVisible "); |
1480 | slotComputeLayout(); | 1484 | slotComputeLayout(); |
@@ -1487,3 +1491,3 @@ void KOMonthView::slotComputeLayout() | |||
1487 | mComputeLayoutTimer->stop(); | 1491 | mComputeLayoutTimer->stop(); |
1488 | qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); | 1492 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); |
1489 | computeLayout(); | 1493 | computeLayout(); |
@@ -1516,3 +1520,3 @@ void KOMonthView::computeLayoutWeek() | |||
1516 | if ( lastWid == width() && lastHei == height() ) { | 1520 | if ( lastWid == width() && lastHei == height() ) { |
1517 | qDebug("KOListWeekView::No compute layout needed "); | 1521 | //qDebug("KOListWeekView::No compute layout needed "); |
1518 | return; | 1522 | return; |
@@ -1569,2 +1573,3 @@ void KOMonthView::computeLayoutWeek() | |||
1569 | h = cellHei; | 1573 | h = cellHei; |
1574 | int max = 0; | ||
1570 | for ( i = 0; i < mCellsW.count(); ++i) { | 1575 | for ( i = 0; i < mCellsW.count(); ++i) { |
@@ -1584,3 +1589,4 @@ void KOMonthView::computeLayoutWeek() | |||
1584 | if ( i ==5 ) { | 1589 | if ( i ==5 ) { |
1585 | mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); | 1590 | max = h/2; |
1591 | mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,max ); | ||
1586 | x -= w ;y += h/2; | 1592 | x -= w ;y += h/2; |
@@ -1590,7 +1596,10 @@ void KOMonthView::computeLayoutWeek() | |||
1590 | } | 1596 | } |
1591 | mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); | 1597 | max = h-h/2; |
1598 | mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,max ); | ||
1592 | y -= h/2; | 1599 | y -= h/2; |
1593 | } | 1600 | } |
1594 | } else | 1601 | } else { |
1602 | max = h; | ||
1595 | mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1603 | mCellsW[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1604 | } | ||
1596 | 1605 | ||
@@ -1602,2 +1611,3 @@ void KOMonthView::computeLayoutWeek() | |||
1602 | } | 1611 | } |
1612 | //mCellsW[i]->dateLabel()->setMaximumHeight( max - mCellsW[i]->lineWidth()*2 ); | ||
1603 | } | 1613 | } |
@@ -1644,3 +1654,3 @@ void KOMonthView::computeLayout() | |||
1644 | if ( lastWid == width() && lastHei == height() ){ | 1654 | if ( lastWid == width() && lastHei == height() ){ |
1645 | qDebug("KOMonthview::No compute layout needed "); | 1655 | //qDebug("KOMonthview::No compute layout needed "); |
1646 | return; | 1656 | return; |
@@ -1650,3 +1660,3 @@ void KOMonthView::computeLayout() | |||
1650 | lastHei = height(); | 1660 | lastHei = height(); |
1651 | qDebug("KOMonthView::computeLayout() MMM ------------------- "); | 1661 | //qDebug("KOMonthView::computeLayout() MMM ------------------- "); |
1652 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1662 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
@@ -1686,2 +1696,3 @@ void KOMonthView::computeLayout() | |||
1686 | h = cellHei ; | 1696 | h = cellHei ; |
1697 | int max = 0; | ||
1687 | for ( i = 0; i < mCells.count(); ++i) { | 1698 | for ( i = 0; i < mCells.count(); ++i) { |
@@ -1697,14 +1708,20 @@ void KOMonthView::computeLayout() | |||
1697 | if ( (i)%7 == daysToShow-1 ) { | 1708 | if ( (i)%7 == daysToShow-1 ) { |
1698 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); | 1709 | max = h/2; |
1710 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); | ||
1699 | x -= w ;y += h/2; | 1711 | x -= w ;y += h/2; |
1700 | } else { | 1712 | } else { |
1701 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); | 1713 | max = h-h/2; |
1714 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); | ||
1702 | y -= h/2; | 1715 | y -= h/2; |
1703 | } | 1716 | } |
1704 | } else | 1717 | } else { |
1718 | max = h; | ||
1705 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1719 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1720 | } | ||
1706 | 1721 | ||
1707 | } | 1722 | } |
1708 | else | 1723 | else { |
1724 | max = h; | ||
1709 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1725 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1726 | } | ||
1710 | x += w; | 1727 | x += w; |
@@ -1713,3 +1730,4 @@ void KOMonthView::computeLayout() | |||
1713 | y += h; | 1730 | y += h; |
1714 | } | 1731 | } |
1732 | //mCells[i]->dateLabel()->setMaximumHeight( max- mCells[i]->lineWidth()*2 ); | ||
1715 | } | 1733 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index b997c1a..a58f6b8 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -161,2 +161,3 @@ class MonthViewCell : public KNoScrollListBox | |||
161 | QDate selectedIncidenceDate(); | 161 | QDate selectedIncidenceDate(); |
162 | QPushButton * dateLabel() { return mLabel; } | ||
162 | 163 | ||