summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-22 09:31:41 (UTC)
committer zautrix <zautrix>2005-03-22 09:31:41 (UTC)
commitd18536f758f4cf64d5c59d7a7c814e6ff12f9a3d (patch) (unidiff)
tree326186e1a65db5a9ba174fa2bdbd3dffc7f23b9f /korganizer
parent8888389a4511e0bda23774b993dcfdeb7f837c31 (diff)
downloadkdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.zip
kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.tar.gz
kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.tar.bz2
layout fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--korganizer/datenavigatorcontainer.cpp13
-rw-r--r--korganizer/kdatenavigator.cpp11
-rw-r--r--korganizer/kdatenavigator.h6
-rw-r--r--korganizer/kodaymatrix.cpp7
-rw-r--r--korganizer/komonthview.cpp2
-rw-r--r--korganizer/navigatorbar.cpp4
-rw-r--r--korganizer/navigatorbar.h2
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
@@ -314,6 +314,7 @@ void CalendarView::init()
314 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 314 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
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 );
319 //mainBoxLayout->addWidget (mLeftFrame); 320 //mainBoxLayout->addWidget (mLeftFrame);
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index b147427..ab0dd50 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -45,6 +45,7 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
45 mNavigatorView = new KDateNavigator( this, name ); 45 mNavigatorView = new KDateNavigator( this, name );
46 46
47 connectNavigatorView( mNavigatorView ); 47 connectNavigatorView( mNavigatorView );
48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
48} 49}
49 50
50DateNavigatorContainer::~DateNavigatorContainer() 51DateNavigatorContainer::~DateNavigatorContainer()
@@ -175,17 +176,24 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
175 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); 176 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
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 ||
180 verticalCount != mVerticalCount ) { 183 verticalCount != mVerticalCount ) {
181 uint count = horizontalCount * verticalCount; 184 uint count = horizontalCount * verticalCount;
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();
191 if ( horizontalCount == 0 ) 199 if ( horizontalCount == 0 )
@@ -231,6 +239,7 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
231 mHorizontalCount = horizontalCount; 239 mHorizontalCount = horizontalCount;
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;
236 245
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index fe83e09..231095f 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -116,6 +116,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
116 updateConfig(); 116 updateConfig();
117 enableRollover(FollowMonth); 117 enableRollover(FollowMonth);
118 mySizeHint = sizeHintTwoButtons(); 118 mySizeHint = sizeHintTwoButtons();
119 myFullSizeHint = sizeHintTwoButtons( 4 );
119 mFontChanged = false; 120 mFontChanged = false;
120} 121}
121void KDateNavigator::changeFont ( QFont fo ) 122void KDateNavigator::changeFont ( QFont fo )
@@ -134,9 +135,13 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b)
134 setFont( fo ); 135 setFont( fo );
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 ");
142 break; 147 break;
@@ -157,11 +162,11 @@ QSize KDateNavigator::sizeHint() const
157 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 162 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
158 return QSize ( wid, hei ); 163 return QSize ( wid, hei );
159} 164}
160QSize KDateNavigator::sizeHintTwoButtons() const 165QSize 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;
167 if ( wid < nav.width() ) 172 if ( wid < nav.width() )
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 77b9b7c..10bc1be 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -64,13 +64,14 @@ class KDateNavigator: public QFrame
64 KCal::DateList selectedDates() const { return mSelectedDates; } 64 KCal::DateList selectedDates() const { return mSelectedDates; }
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; }
70 void unsetFontChanged() { mFontChanged = false; } 71 void unsetFontChanged() { mFontChanged = false; }
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:
76 void selectDates( const KCal::DateList & ); 77 void selectDates( const KCal::DateList & );
@@ -123,6 +124,7 @@ class KDateNavigator: public QFrame
123 124
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;
128 NavigatorBar *mNavigatorBar; 130 NavigatorBar *mNavigatorBar;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 120bc89..a2e0ae0 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -414,7 +414,8 @@ void KODayMatrix::updateView(QDate actdate)
414 } else { 414 } else {
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 );
420 mUpdateTimer->start( 1200 ); 421 mUpdateTimer->start( 1200 );
@@ -843,8 +844,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
843 if ( col >= 7 - colModulo ) 844 if ( col >= 7 - colModulo )
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);
850 } 851 }
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 76982b4..9fd1f68 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -305,7 +305,7 @@ void MonthViewItem::paint(QPainter *p)
305 p->drawText( x, yPos, text() ); 305 p->drawText( x, yPos, text() );
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
311} 311}
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 1b4ee52..06f5ef8 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -175,9 +175,9 @@ QSize NavigatorBar::sizeHint() const
175 //qDebug("ret %d %d ", wid, mCurrentHei); 175 //qDebug("ret %d %d ", wid, mCurrentHei);
176 return QSize ( wid, mCurrentHei ); 176 return QSize ( wid, mCurrentHei );
177} 177}
178QSize NavigatorBar::sizeHintTwoButtons() const 178QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const
179{ 179{
180 return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei ); 180 return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei );
181} 181}
182void NavigatorBar::resetFont ( QFont fo ) 182void NavigatorBar::resetFont ( QFont fo )
183{ 183{
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index bf6d173..9ccef14 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -41,7 +41,7 @@ class NavigatorBar: public QWidget
41 void showButtons( bool left, bool right ); 41 void showButtons( bool left, bool right );
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:
47 void selectDates( const KCal::DateList & ); 47 void selectDates( const KCal::DateList & );