summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 3ae977d..f46a103 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -431,220 +431,220 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e )
}
}
e->accept();
return;
}
if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
switch ( e->key() ) {
case Qt::Key_Down:
case Qt::Key_Up:
QListView::keyPressEvent ( e );
e->accept();
break;
case Qt::Key_Left:
case Qt::Key_Right:
QListView::keyPressEvent ( e );
e->accept();
return;
break;
default:
e->ignore();
break;
}
return;
}
e->ignore();
}
void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
QListView::contentsMouseReleaseEvent(e);
mMousePressed = false;
}
void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
QListViewItem *item = itemAt(vp);
emit double_Clicked(item);
if (!item) return;
emit doubleClicked(item,vp,0);
}
/////////////////////////////////////////////////////////////////////////////
KOQuickTodo::KOQuickTodo(QWidget *parent) :
QLineEdit(parent)
{
setText(i18n("Click to add new Todo"));
}
void KOQuickTodo::focusInEvent(QFocusEvent *ev)
{
if ( text()==i18n("Click to add new Todo") )
setText("");
QLineEdit::focusInEvent(ev);
}
void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
{
setText(i18n("Click to add new Todo"));
QLineEdit::focusOutEvent(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 = mQuickAdd->sizeHint().height();
+ int fixhei = fixwid;
if ( QApplication::desktop()->width() > 800 )
- fixwid *= 2;
+ fixwid = (fixwid*3)/2;
connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
s_done->setPixmap( SmallIcon("greenhook16"));
- s_done->setFixedHeight( flat->sizeHint().height() );
connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
s_run->setPixmap( SmallIcon("ko16old"));
connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
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 );
- }
+
+ flat->setFixedHeight(fixhei );
+ s_done->setFixedHeight(fixhei );
+ allopen->setFixedHeight(fixhei );
+ allclose->setFixedHeight(fixhei );
+ s_run->setFixedHeight(fixhei );
+ mNewSubBut->setFixedHeight(fixhei );
+
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);
mTodoListView->addColumn(i18n("Start Date"));
mTodoListView->setColumnAlignment(5,AlignLeft);
mTodoListView->addColumn(i18n("Start Time"));
mTodoListView->setColumnAlignment(6,AlignHCenter);
//mTodoListView->addColumn(i18n("Cancelled"));
mTodoListView->addColumn(i18n("Categories"));
mTodoListView->addColumn(i18n("Calendar"));
mTodoListView->addColumn(i18n("Last Modified"));
mTodoListView->addColumn(i18n("Created"));
mTodoListView->addColumn(i18n("Last Modified Sub"));
#if 0
mTodoListView->addColumn(i18n("Sort Id"));
mTodoListView->setColumnAlignment(4,AlignHCenter);
#endif
mTodoListView->setMinimumHeight( 60 );
mTodoListView->setItemsRenameable( true );
mTodoListView->setRenameable( 0 );
mTodoListView->setColumnWidth( 0, 120 );
int iii = 0;
for ( iii = 0; iii< 12 ; ++iii )
mTodoListView->setColumnWidthMode( iii, QListView::Manual );
mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
mPriorityPopupMenu = new QPopupMenu(this);
for (int i = 1; i <= 5; i++) {
QString label = QString ("%1").arg (i);
mPriority[mPriorityPopupMenu->insertItem (label)] = i;
}
connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
mPercentageCompletedPopupMenu = new QPopupMenu(this);
for (int i = 0; i <= 100; i+=20) {
QString label = QString ("%1 %").arg (i);
mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
}
connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
mCategoryPopupMenu = new QPopupMenu (this);
mCategoryPopupMenu->setCheckable (true);
connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
mCalPopupMenu = new QPopupMenu (this);
mCalPopupMenu->setCheckable (true);
connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
mItemPopupMenu = new QPopupMenu(this);
mItemPopupMenu->insertItem(i18n("Show"), this,
SLOT (showTodo()));
mItemPopupMenu->insertItem(i18n("Edit..."), this,
SLOT (editTodo()));
mItemPopupMenu->insertItem( i18n("Delete..."), this,
SLOT (deleteTodo()));
mItemPopupMenu->insertItem( i18n("Clone..."), this,
SLOT (cloneTodo()));
mItemPopupMenu->insertItem( i18n("Move..."), this,
SLOT (moveTodo()));
#ifndef DESKTOP_VERSION
mItemPopupMenu->insertItem( i18n("Beam..."), this,