mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
allow externally supplied ModeButtons in SceneToolMode
This commit is contained in:
parent
4dd645559d
commit
9e67a07ad4
2 changed files with 10 additions and 0 deletions
|
@ -45,6 +45,13 @@ void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::st
|
|||
const QString& tooltip)
|
||||
{
|
||||
ModeButton *button = new ModeButton (QIcon (QPixmap (icon.c_str())), tooltip, mPanel);
|
||||
addButton (button, id);
|
||||
}
|
||||
|
||||
void CSVWidget::SceneToolMode::addButton (ModeButton *button, const std::string& id)
|
||||
{
|
||||
button->setParent (mPanel);
|
||||
|
||||
button->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
button->setIconSize (QSize (mIconSize, mIconSize));
|
||||
button->setFixedSize (mButtonSize, mButtonSize);
|
||||
|
|
|
@ -38,6 +38,9 @@ namespace CSVWidget
|
|||
void addButton (const std::string& icon, const std::string& id,
|
||||
const QString& tooltip = "");
|
||||
|
||||
/// The ownership of \a button is transferred to *this.
|
||||
void addButton (ModeButton *button, const std::string& id);
|
||||
|
||||
signals:
|
||||
|
||||
void modeChanged (const std::string& id);
|
||||
|
|
Loading…
Reference in a new issue