mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Removed unused CloseButton class
This commit is contained in:
parent
2717446306
commit
0102bd8ca3
@ -20,37 +20,6 @@
|
||||
#include "qupzilla.h"
|
||||
#include "webtab.h"
|
||||
|
||||
class CloseButton : public QToolButton
|
||||
{
|
||||
public:
|
||||
explicit CloseButton(QWidget* parent ) : QToolButton(parent) { }
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter p(this);
|
||||
QStyleOption opt;
|
||||
opt.init(this);
|
||||
opt.state |= QStyle::State_AutoRaise;
|
||||
if (isEnabled() && underMouse() && !isChecked() && !isDown())
|
||||
opt.state |= QStyle::State_Raised;
|
||||
if (isChecked())
|
||||
opt.state |= QStyle::State_On;
|
||||
if (isDown())
|
||||
opt.state |= QStyle::State_Sunken;
|
||||
|
||||
if (const QTabBar *tb = qobject_cast<const QTabBar *>(parent())) {
|
||||
int index = tb->currentIndex();
|
||||
QTabBar::ButtonPosition position = (QTabBar::ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, tb);
|
||||
if (tb->tabButton(index, position) == this)
|
||||
opt.state |= QStyle::State_Selected;
|
||||
}
|
||||
|
||||
style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &p, this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
TabBar::TabBar(QupZilla* mainClass, QWidget* parent) :
|
||||
QTabBar(parent)
|
||||
,p_QupZilla(mainClass)
|
||||
|
Loading…
Reference in New Issue
Block a user