-rw-r--r-- | korganizer/komonthview.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 6d6ae8a..e66ddce 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1650,21 +1650,31 @@ void KOMonthView::computeLayoutWeek() | |||
1650 | y += hei/(5-daysToShow); | 1650 | y += hei/(5-daysToShow); |
1651 | x = 0; | 1651 | x = 0; |
1652 | w = colWid; | 1652 | w = colWid; |
1653 | } | 1653 | } |
1654 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { | 1654 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { |
1655 | ++w; | 1655 | ++w; |
1656 | } | 1656 | } |
1657 | if ( i >= 5 ) { | 1657 | if ( i >= 5 ) { |
1658 | mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,w/2+w%2,h); | 1658 | int wi = width() - x - weeklabelwid; |
1659 | x -= (w/2 ); | 1659 | if ( i == 5 ) { |
1660 | mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi/2+wi%2,h); | ||
1661 | } else { | ||
1662 | mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi,h); | ||
1663 | } | ||
1664 | x = x - w + wi - (wi/2 ); | ||
1665 | } | ||
1666 | else { | ||
1667 | int wi = w; | ||
1668 | if ( !(( i+1) % daysToShow)) { | ||
1669 | wi = width() - x - weeklabelwid; | ||
1670 | } | ||
1671 | mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,wi,h); | ||
1660 | } | 1672 | } |
1661 | else | ||
1662 | mDayLabelsW[i]->setGeometry( x+weeklabelwid,y,w,h); | ||
1663 | x += w; | 1673 | x += w; |
1664 | } | 1674 | } |
1665 | x= 0; | 1675 | x= 0; |
1666 | y= dayLabelHei; | 1676 | y= dayLabelHei; |
1667 | w = colWid; | 1677 | w = colWid; |
1668 | h = cellHei; | 1678 | h = cellHei; |
1669 | int max = 0; | 1679 | int max = 0; |
1670 | for ( i = 0; i < mCellsW.count(); ++i) { | 1680 | for ( i = 0; i < mCellsW.count(); ++i) { |
@@ -1771,16 +1781,20 @@ void KOMonthView::computeLayout() | |||
1771 | y= 0; | 1781 | y= 0; |
1772 | w = colWid; | 1782 | w = colWid; |
1773 | h = dayLabelHei ; | 1783 | h = dayLabelHei ; |
1774 | for ( i = 0; i < 7; i++) { | 1784 | for ( i = 0; i < 7; i++) { |
1775 | if ( i == daysToShow-colModulo ) | 1785 | if ( i == daysToShow-colModulo ) |
1776 | ++w; | 1786 | ++w; |
1777 | if ( combinedSatSun ) { | 1787 | if ( combinedSatSun ) { |
1778 | if ( i >= daysToShow-1 ) { | 1788 | if ( i >= daysToShow-1 ) { |
1789 | |||
1790 | if ( i == 6 ) | ||
1791 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,width()-x-weeklabelwid,h); | ||
1792 | else | ||
1779 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); | 1793 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); |
1780 | x -= w/2 ; | 1794 | x -= w/2 ; |
1781 | } | 1795 | } |
1782 | else | 1796 | else |
1783 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); | 1797 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); |
1784 | } else | 1798 | } else |
1785 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); | 1799 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); |
1786 | x += w; | 1800 | x += w; |
@@ -1796,20 +1810,22 @@ void KOMonthView::computeLayout() | |||
1796 | if ( ((i) % 7) >= 7-colModulo ) { | 1810 | if ( ((i) % 7) >= 7-colModulo ) { |
1797 | ++w; | 1811 | ++w; |
1798 | } | 1812 | } |
1799 | if ( i == (6-rowModulo)*7) | 1813 | if ( i == (6-rowModulo)*7) |
1800 | ++h; | 1814 | ++h; |
1801 | if ( combinedSatSun ) { | 1815 | if ( combinedSatSun ) { |
1802 | if ( (i)%7 >= daysToShow-1 ) { | 1816 | if ( (i)%7 >= daysToShow-1 ) { |
1803 | if ( (i)%7 == daysToShow-1 ) { | 1817 | if ( (i)%7 == daysToShow-1 ) { |
1818 | w = width()-x-weeklabelwid; | ||
1804 | max = h/2; | 1819 | max = h/2; |
1805 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); | 1820 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); |
1806 | x -= w ;y += h/2; | 1821 | x -= w ;y += h/2; |
1807 | } else { | 1822 | } else { |
1823 | w = width()-x-weeklabelwid; | ||
1808 | max = h-h/2; | 1824 | max = h-h/2; |
1809 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); | 1825 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,max ); |
1810 | y -= h/2; | 1826 | y -= h/2; |
1811 | } | 1827 | } |
1812 | } else { | 1828 | } else { |
1813 | max = h; | 1829 | max = h; |
1814 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1830 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1815 | } | 1831 | } |