author | zautrix <zautrix> | 2005-04-02 17:24:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-02 17:24:28 (UTC) |
commit | 40e5edc1ab153144f0e824ad2d3a0ab37357e408 (patch) (side-by-side diff) | |
tree | 25b1d980554303d99d41960267d57872a338960d /korganizer/koagendaview.cpp | |
parent | f3c3a836ae97ef3e65cfbcd22156b0ba6eaae578 (diff) | |
download | kdepimpi-40e5edc1ab153144f0e824ad2d3a0ab37357e408.zip kdepimpi-40e5edc1ab153144f0e824ad2d3a0ab37357e408.tar.gz kdepimpi-40e5edc1ab153144f0e824ad2d3a0ab37357e408.tar.bz2 |
commit
-rw-r--r-- | korganizer/koagendaview.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 880d399..d450a97 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -165,97 +165,96 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) // center and draw the time label int timeWidth = fm.width(hour); int offset = startW - timeWidth - tw2 -1 ; p->setFont( nFont ); p->drawText( offset, y+ timeHeight, hour); p->setFont( sFont ); offset = startW - tw2; p->drawText( offset, y -1, suffix); // increment indices y += mCellHeight; cell++; } } /** Calculates the minimum width. */ int TimeLabels::minimumWidth() const { return mMiniWidth; } /** updates widget's internal state */ void TimeLabels::updateConfig() { mRedrawNeeded = true; // set the font // config->setGroup("Fonts"); // QFont font = config->readFontEntry("TimeBar Font"); setFont(KOPrefs::instance()->mTimeBarFont); QString test = "20"; if (KGlobal::locale()->use12Clock()) test = "12"; mMiniWidth = fontMetrics().width(test); if (KGlobal::locale()->use12Clock()) test = "pm"; else { test = "00"; } QFont sFont = font(); sFont.setPointSize( sFont.pointSize()/2 ); QFontMetrics fmS( sFont ); mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; - qDebug("testwid %d %d", mMiniWidth ,fmS.width( test )); // update geometry restrictions based on new settings setFixedWidth( mMiniWidth ); // update HourSize mCellHeight = KOPrefs::instance()->mHourSize*4; resizeContents(50,mRows * mCellHeight); } /** update time label positions */ void TimeLabels::positionChanged() { int adjustment = mAgenda->contentsY(); setContentsPos(0, adjustment); } /** */ void TimeLabels::setAgenda(KOAgenda* agenda) { mAgenda = agenda; } void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) { mMouseDownY = e->pos().y(); mOrgCap = topLevelWidget()->caption(); } void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) { int diff = mMouseDownY - e->pos().y(); if ( diff < 10 && diff > -10 ) return; int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; if ( tSize < 4 ) tSize = 4; if ( tSize > 22 ) tSize = 22; tSize = (tSize-2)/2; topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); } void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) { topLevelWidget()->setCaption( mOrgCap ); int diff = mMouseDownY - e->pos().y(); if ( diff < 10 && diff > -10 ) return; int tSize = KOPrefs::instance()->mHourSize + (diff/10); |