author | zautrix <zautrix> | 2005-07-09 14:48:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-09 14:48:54 (UTC) |
commit | 875884b2517f9b82153a14852c0f1676f985494f (patch) (unidiff) | |
tree | 89e1c773a2fdae7a4f2e2fb9ba9d4c59e921d60f | |
parent | fa7a30172aa502aaa9e81868e5960efba76cbb0d (diff) | |
download | kdepimpi-875884b2517f9b82153a14852c0f1676f985494f.zip kdepimpi-875884b2517f9b82153a14852c0f1676f985494f.tar.gz kdepimpi-875884b2517f9b82153a14852c0f1676f985494f.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/komonthview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index b5a59af..498d9b0 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1825,49 +1825,49 @@ void KOMonthView::slotComputeLayout() | |||
1825 | mComputeLayoutTimer->stop(); | 1825 | mComputeLayoutTimer->stop(); |
1826 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); | 1826 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); |
1827 | computeLayout(); | 1827 | computeLayout(); |
1828 | clPending = true; | 1828 | clPending = true; |
1829 | setKeyBFocus(); | 1829 | setKeyBFocus(); |
1830 | } | 1830 | } |
1831 | 1831 | ||
1832 | void KOMonthView::doComputeLayoutWeek() | 1832 | void KOMonthView::doComputeLayoutWeek() |
1833 | { | 1833 | { |
1834 | 1834 | ||
1835 | int daysToShow; | 1835 | int daysToShow; |
1836 | bool combinedSatSun = false; | 1836 | bool combinedSatSun = false; |
1837 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1837 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1838 | daysToShow = 6; | 1838 | daysToShow = 6; |
1839 | combinedSatSun = true; | 1839 | combinedSatSun = true; |
1840 | } | 1840 | } |
1841 | int wid = width();//e | 1841 | int wid = width();//e |
1842 | int hei = height()-1-mNavigatorBar->height(); | 1842 | int hei = height()-1-mNavigatorBar->height(); |
1843 | #ifdef DESKTOP_VERSION | 1843 | #ifdef DESKTOP_VERSION |
1844 | if ( !KOPrefs::instance()->mMonthViewWeekRowlayout ) { | 1844 | if ( !KOPrefs::instance()->mMonthViewWeekRowlayout ) { |
1845 | daysToShow = 2; | 1845 | daysToShow = 2; |
1846 | } else | 1846 | } else |
1847 | #endif | 1847 | #endif |
1848 | { | 1848 | { |
1849 | if ( wid < hei ) | 1849 | if ( wid < hei + 40 ) |
1850 | daysToShow = 2; | 1850 | daysToShow = 2; |
1851 | else | 1851 | else |
1852 | daysToShow = 3; | 1852 | daysToShow = 3; |
1853 | } | 1853 | } |
1854 | bool landscape = (daysToShow == 3); | 1854 | bool landscape = (daysToShow == 3); |
1855 | mShowSatSunComp = true; | 1855 | mShowSatSunComp = true; |
1856 | combinedSatSun = true; | 1856 | combinedSatSun = true; |
1857 | 1857 | ||
1858 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); | 1858 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); |
1859 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1859 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1860 | int weeklabelwid = fm.width( "888" ); | 1860 | int weeklabelwid = fm.width( "888" ); |
1861 | wid -= weeklabelwid; | 1861 | wid -= weeklabelwid; |
1862 | 1862 | ||
1863 | int colWid = wid / daysToShow; | 1863 | int colWid = wid / daysToShow; |
1864 | int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); | 1864 | int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); |
1865 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); | 1865 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); |
1866 | int colModulo = wid % daysToShow; | 1866 | int colModulo = wid % daysToShow; |
1867 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; | 1867 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; |
1868 | //qDebug("rowmod %d ", rowModulo); | 1868 | //qDebug("rowmod %d ", rowModulo); |
1869 | int i; | 1869 | int i; |
1870 | int x,y,w,h; | 1870 | int x,y,w,h; |
1871 | x= 0; | 1871 | x= 0; |
1872 | y= 0; | 1872 | y= 0; |
1873 | w = colWid; | 1873 | w = colWid; |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index c2ad886..add1819 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -495,49 +495,49 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | |||
495 | setText(i18n("Click to add new Todo")); | 495 | setText(i18n("Click to add new Todo")); |
496 | QLineEdit::focusOutEvent(ev); | 496 | QLineEdit::focusOutEvent(ev); |
497 | } | 497 | } |
498 | 498 | ||
499 | ///////////////////////////////////////////////////////////////////////////// | 499 | ///////////////////////////////////////////////////////////////////////////// |
500 | 500 | ||
501 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 501 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
502 | KOrg::BaseView(calendar,parent,name) | 502 | KOrg::BaseView(calendar,parent,name) |
503 | { | 503 | { |
504 | mCategoryPopupMenu = 0; | 504 | mCategoryPopupMenu = 0; |
505 | mPendingUpdateBeforeRepaint = false; | 505 | mPendingUpdateBeforeRepaint = false; |
506 | isFlatDisplay = false; | 506 | isFlatDisplay = false; |
507 | mNavigator = 0; | 507 | mNavigator = 0; |
508 | QBoxLayout *topLayout = new QVBoxLayout(this); | 508 | QBoxLayout *topLayout = new QVBoxLayout(this); |
509 | mName = QString ( name ); | 509 | mName = QString ( name ); |
510 | mBlockUpdate = false; | 510 | mBlockUpdate = false; |
511 | mQuickBar = new QWidget( this ); | 511 | mQuickBar = new QWidget( this ); |
512 | topLayout->addWidget(mQuickBar); | 512 | topLayout->addWidget(mQuickBar); |
513 | 513 | ||
514 | mQuickAdd = new KOQuickTodo(mQuickBar); | 514 | mQuickAdd = new KOQuickTodo(mQuickBar); |
515 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); | 515 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); |
516 | quickLayout->addWidget( mQuickAdd ); | 516 | quickLayout->addWidget( mQuickAdd ); |
517 | QPushButton * flat = new QPushButton( "F",mQuickBar ); | 517 | QPushButton * flat = new QPushButton( "F",mQuickBar ); |
518 | int fixwid = flat->sizeHint().height(); | 518 | int fixwid = flat->sizeHint().height(); |
519 | if ( QApplication::desktop()->width() > 320 ) | 519 | if ( QApplication::desktop()->width() >= 800 ) |
520 | fixwid *= 2; | 520 | fixwid *= 2; |
521 | flat->setFixedWidth( fixwid ); | 521 | flat->setFixedWidth( fixwid ); |
522 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); | 522 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); |
523 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | 523 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); |
524 | allopen->setFixedWidth( fixwid ); | 524 | allopen->setFixedWidth( fixwid ); |
525 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); | 525 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); |
526 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | 526 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); |
527 | allclose->setFixedWidth( fixwid ); | 527 | allclose->setFixedWidth( fixwid ); |
528 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); | 528 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); |
529 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | 529 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); |
530 | s_done->setPixmap( SmallIcon("greenhook16")); | 530 | s_done->setPixmap( SmallIcon("greenhook16")); |
531 | s_done->setFixedWidth( fixwid ); | 531 | s_done->setFixedWidth( fixwid ); |
532 | s_done->setFixedHeight( flat->sizeHint().height() ); | 532 | s_done->setFixedHeight( flat->sizeHint().height() ); |
533 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); | 533 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); |
534 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | 534 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); |
535 | s_run->setPixmap( SmallIcon("ko16old")); | 535 | s_run->setPixmap( SmallIcon("ko16old")); |
536 | s_run->setFixedWidth( fixwid ); | 536 | s_run->setFixedWidth( fixwid ); |
537 | s_run->setFixedHeight( flat->sizeHint().height() ); | 537 | s_run->setFixedHeight( flat->sizeHint().height() ); |
538 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); | 538 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); |
539 | 539 | ||
540 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | 540 | mNewSubBut = new QPushButton( "sub",mQuickBar ); |
541 | mNewSubBut->setFixedWidth( fixwid*3/2 ); | 541 | mNewSubBut->setFixedWidth( fixwid*3/2 ); |
542 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); | 542 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); |
543 | mNewSubBut->setEnabled( false ); | 543 | mNewSubBut->setEnabled( false ); |