Commit e3af0edc authored by Dominik Haumann's avatar Dominik Haumann

Rename activeViewSpace to activeTabBar

parent be7b90ee
......@@ -47,7 +47,7 @@ public:
qreal currentTabWidth;
bool keepTabWidth;
bool isActiveViewSpace;
bool isActive;
QVector<KateTabButton *> tabButtons;
QHash<int, KateTabButton *> idToTab;
......@@ -148,7 +148,7 @@ KateTabBar::KateTabBar(QWidget *parent)
d->currentTabWidth = 350;
d->keepTabWidth = false;
d->isActiveViewSpace = false;
d->isActive = false;
d->activeButton = nullptr;
......@@ -166,17 +166,17 @@ KateTabBar::~KateTabBar()
delete d;
}
void KateTabBar::setActiveViewSpace(bool active)
void KateTabBar::setActive(bool active)
{
if (active != d->isActiveViewSpace) {
d->isActiveViewSpace = active;
if (active != d->isActive) {
d->isActive = active;
update();
}
}
bool KateTabBar::isActiveViewSpace() const
bool KateTabBar::isActive() const
{
return d->isActiveViewSpace;
return d->isActive;
}
int KateTabBar::addTab(const QString &text)
......@@ -377,7 +377,7 @@ void KateTabBar::tabButtonActivated(KateTabButton *tabButton)
if (tabButton == d->activeButton) {
// make sure we are the currently active view space
if (! isActiveViewSpace()) {
if (! isActive()) {
emit activateViewSpaceRequested();
}
return;
......@@ -441,7 +441,7 @@ void KateTabBar::mouseDoubleClickEvent(QMouseEvent *event)
void KateTabBar::mousePressEvent(QMouseEvent *event)
{
if (! isActiveViewSpace()) {
if (! isActive()) {
emit activateViewSpaceRequested();
}
QWidget::mousePressEvent(event);
......
......@@ -40,7 +40,7 @@ class KateTabBarPrivate;
class KateTabBar : public QWidget
{
Q_OBJECT
Q_PROPERTY(bool isActiveViewSpace READ isActiveViewSpace WRITE setActiveViewSpace)
Q_PROPERTY(bool isActive READ isActive WRITE setActive)
public:
explicit KateTabBar(QWidget *parent = 0);
......@@ -96,6 +96,7 @@ public:
* Set the button @p id's tool tip to @p tip.
*/
void setTabToolTip(int index, const QString &tip);
/**
* Get the button @p id's url. Result is QStrint() if not available.
*/
......@@ -106,6 +107,7 @@ public:
* \see tabText()
*/
void setTabText(int index, const QString &text);
/**
* Returns the text of the tab with ID \a id. If the button id does not
* exist \a QString() is returned.
......@@ -136,8 +138,20 @@ public:
*/
int maxTabCount() const;
void setActiveViewSpace(bool active);
bool isActiveViewSpace() const;
/**
* Marks this tabbar as active. That is, current-tab indicators are
* properly highlighted, indicating that child widgets of this tabbar
* will get input.
*
* This concept is mostly useful, if your application has multiple tabbars.
* Inactive tabbars are grayed out.
*/
void setActive(bool active);
/**
* Returns whether this tabbar is active.
*/
bool isActive() const;
Q_SIGNALS:
/**
......
......@@ -125,8 +125,8 @@ void KateTabButton::paintEvent(QPaintEvent *ev)
QColor barColor(palette().color(QPalette::Highlight));
// read from the parent widget (=KateTabBar) the isActiveViewSpace property
if (isActiveViewSpace()) {
// read from the parent widget (=KateTabBar) the isActiveTabBar property
if (!isActiveTabBar()) {
// if inactive, convert color to gray value
const int g = qGray(barColor.rgb());
barColor = QColor(g, g, g);
......@@ -242,12 +242,12 @@ void KateTabButton::moveEvent(QMoveEvent *event)
QAbstractButton::moveEvent(event);
}
bool KateTabButton::isActiveViewSpace() const
bool KateTabButton::isActiveTabBar() const
{
Q_ASSERT(parentWidget());
// read from the parent widget (=KateTabBar) the isActiveViewSpace property
return ! parentWidget()->property("isActiveViewSpace").toBool();
// read from the parent widget (=KateTabBar) the isActive property
return parentWidget()->property("isActive").toBool();
}
void KateTabButton::setAnimatedGeometry(const QRect & startGeom,
......
......@@ -64,7 +64,7 @@ public:
/**
* Returns @e true, if the tabbar is the currently active tab bar.
*/
bool isActiveViewSpace() const;
bool isActiveTabBar() const;
/**
* Check whether a geometry animation is running.
......
......@@ -325,7 +325,7 @@ bool KateViewSpace::isActiveSpace()
void KateViewSpace::setActive(bool active)
{
m_isActiveSpace = active;
m_tabBar->setActiveViewSpace(active);
m_tabBar->setActive(active);
}
void KateViewSpace::makeActive(bool focusCurrentView)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment