summaryrefslogtreecommitdiffabout
path: root/korganizer/kdatenavigator.cpp
authorzautrix <zautrix>2005-03-20 14:04:37 (UTC)
committer zautrix <zautrix>2005-03-20 14:04:37 (UTC)
commit69d75020eea5f95b9f5d77d97ed85ec8869d32db (patch) (side-by-side diff)
tree378b920b9392e7ed4472597e586154d7b99b0645 /korganizer/kdatenavigator.cpp
parent289dd44f4f23d92c45d8f28c867a14a980fd5dde (diff)
downloadkdepimpi-69d75020eea5f95b9f5d77d97ed85ec8869d32db.zip
kdepimpi-69d75020eea5f95b9f5d77d97ed85ec8869d32db.tar.gz
kdepimpi-69d75020eea5f95b9f5d77d97ed85ec8869d32db.tar.bz2
layout fixes
Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index b097dc1..92a0ac2 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -116,6 +116,46 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
updateConfig();
enableRollover(FollowMonth);
mySizeHint = sizeHint();
+ mFontChanged = false;
+}
+void KDateNavigator::changeFont ( QFont fo )
+{
+ setFont( fo );
+ mNavigatorBar->resetFont( fo );
+}
+QFont KDateNavigator::yourFontHint( QSize si , bool *b)
+{
+ QFont fo = KOPrefs::instance()->mDateNavigatorFont;
+ *b = false;
+ int fontPoint = fo.pointSize();
+ while ( fontPoint > 5 ) {
+ --fontPoint;
+ fo.setPointSize( fontPoint );
+ setFont( fo );
+ mFontChanged = true;
+ mNavigatorBar->resetFont( fo );
+ QSize sh = sizeHint();
+ //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() );
+ return fo;
+}
+QSize KDateNavigator::sizeHint() const
+{
+ QFontMetrics fm ( font() );
+ QSize day = daymatrix->sizeHint();
+ 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 );
}
void KDateNavigator::slotMonthSelected( int m )
{