summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneraltodo.cpp2
-rw-r--r--korganizer/komonthview.cpp96
-rw-r--r--korganizer/komonthview.h3
-rw-r--r--korganizer/koviewmanager.cpp3
4 files changed, 59 insertions, 45 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index ce66863..da5ef07 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -159,17 +159,17 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) );
mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
if ( QApplication::desktop()->width() <= 480 ) {
if ( QApplication::desktop()->width() < 320 )
mCompleteDateEdit->setMaximumWidth( 85 );
else
- mCompleteDateEdit->setMaximumWidth( 130 );
+ mCompleteDateEdit->setMaximumWidth( 140 );
topLayout->setSpacing( 0 );
}
}
void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
{
QHBox* h = new QHBox ( parent );
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 5926abe..ffb2e1e 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -87,17 +87,17 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
KNoScrollListBox::~KNoScrollListBox()
{
}
QString KNoScrollListBox::getWhatsThisText(QPoint p)
{
QListBoxItem* item = itemAt ( p );
if ( ! item ) {
- return i18n("Click in the cell\nto add an event!");
+ return i18n("Click in the cell\nto add an event!");
}
return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence());
}
void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
{
switch(e->key()) {
case Key_Right:
@@ -314,17 +314,17 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
//connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ),
SLOT( defaultAction( QListBoxItem * ) ) );
connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *,
const QPoint &) ),
SLOT( contextMenu( QListBoxItem * ) ) );
connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ),
- SLOT( selection( QListBoxItem * ) ) );
+ SLOT( selection( QListBoxItem * ) ) );
connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ),
SLOT( cellClicked( QListBoxItem * ) ) );
connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ),
SLOT( selection( QListBoxItem * ) ) );
}
#ifdef DESKTOP_VERSION
QToolTipGroup *MonthViewCell::toolTipGroup()
{
@@ -547,53 +547,54 @@ void MonthViewCell::insertEvent(Event *event)
} else
item->setReply(false);
#endif
mItemList->insertItem( item );
mToolTip += "\n";
}
void MonthViewCell::insertTodo(Todo *todo)
{
- QString text;
- if (todo->hasDueDate()) {
- if (!todo->doesFloat()) {
- text += KGlobal::locale()->formatTime(todo->dtDue().time());
- text += " ";
- }
+ QString text;
+ mItemList->setFocusPolicy(WheelFocus);
+ if (todo->hasDueDate()) {
+ if (!todo->doesFloat()) {
+ text += KGlobal::locale()->formatTime(todo->dtDue().time());
+ text += " ";
}
- text += i18n("Td: %1").arg(todo->summary());
-
- MonthViewItem *item = new MonthViewItem( todo, mDate, text );
- //item->setPalette( mStandardPalette );
- QPalette pal;
- if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
- QStringList categories = todo->categories();
- QString cat = categories.first();
- if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
- pal = getPalette();
- if (cat.isEmpty()) {
- pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
- } else {
- pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
- }
-
+ }
+ text += i18n("T: %1").arg(todo->summary());
+
+ MonthViewItem *item = new MonthViewItem( todo, mDate, text );
+ //item->setPalette( mStandardPalette );
+ QPalette pal;
+ if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
+ QStringList categories = todo->categories();
+ QString cat = categories.first();
+ if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
+ pal = getPalette();
+ if (cat.isEmpty()) {
+ pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
} else {
- if (cat.isEmpty()) {
- pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
- } else {
- pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
- }
+ pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
}
-
+
} else {
- pal = mStandardPalette ;
+ if (cat.isEmpty()) {
+ pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
+ } else {
+ pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
+ }
}
- item->setPalette( pal );
- mItemList->insertItem( item );
- mToolTip += text+"\n";
+
+ } else {
+ pal = mStandardPalette ;
+ }
+ item->setPalette( pal );
+ mItemList->insertItem( item );
+ mToolTip += text+"\n";
}
void MonthViewCell::finishUpdateCell()
{
#ifdef DESKTOP_VERSION
if (mToolTip != "")
QToolTip::add(this,mToolTip,toolTipGroup(),"");
#endif
mItemList->sort();
@@ -777,17 +778,16 @@ void MonthViewCell::contextMenu( QListBoxItem *item )
MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
Incidence *incidence = eventItem->incidence();
if ( incidence ) mMonthView->showContextMenu( incidence );
}
void MonthViewCell::selection( QListBoxItem *item )
{
if ( !item ) return;
-
mMonthView->setSelectedCell( this );
}
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
@@ -1260,19 +1260,25 @@ void KOMonthView::updateView()
//qDebug("update time %d ", ti.elapsed());
}
void KOMonthView::resizeEvent(QResizeEvent * e)
{
qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
if ( ignoreResizeEvent ) {
- qDebug("KOMonthView::resizeEvent ignored ");
- --ignoreResizeEvent;
- return;
+ int diff = e->size().height() - e->oldSize().height();
+ if ( diff < 0 )
+ diff = diff * (-1);
+ if ( diff == ignoreResizeEventHeight ) {
+ qDebug("KOMonthView::resizeEvent ignored ");
+ --ignoreResizeEvent;
+ return;
+ }
+ ignoreResizeEvent = 0;
}
if ( e->size().width()+ e->size().height() < 240 )
return;
computeLayout();
clPending = true;
if ( mShowWeekView )
mCellsW[0]->setFocus();
else
@@ -1506,17 +1512,17 @@ void KOMonthView::showContextMenu( Incidence *incidence )
*/
}
MonthViewCell * KOMonthView::selectedCell( )
{
return mSelectedCell;
}
void KOMonthView::setSelectedCell( MonthViewCell *cell )
{
- // qDebug("KOMonthView::setSelectedCell ");
+ //qDebug("KOMonthView::setSelectedCell %x ", cell);
if ( mSelectedCell && mSelectedCell != cell ) {
MonthViewCell * mvc = mSelectedCell;
mSelectedCell = cell;
mvc->deselect();
} else
mSelectedCell = cell;
// if ( mSelectedCell )
// mSelectedCell->select();
@@ -1545,25 +1551,31 @@ void KOMonthView::clearSelection()
}
void KOMonthView::keyPressEvent ( QKeyEvent * e )
{
//qDebug("KOMonthView::keyPressEvent ");
switch(e->key()) {
case Key_Up:
{
emit prevMonth();
- mCells[0]->setFocus();
+ if ( mShowWeekView )
+ mCellsW[0]->setFocus();
+ else
+ mCells[0]->setFocus();
}
e->accept();
break;
case Key_Down:
{
emit nextMonth();
- mCells[0]->setFocus();
-
+ if ( mShowWeekView )
+ mCellsW[0]->setFocus();
+ else
+ mCells[0]->setFocus();
+
}
e->accept();
break;
case Key_Return:
case Key_Enter:
{
selectInternalWeekNum ( currentWeek() );
}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 9dbe319..d70cda1 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -221,17 +221,17 @@ class KOMonthView: public KOEventView
/** returns dates of the currently selected events */
virtual DateList selectedDates();
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
bool isMonthView() { return true; }
bool isUpdatePossible() { return updatePossible; }
- void setIgnoreResizeEvent( int c ) { ignoreResizeEvent = c ;}
+ void setIgnoreResizeEvent( int c, int h ) { ignoreResizeEvent = c ;ignoreResizeEventHeight = h;}
MonthViewCell * selectedCell();
public slots:
virtual void updateView();
virtual void updateConfig();
virtual void showDates(const QDate &start, const QDate &end);
virtual void showEvents(QPtrList<Event> eventList);
@@ -255,16 +255,17 @@ class KOMonthView: public KOEventView
void showDaySignal( QDate );
protected:
void resizeEvent(QResizeEvent *);
void viewChanged();
void updateDayLabels();
private:
int ignoreResizeEvent;
+ int ignoreResizeEventHeight;
int currentWeek();
bool clPending;
QWidgetStack * mWidStack;
QWidget* mMonthView;
QWidget* mWeekView;
bool mShowWeekView;
bool updatePossible;
int mDaysPerWeek;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index dcb51dc..c35de0a 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -218,17 +218,18 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
{
mCurrentAgendaView = 0;
int wid = mMainView->width() ;
int hei = mMainView->height();
if ( mCurrentView == mMonthView ) {
if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) {
- mMonthView->setIgnoreResizeEvent( 2 );
+
+ mMonthView->setIgnoreResizeEvent( 2 ,mMainView->navigatorBar()->height());
mMainView->navigatorBar()->show();
hei -= mMainView->navigatorBar()->sizeHint().height();
}
//mMainView->navigatorBar()->hide();
} else {
mMainView->navigatorBar()->hide();
}
if ( fullScreen ) {