author | zautrix <zautrix> | 2005-03-22 09:31:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 09:31:41 (UTC) |
commit | d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d (patch) (unidiff) | |
tree | 326186e1a65db5a9ba174fa2bdbd3dffc7f23b9f | |
parent | 8888389a4511e0bda23774b993dcfdeb7f837c31 (diff) | |
download | kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.zip kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.tar.gz kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 13 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 11 | ||||
-rw-r--r-- | korganizer/kdatenavigator.h | 6 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 7 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 2 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 4 | ||||
-rw-r--r-- | korganizer/navigatorbar.h | 2 |
8 files changed, 32 insertions, 14 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 90b36ac..8100e25 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -315,4 +315,5 @@ void CalendarView::init() | |||
315 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 315 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
316 | } | 316 | } |
317 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | ||
317 | //QBoxLayout * leftFrameLayout; | 318 | //QBoxLayout * leftFrameLayout; |
318 | topLayout->addWidget( mMainFrame ); | 319 | topLayout->addWidget( mMainFrame ); |
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index b147427..ab0dd50 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -46,4 +46,5 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, | |||
46 | 46 | ||
47 | connectNavigatorView( mNavigatorView ); | 47 | connectNavigatorView( mNavigatorView ); |
48 | //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | ||
48 | } | 49 | } |
49 | 50 | ||
@@ -176,4 +177,6 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | |||
176 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); | 177 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); |
177 | bool fontchange = false; | 178 | bool fontchange = false; |
179 | if ( horizontalCount == 1) | ||
180 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); | ||
178 | QFont fo; | 181 | QFont fo; |
179 | if ( horizontalCount != mHorizontalCount || | 182 | if ( horizontalCount != mHorizontalCount || |
@@ -182,9 +185,14 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | |||
182 | if ( count == 0 ) { | 185 | if ( count == 0 ) { |
183 | bool ok; | 186 | bool ok; |
184 | fo = mNavigatorView->yourFontHint( size() , &ok); | 187 | fo = mNavigatorView->yourFontHint( size() , &ok ); |
185 | //mNavigatorView->resize( size() ); | 188 | //mNavigatorView->resize( size() ); |
186 | //if ( ! ok ) | 189 | //if ( ! ok ) |
187 | // return; | 190 | // return; |
188 | minSize = mNavigatorView->sizeHintTwoButtons(); | 191 | int butt = 2; |
192 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); | ||
193 | if ( horizontalCount <= 1 ) | ||
194 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); | ||
195 | else | ||
196 | minSize = mNavigatorView->sizeHintTwoButtons(); | ||
189 | verticalCount = size().height() / minSize.height(); | 197 | verticalCount = size().height() / minSize.height(); |
190 | horizontalCount = size().width() / minSize.width(); | 198 | horizontalCount = size().width() / minSize.width(); |
@@ -232,4 +240,5 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | |||
232 | mVerticalCount = verticalCount; | 240 | mVerticalCount = verticalCount; |
233 | } | 241 | } |
242 | //qDebug("COUNT %d ", mExtraViews.count()); | ||
234 | int height = size().height() / verticalCount; | 243 | int height = size().height() / verticalCount; |
235 | int width = size().width() / horizontalCount; | 244 | int width = size().width() / horizontalCount; |
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index fe83e09..231095f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -117,4 +117,5 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
117 | enableRollover(FollowMonth); | 117 | enableRollover(FollowMonth); |
118 | mySizeHint = sizeHintTwoButtons(); | 118 | mySizeHint = sizeHintTwoButtons(); |
119 | myFullSizeHint = sizeHintTwoButtons( 4 ); | ||
119 | mFontChanged = false; | 120 | mFontChanged = false; |
120 | } | 121 | } |
@@ -135,7 +136,11 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b) | |||
135 | mFontChanged = true; | 136 | mFontChanged = true; |
136 | mNavigatorBar->resetFont( fo ); | 137 | mNavigatorBar->resetFont( fo ); |
137 | QSize sh = sizeHintTwoButtons(); | 138 | QSize sh = sizeHintTwoButtons( 2 ); |
138 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); | 139 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); |
139 | if ( si.width() > sh.width() && si.height() > sh.height()) { | 140 | if ( si.width() > sh.width() && si.height() > sh.height()) { |
141 | if ( si.width() / sh.width() == 1 ) { | ||
142 | if ( si.width() < sizeHintTwoButtons( 4 ).width()) | ||
143 | continue; | ||
144 | } | ||
140 | *b = true; | 145 | *b = true; |
141 | //qDebug("fooooooooooooooooooooooouuuuund "); | 146 | //qDebug("fooooooooooooooooooooooouuuuund "); |
@@ -158,9 +163,9 @@ QSize KDateNavigator::sizeHint() const | |||
158 | return QSize ( wid, hei ); | 163 | return QSize ( wid, hei ); |
159 | } | 164 | } |
160 | QSize KDateNavigator::sizeHintTwoButtons() const | 165 | QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const |
161 | { | 166 | { |
162 | QFontMetrics fm ( font() ); | 167 | QFontMetrics fm ( font() ); |
163 | QSize day = daymatrix->sizeHint(); | 168 | QSize day = daymatrix->sizeHint(); |
164 | QSize nav = mNavigatorBar->sizeHintTwoButtons(); | 169 | QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum ); |
165 | int wid = fm.width( "30") + day.width()+3; | 170 | int wid = fm.width( "30") + day.width()+3; |
166 | int hei = fm.height() +day.height()+nav.height()+2; | 171 | int hei = fm.height() +day.height()+nav.height()+2; |
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 77b9b7c..10bc1be 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h | |||
@@ -65,5 +65,6 @@ class KDateNavigator: public QFrame | |||
65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } | 65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } |
66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;} | 66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;} |
67 | QSize yourSizeHint() { return mySizeHint; } | 67 | QSize yourSizeHint()const { return mySizeHint; }; |
68 | QSize yourFullSizeHint() const { return myFullSizeHint;}; | ||
68 | QFont yourFontHint( QSize , bool * b); | 69 | QFont yourFontHint( QSize , bool * b); |
69 | bool fontChanged() {return mFontChanged; } | 70 | bool fontChanged() {return mFontChanged; } |
@@ -71,5 +72,5 @@ class KDateNavigator: public QFrame | |||
71 | KODayMatrix *dayMatrix() { return daymatrix ;} | 72 | KODayMatrix *dayMatrix() { return daymatrix ;} |
72 | QSize sizeHint() const; | 73 | QSize sizeHint() const; |
73 | QSize sizeHintTwoButtons() const; | 74 | QSize sizeHintTwoButtons( int butnum = 2 ) const; |
74 | void changeFont ( QFont fo ); | 75 | void changeFont ( QFont fo ); |
75 | public slots: | 76 | public slots: |
@@ -124,4 +125,5 @@ class KDateNavigator: public QFrame | |||
124 | private: | 125 | private: |
125 | QSize mySizeHint; | 126 | QSize mySizeHint; |
127 | QSize myFullSizeHint; | ||
126 | bool mFontChanged; | 128 | bool mFontChanged; |
127 | int mMonthSignalOffset; | 129 | int mMonthSignalOffset; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 120bc89..a2e0ae0 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -415,5 +415,6 @@ void KODayMatrix::updateView(QDate actdate) | |||
415 | #ifdef DESKTOP_VERSION | 415 | #ifdef DESKTOP_VERSION |
416 | //mRepaintTimer->start( 100 ); | 416 | //mRepaintTimer->start( 100 ); |
417 | mUpdateTimer->start( 100 ); | 417 | //updateViewTimed(); |
418 | mUpdateTimer->start( 20 ); | ||
418 | #else | 419 | #else |
419 | mRepaintTimer->start( 350 ); | 420 | mRepaintTimer->start( 350 ); |
@@ -844,6 +845,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
844 | addCol = col - 6 + colModulo-1; | 845 | addCol = col - 6 + colModulo-1; |
845 | } | 846 | } |
846 | if ( col == 0 ) | 847 | |
847 | addCol = 1; | 848 | addCol += 1; |
848 | p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1); | 849 | p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1); |
849 | p.setPen(tmppen); | 850 | p.setPen(tmppen); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 76982b4..9fd1f68 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -306,5 +306,5 @@ void MonthViewItem::paint(QPainter *p) | |||
306 | if ( mIncidence->cancelled() ) { | 306 | if ( mIncidence->cancelled() ) { |
307 | int wid = fm.width( text() ); | 307 | int wid = fm.width( text() ); |
308 | p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); | 308 | p->drawLine( x, heihei/2-1 ,x+wid, heihei/2-1 ); |
309 | } | 309 | } |
310 | 310 | ||
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 1b4ee52..06f5ef8 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -176,7 +176,7 @@ QSize NavigatorBar::sizeHint() const | |||
176 | return QSize ( wid, mCurrentHei ); | 176 | return QSize ( wid, mCurrentHei ); |
177 | } | 177 | } |
178 | QSize NavigatorBar::sizeHintTwoButtons() const | 178 | QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const |
179 | { | 179 | { |
180 | return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei ); | 180 | return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); |
181 | } | 181 | } |
182 | void NavigatorBar::resetFont ( QFont fo ) | 182 | void NavigatorBar::resetFont ( QFont fo ) |
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index bf6d173..9ccef14 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h | |||
@@ -42,5 +42,5 @@ class NavigatorBar: public QWidget | |||
42 | void resetFont ( QFont fo ); | 42 | void resetFont ( QFont fo ); |
43 | QSize sizeHint() const; | 43 | QSize sizeHint() const; |
44 | QSize sizeHintTwoButtons() const; | 44 | QSize sizeHintTwoButtons( int butNum = 2 ) const; |
45 | 45 | ||
46 | public slots: | 46 | public slots: |