summaryrefslogtreecommitdiff
path: root/src/libs/utils/detailsbutton.cpp
blob: b9d0982212985cc90d81635feec1859abb5d9d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "detailsbutton.h"

using namespace Utils;

DetailsButton::DetailsButton(QWidget *parent)
#ifdef Q_OS_MAC
    : QPushButton(parent),
#else
    : QToolButton(parent),
#endif
    m_checked(false)
{
#ifdef Q_OS_MAC
    setAttribute(Qt::WA_MacSmallSize);
    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
#else
    setCheckable(true);
#endif
    setText(tr("Show Details"));
    connect(this, SIGNAL(clicked()),
            this, SLOT(onClicked()));
}

void DetailsButton::onClicked()
{
    m_checked = !m_checked;
}

bool DetailsButton::isToggled()
{
    return m_checked;
}