Changeset View
Changeset View
Standalone View
Standalone View
src/settings/ProfileSettings.cpp
Show First 20 Lines • Show All 503 Lines • ▼ Show 20 Line(s) | |||||
504 | } | 504 | } | ||
505 | 505 | | |||
506 | QSize Konsole::ShortcutItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const | 506 | QSize Konsole::ShortcutItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const | ||
507 | { | 507 | { | ||
508 | const QString shortcutString = index.data(Qt::DisplayRole).toString(); | 508 | const QString shortcutString = index.data(Qt::DisplayRole).toString(); | ||
509 | QFontMetrics fm = option.fontMetrics; | 509 | QFontMetrics fm = option.fontMetrics; | ||
510 | 510 | | |||
511 | static const int editorMargins = 16; // chosen empirically | 511 | static const int editorMargins = 16; // chosen empirically | ||
512 | const int width = fm.width(shortcutString + QStringLiteral(", ...")) | 512 | const int width = fm.boundingRect(shortcutString + QStringLiteral(", ...")).width() | ||
513 | + editorMargins; | 513 | + editorMargins; | ||
514 | 514 | | |||
515 | return {width, QStyledItemDelegate::sizeHint(option, index).height()}; | 515 | return {width, QStyledItemDelegate::sizeHint(option, index).height()}; | ||
516 | } | 516 | } | ||
517 | 517 | | |||
518 | void Konsole::ShortcutItemDelegate::destroyEditor(QWidget *editor, const QModelIndex &index) const | 518 | void Konsole::ShortcutItemDelegate::destroyEditor(QWidget *editor, const QModelIndex &index) const | ||
519 | { | 519 | { | ||
520 | _itemsBeingEdited.remove(index); | 520 | _itemsBeingEdited.remove(index); | ||
Show All 25 Lines |