diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-18 21:19:28 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-18 21:19:47 +0530 |
| commit | 4c762b2516bc664293c2aec072074f1e34dda8c3 (patch) | |
| tree | ebe441f7af8c1f4c49f04630538312d55f18f63b /src/completion/CompleterDelegate.cpp | |
| parent | 056b0b16947ac19a0c425aa9d2ff8f589378d3bc (diff) | |
| download | null-browser-4c762b2516bc664293c2aec072074f1e34dda8c3.tar.gz null-browser-4c762b2516bc664293c2aec072074f1e34dda8c3.zip | |
Remove all the ui bits because screw it, lets unix a bit more
Diffstat (limited to 'src/completion/CompleterDelegate.cpp')
| -rw-r--r-- | src/completion/CompleterDelegate.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/completion/CompleterDelegate.cpp b/src/completion/CompleterDelegate.cpp deleted file mode 100644 index ce446b2..0000000 --- a/src/completion/CompleterDelegate.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include <QPainter> -#include <QWidget> -#include <QtCore/qlogging.h> -#include <QtCore/qnamespace.h> -#include <QtCore> - -#include "completion/CompleterDelegate.hpp" - -CompleterDelegate::CompleterDelegate(QObject *parent) - : QStyledItemDelegate(parent) {} - -void CompleterDelegate::setCurrentRow(uint32_t r) { row = r; } - -uint32_t CompleterDelegate::currentRow() { return row; } - -void CompleterDelegate::paint(QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const { - painter->save(); - - bool selected = index.row() == row; - - // Style - if (selected) { - painter->fillRect(option.rect, QColor("#aaa")); - painter->setPen(Qt::black); - } else { - painter->fillRect(option.rect, QColor("#111")); - painter->setPen(Qt::white); - } - - // Draw text - QString text; - QRect rect; - if (index.column() == 0) { - text = index.data(Qt::DisplayRole).toString(); - rect = option.rect.adjusted(5, 0, 0, 0); - painter->drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, text); - } else if (index.column() == 1) { - text = index.data(Qt::UserRole).toString(); - rect = option.rect.adjusted(0, 0, -5, 0); - painter->drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, text); - } - - painter->restore(); -} |
