mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
added push mode and icon-less push button constructor
This commit is contained in:
parent
8b239df1b1
commit
44b95bbd7b
@ -29,10 +29,16 @@ void CSVWidget::PushButton::mouseReleaseEvent (QMouseEvent *event)
|
|||||||
QPushButton::mouseReleaseEvent (event);
|
QPushButton::mouseReleaseEvent (event);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSVWidget::PushButton::PushButton (const QIcon& icon, QWidget *parent)
|
CSVWidget::PushButton::PushButton (const QIcon& icon, bool push, QWidget *parent)
|
||||||
: QPushButton (icon, "", parent), mKeepOpen (false)
|
: QPushButton (icon, "", parent), mKeepOpen (false)
|
||||||
{
|
{
|
||||||
setCheckable (true);
|
setCheckable (!push);
|
||||||
|
}
|
||||||
|
|
||||||
|
CSVWidget::PushButton::PushButton (bool push, QWidget *parent)
|
||||||
|
: QPushButton (parent), mKeepOpen (false)
|
||||||
|
{
|
||||||
|
setCheckable (!push);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSVWidget::PushButton::hasKeepOpen() const
|
bool CSVWidget::PushButton::hasKeepOpen() const
|
||||||
|
@ -21,7 +21,11 @@ namespace CSVWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PushButton (const QIcon& icon, QWidget *parent = 0);
|
/// \param push Do not maintain a toggle state
|
||||||
|
PushButton (const QIcon& icon, bool push = false, QWidget *parent = 0);
|
||||||
|
|
||||||
|
/// \param push Do not maintain a toggle state
|
||||||
|
PushButton (bool push = false, QWidget *parent = 0);
|
||||||
|
|
||||||
bool hasKeepOpen() const;
|
bool hasKeepOpen() const;
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,7 @@ void CSVWidget::SceneToolMode::showPanel (const QPoint& position)
|
|||||||
|
|
||||||
void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::string& id)
|
void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::string& id)
|
||||||
{
|
{
|
||||||
PushButton *button = new PushButton (QIcon (QPixmap (icon.c_str())), mPanel);
|
PushButton *button = new PushButton (QIcon (QPixmap (icon.c_str())), false, mPanel);
|
||||||
button->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
|
button->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||||
button->setIconSize (QSize (mIconSize, mIconSize));
|
button->setIconSize (QSize (mIconSize, mIconSize));
|
||||||
button->setFixedSize (mButtonSize, mButtonSize);
|
button->setFixedSize (mButtonSize, mButtonSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user