1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

TabManager: Rename TabFilterDelegate to TabManagerDelegate

This commit is contained in:
srazi 2017-04-06 22:13:02 +04:30
parent 3a7e843677
commit ae29ef0030
4 changed files with 13 additions and 13 deletions

View File

@ -6,13 +6,13 @@ SOURCES += tabmanagerplugin.cpp \
tabmanagerwidget.cpp \
tabmanagerwidgetcontroller.cpp \
tabmanagersettings.cpp \
tabfilterdelegate.cpp
tabmanagerdelegate.cpp
HEADERS += tabmanagerplugin.h \
tabmanagerwidget.h \
tabmanagerwidgetcontroller.h \
tabmanagersettings.h \
tabfilterdelegate.h
tabmanagerdelegate.h
RESOURCES += tabmanagerplugin.qrc

View File

@ -16,19 +16,19 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "tabfilterdelegate.h"
#include "tabmanagerdelegate.h"
#include <QPainter>
#include <QApplication>
#include <QTextLayout>
TabFilterDelegate::TabFilterDelegate(QObject* parent)
TabManagerDelegate::TabManagerDelegate(QObject* parent)
: QStyledItemDelegate(parent)
{
}
// most of codes taken from QCommonStyle::drawControl() and add our custom text drawer
void TabFilterDelegate::paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void TabManagerDelegate::paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
@ -156,7 +156,7 @@ static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth)
// most of codes taken from QCommonStylePrivate::viewItemDrawText()
// added highlighting and simplified for single-line textlayouts
void TabFilterDelegate::viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect,
void TabManagerDelegate::viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect,
const QString &text, const QColor &color, const QString &searchText) const
{
if (text.isEmpty()) {

View File

@ -15,15 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef TABFILTERDELEGATE_H
#define TABFILTERDELEGATE_H
#ifndef TABMANAGERDELEGATE_H
#define TABMANAGERDELEGATE_H
#include <QStyledItemDelegate>
class TabFilterDelegate : public QStyledItemDelegate
class TabManagerDelegate : public QStyledItemDelegate
{
public:
explicit TabFilterDelegate(QObject* parent = 0);
explicit TabManagerDelegate(QObject* parent = 0);
void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
@ -36,4 +36,4 @@ private:
};
#endif // TABFILTERDELEGATE_H
#endif // TABMANAGERDELEGATE_H

View File

@ -29,7 +29,7 @@
#include "bookmarks.h"
#include "tabmanagerplugin.h"
#include "tldextractor/tldextractor.h"
#include "tabfilterdelegate.h"
#include "tabmanagerdelegate.h"
#include <QDesktopWidget>
@ -79,7 +79,7 @@ TabManagerWidget::TabManagerWidget(BrowserWindow* mainClass, QWidget* parent, bo
ui->filterBar->addWidget(closeButton, LineEdit::RightSide);
ui->filterBar->hide();
ui->treeWidget->setItemDelegate(new TabFilterDelegate(ui->treeWidget));
ui->treeWidget->setItemDelegate(new TabManagerDelegate(ui->treeWidget));
connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(filterBarClosed()));
connect(ui->filterBar, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));