From 02b503cbf9f05c1c8f254858efe1547eaff5b876 Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Wed, 29 Apr 2026 23:34:25 +0500 Subject: [PATCH 1/5] rebase dev --- src/core/MainWindow.cpp | 5 - src/core/MainWindow.h | 1 - src/shortcuts/DefaultShortcuts.cpp | 8 ++ src/widgets/FlagsWidget.cpp | 6 - src/widgets/Omnibar.cpp | 220 +++++++++++++++++++++++++---- src/widgets/Omnibar.h | 57 +++++++- 6 files changed, 255 insertions(+), 42 deletions(-) diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index 18b6b78a46..e2134d3b7e 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -762,11 +762,6 @@ void MainWindow::showProjectSaveError(RzProjectErr err) tr("Failed to save project: %1").arg(QString::fromUtf8(s))); } -void MainWindow::refreshOmniBar(const QStringList &flags) -{ - omnibar->refresh(flags); -} - void MainWindow::setFilename(const QString &fn) { // Add file name to window title diff --git a/src/core/MainWindow.h b/src/core/MainWindow.h index 2238e73a28..c598d4cbf5 100644 --- a/src/core/MainWindow.h +++ b/src/core/MainWindow.h @@ -86,7 +86,6 @@ class CUTTER_EXPORT MainWindow : public QMainWindow void readSettings(); void saveSettings(); void setFilename(const QString &fn); - void refreshOmniBar(const QStringList &flags); void addWidget(CutterDockWidget *widget); void addMemoryDockWidget(MemoryDockWidget *widget); diff --git a/src/shortcuts/DefaultShortcuts.cpp b/src/shortcuts/DefaultShortcuts.cpp index 1d43b78dd4..85238ea4cc 100644 --- a/src/shortcuts/DefaultShortcuts.cpp +++ b/src/shortcuts/DefaultShortcuts.cpp @@ -288,6 +288,14 @@ const QHash &getDefaultShortcuts() { { QKeySequence(Qt::Key_Escape) }, QT_TRANSLATE_NOOP("Omnibar", "Clear Omnibar"), "Omnibar" } }, + { "Omnibar.showMore", + { { Qt::ControlModifier | Qt::Key_Return }, + QT_TRANSLATE_NOOP("Omnibar", "Show More Completions"), + "Omnibar" } }, + { "Omnibar.showAll", + { { Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Return }, + QT_TRANSLATE_NOOP("Omnibar", "Show All Completions"), + "Omnibar" } }, // Graph Overview { "Overview.zoomIn", diff --git a/src/widgets/FlagsWidget.cpp b/src/widgets/FlagsWidget.cpp index 9685f20185..2eb4f0f15a 100644 --- a/src/widgets/FlagsWidget.cpp +++ b/src/widgets/FlagsWidget.cpp @@ -266,12 +266,6 @@ void FlagsWidget::refreshFlags() // set the initial item count ui->filterLineEdit->setItemCount(flags_proxy_model->rowCount()); - - // TODO: this is not a very good place for the following: - QStringList flagNames; - for (const FlagDescription &i : flags_model->flags) - flagNames.append(i.name); - main->refreshOmniBar(flagNames); } void FlagsWidget::setScrollMode() diff --git a/src/widgets/Omnibar.cpp b/src/widgets/Omnibar.cpp index 584f49a3f3..1b0e37c253 100644 --- a/src/widgets/Omnibar.cpp +++ b/src/widgets/Omnibar.cpp @@ -7,8 +7,39 @@ #include #include #include +#include +#include +#include +#include +#include +#include + +namespace { +constexpr int DEFAULT_ITEM_COUNT = 100; +} + +OmnibarCompleter::OmnibarCompleter(QObject *parent) : QCompleter(parent) {} -Omnibar::Omnibar(MainWindow *main, QWidget *parent) : QLineEdit(parent), main(main) +QStringList OmnibarCompleter::splitPath(const QString &) const +{ + return QStringList(""); +} + +QString OmnibarCompleter::pathFromIndex(const QModelIndex &index) const +{ + int type = index.data(Qt::UserRole).toInt(); + + if (type == Omnibar::ShowMore || type == Omnibar::ShowAll) { + if (auto edit = qobject_cast(widget())) { + return edit->text(); + } + } + + return QCompleter::pathFromIndex(index); +} + +Omnibar::Omnibar(MainWindow *main, QWidget *parent) + : QLineEdit(parent), main(main), m_completerModel(new QStandardItemModel(this)) { // QLineEdit basic features this->setMinimumHeight(16); @@ -18,53 +49,108 @@ Omnibar::Omnibar(MainWindow *main, QWidget *parent) : QLineEdit(parent), main(ma this->setTextMargins(10, 0, 0, 0); this->setClearButtonEnabled(true); - connect(this, &QLineEdit::returnPressed, this, &Omnibar::on_gotoEntry_returnPressed); + connect(this, &QLineEdit::textEdited, this, [this](const QString &text) { + m_maxShownItems = DEFAULT_ITEM_COUNT; // reset the entries count to 100 + handleSearch(text); + }); // Esc clears omnibar QShortcut *clear_shortcut = Shortcuts()->makeQShortcut("Omnibar.clear", this); connect(clear_shortcut, &QShortcut::activated, this, &Omnibar::clear); clear_shortcut->setContext(Qt::WidgetWithChildrenShortcut); -} -void Omnibar::setupCompleter() -{ // Set gotoEntry completer for jump history - QCompleter *completer = new QCompleter(flags, this); - completer->setMaxVisibleItems(20); - completer->setCompletionMode(QCompleter::PopupCompletion); - completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); - completer->setCaseSensitivity(Qt::CaseInsensitive); - completer->setFilterMode(Qt::MatchContains); - - this->setCompleter(completer); + m_completer = new OmnibarCompleter(this); + m_completer->setModel(m_completerModel); + m_completer->setMaxVisibleItems(20); + m_completer->setFilterMode(Qt::MatchContains); + m_completer->setCompletionMode(QCompleter::PopupCompletion); + m_completer->popup()->installEventFilter(this); + m_completer->popup()->viewport()->installEventFilter(this); + + this->setCompleter(m_completer); + this->installEventFilter(this); + + connect(Core(), &CutterCore::flagsChanged, this, &Omnibar::refresh); + connect(Core(), &CutterCore::codeRebased, this, &Omnibar::refresh); + connect(Core(), &CutterCore::refreshAll, this, &Omnibar::refresh); } -void Omnibar::refresh(const QStringList &flagList) +bool Omnibar::eventFilter(QObject *obj, QEvent *event) { - flags = flagList; + QAbstractItemView *popup = m_completer->popup(); + + if (((obj == popup || obj == this) && (event->type() == QEvent::KeyPress)) + || (obj == popup->viewport() && event->type() == QEvent::MouseButtonPress)) { + + QModelIndex index; + + if (event->type() == QEvent::MouseButtonPress) { + QMouseEvent *mouseEvent = static_cast(event); + if (mouseEvent->button() == Qt::LeftButton) { + index = popup->indexAt(mouseEvent->pos()); + } + } else if (event->type() == QEvent::KeyPress) { + QKeyEvent *keyEvent = static_cast(event); + + int keyInt = keyEvent->modifiers() | keyEvent->key(); + QKeySequence eventSeq(keyInt); + if (eventSeq == Shortcuts()->getKeySequence("Omnibar.showMore")) { + handleShowMore(popup->currentIndex().row()); + return true; + } else if (eventSeq == Shortcuts()->getKeySequence("Omnibar.showAll")) { + handleShowAll(popup->currentIndex().row()); + return true; + } else if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) { + index = popup->currentIndex(); + } + } + + if (index.isValid()) { + int row = index.row(); + int type = index.data(Qt::UserRole).toInt(); - setupCompleter(); + if (type == ItemType::ShowMore) { + handleShowMore(row); + } else if (type == ItemType::ShowAll) { + handleShowAll(row); + } else { + goToEntry(); + popup->hide(); + } + return true; + } + } + return QObject::eventFilter(obj, event); } -void Omnibar::restoreCompleter() +void Omnibar::refresh() { - QCompleter *completer = this->completer(); - if (!completer) { - return; + m_flags.clear(); + const auto flags = Core()->getAllFlags(); + for (const auto &f : flags) { + m_flags.append(f.name); } - completer->setFilterMode(Qt::MatchContains); + + QCollator collator; + collator.setNumericMode(true); + collator.setCaseSensitivity(Qt::CaseInsensitive); + std::sort(m_flags.begin(), m_flags.end(), [&collator](const QString &a, const QString &b) { + return collator.compare(a, b) < 0; + }); + + handleSearch(this->text()); } void Omnibar::clear() { QLineEdit::clear(); - // Close the potential shown completer popup - clearFocus(); - setFocus(); + m_completerModel->clear(); + m_completer->popup()->hide(); } -void Omnibar::on_gotoEntry_returnPressed() +void Omnibar::goToEntry() { QString str = this->text(); if (!str.isEmpty()) { @@ -79,5 +165,87 @@ void Omnibar::on_gotoEntry_returnPressed() this->setText(""); this->clearFocus(); - this->restoreCompleter(); +} + +void Omnibar::handleSearch(const QString &Text, bool append) +{ + m_searchedText = Text; + m_matchCount = 0; + + if (!append) { + m_completerModel->clear(); + m_lastIndex = 0; + } else { + // remove "show more" and "show all" rows + m_completerModel->removeRows(m_completerModel->rowCount() - 2, 2); + } + + if (Text.isEmpty()) { + return; + } + + bool hasMore = false; + int itemsInModel = m_completerModel->rowCount(); + + for (int i = 0; i < m_flags.size(); ++i) { + const QString &flag = m_flags[i]; + if (flag.contains(Text, Qt::CaseInsensitive)) { + if (itemsInModel < m_maxShownItems) { + if (!append || i > m_lastIndex) { + QStandardItem *item = new QStandardItem(flag); + item->setData(ItemType::Standard, Qt::UserRole); + m_completerModel->appendRow(item); + ++itemsInModel; + m_lastIndex = i; + } + } else { + hasMore = true; + } + ++m_matchCount; + } + } + + if (hasMore) { + auto addActionRow = [&](const QString &text, ItemType type) { + QStandardItem *actionItem = new QStandardItem(text); + actionItem->setData(type, Qt::UserRole); + + QPalette palette = this->palette(); + QColor placeholderColor = palette.color(QPalette::PlaceholderText); + actionItem->setForeground(placeholderColor); + + QFont font = actionItem->font(); + font.setItalic(true); + actionItem->setFont(font); + + m_completerModel->appendRow(actionItem); + }; + + addActionRow(tr("Show More"), ItemType::ShowMore); + addActionRow(tr("Show All (%1 of %2)").arg(m_maxShownItems).arg(m_matchCount), + ItemType::ShowAll); + } + + m_completer->setCompletionPrefix(""); + m_completer->complete(); +} + +void Omnibar::handleShowMore(int currentRow) +{ + if (m_maxShownItems >= m_matchCount) { + return; + } + m_maxShownItems = std::min(m_maxShownItems + DEFAULT_ITEM_COUNT, m_matchCount); + handleSearch(m_searchedText, true); + m_completer->popup()->setCurrentIndex(m_completerModel->index(currentRow, 0)); +} + +void Omnibar::handleShowAll(int currentRow) +{ + if (m_maxShownItems >= m_matchCount) { + return; + } + m_maxShownItems = m_matchCount; + handleSearch(m_searchedText, true); + m_completer->popup()->setCurrentIndex(m_completerModel->index(currentRow, 0)); } diff --git a/src/widgets/Omnibar.h b/src/widgets/Omnibar.h index b3dc05e346..ccab0795f5 100644 --- a/src/widgets/Omnibar.h +++ b/src/widgets/Omnibar.h @@ -2,8 +2,28 @@ #define OMNIBAR_H #include +#include class MainWindow; +class QStandardItemModel; + +class OmnibarCompleter : public QCompleter +{ +public: + explicit OmnibarCompleter(QObject *parent = nullptr); + + /** + * @brief Force the completer to match everything, since we are handling filtering on our own + */ + QStringList splitPath(const QString &) const override; + + /** + * @brief Do not auto-complete when selecting "Show More" or "Show All" entries + * + * Keeps the text the same for "Show More" and "Show All", auto-completes for other entries + */ + QString pathFromIndex(const QModelIndex &index) const override; +}; class Omnibar : public QLineEdit { @@ -11,21 +31,50 @@ class Omnibar : public QLineEdit public: explicit Omnibar(MainWindow *main, QWidget *parent = nullptr); - void refresh(const QStringList &flagList); + void refresh(); + + enum ItemType { Standard = 0, ShowMore = 1, ShowAll = 2 }; private slots: - void on_gotoEntry_returnPressed(); + /** + * @brief Seeks to the address of selected entry/flag and shows it in the last memory widget + */ + void goToEntry(); + + /** + * @brief Filters or searches entries "containing" the text + * + * Appends "Show More" and "Show All" entries at the end if there are more found matches then + * currently shown + * + * @param text The string to match against + * @param append If false, resets the search to the beginning. If true, continues from the last + * found position + */ + void handleSearch(const QString &text, bool append = false); - void restoreCompleter(); +protected: + bool eventFilter(QObject *obj, QEvent *event) override; public slots: void clear(); private: void setupCompleter(); + void handleShowMore(int currentRow); + void handleShowAll(int currentRow); MainWindow *main; - QStringList flags; + QStringList m_flags; + + QStringList m_filteredFlags; + QStandardItemModel *m_completerModel; + QCompleter *m_completer; + + QString m_searchedText; + int m_maxShownItems; + int m_lastIndex; + int m_matchCount; }; #endif // OMNIBAR_H From cb00adbc629de8e541f768e23de0952b7338f993 Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Thu, 30 Apr 2026 02:53:44 +0500 Subject: [PATCH 2/5] InterfaceOptionsWidget: add options for omnibar --- src/common/Configuration.cpp | 30 ++++++++ src/common/Configuration.h | 23 ++++++ .../preferences/InterfaceOptionsWidget.cpp | 25 ++++++ .../preferences/InterfaceOptionsWidget.h | 1 + .../preferences/InterfaceOptionsWidget.ui | 77 ++++++++++++++++++- src/widgets/Omnibar.cpp | 14 ++-- 6 files changed, 158 insertions(+), 12 deletions(-) diff --git a/src/common/Configuration.cpp b/src/common/Configuration.cpp index be7aea2ee6..031c66fc3c 100644 --- a/src/common/Configuration.cpp +++ b/src/common/Configuration.cpp @@ -999,3 +999,33 @@ int Configuration::getFunctionNameColWidth() const { return s.value("fcnNameColWidth", 400).toInt(); } + +void Configuration::setOmnibarLimitEntries(bool value) +{ + s.setValue("omnibarLimitEntries", value); +} + +bool Configuration::getOmnibarLimitEntries() const +{ + return s.value("omnibarLimitEntries", true).toBool(); +} + +void Configuration::setOmnibarEntriesCount(int count) +{ + s.setValue("omnibarEntriesCount", count); +} + +int Configuration::getOmnibarEntriesCount() const +{ + return s.value("omnibarEntriesCount", 100).toInt(); +} + +void Configuration::setOmnibarEntriesIncrement(int count) +{ + s.setValue("omnibarEntriesIncrement", count); +} + +int Configuration::getOmnibarEntriesIncrement() const +{ + return s.value("omnibarEntriesIncrement", 100).toInt(); +} diff --git a/src/common/Configuration.h b/src/common/Configuration.h index e224050282..d8280fcab9 100644 --- a/src/common/Configuration.h +++ b/src/common/Configuration.h @@ -355,6 +355,29 @@ class CUTTER_EXPORT Configuration : public QObject void setFunctionNameColWidth(int width); int getFunctionNameColWidth() const; + /** + * @brief Set whether to limit the number of entries when searching inside omnibar + * + * The limit is set through @ref setOmnibarEntriesCount + * @param value True to set limit, false otherwise + */ + void setOmnibarLimitEntries(bool value); + bool getOmnibarLimitEntries() const; + + /** + * @brief Set the default number of entries shown when searching inside omnibar + * @param count Number of entries to be shown inside omnibar + */ + void setOmnibarEntriesCount(int count); + int getOmnibarEntriesCount() const; + + /** + * @brief Number of entries to add to initial count when clicking on "Show More" inside omnibar + * @param count Number of entries to add + */ + void setOmnibarEntriesIncrement(int count); + int getOmnibarEntriesIncrement() const; + public slots: void refreshFont(); signals: diff --git a/src/dialogs/preferences/InterfaceOptionsWidget.cpp b/src/dialogs/preferences/InterfaceOptionsWidget.cpp index ebe10ea3c2..23c7a4835f 100644 --- a/src/dialogs/preferences/InterfaceOptionsWidget.cpp +++ b/src/dialogs/preferences/InterfaceOptionsWidget.cpp @@ -10,6 +10,7 @@ InterfaceOptionsWidget::InterfaceOptionsWidget(PreferencesDialog *dialog) ui->setupUi(this); setUpQuickFilter(); + setUpOmnibar(); setUpFunctions(); } @@ -31,6 +32,30 @@ void InterfaceOptionsWidget::setUpFunctions() &Configuration::setFunctionNameColWidth); } +void InterfaceOptionsWidget::setUpOmnibar() +{ + const bool limitEntries = Config()->getOmnibarLimitEntries(); + ui->omnibarCountCheckBox->setChecked(limitEntries); + ui->omnibarCountSpinBox->setValue(Config()->getOmnibarEntriesCount()); + + auto toggleWidgets = [this](bool enable) { + ui->omnibarCountSpinBox->setEnabled(enable); + ui->omnibarIncrementLabel->setEnabled(enable); + ui->omnibarIncrementSpinBox->setEnabled(enable); + }; + toggleWidgets(limitEntries); + ui->omnibarIncrementSpinBox->setValue(Config()->getOmnibarEntriesIncrement()); + + connect(ui->omnibarCountCheckBox, &QCheckBox::toggled, this, [toggleWidgets](bool checked) { + Config()->setOmnibarLimitEntries(checked); + toggleWidgets(checked); + }); + connect(ui->omnibarCountSpinBox, &QSpinBox::valueChanged, Config(), + &Configuration::setOmnibarEntriesCount); + connect(ui->omnibarIncrementSpinBox, &QSpinBox::valueChanged, Config(), + &Configuration::setOmnibarEntriesIncrement); +} + void InterfaceOptionsWidget::setUpQuickFilter() { ui->quickFilterCheckBox->setChecked(Config()->getShowQuickFilter()); diff --git a/src/dialogs/preferences/InterfaceOptionsWidget.h b/src/dialogs/preferences/InterfaceOptionsWidget.h index a485672a77..563ca6fea3 100644 --- a/src/dialogs/preferences/InterfaceOptionsWidget.h +++ b/src/dialogs/preferences/InterfaceOptionsWidget.h @@ -29,6 +29,7 @@ class InterfaceOptionsWidget : public QDialog std::unique_ptr ui; void setUpFunctions(); + void setUpOmnibar(); void setUpQuickFilter(); }; diff --git a/src/dialogs/preferences/InterfaceOptionsWidget.ui b/src/dialogs/preferences/InterfaceOptionsWidget.ui index d9171fac08..eb232786de 100644 --- a/src/dialogs/preferences/InterfaceOptionsWidget.ui +++ b/src/dialogs/preferences/InterfaceOptionsWidget.ui @@ -6,8 +6,8 @@ 0 0 - 633 - 361 + 678 + 417 @@ -39,8 +39,8 @@ 0 0 - 633 - 361 + 678 + 417 @@ -89,6 +89,75 @@ + + + + Omnibar + + + + 24 + + + + + + + Only show the number of entries equal to set value when searching inside omnibar. If unchecked all entries will be shown + + + Limit entries by default to + + + + + + + 1 + + + 999999 + + + 10 + + + + + + + + + 0 + + + + + Number of entries to add when clicking "Show More" inside omnibar + + + On "Show More" increment entries by + + + + + + + 1 + + + 999999 + + + 10 + + + + + + + + diff --git a/src/widgets/Omnibar.cpp b/src/widgets/Omnibar.cpp index 1b0e37c253..1e12a662c2 100644 --- a/src/widgets/Omnibar.cpp +++ b/src/widgets/Omnibar.cpp @@ -14,10 +14,6 @@ #include #include -namespace { -constexpr int DEFAULT_ITEM_COUNT = 100; -} - OmnibarCompleter::OmnibarCompleter(QObject *parent) : QCompleter(parent) {} QStringList OmnibarCompleter::splitPath(const QString &) const @@ -50,7 +46,7 @@ Omnibar::Omnibar(MainWindow *main, QWidget *parent) this->setClearButtonEnabled(true); connect(this, &QLineEdit::textEdited, this, [this](const QString &text) { - m_maxShownItems = DEFAULT_ITEM_COUNT; // reset the entries count to 100 + m_maxShownItems = Config()->getOmnibarEntriesCount(); // reset entries count to default handleSearch(text); }); @@ -176,7 +172,7 @@ void Omnibar::handleSearch(const QString &Text, bool append) m_completerModel->clear(); m_lastIndex = 0; } else { - // remove "show more" and "show all" rows + // remove "show more" and "show all" rows (last two) m_completerModel->removeRows(m_completerModel->rowCount() - 2, 2); } @@ -190,7 +186,8 @@ void Omnibar::handleSearch(const QString &Text, bool append) for (int i = 0; i < m_flags.size(); ++i) { const QString &flag = m_flags[i]; if (flag.contains(Text, Qt::CaseInsensitive)) { - if (itemsInModel < m_maxShownItems) { + const bool showAll = !Config()->getOmnibarLimitEntries(); + if ((itemsInModel < m_maxShownItems) || showAll) { if (!append || i > m_lastIndex) { QStandardItem *item = new QStandardItem(flag); item->setData(ItemType::Standard, Qt::UserRole); @@ -235,7 +232,8 @@ void Omnibar::handleShowMore(int currentRow) if (m_maxShownItems >= m_matchCount) { return; } - m_maxShownItems = std::min(m_maxShownItems + DEFAULT_ITEM_COUNT, m_matchCount); + m_maxShownItems = + std::min(m_maxShownItems + Config()->getOmnibarEntriesIncrement(), m_matchCount); handleSearch(m_searchedText, true); m_completer->popup()->setCurrentIndex(m_completerModel->index(currentRow, 0)); } From c936ed61ad65fa0d0f61ea7f1e9930f637d95143 Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Fri, 27 Mar 2026 01:30:32 +0500 Subject: [PATCH 3/5] Explicitly use QKeySequence --- src/shortcuts/DefaultShortcuts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shortcuts/DefaultShortcuts.cpp b/src/shortcuts/DefaultShortcuts.cpp index 85238ea4cc..798c311bba 100644 --- a/src/shortcuts/DefaultShortcuts.cpp +++ b/src/shortcuts/DefaultShortcuts.cpp @@ -289,11 +289,11 @@ const QHash &getDefaultShortcuts() QT_TRANSLATE_NOOP("Omnibar", "Clear Omnibar"), "Omnibar" } }, { "Omnibar.showMore", - { { Qt::ControlModifier | Qt::Key_Return }, + { { QKeySequence(Qt::ControlModifier | Qt::Key_Return) }, QT_TRANSLATE_NOOP("Omnibar", "Show More Completions"), "Omnibar" } }, { "Omnibar.showAll", - { { Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Return }, + { { QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Return) }, QT_TRANSLATE_NOOP("Omnibar", "Show All Completions"), "Omnibar" } }, From e12bdd1a3c3a6589199ceace570d61a400f56752 Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Fri, 27 Mar 2026 01:46:19 +0500 Subject: [PATCH 4/5] Qt version check for QPallete::PlaceholderText --- src/widgets/Omnibar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widgets/Omnibar.cpp b/src/widgets/Omnibar.cpp index 1e12a662c2..8d477a89d4 100644 --- a/src/widgets/Omnibar.cpp +++ b/src/widgets/Omnibar.cpp @@ -208,7 +208,12 @@ void Omnibar::handleSearch(const QString &Text, bool append) actionItem->setData(type, Qt::UserRole); QPalette palette = this->palette(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) QColor placeholderColor = palette.color(QPalette::PlaceholderText); +#else + QColor placeholderColor = palette.color(QPalette::Text); + placeholderColor.setAlpha(128); +#endif actionItem->setForeground(placeholderColor); QFont font = actionItem->font(); From 8271875f7eda4a5357fbd9d1569a417c93efb1b5 Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Thu, 30 Apr 2026 04:38:17 +0500 Subject: [PATCH 5/5] ci