mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
[ComboTabBar] Double click on scroll buttons will scroll to end/start
This commit is contained in:
parent
cf87a9895e
commit
0038fd6cb6
|
@ -1119,12 +1119,14 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent)
|
||||||
m_leftScrollButton->setObjectName("tabbar-button-left");
|
m_leftScrollButton->setObjectName("tabbar-button-left");
|
||||||
connect(m_leftScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart()));
|
connect(m_leftScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart()));
|
||||||
connect(m_leftScrollButton, SIGNAL(released()), this, SLOT(scrollStop()));
|
connect(m_leftScrollButton, SIGNAL(released()), this, SLOT(scrollStop()));
|
||||||
|
connect(m_leftScrollButton, SIGNAL(doubleClicked()), this, SLOT(scrollToLeftEdge()));
|
||||||
|
|
||||||
m_rightScrollButton = new ToolButton(this);
|
m_rightScrollButton = new ToolButton(this);
|
||||||
m_rightScrollButton->setAutoRaise(true);
|
m_rightScrollButton->setAutoRaise(true);
|
||||||
m_rightScrollButton->setObjectName("tabbar-button-right");
|
m_rightScrollButton->setObjectName("tabbar-button-right");
|
||||||
connect(m_rightScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart()));
|
connect(m_rightScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart()));
|
||||||
connect(m_rightScrollButton, SIGNAL(released()), this, SLOT(scrollStop()));
|
connect(m_rightScrollButton, SIGNAL(released()), this, SLOT(scrollStop()));
|
||||||
|
connect(m_rightScrollButton, SIGNAL(doubleClicked()), this, SLOT(scrollToRightEdge()));
|
||||||
|
|
||||||
m_leftLayout = new QHBoxLayout;
|
m_leftLayout = new QHBoxLayout;
|
||||||
m_leftLayout->setSpacing(0);
|
m_leftLayout->setSpacing(0);
|
||||||
|
|
|
@ -150,6 +150,13 @@ void ToolButton::mouseReleaseEvent(QMouseEvent* e)
|
||||||
setDown(false);
|
setDown(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolButton::mouseDoubleClickEvent(QMouseEvent* e)
|
||||||
|
{
|
||||||
|
QToolButton::mouseDoubleClickEvent(e);
|
||||||
|
|
||||||
|
emit doubleClicked();
|
||||||
|
}
|
||||||
|
|
||||||
void ToolButton::showMenu()
|
void ToolButton::showMenu()
|
||||||
{
|
{
|
||||||
if (!m_showMenuInside) {
|
if (!m_showMenuInside) {
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void middleMouseClicked();
|
void middleMouseClicked();
|
||||||
void controlClicked();
|
void controlClicked();
|
||||||
|
void doubleClicked();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showMenu();
|
void showMenu();
|
||||||
|
@ -67,6 +68,7 @@ public slots:
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent* e);
|
void mousePressEvent(QMouseEvent* e);
|
||||||
void mouseReleaseEvent(QMouseEvent* e);
|
void mouseReleaseEvent(QMouseEvent* e);
|
||||||
|
void mouseDoubleClickEvent(QMouseEvent* e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void paintEvent(QPaintEvent* e);
|
void paintEvent(QPaintEvent* e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user