mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
WebTab: Add makeCurrentTab and closeTab methods
This commit is contained in:
parent
349f6b9c32
commit
29735b24c8
@ -628,6 +628,20 @@ bool WebTab::isCurrentTab() const
|
|||||||
return m_isCurrentTab;
|
return m_isCurrentTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebTab::makeCurrentTab()
|
||||||
|
{
|
||||||
|
if (m_tabBar) {
|
||||||
|
m_tabBar->tabWidget()->setCurrentIndex(tabIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WebTab::closeTab()
|
||||||
|
{
|
||||||
|
if (m_tabBar) {
|
||||||
|
m_tabBar->tabWidget()->closeTab(tabIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int WebTab::tabIndex() const
|
int WebTab::tabIndex() const
|
||||||
{
|
{
|
||||||
return m_tabBar ? m_tabBar->tabWidget()->indexOf(const_cast<WebTab*>(this)) : -1;
|
return m_tabBar ? m_tabBar->tabWidget()->indexOf(const_cast<WebTab*>(this)) : -1;
|
||||||
|
@ -100,6 +100,8 @@ public:
|
|||||||
int tabIndex() const;
|
int tabIndex() const;
|
||||||
|
|
||||||
bool isCurrentTab() const;
|
bool isCurrentTab() const;
|
||||||
|
void makeCurrentTab();
|
||||||
|
void closeTab();
|
||||||
|
|
||||||
bool haveInspector() const;
|
bool haveInspector() const;
|
||||||
void showWebInspector(bool inspectElement = false);
|
void showWebInspector(bool inspectElement = false);
|
||||||
|
Loading…
Reference in New Issue
Block a user