diff options
| author | Peter LaFosse <peter@vector35.com> | 2019-07-01 23:51:13 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2019-07-02 11:39:06 -0400 |
| commit | 83373dcb680ebf5b2a26051a323636dc0d80f734 (patch) | |
| tree | c778e807903a13ab17426d5115d78ec6b3de3426 /ui/commandpalette.h | |
| parent | cc913b0f3667f5a70792f3b36b1bdf764435b01b (diff) | |
Add shortcut keys to command palette
Diffstat (limited to 'ui/commandpalette.h')
| -rw-r--r-- | ui/commandpalette.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/commandpalette.h b/ui/commandpalette.h index f009764d..430d9f72 100644 --- a/ui/commandpalette.h +++ b/ui/commandpalette.h @@ -5,6 +5,7 @@ #include <QtWidgets/QLineEdit> #include <QtWidgets/QFrame> #include <QtCore/QPointer> +#include <QtWidgets/QStyledItemDelegate> #include <vector> #include "action.h" @@ -18,6 +19,19 @@ struct BINARYNINJAUIAPI CommandListItem class CommandPalette; class CommandListFilter; + +class BINARYNINJAUIAPI CommandListDelegate: public QStyledItemDelegate +{ + Q_OBJECT + QFont m_font; + int m_height; + +public: + CommandListDelegate(QWidget* parent); + virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& idx) const override; + virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; +}; + class BINARYNINJAUIAPI CommandListModel: public QAbstractItemModel { Q_OBJECT @@ -39,6 +53,7 @@ public: virtual QVariant data(const QModelIndex& i, int role) const override; QString getActionForItem(int row); + QString getShortcutForItem(int row); void setFilterText(const QString& text); }; |
