author | zautrix <zautrix> | 2005-07-29 14:38:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-29 14:38:22 (UTC) |
commit | 50b0d4463cf13ae27e45e54b48b2911a3ceb5f9f (patch) (unidiff) | |
tree | 66e4544dd5528d342871b955f000ec4bd0de79b5 | |
parent | 43a46672f4212c9617c753e0aa591f781d2e5240 (diff) | |
download | kdepimpi-50b0d4463cf13ae27e45e54b48b2911a3ceb5f9f.zip kdepimpi-50b0d4463cf13ae27e45e54b48b2911a3ceb5f9f.tar.gz kdepimpi-50b0d4463cf13ae27e45e54b48b2911a3ceb5f9f.tar.bz2 |
layout fix
-rw-r--r-- | korganizer/journalentry.cpp | 7 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 739949d..5fc3f2f 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -56,81 +56,82 @@ | |||
56 | #ifndef DESKTOP_VERSION | 56 | #ifndef DESKTOP_VERSION |
57 | #include <qpe/qpeapplication.h> | 57 | #include <qpe/qpeapplication.h> |
58 | #endif | 58 | #endif |
59 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | 59 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : |
60 | QFrame(parent) | 60 | QFrame(parent) |
61 | { | 61 | { |
62 | 62 | ||
63 | int fac = 5; | 63 | int fac = 5; |
64 | heiHint = QApplication::desktop()->height(); | 64 | heiHint = QApplication::desktop()->height(); |
65 | if ( heiHint > 800 ) | 65 | if ( heiHint > 800 ) |
66 | fac += 2; | 66 | fac += 2; |
67 | heiHint = heiHint / fac; | 67 | heiHint = heiHint / fac; |
68 | 68 | ||
69 | showOnlyMode = false; | 69 | showOnlyMode = false; |
70 | mCalendar = calendar; | 70 | mCalendar = calendar; |
71 | mJournal = 0; | 71 | mJournal = 0; |
72 | visibleMode = true; | 72 | visibleMode = true; |
73 | QHBox * vb = new QHBox ( this ); | 73 | QHBox * vb = new QHBox ( this ); |
74 | QPixmap iconp; | 74 | QPixmap iconp; |
75 | vb->setMargin ( KDialog::marginHint()-1 ); | 75 | vb->setMargin ( KDialog::marginHint()-1 ); |
76 | QPushButton * toggleJournal = new QPushButton( vb ); | 76 | QPushButton * toggleJournal = new QPushButton( vb ); |
77 | iconp = SmallIcon("1updownarrow"); | 77 | iconp = SmallIcon("1updownarrow"); |
78 | toggleJournal->setPixmap (iconp ) ; | 78 | toggleJournal->setPixmap (iconp ) ; |
79 | QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); | 79 | QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); |
80 | vb->setStretchFactor (textLabel,1); | ||
81 | vb->setStretchFactor( toggleJournal, 1 ); | ||
82 | mTitle = new KOLocationBox(TRUE, vb, 30); | 80 | mTitle = new KOLocationBox(TRUE, vb, 30); |
83 | mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); | 81 | mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); |
84 | mCalendarBox = new QComboBox(vb); | 82 | mCalendarBox = new QComboBox(vb); |
85 | mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); | 83 | mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); |
86 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
87 | mTitle->setSizeLimit( 8 ); | 85 | mTitle->setSizeLimit( 8 ); |
88 | mCalendarBox->setSizeLimit( 8 ); | 86 | mCalendarBox->setSizeLimit( 8 ); |
89 | #endif | 87 | #endif |
90 | vb->setStretchFactor ( mTitle, 8 ); | 88 | vb->setStretchFactor ( mTitle, 8 ); |
91 | int limit = 3; | 89 | int limit = 3; |
92 | if ( QApplication::desktop()->width() < 640 ) | 90 | if ( QApplication::desktop()->width() < 640 ) |
93 | limit = 6; | 91 | limit = 6; |
94 | vb->setStretchFactor ( mCalendarBox, limit ); | 92 | vb->setStretchFactor ( mCalendarBox, limit ); |
95 | //mTitleLabel->setMargin(0); | 93 | //mTitleLabel->setMargin(0); |
96 | //mTitleLabel->setAlignment(AlignCenter); | 94 | //mTitleLabel->setAlignment(AlignCenter); |
97 | QPushButton * loadTemplate = new QPushButton( vb ); | 95 | QPushButton * loadTemplate = new QPushButton( vb ); |
98 | QPushButton * saveTemplate = new QPushButton( vb ); | 96 | QPushButton * saveTemplate = new QPushButton( vb ); |
99 | if ( QApplication::desktop()->width() < 321 ) | 97 | if ( QApplication::desktop()->width() < 321 ) |
100 | iconp = SmallIcon("fileexport16"); | 98 | iconp = SmallIcon("fileexport16"); |
101 | else | 99 | else |
102 | iconp = SmallIcon("fileexport"); | 100 | iconp = SmallIcon("fileexport"); |
103 | saveTemplate->setPixmap (iconp ) ; | 101 | saveTemplate->setPixmap (iconp ) ; |
104 | int size = saveTemplate->sizeHint().height(); | 102 | int size = saveTemplate->sizeHint().height(); |
105 | if ( QApplication::desktop()->width() < 321 ) | 103 | if ( QApplication::desktop()->width() < 321 ) |
106 | iconp = SmallIcon("fileimport16"); | 104 | iconp = SmallIcon("fileimport16"); |
107 | else | 105 | else |
108 | iconp = SmallIcon("fileimport"); | 106 | iconp = SmallIcon("fileimport"); |
109 | loadTemplate->setPixmap (iconp ) ; | 107 | loadTemplate->setPixmap (iconp ) ; |
110 | loadTemplate->setFixedSize( size, size ); | 108 | loadTemplate->setFixedSize( size, size ); |
111 | saveTemplate->setFixedSize( size, size ); | 109 | saveTemplate->setFixedSize( size, size ); |
112 | toggleJournal->setFixedSize( size , size ); | 110 | int widwid = size; |
111 | if ( QApplication::desktop()->width() < 320 ) | ||
112 | widwid = size/2+1; | ||
113 | toggleJournal->setFixedSize( widwid , size ); | ||
113 | mTitle->setFixedHeight( size+4); | 114 | mTitle->setFixedHeight( size+4); |
114 | mCalendarBox->setFixedHeight( size+4); | 115 | mCalendarBox->setFixedHeight( size+4); |
115 | mEditor = new KTextEdit(this); | 116 | mEditor = new KTextEdit(this); |
116 | #ifndef DESKTOP_VERSION | 117 | #ifndef DESKTOP_VERSION |
117 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); | 118 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); |
118 | #endif | 119 | #endif |
119 | mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width(); | 120 | mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width(); |
120 | mDeskWid = QApplication::desktop()->width(); | 121 | mDeskWid = QApplication::desktop()->width(); |
121 | int maxwid = mDeskWid - mMaxWidDiff; | 122 | int maxwid = mDeskWid - mMaxWidDiff; |
122 | if ( QApplication::desktop()->width() < 640 ) { | 123 | if ( QApplication::desktop()->width() < 640 ) { |
123 | mTitle->setMaximumWidth( maxwid/2 +20 ); | 124 | mTitle->setMaximumWidth( maxwid/2 +20 ); |
124 | mCalendarBox->setMaximumWidth( maxwid/2 -20); | 125 | mCalendarBox->setMaximumWidth( maxwid/2 -20); |
125 | } else { | 126 | } else { |
126 | mTitle->setMaximumWidth( (maxwid/4)*3); | 127 | mTitle->setMaximumWidth( (maxwid/4)*3); |
127 | mCalendarBox->setMaximumWidth( maxwid/2 ); | 128 | mCalendarBox->setMaximumWidth( maxwid/2 ); |
128 | } | 129 | } |
129 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); | 130 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); |
130 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 131 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
131 | QBoxLayout *topLayout = new QVBoxLayout(this); | 132 | QBoxLayout *topLayout = new QVBoxLayout(this); |
132 | topLayout->addWidget(vb); | 133 | topLayout->addWidget(vb); |
133 | topLayout->addWidget(mEditor); | 134 | topLayout->addWidget(mEditor); |
134 | mEditor->installEventFilter(this); | 135 | mEditor->installEventFilter(this); |
135 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 136 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
136 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 137 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index aa55d82..e601eef 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -104,49 +104,54 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | |||
104 | headerLayout->addWidget(locationLabel,0,2); | 104 | headerLayout->addWidget(locationLabel,0,2); |
105 | else | 105 | else |
106 | headerLayout->addWidget(locationLabel,1,0); | 106 | headerLayout->addWidget(locationLabel,1,0); |
107 | 107 | ||
108 | mLocationEdit = new KOLocationBox(TRUE,parent,30); | 108 | mLocationEdit = new KOLocationBox(TRUE,parent,30); |
109 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 109 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
110 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) | 110 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) |
111 | mLocationEdit->setMaximumHeight( hei + 6); | 111 | mLocationEdit->setMaximumHeight( hei + 6); |
112 | 112 | ||
113 | // mLocationEdit = new QLineEdit(parent); | 113 | // mLocationEdit = new QLineEdit(parent); |
114 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 114 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
115 | 115 | ||
116 | mCalendarBox = new QComboBox ( parent ); | 116 | mCalendarBox = new QComboBox ( parent ); |
117 | mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 117 | mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
118 | if ( QApplication::desktop()->height() < 320 ) { | 118 | if ( QApplication::desktop()->height() < 320 ) { |
119 | headerLayout->addWidget(mLocationEdit,0,3); | 119 | headerLayout->addWidget(mLocationEdit,0,3); |
120 | headerLayout->addWidget(mCalendarBox,0,4); | 120 | headerLayout->addWidget(mCalendarBox,0,4); |
121 | headerLayout->setColStretch( 1, 10); | 121 | headerLayout->setColStretch( 1, 10); |
122 | headerLayout->setColStretch( 3, 10); | 122 | headerLayout->setColStretch( 3, 10); |
123 | mCalendarBox->setMaximumWidth( 64 ); | 123 | mCalendarBox->setMaximumWidth( 64 ); |
124 | } | 124 | } |
125 | else { | 125 | else { |
126 | headerLayout->addWidget(mLocationEdit,1,1); | 126 | headerLayout->addWidget(mLocationEdit,1,1); |
127 | headerLayout->addWidget(mCalendarBox,1,2); | 127 | headerLayout->addWidget(mCalendarBox,1,2); |
128 | headerLayout->setColStretch( 1, 3); | 128 | int str = 3; |
129 | if ( QApplication::desktop()->width() < 320 ) { | ||
130 | --str; | ||
131 | --str; | ||
132 | } | ||
133 | headerLayout->setColStretch( 1, str); | ||
129 | headerLayout->setColStretch( 2, 1); | 134 | headerLayout->setColStretch( 2, 1); |
130 | } | 135 | } |
131 | 136 | ||
132 | } | 137 | } |
133 | void KOEditorGeneral::setFocusOn( int i ) | 138 | void KOEditorGeneral::setFocusOn( int i ) |
134 | { | 139 | { |
135 | mNextFocus = i; | 140 | mNextFocus = i; |
136 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); | 141 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); |
137 | } | 142 | } |
138 | void KOEditorGeneral::slotSetFocusOn() | 143 | void KOEditorGeneral::slotSetFocusOn() |
139 | { | 144 | { |
140 | mNextFocus; | 145 | mNextFocus; |
141 | if ( mNextFocus == 1 ) { | 146 | if ( mNextFocus == 1 ) { |
142 | mDescriptionEdit->setFocus(); | 147 | mDescriptionEdit->setFocus(); |
143 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); | 148 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); |
144 | } | 149 | } |
145 | if ( mNextFocus == 2 ) { | 150 | if ( mNextFocus == 2 ) { |
146 | mSummaryEdit->setFocus(); | 151 | mSummaryEdit->setFocus(); |
147 | } | 152 | } |
148 | } | 153 | } |
149 | void KOEditorGeneral::editCategories() | 154 | void KOEditorGeneral::editCategories() |
150 | { | 155 | { |
151 | // qDebug("KOEditorGeneral::editCategories() "); | 156 | // qDebug("KOEditorGeneral::editCategories() "); |
152 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 157 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |