Changeset View
Changeset View
Standalone View
Standalone View
src/kmessagebox.cpp
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Line(s) | 198 | { | |||
---|---|---|---|---|---|
223 | iconLayout->addWidget(iconLabel); | 223 | iconLayout->addWidget(iconLabel); | ||
224 | iconLayout->addStretch(5); | 224 | iconLayout->addStretch(5); | ||
225 | 225 | | |||
226 | hLayout->addLayout(iconLayout, 0); | 226 | hLayout->addLayout(iconLayout, 0); | ||
227 | hLayout->addSpacing(spacingHint); | 227 | hLayout->addSpacing(spacingHint); | ||
228 | 228 | | |||
229 | QLabel *messageLabel = new QLabel(text, mainWidget); | 229 | QLabel *messageLabel = new QLabel(text, mainWidget); | ||
230 | messageLabel->setOpenExternalLinks(options & KMessageBox::AllowLink); | 230 | messageLabel->setOpenExternalLinks(options & KMessageBox::AllowLink); | ||
231 | Qt::TextInteractionFlags flags = Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard; | 231 | Qt::TextInteractionFlags flags = Qt::TextSelectableByMouse; | ||
232 | if (options & KMessageBox::AllowLink) { | 232 | if (options & KMessageBox::AllowLink) { | ||
233 | flags |= Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard; | 233 | flags |= Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard; | ||
234 | } | 234 | } | ||
235 | messageLabel->setTextInteractionFlags(flags); | 235 | messageLabel->setTextInteractionFlags(flags); | ||
236 | 236 | | |||
237 | QRect desktop = QApplication::desktop()->screenGeometry(dialog); | 237 | QRect desktop = QApplication::desktop()->screenGeometry(dialog); | ||
238 | bool usingSqueezedTextLabel = false; | 238 | bool usingSqueezedTextLabel = false; | ||
239 | if (messageLabel->sizeHint().width() > desktop.width() * 0.5) { | 239 | if (messageLabel->sizeHint().width() > desktop.width() * 0.5) { | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 311 | if (!details.isEmpty()) { | |||
312 | QHBoxLayout *detailsHLayout = new QHBoxLayout(); | 312 | QHBoxLayout *detailsHLayout = new QHBoxLayout(); | ||
313 | detailsHLayout->addSpacing(2 * spacingHint + iconLayout->sizeHint().width()); | 313 | detailsHLayout->addSpacing(2 * spacingHint + iconLayout->sizeHint().width()); | ||
314 | KCollapsibleGroupBox *detailsGroup = new KCollapsibleGroupBox(); | 314 | KCollapsibleGroupBox *detailsGroup = new KCollapsibleGroupBox(); | ||
315 | detailsGroup->setTitle(QApplication::translate("KMessageBox", "Details")); | 315 | detailsGroup->setTitle(QApplication::translate("KMessageBox", "Details")); | ||
316 | QVBoxLayout *detailsLayout = new QVBoxLayout(detailsGroup); | 316 | QVBoxLayout *detailsLayout = new QVBoxLayout(detailsGroup); | ||
317 | if (details.length() < 512) { | 317 | if (details.length() < 512) { | ||
318 | QLabel *detailsLabel = new QLabel(details); | 318 | QLabel *detailsLabel = new QLabel(details); | ||
319 | detailsLabel->setOpenExternalLinks(options & KMessageBox::AllowLink); | 319 | detailsLabel->setOpenExternalLinks(options & KMessageBox::AllowLink); | ||
320 | Qt::TextInteractionFlags flags = Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard; | 320 | Qt::TextInteractionFlags flags = Qt::TextSelectableByMouse; | ||
321 | if (options & KMessageBox::AllowLink) { | 321 | if (options & KMessageBox::AllowLink) { | ||
322 | flags |= Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard; | 322 | flags |= Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard; | ||
323 | }; | 323 | }; | ||
324 | detailsLabel->setTextInteractionFlags(flags); | 324 | detailsLabel->setTextInteractionFlags(flags); | ||
325 | detailsLabel->setWordWrap(true); | 325 | detailsLabel->setWordWrap(true); | ||
326 | detailsLabel->setMinimumSize(detailsLabel->sizeHint()); | 326 | detailsLabel->setMinimumSize(detailsLabel->sizeHint()); | ||
327 | detailsLayout->addWidget(detailsLabel, 50); | 327 | detailsLayout->addWidget(detailsLabel, 50); | ||
328 | } else { | 328 | } else { | ||
▲ Show 20 Lines • Show All 871 Lines • Show Last 20 Lines |