-rw-r--r-- | korganizer/navigatorbar.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 1b4ee52..06f5ef8 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -130,99 +130,99 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
130 | // ctrlLayout->addSpacing( 1 ); | 130 | // ctrlLayout->addSpacing( 1 ); |
131 | // ctrlLayout->addWidget( mDateLabel ); | 131 | // ctrlLayout->addWidget( mDateLabel ); |
132 | ctrlLayout->addWidget( mSelectMonth ); | 132 | ctrlLayout->addWidget( mSelectMonth ); |
133 | // ctrlLayout->addSpacing( 1 ); | 133 | // ctrlLayout->addSpacing( 1 ); |
134 | // ctrlLayout->addStretch( 1 ); | 134 | // ctrlLayout->addStretch( 1 ); |
135 | ctrlLayout->addWidget( mNextWeek, 3 ); | 135 | ctrlLayout->addWidget( mNextWeek, 3 ); |
136 | ctrlLayout->addWidget( mNextMonth, 3 ); | 136 | ctrlLayout->addWidget( mNextMonth, 3 ); |
137 | ctrlLayout->addWidget( mNextYear, 3 ); | 137 | ctrlLayout->addWidget( mNextYear, 3 ); |
138 | 138 | ||
139 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); | 139 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); |
140 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 140 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
141 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); | 141 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); |
142 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); | 142 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); |
143 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); | 143 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); |
144 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); | 144 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); |
145 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); | 145 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |
146 | mPrevYear->setFocusPolicy(NoFocus); | 146 | mPrevYear->setFocusPolicy(NoFocus); |
147 | mPrevMonth->setFocusPolicy(NoFocus); | 147 | mPrevMonth->setFocusPolicy(NoFocus); |
148 | mNextMonth->setFocusPolicy(NoFocus); | 148 | mNextMonth->setFocusPolicy(NoFocus); |
149 | mPrevWeek->setFocusPolicy(NoFocus); | 149 | mPrevWeek->setFocusPolicy(NoFocus); |
150 | mNextWeek->setFocusPolicy(NoFocus); | 150 | mNextWeek->setFocusPolicy(NoFocus); |
151 | mNextYear->setFocusPolicy(NoFocus); | 151 | mNextYear->setFocusPolicy(NoFocus); |
152 | mSelectMonth->setFocusPolicy(NoFocus); | 152 | mSelectMonth->setFocusPolicy(NoFocus); |
153 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | 153 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |
154 | 154 | ||
155 | } | 155 | } |
156 | 156 | ||
157 | NavigatorBar::~NavigatorBar() | 157 | NavigatorBar::~NavigatorBar() |
158 | { | 158 | { |
159 | } | 159 | } |
160 | QSize NavigatorBar::sizeHint() const | 160 | QSize NavigatorBar::sizeHint() const |
161 | { | 161 | { |
162 | int wid = mCurrentMinWid ; | 162 | int wid = mCurrentMinWid ; |
163 | if ( mPrevYear->isVisible() ) | 163 | if ( mPrevYear->isVisible() ) |
164 | wid += mCurrentButtonMinWid; | 164 | wid += mCurrentButtonMinWid; |
165 | if ( mPrevMonth->isVisible() ) | 165 | if ( mPrevMonth->isVisible() ) |
166 | wid += mCurrentButtonMinWid; | 166 | wid += mCurrentButtonMinWid; |
167 | if ( mPrevWeek->isVisible() ) | 167 | if ( mPrevWeek->isVisible() ) |
168 | wid += mCurrentButtonMinWid; | 168 | wid += mCurrentButtonMinWid; |
169 | if ( mNextMonth->isVisible() ) | 169 | if ( mNextMonth->isVisible() ) |
170 | wid += mCurrentButtonMinWid; | 170 | wid += mCurrentButtonMinWid; |
171 | if ( mNextWeek->isVisible() ) | 171 | if ( mNextWeek->isVisible() ) |
172 | wid += mCurrentButtonMinWid; | 172 | wid += mCurrentButtonMinWid; |
173 | if ( mNextYear->isVisible() ) | 173 | if ( mNextYear->isVisible() ) |
174 | wid += mCurrentButtonMinWid; | 174 | wid += mCurrentButtonMinWid; |
175 | //qDebug("ret %d %d ", wid, mCurrentHei); | 175 | //qDebug("ret %d %d ", wid, mCurrentHei); |
176 | return QSize ( wid, mCurrentHei ); | 176 | return QSize ( wid, mCurrentHei ); |
177 | } | 177 | } |
178 | QSize NavigatorBar::sizeHintTwoButtons() const | 178 | QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const |
179 | { | 179 | { |
180 | return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei ); | 180 | return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); |
181 | } | 181 | } |
182 | void NavigatorBar::resetFont ( QFont fo ) | 182 | void NavigatorBar::resetFont ( QFont fo ) |
183 | { | 183 | { |
184 | 184 | ||
185 | QFont tfont = fo; | 185 | QFont tfont = fo; |
186 | if ( QApplication::desktop()->width() >= 480 ) | 186 | if ( QApplication::desktop()->width() >= 480 ) |
187 | tfont.setPointSize(tfont.pointSize()+2); | 187 | tfont.setPointSize(tfont.pointSize()+2); |
188 | tfont.setBold(true); | 188 | tfont.setBold(true); |
189 | 189 | ||
190 | mSelectMonth->setFont( tfont ); | 190 | mSelectMonth->setFont( tfont ); |
191 | // Set minimum width to width of widest month name label | 191 | // Set minimum width to width of widest month name label |
192 | int i; | 192 | int i; |
193 | int maxwidth = 0; | 193 | int maxwidth = 0; |
194 | QFontMetrics fm ( mSelectMonth->font() ); | 194 | QFontMetrics fm ( mSelectMonth->font() ); |
195 | int width = fm.width("September '00" ); | 195 | int width = fm.width("September '00" ); |
196 | maxwidth = width+2; | 196 | maxwidth = width+2; |
197 | int size = fm.height()+2; | 197 | int size = fm.height()+2; |
198 | if ( QApplication::desktop()->width() >= 480 ) { | 198 | if ( QApplication::desktop()->width() >= 480 ) { |
199 | size += 6; | 199 | size += 6; |
200 | maxwidth+= 6; | 200 | maxwidth+= 6; |
201 | } | 201 | } |
202 | mSelectMonth->setMinimumWidth( maxwidth ); | 202 | mSelectMonth->setMinimumWidth( maxwidth ); |
203 | mSelectMonth->setFixedHeight( size ); | 203 | mSelectMonth->setFixedHeight( size ); |
204 | mPrevYear->setFixedHeight( size ); | 204 | mPrevYear->setFixedHeight( size ); |
205 | mPrevMonth->setFixedHeight( size ); | 205 | mPrevMonth->setFixedHeight( size ); |
206 | mPrevWeek->setFixedHeight( size ); | 206 | mPrevWeek->setFixedHeight( size ); |
207 | mNextMonth->setFixedHeight( size ); | 207 | mNextMonth->setFixedHeight( size ); |
208 | mNextWeek->setFixedHeight( size ); | 208 | mNextWeek->setFixedHeight( size ); |
209 | mNextYear->setFixedHeight ( size ); | 209 | mNextYear->setFixedHeight ( size ); |
210 | mCurrentHei = size +2; | 210 | mCurrentHei = size +2; |
211 | mCurrentMinWid = maxwidth+2; | 211 | mCurrentMinWid = maxwidth+2; |
212 | mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2; | 212 | mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2; |
213 | } | 213 | } |
214 | 214 | ||
215 | void NavigatorBar::showButtons( bool left, bool right ) | 215 | void NavigatorBar::showButtons( bool left, bool right ) |
216 | { | 216 | { |
217 | if ( left ) { | 217 | if ( left ) { |
218 | mPrevYear->show(); | 218 | mPrevYear->show(); |
219 | mPrevMonth->show(); | 219 | mPrevMonth->show(); |
220 | } else { | 220 | } else { |
221 | mPrevYear->hide(); | 221 | mPrevYear->hide(); |
222 | mPrevMonth->hide(); | 222 | mPrevMonth->hide(); |
223 | } | 223 | } |
224 | 224 | ||
225 | if ( right ) { | 225 | if ( right ) { |
226 | mNextYear->show(); | 226 | mNextYear->show(); |
227 | mNextMonth->show(); | 227 | mNextMonth->show(); |
228 | } else { | 228 | } else { |