Changeset View
Changeset View
Standalone View
Standalone View
src/kmessagebox.cpp
Show First 20 Lines • Show All 341 Lines • ▼ Show 20 Line(s) | 341 | if (!usingListWidget) { | |||
---|---|---|---|---|---|
342 | mainLayout->setStretchFactor(hLayout, 10); | 342 | mainLayout->setStretchFactor(hLayout, 10); | ||
343 | } | 343 | } | ||
344 | topLayout->addWidget(detailsGroup); | 344 | topLayout->addWidget(detailsGroup); | ||
345 | buttonsHelper->setDetailsWidget(detailsGroup); | 345 | buttonsHelper->setDetailsWidget(detailsGroup); | ||
346 | detailsGroup->hide(); | 346 | detailsGroup->hide(); | ||
347 | } | 347 | } | ||
348 | 348 | | |||
349 | buttons->setParent(dialog); | 349 | buttons->setParent(dialog); | ||
350 | | ||||
351 | // try to set the focus to a default button. | ||||
352 | Q_FOREACH(QAbstractButton* button, buttons->buttons()) { | ||||
353 | QPushButton* btn = dynamic_cast<QPushButton*>(button); | ||||
354 | | ||||
355 | if (btn != nullptr && btn->isDefault()) { | ||||
356 | btn->setFocus(); | ||||
357 | } | ||||
358 | } | ||||
359 | | ||||
350 | topLayout->addWidget(buttons); | 360 | topLayout->addWidget(buttons); | ||
351 | 361 | | |||
352 | if (!usingListWidget && !usingScrollArea && !usingSqueezedTextLabel && details.isEmpty()) { | 362 | if (!usingListWidget && !usingScrollArea && !usingSqueezedTextLabel && details.isEmpty()) { | ||
353 | dialog->setFixedSize(dialog->sizeHint() + QSize(10, 10)); | 363 | dialog->setFixedSize(dialog->sizeHint() + QSize(10, 10)); | ||
354 | } else if (!details.isEmpty() && dialog->minimumHeight() < iconLabel->sizeHint().height() * 2) { //strange bug... | 364 | } else if (!details.isEmpty() && dialog->minimumHeight() < iconLabel->sizeHint().height() * 2) { //strange bug... | ||
355 | if (!usingScrollArea) { | 365 | if (!usingScrollArea) { | ||
356 | dialog->setMinimumSize(300, qMax(150, qMax(iconLabel->sizeHint().height(), messageLabel->sizeHint().height()))); | 366 | dialog->setMinimumSize(300, qMax(150, qMax(iconLabel->sizeHint().height(), messageLabel->sizeHint().height()))); | ||
357 | } else { | 367 | } else { | ||
▲ Show 20 Lines • Show All 815 Lines • Show Last 20 Lines |