author | zautrix <zautrix> | 2004-10-27 00:49:03 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 00:49:03 (UTC) |
commit | ba3d660ed4f856362d2b914ed744874c235b4001 (patch) (side-by-side diff) | |
tree | d70423c6bf3a6342a6ae2277dda70f15736086a9 | |
parent | 00d623c9391a9bdaeb142f443f1dd09861317608 (diff) | |
download | kdepimpi-ba3d660ed4f856362d2b914ed744874c235b4001.zip kdepimpi-ba3d660ed4f856362d2b914ed744874c235b4001.tar.gz kdepimpi-ba3d660ed4f856362d2b914ed744874c235b4001.tar.bz2 |
fixed some whantsnext view kayout
-rw-r--r-- | korganizer/koagendaview.cpp | 10 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 17 | ||||
-rw-r--r-- | libkdepim/categoryeditdialog.cpp | 2 | ||||
-rw-r--r-- | libkdepim/categoryselectdialog.cpp | 8 |
4 files changed, 27 insertions, 10 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 3aae076..749204b 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -353,50 +353,56 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mainLayout->addWidget(mAllDayFrame); mainLayout->setStretchFactor( mAllDayFrame, 0 ); mAllDayFrame->setFocusPolicy(NoFocus); QWidget *agendaFrame = new QWidget(mainBox); mainLayout->addWidget(agendaFrame); mainLayout->setStretchFactor( agendaFrame, 10 ); agendaFrame->setFocusPolicy(NoFocus); #endif mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); topLayout->addWidget( mSplitterAgenda ); mAllDayFrame = new QHBox(mSplitterAgenda); mAllDayFrame->setFocusPolicy(NoFocus); QWidget *agendaFrame = new QWidget(mSplitterAgenda); agendaFrame->setFocusPolicy(NoFocus); #endif // Create all-day agenda widget mDummyAllDayLeft = new QVBox( mAllDayFrame ); mExpandButton = new QPushButton(mDummyAllDayLeft); mExpandButton->setPixmap( mNotExpandedPixmap ); - mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, - QSizePolicy::Fixed ) ); + int widebut = mExpandButton->sizeHint().width(); + if ( QApplication::desktop()->width() < 480 ) + widebut = widebut*2; + else + widebut = (widebut*3) / 2; + //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, + // QSizePolicy::Fixed ) ); + mExpandButton->setFixedSize( widebut, widebut); connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); mExpandButton->setFocusPolicy(NoFocus); mAllDayAgenda = new KOAgenda(1,mAllDayFrame); mAllDayAgenda->setFocusPolicy(NoFocus); QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); // Create event context menu for all day agenda mAllDayAgendaPopup = eventPopup(); connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); // Create agenda frame QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); // QHBox *agendaFrame = new QHBox(splitterAgenda); // create event indicator bars mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); agendaLayout->addWidget(mEventIndicatorTop,0,1); mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, agendaFrame); agendaLayout->addWidget(mEventIndicatorBottom,2,1); QWidget *dummyAgendaRight = new QWidget(agendaFrame); agendaLayout->addWidget(dummyAgendaRight,0,2); diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 0fea9be..59b864c 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -18,78 +18,88 @@ */ #include <qlayout.h> #include <qtextbrowser.h> #include <qtextcodec.h> #include <qfileinfo.h> #include <qlabel.h> #include <qapplication.h> #include <kglobal.h> #include <klocale.h> #include <kdebug.h> #include <kiconloader.h> #include <kmessagebox.h> #include <libkcal/calendar.h> #ifndef KORG_NOPRINTER #include "calprinter.h" #endif #include "koglobals.h" #include "koprefs.h" #include "koeventviewerdialog.h" - +#include <qstylesheet.h> #include "kowhatsnextview.h" using namespace KOrg; void WhatsNextTextBrowser::setSource(const QString& n) { if (n.startsWith("event:")) { emit showIncidence(n); return; } else if (n.startsWith("todo:")) { emit showIncidence(n); return; } else { QTextBrowser::setSource(n); } } KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, const char *name) : KOrg::BaseView(calendar, parent, name) { // mDateLabel = // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); // mDateLabel->setMargin(2); // mDateLabel->setAlignment(AlignCenter); setFont( KOPrefs::instance()->mWhatsNextFont ); mView = new WhatsNextTextBrowser(this); connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); + QStyleSheet* stsh = mView->styleSheet(); + QStyleSheetItem * style ; + style = stsh->item ("h2" ); + if ( style ) { + style->setMargin(QStyleSheetItem::MarginAll,0); + } + style = stsh->item ("table" ); + if ( style ) { + style->setMargin(QStyleSheetItem::MarginAll,0); + } mEventViewer = 0; QBoxLayout *topLayout = new QVBoxLayout(this); // topLayout->addWidget(mDateLabel); topLayout->addWidget(mView); mTimer = new QTimer( this ); connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); } KOWhatsNextView::~KOWhatsNextView() { } int KOWhatsNextView::maxDatesHint() { return 0; } int KOWhatsNextView::currentDateCount() { return 0; @@ -123,49 +133,49 @@ void KOWhatsNextView::showEvent ( QShowEvent * e ) QWidget::showEvent ( e ); } void KOWhatsNextView::hideEvent ( QHideEvent * e) { //qDebug(" KOWhatsNextView::hideEvent"); mTimer->stop(); QWidget::hideEvent ( e ); } void KOWhatsNextView::restartTimer() { //qDebug("KOWhatsNextView::restartTimer() "); mTimer->start( 300000 ); //mTimer->start( 5000 ); } void KOWhatsNextView::updateView() { if ( mTimer->isActive() ) restartTimer(); //qDebug("KOWhatsNextView::updateView() "); // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); KIconLoader kil("korganizer"); QString ipath;// = new QString(); // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); //<big><big><strong>" + date + "</strong></big></big>\n"; - mText = "<table width=\"100%\">\n"; + mText = "<qt><table width=\"100%\">\n"; //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; #ifdef DESKTOP_VERSION mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; #else mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; #endif // mText += "<img src=\""; // mText += ipath; // mText += "\">"; mEventDate = QDate::currentDate(); #ifdef DESKTOP_VERSION mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; #else mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; #endif mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; int iii; mTodos.clear(); QPtrList<Event> events; QPtrList<Todo> todos = calendar()->todos(); Todo * todo; //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; int daysToShow = KOPrefs::instance()->mWhatsNextDays ; bool itemAdded = false; @@ -305,62 +315,63 @@ void KOWhatsNextView::updateView() } todos = calendar()->todos(); if (todos.count() > 0) { Todo *to = todos.first(); while(to) { if ( !to->isCompleted() ){ Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); if (me!=0) { if (me->status()==Attendee::NeedsAction && me->RSVP()) { if (replys == 0) { mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n"; mText += "<table>\n"; } replys++; appendEvent(to, true); } } } to = todos.next(); } } if (replys > 0 ) mText += "</table>\n"; - mText += "</td></tr>\n</table>\n"; + mText += "</td></tr>\n</table></qt>\n"; mView->setText(mText); mView->setFocus(); // QPixmap bPix = SmallIcon( "back" ); // qDebug("xxxxxxxxxxxxxxxxxxxxx "); // QWidget* test = new QWidget(); // test->setBackgroundMode(FixedPixmap ); // test->setBackgroundPixmap ( bPix ); // test->resize( 300, 400 ); // test->show(); // mView->setBackgroundMode(FixedPixmap ); // mView->setBackgroundPixmap ( bPix ); + qDebug("%s ",mText.latin1()); } void KOWhatsNextView::appendDay( int i, QDate eventDate ) { QString date; QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { if ( i == 0 ) { mText += "<table>\n"; return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; } else if ( i == 1 ) date = "<em><font color=\"#000080\">" + day + "</font></em>" ; else date = "<em><font color=\"#000080\">" + day + "</font></em>"; //mText += "<h2>" + date + "</h2>\n"; mText += "<big><big><strong>" + date + "</strong></big></big>\n"; mText += "<table>\n"; } else { if ( i == 0 ) { mText += "<table>\n"; return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp index f719c31..a19900f 100644 --- a/libkdepim/categoryeditdialog.cpp +++ b/libkdepim/categoryeditdialog.cpp @@ -37,48 +37,50 @@ using namespace KPIM; CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, const char* name, bool modal, WFlags fl ) : CategoryEditDialog_base( parent, name, modal, fl ), mPrefs( prefs ) { mCategories->header()->hide(); QStringList::Iterator it; bool categoriesExist=false; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { new QListViewItem(mCategories,*it); categoriesExist=true; } connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), SLOT(editItem(QListViewItem *))); connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); mButtonRemove->setEnabled(categoriesExist); mButtonModify->setEnabled(categoriesExist); mButtonAdd->setEnabled(!mEdit->text().isEmpty()); if ( QApplication::desktop()->width() > 460 ) resize( 300, 360 ); + else + showMaximized(); } /* * Destroys the object and frees any allocated resources */ CategoryEditDialog::~CategoryEditDialog() { // no need to delete child widgets, Qt does it all for us } void CategoryEditDialog::slotTextChanged(const QString &text) { mButtonAdd->setEnabled(!text.isEmpty()); } void CategoryEditDialog::add() { if (!mEdit->text().isEmpty()) { new QListViewItem(mCategories,mEdit->text()); mEdit->setText(""); mButtonRemove->setEnabled(mCategories->childCount()>0); mButtonModify->setEnabled(mCategories->childCount()>0); } } diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 40b46cf..7df9154 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp @@ -25,54 +25,52 @@ #include <qpushbutton.h> #include <qheader.h> #include <qapp.h> #include <qmessagebox.h> #include "categoryeditdialog.h" #include "categoryselectdialog.h" #include "kpimprefs.h" using namespace KPIM; CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, const char* name, bool modal, WFlags fl ) : CategorySelectDialog_base( parent, name, true, fl ), mPrefs( prefs ) { mCategories->header()->hide(); setCategories(); connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog())); - if ( qApp->desktop()->height() < 321 ) - setMaximumHeight( QApplication::desktop()->height() - 50 ); - else - setMaximumHeight( QApplication::desktop()->height() - 80 ); if ( QApplication::desktop()->width() > 460 ) - resize( 260, 360 ); + resize( 300, 360 ); + else + showMaximized(); } void CategorySelectDialog::editCategoriesDialog() { KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this ); ced->exec(); delete ced; setCategories(); } void CategorySelectDialog::setCategories() { mCategories->clear(); mCategoryList.clear(); QStringList::Iterator it; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox); } } CategorySelectDialog::~CategorySelectDialog() { |