summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-07-10 01:20:01 (UTC)
committer zautrix <zautrix>2005-07-10 01:20:01 (UTC)
commit2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a (patch) (side-by-side diff)
treeb85ac7b9a3bc85abe04f6e3aea77b0e70fa22396 /korganizer/kotodoview.cpp
parent2d1e1fe5d290503db8c0462fc294f5c04f58e95c (diff)
downloadkdepimpi-2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a.zip
kdepimpi-2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a.tar.gz
kdepimpi-2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a.tar.bz2
fixxx
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 94f35e6..3ae977d 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -502,73 +502,80 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
KOrg::BaseView(calendar,parent,name)
{
mCategoryPopupMenu = 0;
mPendingUpdateBeforeRepaint = false;
isFlatDisplay = false;
mNavigator = 0;
QBoxLayout *topLayout = new QVBoxLayout(this);
mName = QString ( name );
mBlockUpdate = false;
mQuickBar = new QWidget( this );
topLayout->addWidget(mQuickBar);
mQuickAdd = new KOQuickTodo(mQuickBar);
QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
quickLayout->addWidget( mQuickAdd );
mNewSubBut = new QPushButton( "sub",mQuickBar );
QPushButton * s_done = new QPushButton( "D",mQuickBar );
QPushButton * s_run = new QPushButton( "R",mQuickBar );
QPushButton * allopen = new QPushButton( "O",mQuickBar );
QPushButton * allclose = new QPushButton( "C",mQuickBar );
QPushButton * flat = new QPushButton( "F",mQuickBar );
- int fixwid = flat->sizeHint().height();
- if ( QApplication::desktop()->width() >= 800 )
+ int fixwid = mQuickAdd->sizeHint().height();
+ if ( QApplication::desktop()->width() > 800 )
fixwid *= 2;
- flat->setFixedWidth( fixwid );
connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
- allopen->setFixedWidth( fixwid );
connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
- allclose->setFixedWidth( fixwid );
connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
s_done->setPixmap( SmallIcon("greenhook16"));
- s_done->setFixedWidth( fixwid );
s_done->setFixedHeight( flat->sizeHint().height() );
connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
s_run->setPixmap( SmallIcon("ko16old"));
- s_run->setFixedWidth( fixwid );
- s_run->setFixedHeight( flat->sizeHint().height() );
connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
- mNewSubBut->setFixedWidth( fixwid*3/2 );
connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
+
+ mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() );
mNewSubBut->setEnabled( false );
+ flat->setFixedWidth( fixwid );
+ s_done->setFixedWidth( fixwid );
+ allopen->setFixedWidth( fixwid );
+ allclose->setFixedWidth( fixwid );
+ s_run->setFixedWidth( fixwid );
+ if ( QApplication::desktop()->width() < 800 ) {
+ flat->setFixedHeight( fixwid );
+ s_done->setFixedHeight( fixwid );
+ allopen->setFixedHeight( fixwid );
+ allclose->setFixedHeight( fixwid );
+ s_run->setFixedHeight( fixwid );
+ mNewSubBut->setFixedHeight( fixwid );
+ }
quickLayout->addWidget( mNewSubBut );
quickLayout->addWidget( s_done );
quickLayout->addWidget( s_run );
-
quickLayout->addWidget( allopen );
quickLayout->addWidget( allclose );
quickLayout->addWidget( flat );
if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
mTodoListView = new KOTodoListView(calendar,this, name );
topLayout->addWidget(mTodoListView);
//mTodoListView->header()->setMaximumHeight(30);
mTodoListView->setRootIsDecorated(true);
mTodoListView->setAllColumnsShowFocus(true);
mTodoListView->setShowSortIndicator(true);
mTodoListView->addColumn(i18n("Todo"));
mTodoListView->addColumn(i18n("Prio"));
mTodoListView->setColumnAlignment(1,AlignHCenter);
mTodoListView->addColumn(i18n("Complete"));
mTodoListView->setColumnAlignment(2,AlignCenter);
mTodoListView->addColumn(i18n("Due Date"));
mTodoListView->setColumnAlignment(3,AlignLeft);
mTodoListView->addColumn(i18n("Due Time"));
mTodoListView->setColumnAlignment(4,AlignHCenter);
@@ -1093,51 +1100,51 @@ void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
void KOTodoView::editItem(QListViewItem *item )
{
emit editTodoSignal(((KOTodoViewItem *)item)->todo());
}
void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
{
emit showTodoSignal(((KOTodoViewItem *)item)->todo());
}
void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
{
pendingSubtodo = 0;
mActiveItem = (KOTodoViewItem *)item;
if (item) {
switch (column){
case 1:
mPriorityPopupMenu->popup(QCursor::pos ()); break;
case 2:
mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
case 3:
moveTodo();
break;
- case 8:
+ case 7:
mCategoryPopupMenu->popup(QCursor::pos ()); break;
- case 9:
+ case 8:
mCalPopupMenu->popup(QCursor::pos ()); break;
default:
mItemPopupMenu->popup(QCursor::pos());
}
} else mPopupMenu->popup(QCursor::pos());
}
void KOTodoView::newTodo()
{
emit newTodoSignal();
}
void KOTodoView::newSubTodo()
{
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
if (mActiveItem) {
if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) {
addQuickTodoPar( mActiveItem->todo());
} else
emit newSubTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::unparentTodo()
{
if (mActiveItem) {