Changeset View
Changeset View
Standalone View
Standalone View
src/kcollapsiblegroupbox.cpp
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Line(s) | 274 | { | |||
---|---|---|---|---|---|
280 | if (key == Qt::Key_Space || key == Qt::Key_Enter || key == Qt::Key_Return) { | 280 | if (key == Qt::Key_Space || key == Qt::Key_Enter || key == Qt::Key_Return) { | ||
281 | toggle(); | 281 | toggle(); | ||
282 | event->setAccepted(true); | 282 | event->setAccepted(true); | ||
283 | } | 283 | } | ||
284 | } | 284 | } | ||
285 | 285 | | |||
286 | void KCollapsibleGroupBox::resizeEvent(QResizeEvent *event) | 286 | void KCollapsibleGroupBox::resizeEvent(QResizeEvent *event) | ||
287 | { | 287 | { | ||
288 | int top, left, right, bottom; | 288 | const QMargins margins = contentsMargins(); | ||
aacid: if you get bored, add const? | |||||
289 | getContentsMargins(&left, &top, &right, &bottom); | | |||
290 | 289 | | |||
291 | if (layout()) { | 290 | if (layout()) { | ||
292 | //we don't want the layout trying to fit the current frame of the animation so always set it to the target height | 291 | //we don't want the layout trying to fit the current frame of the animation so always set it to the target height | ||
293 | layout()->setGeometry(QRect(left, top, width() - left - right, layout()->sizeHint().height())); | 292 | layout()->setGeometry(QRect(margins.left(), margins.top(), width() - margins.left() - margins.right(), layout()->sizeHint().height())); | ||
294 | } | 293 | } | ||
295 | 294 | | |||
296 | Q_UNUSED(bottom) | | |||
297 | QWidget::resizeEvent(event); | 295 | QWidget::resizeEvent(event); | ||
298 | } | 296 | } | ||
299 | 297 | | |||
300 | void KCollapsibleGroupBox::overrideFocusPolicyOf(QWidget *widget) | 298 | void KCollapsibleGroupBox::overrideFocusPolicyOf(QWidget *widget) | ||
301 | { | 299 | { | ||
302 | // https://bugs.kde.org/show_bug.cgi?id=396450 | 300 | // https://bugs.kde.org/show_bug.cgi?id=396450 | ||
303 | // A label with word-wrapping enabled will break positioning of the groupbox in the layout. | 301 | // A label with word-wrapping enabled will break positioning of the groupbox in the layout. | ||
304 | // The cause seems to be the setFocusPolicy() call below, but it's not clear why. | 302 | // The cause seems to be the setFocusPolicy() call below, but it's not clear why. | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
if you get bored, add const?