diff options
Diffstat (limited to 'kde-frameworks/kconfigwidgets')
-rw-r--r-- | kde-frameworks/kconfigwidgets/Manifest | 10 | ||||
-rw-r--r-- | kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-KCommandBar-alignment.patch | 494 | ||||
-rw-r--r-- | kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-hamburger-menu-no-window-on-wayland.patch | 87 | ||||
-rw-r--r-- | kde-frameworks/kconfigwidgets/kconfigwidgets-5.90.1.ebuild | 2 | ||||
-rw-r--r-- | kde-frameworks/kconfigwidgets/kconfigwidgets-5.92.0.ebuild (renamed from kde-frameworks/kconfigwidgets/kconfigwidgets-5.88.0-r1.ebuild) | 20 | ||||
-rw-r--r-- | kde-frameworks/kconfigwidgets/metadata.xml | 1 |
6 files changed, 13 insertions, 601 deletions
diff --git a/kde-frameworks/kconfigwidgets/Manifest b/kde-frameworks/kconfigwidgets/Manifest index 4fd612a8c555..550ec8648053 100644 --- a/kde-frameworks/kconfigwidgets/Manifest +++ b/kde-frameworks/kconfigwidgets/Manifest @@ -1,7 +1,5 @@ -AUX kconfigwidgets-5.88.0-KCommandBar-alignment.patch 19750 BLAKE2B f4d2cfeb271238067217b0b45a990c5decd766dd225c9c88ea0976b699c96c2cacb2cde8c336be297902234a22c77d12f3e80cb32f82de3a1a5b3fe0c30809f0 SHA512 40875e9f7b6eeedd5ddfdebade4faca2b8f9a86485a656ef83b3e65b925233c97af3daafa0f41d042451a98a198523117cf5cc10f4c2ec8e209be7ea4734a4ad -AUX kconfigwidgets-5.88.0-hamburger-menu-no-window-on-wayland.patch 3542 BLAKE2B 87448642741508dc6d259500a6539f83f270a9ad473146e76f527d22843149245b296ccaac67bed0b1566b45f97e2e6f77fc19ed8c7698101daf81d7d7fa988a SHA512 6aabfbe4923882d8d3dbd2271120a2a748f8299f4a9ff3a413ff107442319c698f47adc248b548f2fb33ee61313365d346154175e5edab481fb19f5891c92d94 -DIST kconfigwidgets-5.88.0.tar.xz 412648 BLAKE2B 45b08f839fea13f848a8c6f0990b0da1fad44c27659d18102fcba9ec407fed7588cafc20d401f9b0253fb26baba484bb901b5ffe310f2e8ad4b666673773968d SHA512 cbc4af1f19509325528cef138746b081552547bbbd5c741dada8d9b58e6d510eb3611867335d94b892d42fa1eb771f0ab4b93c56014cede65bf6769cf10b5a3e DIST kconfigwidgets-5.90.1.tar.xz 414176 BLAKE2B 3e6bdcefd2dc0b275b2c8d7e6d314e98fb3f2911fc60e4445b6a07adb52240b247927cb869a27695f2c43d0304e545a534de809518a84b2f53c34cce9fa73ed0 SHA512 51e1f388a4d6c41f538b7adc01b0fd87242b483f10c425f8ff0e4920e82cded5b9c921ec0e1ad858cdb905bd3fdc32befd5e17424702c7861ec2c9fbf517a208 -EBUILD kconfigwidgets-5.88.0-r1.ebuild 1125 BLAKE2B 2152f35149beb1f0ddf579a33eb0db4de132d71cb8b46f39fb02ef2f2b3613b4a7c20d92d92b54d7f3b37567a778e76e078dbd70862b5fa59fef550428d55626 SHA512 753778fa41c1fae49735400ae42d3371571da782f06f99d626a9a3199159523479cfdabe6ab2fa3573e889f3b582e774a7eb2e4501aca5110708a622d2504f87 -EBUILD kconfigwidgets-5.90.1.ebuild 1005 BLAKE2B 433269c97c4b813fef3cc54ca7cb49d257224cb82d9c1330527f7928fafeeca4d917fee99672703046c28789983738e455045ed6505faa0e1a006813c25d23e4 SHA512 d9cc5388fc6bc2b5cf81bcd7072e04aa6a76a51a842ddb84309919ebb65740a66bc788ef89b2489f9280f66ac8fbe253dbba2ed0ae7668fd60f1ce6875a2b369 -MISC metadata.xml 547 BLAKE2B 127ee4110b748cd3e3c26b63248d35f78b233b00cf4466ccc0145a613062a5aa9cc2e9ebd91d0e7482c67f6e265938176b169a9c52eda30bfcddf02549ec8f06 SHA512 2d36585b1af6205dc1bfcff7c3cb24c85376716159317b5c105c866143d49e89e91e501c9a4cf2d63265c30a09e8df71bca841319bd3f2b551e79fde90b1d96e +DIST kconfigwidgets-5.92.0.tar.xz 414528 BLAKE2B 688c6c509577e67558e0d3d080c7b11dc0041a6607c9b5d10d7e057e7c38db57b49bb0e28535a4314f32906d2a9bf55a6b96dc8e064a8775d08d3faf270351aa SHA512 50d07daab3469a3ac9bea2a5ff37b9b1be13bd833a94892825d25f5cd066dc5eb8d44d37319811463e6edc94123da0255851d4f6463ed3c723c6fc69e1902a5f +EBUILD kconfigwidgets-5.90.1.ebuild 1002 BLAKE2B 1854eacaa26b8b7876f7cfd316fb345502272bb43aa3eafc70f5de686b0bc004e53293b14bc8cae4e54b9dce6662ff17409f9a048d909d4be1c0ddd29e137955 SHA512 69ab2a2dda85be6413ecb18cf7f22f2c5165696a08ee07aed5bc291d055a09546cd500d4ba70d153715b393e86e3a37e68aa55ad5044859da0a492e16b9625c5 +EBUILD kconfigwidgets-5.92.0.ebuild 977 BLAKE2B 81fa5c46d271f35bca0c196e9965dff5f9276bb333bde5b2e7e8c4586580f37d113929537d7e17c4b17040dfbb869b9f70c3713ce96ee09ac7fcda3cb8cbb3e8 SHA512 ecdf2239a29ed3535c398951af5c3bfef717e87e88dc9b936f8f107b4aa6b32ac5073dfa380f50adbedd365fb3cb6658ded782f47a454ac9a60de1086b1c0c5c +MISC metadata.xml 640 BLAKE2B 52c9d5ed9112001bc1111ca95b80d3e261b240658ca4e0ce08b8b852a6894af72b6170f31c16fa28c834dba95e0df79380fc1639dc337484909b118c5b005916 SHA512 4a1995fa56a5d0bdecb9d10654239d48706d670a6e0a38837c59f404dc1165b12a690be51f60880327d85c8b3c778e866826cb73d3d07331cbce9f4303754316 diff --git a/kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-KCommandBar-alignment.patch b/kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-KCommandBar-alignment.patch deleted file mode 100644 index 1ebd8e3dd551..000000000000 --- a/kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-KCommandBar-alignment.patch +++ /dev/null @@ -1,494 +0,0 @@ -From 34d5352c1f30d92b10667574cb7fcc1cf7e9af66 Mon Sep 17 00:00:00 2001 -From: Eugene Popov <popov895@ukr.net> -Date: Sat, 6 Nov 2021 18:49:37 +0000 -Subject: [PATCH] [KCommandBar] Dynamic column widths + shortcuts alignment - ---- - src/kcommandbar.cpp | 278 +++++++++++++++++++++---------------- - src/kcommandbarmodel_p.cpp | 17 +-- - src/kcommandbarmodel_p.h | 9 +- - tests/kcommandbartest.cpp | 9 ++ - 4 files changed, 176 insertions(+), 137 deletions(-) - -diff --git a/src/kcommandbar.cpp b/src/kcommandbar.cpp -index 0d17ffa0..4d0987d7 100644 ---- a/src/kcommandbar.cpp -+++ b/src/kcommandbar.cpp -@@ -16,6 +16,7 @@ - #include <QTextLayout> - #include <QTreeView> - #include <QVBoxLayout> -+#include <QHeaderView> - - #include <KConfigGroup> - #include <KFuzzyMatcher> -@@ -147,32 +148,24 @@ public: - - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override - { -- QStyleOptionViewItem options = option; -- initStyleOption(&options, index); -- - painter->save(); - -- // paint background -- if (option.state & QStyle::State_Selected) { -- painter->fillRect(option.rect, option.palette.highlight()); -- } else { -- painter->fillRect(option.rect, option.palette.base()); -- } -- - /** - * Draw everything, (widget, icon etc) except the text - */ -- options.text = QString(); // clear old text -- QStyle *style = options.widget->style(); -- style->drawControl(QStyle::CE_ItemViewItem, &options, painter, options.widget); -+ QStyleOptionViewItem optionCopy = option; -+ initStyleOption(&optionCopy, index); -+ optionCopy.text.clear(); // clear old text -+ QStyle *style = option.widget->style(); -+ style->drawControl(QStyle::CE_ItemViewItem, &optionCopy, painter, option.widget); - -- const int hMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, &options, options.widget); -+ const int hMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, &option, option.widget); - - QRect outputRect = option.rect; - - const CommandBarFilterModel *model = static_cast<const CommandBarFilterModel*>(index.model()); - if (model->hasActionsWithIcons()) { -- const int iconWidth = options.decorationSize.width() + hMargin; -+ const int iconWidth = option.decorationSize.width() + hMargin; - if (option.direction == Qt::RightToLeft) { - outputRect.adjust(0, 0, -iconWidth, 0); - } else { -@@ -198,7 +191,7 @@ public: - } - - QTextCharFormat fmt; -- fmt.setForeground(options.palette.link().color()); -+ fmt.setForeground(option.palette.link().color()); - fmt.setFontWeight(QFont::Bold); - - /** -@@ -206,13 +199,13 @@ public: - */ - const auto fmtRanges = KFuzzyMatcher::matchedRanges(m_filterString, str); - QTextCharFormat f; -- f.setForeground(options.palette.link()); -+ f.setForeground(option.palette.link()); - std::transform(fmtRanges.begin(), fmtRanges.end(), std::back_inserter(formats), [f, actionNameStart](const KFuzzyMatcher::Range &fr) { - return QTextLayout::FormatRange{fr.start + actionNameStart, fr.length, f}; - }); - - outputRect.adjust(hMargin, 0, -hMargin, 0); -- paintItemText(painter, original, outputRect, options, std::move(formats)); -+ paintItemText(painter, original, outputRect, option, std::move(formats)); - - painter->restore(); - } -@@ -240,122 +233,159 @@ public: - return shortcutString.split(QLatin1String(", "), Qt::SkipEmptyParts); - } - -+ // returns the width needed to draw the shortcut -+ static int shortcutDrawingWidth(const QStyleOptionViewItem &option, const QString &shortcut, int hMargin) -+ { -+ int width = 0; -+ if (!shortcut.isEmpty()) { -+ // adapt the shortcut as it will be drawn -+ // "Ctrl+A, Alt+B" => "Ctrl+A+Alt+B" -+ QString adaptedShortcut = shortcut; -+ adaptedShortcut.replace(QStringLiteral(", "), QStringLiteral("+")); -+ -+ width = option.fontMetrics.horizontalAdvance(adaptedShortcut); -+ -+ // count the number of segments -+ // "Ctrl+A+Alt+B" => ["Ctrl", "+", "A", "+", "Alt", "+", "B"] -+ static const QRegularExpression regExp(QStringLiteral("(\\+(?!\\+)|\\+(?=\\+{2}))")); -+ const int segmentsCount = 2 * adaptedShortcut.count(regExp) + 1; -+ -+ // add left and right margins for each segment -+ width += segmentsCount * 2 * hMargin; -+ } -+ -+ return width; -+ } -+ - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override - { -- QStyleOptionViewItem options = option; -- initStyleOption(&options, index); -- painter->save(); -+ // draw background -+ option.widget->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, painter); - - const QString shortcutString = index.data().toString(); -- -- // paint background -- if (option.state & QStyle::State_Selected) { -- painter->fillRect(option.rect, option.palette.highlight()); -- } else { -- painter->fillRect(option.rect, option.palette.base()); -+ if (shortcutString.isEmpty()) { -+ return; - } - -- options.text = QString(); // clear old text -- options.widget->style()->drawControl(QStyle::CE_ItemViewItem, &options, painter, options.widget); -- -- if (!shortcutString.isEmpty()) { -- /** -- * Shortcut string splitting -- * -- * We do it in two steps -- * 1. Split on ", " so that if we have multi modifier shortcuts they are nicely -- * split into strings. -- * 2. Split each shortcut from step 1 into individual string. -- * -- * Example: -- * -- * "Ctrl+,, Alt+:" -- * Step 1: [ "Ctrl+," , "Alt+:"] -- * Step 2: [ "Ctrl", ",", "Alt", ":"] -- */ -- const QStringList spaceSplitted = splitShortcutString(shortcutString); -- QStringList list; -- list.reserve(spaceSplitted.size() * 2); -- for (const QString &shortcut : spaceSplitted) { -- list += shortcut.split(QLatin1Char('+'), Qt::SkipEmptyParts); -- if (shortcut.endsWith(QLatin1Char('+'))) { -- list.append(QStringLiteral("+")); -- } -+ /** -+ * Shortcut string splitting -+ * -+ * We do it in two steps -+ * 1. Split on ", " so that if we have multi modifier shortcuts they are nicely -+ * split into strings. -+ * 2. Split each shortcut from step 1 into individual string. -+ * -+ * Example: -+ * -+ * "Ctrl+,, Alt+:" -+ * Step 1: [ "Ctrl+," , "Alt+:"] -+ * Step 2: [ "Ctrl", ",", "Alt", ":"] -+ */ -+ const QStringList spaceSplitted = splitShortcutString(shortcutString); -+ QStringList list; -+ list.reserve(spaceSplitted.size() * 2); -+ for (const QString &shortcut : spaceSplitted) { -+ list += shortcut.split(QLatin1Char('+'), Qt::SkipEmptyParts); -+ if (shortcut.endsWith(QLatin1Char('+'))) { -+ list.append(QStringLiteral("+")); - } -+ } - -- /** -- * Create rects for each string from the previous step -- * -- * @todo boundingRect may give issues here, use horizontalAdvance -- * @todo We probably dont need the full rect, just the width so the -- * "btns" vector can just be vector<pair<int, string>> -- */ -- QVector<QPair<QRect, QString>> btns; -- btns.reserve(list.size()); -- const int height = options.rect.height(); -- for (const QString &text : std::as_const(list)) { -- if (text.isEmpty()) { -- continue; -- } -- QRect r = option.fontMetrics.boundingRect(text); -- // this happens on gnome so we manually decrease the -- // height a bit -- if (r.height() == height) { -- r.setHeight(r.height() - 4); -- } -- r.setWidth(r.width() + 8); -- btns.append({r, text}); -+ /** -+ * Create rects for each string from the previous step -+ * -+ * @todo We probably dont need the full rect, just the width so the -+ * "btns" vector can just be vector<pair<int, string>> -+ */ -+ QVector<QPair<QRect, QString>> btns; -+ btns.reserve(list.size()); -+ const int height = option.rect.height(); -+ const int hMargin = horizontalMargin(option); -+ for (const QString &text : std::as_const(list)) { -+ if (text.isEmpty()) { -+ continue; - } -- -- // we have nothing, just return -- if (btns.isEmpty()) { -- return; -+ QRect r(0, 0, option.fontMetrics.horizontalAdvance(text), option.fontMetrics.lineSpacing()); -+ // this happens on gnome so we manually decrease the -+ // height a bit -+ if (r.height() == height) { -+ r.setHeight(r.height() - 4); - } -+ r.setWidth(r.width() + 2 * hMargin); -+ btns.append({r, text}); -+ } -+ -+ // we have nothing, just return -+ if (btns.isEmpty()) { -+ return; -+ } -+ -+ const QRect plusRect = option.fontMetrics.boundingRect(QLatin1Char('+')); - -- const QRect plusRect = option.fontMetrics.boundingRect(QLatin1Char('+')); -- -- // draw them -- int x = option.rect.x(); -- const int y = option.rect.y(); -- const int plusY = option.rect.y() + plusRect.height() / 2; -- const int total = btns.size(); -- -- // make sure our rects are nicely V-center aligned in the row -- painter->translate(QPoint(0, (option.rect.height() - btns.at(0).first.height()) / 2)); -- -- int i = 0; -- painter->setRenderHint(QPainter::Antialiasing); -- for (const auto &btn : std::as_const(btns)) { -- painter->setPen(Qt::NoPen); -- const QRect &rect = btn.first; -- -- QRect buttonRect(x, y, rect.width(), rect.height()); -- -- // draw rounded rect shadow -- auto shadowRect = buttonRect.translated(0, 1); -- painter->setBrush(option.palette.shadow()); -- painter->drawRoundedRect(shadowRect, 3.0, 3.0); -- -- // draw rounded rect itself -- painter->setBrush(option.palette.button()); -- painter->drawRoundedRect(buttonRect, 3.0, 3.0); -- -- // draw text inside rounded rect -- painter->setPen(option.palette.buttonText().color()); -- painter->drawText(buttonRect, Qt::AlignCenter, btn.second); -- -- // draw '+' -- if (i + 1 < total) { -- x += rect.width() + 5; -- painter->drawText(QPoint(x, plusY + (rect.height() / 2)), QStringLiteral("+")); -- x += plusRect.width() + 5; -- } -- i++; -+ // draw them -+ int x; -+ if (option.direction == Qt::RightToLeft) { -+ x = option.rect.x() + hMargin; -+ } else { -+ x = option.rect.right() - shortcutDrawingWidth(option, shortcutString, hMargin) - hMargin; -+ } -+ const int y = option.rect.y() + (option.rect.height() - btns.at(0).first.height()) / 2; -+ const int plusY = option.rect.y() + (option.rect.height() - plusRect.height()) / 2; -+ const int total = btns.size(); -+ -+ int i = 0; -+ painter->save(); -+ painter->setRenderHint(QPainter::Antialiasing); -+ for (const auto &btn : std::as_const(btns)) { -+ painter->setPen(Qt::NoPen); -+ const QRect &rect = btn.first; -+ -+ QRect buttonRect(x, y, rect.width(), rect.height()); -+ -+ // draw rounded rect shadow -+ auto shadowRect = buttonRect.translated(0, 1); -+ painter->setBrush(option.palette.shadow()); -+ painter->drawRoundedRect(shadowRect, 3.0, 3.0); -+ -+ // draw rounded rect itself -+ painter->setBrush(option.palette.button()); -+ painter->drawRoundedRect(buttonRect, 3.0, 3.0); -+ -+ // draw text inside rounded rect -+ painter->setPen(option.palette.buttonText().color()); -+ painter->drawText(buttonRect, Qt::AlignCenter, btn.second); -+ -+ // draw '+' -+ if (i + 1 < total) { -+ x += rect.width() + hMargin; -+ painter->drawText(QPoint(x, plusY + (rect.height() / 2)), QStringLiteral("+")); -+ x += plusRect.width() + hMargin; - } -+ i++; - } - - painter->restore(); - } -+ -+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override -+ { -+ if (index.isValid() && index.column() == KCommandBarModel::Column_Shortcut) { -+ QString shortcut = index.data().toString(); -+ if (!shortcut.isEmpty()) { -+ const int hMargin = horizontalMargin(option); -+ const int width = shortcutDrawingWidth(option, shortcut, hMargin) + 2 * hMargin; -+ -+ return QSize(width, 0); -+ } -+ } -+ -+ return QStyledItemDelegate::sizeHint(option, index); -+ } -+ -+ int horizontalMargin(const QStyleOptionViewItem &option) const -+ { -+ return option.widget->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &option) + 2; -+ } - }; - - // BEGIN KCommandBarPrivate -@@ -410,9 +440,6 @@ void KCommandBarPrivate::updateViewGeometry(KCommandBar *q) - - const QSize viewMaxSize(centralSize.width() / 2.4, centralSize.height() / 2); - -- // First column occupies 60% of the width -- m_treeView.setColumnWidth(0, viewMaxSize.width() * 0.6); -- - // Position should be central over window - const int xPos = std::max(0, (centralSize.width() - viewMaxSize.width()) / 2); - const int yPos = std::max(0, (centralSize.height() - viewMaxSize.height()) * 1 / 4); -@@ -505,8 +532,8 @@ KCommandBar::KCommandBar(QWidget *parent) - - CommandBarStyleDelegate *delegate = new CommandBarStyleDelegate(this); - ShortcutStyleDelegate *del = new ShortcutStyleDelegate(this); -- d->m_treeView.setItemDelegateForColumn(0, delegate); -- d->m_treeView.setItemDelegateForColumn(1, del); -+ d->m_treeView.setItemDelegateForColumn(KCommandBarModel::Column_Command, delegate); -+ d->m_treeView.setItemDelegateForColumn(KCommandBarModel::Column_Shortcut, del); - - connect(&d->m_lineEdit, &QLineEdit::returnPressed, this, [this]() { - d->slotReturnPressed(this); -@@ -525,6 +552,11 @@ KCommandBar::KCommandBar(QWidget *parent) - d->m_treeView.setSortingEnabled(true); - d->m_treeView.setModel(&d->m_proxyModel); - -+ d->m_treeView.header()->setMinimumSectionSize(0); -+ d->m_treeView.header()->setStretchLastSection(false); -+ d->m_treeView.header()->setSectionResizeMode(KCommandBarModel::Column_Command, QHeaderView::Stretch); -+ d->m_treeView.header()->setSectionResizeMode(KCommandBarModel::Column_Shortcut, QHeaderView::ResizeToContents); -+ - d->m_treeView.installEventFilter(this); - d->m_lineEdit.installEventFilter(this); - -diff --git a/src/kcommandbarmodel_p.cpp b/src/kcommandbarmodel_p.cpp -index fee271c5..6a172c9c 100644 ---- a/src/kcommandbarmodel_p.cpp -+++ b/src/kcommandbarmodel_p.cpp -@@ -69,12 +69,9 @@ void KCommandBarModel::refresh(const QVector<KCommandBar::ActionGroup> &actionGr - QVector<Item> temp_rows; - std::unordered_set<QAction *> uniqueActions; - temp_rows.reserve(totalActions); -- int actionGroupIdx = 0; - for (const auto &ag : actionGroups) { - const auto &agActions = ag.actions; - fillRows(temp_rows, ag.name, agActions, uniqueActions); -- -- actionGroupIdx++; - } - - /** -@@ -117,22 +114,16 @@ QVariant KCommandBarModel::data(const QModelIndex &index, int role) const - - switch (role) { - case Qt::DisplayRole: -- if (col == 0) { -+ if (col == Column_Command) { - return entry.displayName(); -- } else { -- return entry.action->shortcut().toString(); - } -+ Q_ASSERT(col == Column_Shortcut); -+ return entry.action->shortcut().toString(); - case Qt::DecorationRole: -- if (col == 0) { -+ if (col == Column_Command) { - return entry.action->icon(); - } - break; -- case Qt::TextAlignmentRole: -- if (col == 0) { -- return Qt::AlignLeft; -- } else { -- return Qt::AlignRight; -- } - case Qt::ToolTipRole: { - QString toolTip = entry.displayName(); - if (!entry.action->shortcut().isEmpty()) { -diff --git a/src/kcommandbarmodel_p.h b/src/kcommandbarmodel_p.h -index 29a0249c..af547104 100644 ---- a/src/kcommandbarmodel_p.h -+++ b/src/kcommandbarmodel_p.h -@@ -29,6 +29,13 @@ public: - - enum Role { Score = Qt::UserRole + 1 }; - -+ enum Column -+ { -+ Column_Command, -+ Column_Shortcut, -+ Column_Count -+ }; -+ - /** - * Resets the model - * -@@ -48,7 +55,7 @@ public: - int columnCount(const QModelIndex &parent = QModelIndex()) const override - { - Q_UNUSED(parent); -- return 2; -+ return Column_Count; - } - - /** -diff --git a/tests/kcommandbartest.cpp b/tests/kcommandbartest.cpp -index 46e1bc86..1c631bbb 100644 ---- a/tests/kcommandbartest.cpp -+++ b/tests/kcommandbartest.cpp -@@ -103,6 +103,9 @@ public: - for (; i < 2; ++i) { - acts[1].actions.append(genAction(this, QStringLiteral("folder"), i)); - } -+ acts[1].actions[0]->setShortcut(QStringLiteral("G")); -+ acts[1].actions[1]->setCheckable(true); -+ acts[1].actions[1]->setShortcut(QStringLiteral("Ctrl++")); - - acts[2].name = QStringLiteral("Second Menu Group - Disabled acts"); - for (; i < 4; ++i) { -@@ -116,6 +119,8 @@ public: - for (; i < 6; ++i) { - acts[3].actions.append(genAction(this, QStringLiteral("security-low"), i, Qt::CTRL | Qt::ALT)); - } -+ acts[3].actions[0]->setCheckable(true); -+ acts[3].actions[0]->setShortcut(QStringLiteral("Ctrl+,, Ctrl++, Ctrl+K")); - - return acts; - } -@@ -128,10 +133,14 @@ public: - acts[0].name = QStringLiteral("مینو گروپ"); - acts[0].actions = {new QAction(QIcon::fromTheme("folder"), QStringLiteral("یہ فولڈر ایکشن ہے"), this), - new QAction(QIcon::fromTheme("folder"), QStringLiteral("یہ ایک اور فولڈر ایکشن ہے"), this)}; -+ acts[0].actions[1]->setCheckable(true); -+ acts[0].actions[1]->setShortcut(QStringLiteral("Ctrl+Shift++")); - - acts[1].name = QStringLiteral("گروپ"); - acts[1].actions = {new QAction(QIcon::fromTheme("zoom-out"), QStringLiteral("یہ فولڈر ایکشن ہے"), this), - new QAction(QIcon::fromTheme("security-low"), QStringLiteral("یہ ایک اور فولڈر ایکشن ہے"), this)}; -+ acts[1].actions[1]->setCheckable(true); -+ acts[1].actions[1]->setShortcut(QStringLiteral("Ctrl+-")); - - return acts; - } --- -GitLab - diff --git a/kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-hamburger-menu-no-window-on-wayland.patch b/kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-hamburger-menu-no-window-on-wayland.patch deleted file mode 100644 index 8cf60aeb7594..000000000000 --- a/kde-frameworks/kconfigwidgets/files/kconfigwidgets-5.88.0-hamburger-menu-no-window-on-wayland.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 82c40f18709484fd462643aa113a8ccf961b646a Mon Sep 17 00:00:00 2001 -From: Felix Ernst <fe.a.ernst@gmail.com> -Date: Tue, 26 Oct 2021 17:28:09 +0200 -Subject: [PATCH] Fix hamburger menu opening as a window on Wayland - -Before this commit, if an app window is unfocused and the first -click on the window is the hamburger menu button, the menu would -appear displaced as a separate window on Wayland. - -This commit fixes this by setting a sane transientParent for the -menu. This is slightly difficult because there can be any number -of hamburger buttons in any number of different windows so we need -to figure out spontaneously which button was pressed to open the -menu. - -BUG: 442375 ---- - src/khamburgermenuhelpers.cpp | 26 ++++++++++++++++++++++++-- - src/khamburgermenuhelpers_p.h | 2 +- - 2 files changed, 25 insertions(+), 3 deletions(-) - -diff --git a/src/khamburgermenuhelpers.cpp b/src/khamburgermenuhelpers.cpp -index 88242aa5..d1ae2835 100644 ---- a/src/khamburgermenuhelpers.cpp -+++ b/src/khamburgermenuhelpers.cpp -@@ -10,7 +10,10 @@ - #include "khamburgermenu.h" - - #include <QEvent> -+#include <QMenu> -+#include <QToolButton> - #include <QWidget> -+#include <QWindow> - - ListenerContainer::ListenerContainer(KHamburgerMenuPrivate *hamburgerMenuPrivate) - : QObject{hamburgerMenuPrivate}, -@@ -28,13 +31,32 @@ bool AddOrRemoveActionListener::eventFilter(QObject * /*watched*/, QEvent *event - return false; - } - --bool ButtonPressListener::eventFilter(QObject * /*watched*/, QEvent *event) -+bool ButtonPressListener::eventFilter(QObject *watched, QEvent *event) - { - if (event->type() == QEvent::KeyPress || event->type() == QEvent::MouseButtonPress) { - auto hamburgerMenuPrivate = static_cast<KHamburgerMenuPrivate *>(parent()); - auto q = static_cast<KHamburgerMenu *>(hamburgerMenuPrivate->q_ptr); - Q_EMIT q->aboutToShowMenu(); -- hamburgerMenuPrivate->resetMenu(); -+ hamburgerMenuPrivate->resetMenu(); // This menu never has a parent which can be -+ // problematic because it can lead to situations in which the QMenu itself is -+ // treated like its own window. -+ // To avoid this we set a sane transientParent() now even if it already has one -+ // because the menu might be opened from another window this time. -+ const auto watchedButton = qobject_cast<QToolButton *>(watched); -+ if (!watchedButton) { -+ return false; -+ } -+ auto menu = watchedButton->menu(); -+ if (!menu) { -+ return false; -+ } -+ menu->winId(); // trigger being a native widget already, to ensure windowHandle created -+ // generic code if not known if the available parent widget is a native widget or not -+ auto parentWindowHandle = watchedButton->windowHandle(); -+ if (!parentWindowHandle) { -+ parentWindowHandle = watchedButton->nativeParentWidget()->windowHandle(); -+ } -+ menu->windowHandle()->setTransientParent(parentWindowHandle); - } - return false; - } -diff --git a/src/khamburgermenuhelpers_p.h b/src/khamburgermenuhelpers_p.h -index f0d98790..4993ee61 100644 ---- a/src/khamburgermenuhelpers_p.h -+++ b/src/khamburgermenuhelpers_p.h -@@ -80,7 +80,7 @@ class ButtonPressListener : public QObject - protected: - inline ButtonPressListener(QObject *parent) : QObject{parent} { }; - -- bool eventFilter(QObject * /*watched*/, QEvent *event) override; -+ bool eventFilter(QObject *watched, QEvent *event) override; - - friend class ListenerContainer; - }; --- -GitLab - diff --git a/kde-frameworks/kconfigwidgets/kconfigwidgets-5.90.1.ebuild b/kde-frameworks/kconfigwidgets/kconfigwidgets-5.90.1.ebuild index cbcdf38eef25..1e9fb1efd3da 100644 --- a/kde-frameworks/kconfigwidgets/kconfigwidgets-5.90.1.ebuild +++ b/kde-frameworks/kconfigwidgets/kconfigwidgets-5.90.1.ebuild @@ -11,7 +11,7 @@ inherit ecm kde.org DESCRIPTION="Framework providing an assortment of configuration-related widgets" LICENSE="LGPL-2+" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" +KEYWORDS="amd64 ~arm arm64 ~ppc64 ~riscv x86" IUSE="+man" BDEPEND=" diff --git a/kde-frameworks/kconfigwidgets/kconfigwidgets-5.88.0-r1.ebuild b/kde-frameworks/kconfigwidgets/kconfigwidgets-5.92.0.ebuild index 7d172fd46987..7312473f399e 100644 --- a/kde-frameworks/kconfigwidgets/kconfigwidgets-5.88.0-r1.ebuild +++ b/kde-frameworks/kconfigwidgets/kconfigwidgets-5.92.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -10,35 +10,29 @@ VIRTUALX_REQUIRED="test" inherit ecm kde.org DESCRIPTION="Framework providing an assortment of configuration-related widgets" + LICENSE="LGPL-2+" -KEYWORDS="amd64 ~arm arm64 ~ppc64 ~riscv x86" -IUSE="+man" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" +IUSE="+auth +man" -BDEPEND=" - man? ( >=kde-frameworks/kdoctools-${PVCUT}:5 ) -" DEPEND=" >=dev-qt/qtdbus-${QTMIN}:5 >=dev-qt/qtgui-${QTMIN}:5 >=dev-qt/qtwidgets-${QTMIN}:5 - =kde-frameworks/kauth-${PVCUT}*:5 =kde-frameworks/kcodecs-${PVCUT}*:5 =kde-frameworks/kconfig-${PVCUT}*:5 =kde-frameworks/kcoreaddons-${PVCUT}*:5 =kde-frameworks/kguiaddons-${PVCUT}*:5 =kde-frameworks/ki18n-${PVCUT}*:5 =kde-frameworks/kwidgetsaddons-${PVCUT}*:5 + auth? ( =kde-frameworks/kauth-${PVCUT}*:5 ) " RDEPEND="${DEPEND}" - -PATCHES=( - "${FILESDIR}"/${P}-hamburger-menu-no-window-on-wayland.patch - "${FILESDIR}"/${P}-KCommandBar-alignment.patch -) +BDEPEND="man? ( >=kde-frameworks/kdoctools-${PVCUT}:5 )" src_configure() { local mycmakeargs=( - -DCMAKE_DISABLE_FIND_PACKAGE_PythonModuleGeneration=ON # bug 746866 + -DWITH_KAUTH=$(usex auth) $(cmake_use_find_package man KF5DocTools) ) diff --git a/kde-frameworks/kconfigwidgets/metadata.xml b/kde-frameworks/kconfigwidgets/metadata.xml index 3ace511214fd..dcf525b73fcc 100644 --- a/kde-frameworks/kconfigwidgets/metadata.xml +++ b/kde-frameworks/kconfigwidgets/metadata.xml @@ -9,6 +9,7 @@ <bugs-to>https://bugs.kde.org/</bugs-to> </upstream> <use> + <flag name="auth">Enable authentication support via <pkg>kde-frameworks/kauth</pkg></flag> <flag name="designer">Build plugins for <pkg>dev-qt/designer</pkg></flag> </use> <slots> |