mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-13 08:51:44 +00:00
changed handling of scene toolbar button icons
This commit is contained in:
parent
74cee66273
commit
4624bed899
3 changed files with 4 additions and 10 deletions
|
@ -11,11 +11,6 @@ CSVWorld::SceneTool::SceneTool (SceneToolbar *parent) : QPushButton (parent)
|
||||||
connect (this, SIGNAL (clicked()), this, SLOT (openRequest()));
|
connect (this, SIGNAL (clicked()), this, SLOT (openRequest()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::SceneTool::updateIcon (const QIcon& icon)
|
|
||||||
{
|
|
||||||
setIcon (icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSVWorld::SceneTool::openRequest()
|
void CSVWorld::SceneTool::openRequest()
|
||||||
{
|
{
|
||||||
showPanel (parentWidget()->mapToGlobal (pos()));
|
showPanel (parentWidget()->mapToGlobal (pos()));
|
||||||
|
|
|
@ -18,10 +18,6 @@ namespace CSVWorld
|
||||||
|
|
||||||
virtual void showPanel (const QPoint& position) = 0;
|
virtual void showPanel (const QPoint& position) = 0;
|
||||||
|
|
||||||
protected slots:
|
|
||||||
|
|
||||||
void updateIcon (const QIcon& icon);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void openRequest();
|
void openRequest();
|
||||||
|
|
|
@ -36,6 +36,9 @@ void CSVWorld::SceneToolMode::addButton (const std::string& icon, const std::str
|
||||||
mButtons.insert (std::make_pair (button, id));
|
mButtons.insert (std::make_pair (button, id));
|
||||||
|
|
||||||
connect (button, SIGNAL (clicked()), this, SLOT (selected()));
|
connect (button, SIGNAL (clicked()), this, SLOT (selected()));
|
||||||
|
|
||||||
|
if (mButtons.size()==1)
|
||||||
|
setIcon (button->icon());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::SceneToolMode::selected()
|
void CSVWorld::SceneToolMode::selected()
|
||||||
|
@ -47,7 +50,7 @@ void CSVWorld::SceneToolMode::selected()
|
||||||
{
|
{
|
||||||
mPanel->hide();
|
mPanel->hide();
|
||||||
|
|
||||||
emit updateIcon (iter->first->icon());
|
setIcon (iter->first->icon());
|
||||||
emit modeChanged (iter->second);
|
emit modeChanged (iter->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue