summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp4
-rw-r--r--korganizer/kdatenavigator.cpp14
-rw-r--r--korganizer/kdatenavigator.h1
-rw-r--r--korganizer/navigatorbar.cpp11
-rw-r--r--korganizer/navigatorbar.h1
5 files changed, 24 insertions, 7 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 3358ecf..5cdaa83 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -155,17 +155,17 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
{
#if 0
kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl;
kdDebug(5850) << " CURRENT SIZE: " << size() << endl;
kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl;
kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl;
kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl;
#endif
- QSize minSize = mNavigatorView->yourSizeHint();
+ QSize minSize = mNavigatorView->sizeHintTwoButtons();
// kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl;
int verticalCount = size().height() / minSize.height();
int horizontalCount = size().width() / minSize.width();
//qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
//qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
bool fontchange = false;
@@ -174,17 +174,17 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
verticalCount != mVerticalCount ) {
uint count = horizontalCount * verticalCount;
if ( count == 0 ) {
bool ok;
fo = mNavigatorView->yourFontHint( size() , &ok);
//mNavigatorView->resize( size() );
//if ( ! ok )
// return;
- minSize = mNavigatorView->sizeHint();
+ minSize = mNavigatorView->sizeHintTwoButtons();
verticalCount = size().height() / minSize.height();
horizontalCount = size().width() / minSize.width();
if ( horizontalCount == 0 )
horizontalCount = 1;
if ( verticalCount == 0 )
verticalCount = 1;
fontchange = true;
count = horizontalCount * verticalCount;
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 92a0ac2..a5dbc5d 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -129,17 +129,17 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b)
*b = false;
int fontPoint = fo.pointSize();
while ( fontPoint > 5 ) {
--fontPoint;
fo.setPointSize( fontPoint );
setFont( fo );
mFontChanged = true;
mNavigatorBar->resetFont( fo );
- QSize sh = sizeHint();
+ QSize sh = sizeHintTwoButtons();
//qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
if ( si.width() > sh.width() && si.height() > sh.height()) {
*b = true;
//qDebug("fooooooooooooooooooooooouuuuund ");
break;
}
}
//qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() );
@@ -152,16 +152,28 @@ QSize KDateNavigator::sizeHint() const
QSize nav = mNavigatorBar->sizeHint();
int wid = fm.width( "30") + day.width()+3;
int hei = fm.height() +day.height()+nav.height()+2;
if ( wid < nav.width() )
wid = nav.width() ;
//qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
return QSize ( wid, hei );
}
+QSize KDateNavigator::sizeHintTwoButtons() const
+{
+ QFontMetrics fm ( font() );
+ QSize day = daymatrix->sizeHint();
+ QSize nav = mNavigatorBar->sizeHintTwoButtons();
+ int wid = fm.width( "30") + day.width()+3;
+ int hei = fm.height() +day.height()+nav.height()+2;
+ if ( wid < nav.width() )
+ wid = nav.width() ;
+ //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
+ return QSize ( wid, hei );
+}
void KDateNavigator::slotMonthSelected( int m )
{
if ( m_MthYr.month() <= mMonthSignalOffset)
m += 12;
int mo = m - mMonthSignalOffset;
emit monthSelected( m - mMonthSignalOffset );
}
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 3177687..d1f32b6 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -65,16 +65,17 @@ class KDateNavigator: public QFrame
NavigatorBar *navigatorBar() const { return mNavigatorBar; }
void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;}
QSize yourSizeHint() { return mySizeHint; }
QFont yourFontHint( QSize , bool * b);
bool fontChanged() {return mFontChanged; }
void unsetFontChanged() { mFontChanged = false; }
KODayMatrix *dayMatrix() { return daymatrix ;}
QSize sizeHint() const;
+ QSize sizeHintTwoButtons() const;
void changeFont ( QFont fo );
public slots:
void selectDates( const KCal::DateList & );
void updateView();
void updateConfig();
void updateDayMatrix();
signals:
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index e4abbf7..1b4ee52 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -168,18 +168,21 @@ QSize NavigatorBar::sizeHint() const
wid += mCurrentButtonMinWid;
if ( mNextMonth->isVisible() )
wid += mCurrentButtonMinWid;
if ( mNextWeek->isVisible() )
wid += mCurrentButtonMinWid;
if ( mNextYear->isVisible() )
wid += mCurrentButtonMinWid;
//qDebug("ret %d %d ", wid, mCurrentHei);
- int add = 2;
- return QSize ( wid+add, mCurrentHei+add );
+ return QSize ( wid, mCurrentHei );
+}
+QSize NavigatorBar::sizeHintTwoButtons() const
+{
+ return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei );
}
void NavigatorBar::resetFont ( QFont fo )
{
QFont tfont = fo;
if ( QApplication::desktop()->width() >= 480 )
tfont.setPointSize(tfont.pointSize()+2);
tfont.setBold(true);
@@ -199,18 +202,18 @@ void NavigatorBar::resetFont ( QFont fo )
mSelectMonth->setMinimumWidth( maxwidth );
mSelectMonth->setFixedHeight( size );
mPrevYear->setFixedHeight( size );
mPrevMonth->setFixedHeight( size );
mPrevWeek->setFixedHeight( size );
mNextMonth->setFixedHeight( size );
mNextWeek->setFixedHeight( size );
mNextYear->setFixedHeight ( size );
- mCurrentHei = size;
- mCurrentMinWid = maxwidth;
+ mCurrentHei = size +2;
+ mCurrentMinWid = maxwidth+2;
mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2;
}
void NavigatorBar::showButtons( bool left, bool right )
{
if ( left ) {
mPrevYear->show();
mPrevMonth->show();
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 5d5aff4..bf6d173 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -36,16 +36,17 @@ class NavigatorBar: public QWidget
{
Q_OBJECT
public:
NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 );
~NavigatorBar();
void showButtons( bool left, bool right );
void resetFont ( QFont fo );
QSize sizeHint() const;
+ QSize sizeHintTwoButtons() const;
public slots:
void selectDates( const KCal::DateList & );
void selectMonth();
signals:
void goNextMonth();
void goPrevMonth();