forked from qt-creator/qt-creator
FancyToolButton: remove forceVisible
It's never used Change-Id: Ia2e7ab19685066daf29b5209cb7ea2a7485dfcf2 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -52,17 +52,10 @@ using namespace Internal;
|
|||||||
FancyToolButton::FancyToolButton(QWidget *parent)
|
FancyToolButton::FancyToolButton(QWidget *parent)
|
||||||
: QToolButton(parent), m_fader(0)
|
: QToolButton(parent), m_fader(0)
|
||||||
{
|
{
|
||||||
m_hasForceVisible = false;
|
|
||||||
setAttribute(Qt::WA_Hover, true);
|
setAttribute(Qt::WA_Hover, true);
|
||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FancyToolButton::forceVisible(bool visible)
|
|
||||||
{
|
|
||||||
m_hasForceVisible = true;
|
|
||||||
setVisible(visible);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FancyToolButton::event(QEvent *e)
|
bool FancyToolButton::event(QEvent *e)
|
||||||
{
|
{
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
@@ -302,10 +295,8 @@ void FancyToolButton::actionChanged()
|
|||||||
{
|
{
|
||||||
// the default action changed in some way, e.g. it might got hidden
|
// the default action changed in some way, e.g. it might got hidden
|
||||||
// since we inherit a tool button we won't get invisible, so do this here
|
// since we inherit a tool button we won't get invisible, so do this here
|
||||||
if (!m_hasForceVisible) {
|
if (QAction* action = defaultAction())
|
||||||
if (QAction* action = defaultAction())
|
setVisible(action->isVisible());
|
||||||
setVisible(action->isVisible());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FancyActionBar::FancyActionBar(QWidget *parent)
|
FancyActionBar::FancyActionBar(QWidget *parent)
|
||||||
|
|||||||
@@ -57,13 +57,8 @@ public:
|
|||||||
float fader() { return m_fader; }
|
float fader() { return m_fader; }
|
||||||
void setFader(float value) { m_fader = value; update(); }
|
void setFader(float value) { m_fader = value; update(); }
|
||||||
|
|
||||||
void forceVisible(bool visible);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void actionChanged();
|
void actionChanged();
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_hasForceVisible;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class FancyActionBar : public QWidget
|
class FancyActionBar : public QWidget
|
||||||
|
|||||||
Reference in New Issue
Block a user