summaryrefslogtreecommitdiff
path: root/src/gui/windows/skilldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-16 01:47:39 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-16 01:47:39 +0300
commitabee7cd42ffa9c4fe6e789f6ceb98d7b695f8c72 (patch)
tree6e6841d6b8d0d25fbfad1de753f0a01cb96fce30 /src/gui/windows/skilldialog.cpp
parentddfa72d8d01dacdcd38c159ea8dc024fe9d5562a (diff)
downloadmanaverse-abee7cd42ffa9c4fe6e789f6ceb98d7b695f8c72.tar.gz
manaverse-abee7cd42ffa9c4fe6e789f6ceb98d7b695f8c72.tar.bz2
manaverse-abee7cd42ffa9c4fe6e789f6ceb98d7b695f8c72.tar.xz
manaverse-abee7cd42ffa9c4fe6e789f6ceb98d7b695f8c72.zip
Fix hiding tabs in skill dialog.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r--src/gui/windows/skilldialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index a18ab3b3e..d273d8453 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -145,7 +145,10 @@ void SkillDialog::addDefaultTab()
// TRANSLATORS: unknown skills tab name
mDefaultTab = new SkillTab(this, _("Unknown"), listbox);
mDeleteTabs.push_back(mDefaultTab);
+ mDefaultTab->setVisible(Visible_false);
mTabs->addTab(mDefaultTab, scroll);
+ mTabs->adjustTabPositions();
+ mTabs->setSelectedTabDefault();
}
void SkillDialog::action(const ActionEvent &event)
@@ -403,11 +406,11 @@ void SkillDialog::loadXmlFile(const std::string &fileName,
mDefaultTab = tab;
}
+ mDeleteTabs.push_back(tab);
if (alwaysVisible == true)
tab->setVisible(Visible_true);
else
tab->setVisible(Visible_false);
- mDeleteTabs.push_back(tab);
mTabs->addTab(tab, scroll);
for_each_xml_child_node(node, set)
@@ -602,7 +605,11 @@ bool SkillDialog::updateSkill(const int id,
info->sp = sp;
info->update();
if (info->tab)
+ {
info->tab->setVisible(Visible_true);
+ mTabs->adjustTabPositions();
+ mTabs->setSelectedTabDefault();
+ }
}
return true;
}
@@ -655,6 +662,8 @@ void SkillDialog::addSkill(const SkillOwner::Type owner,
skill->tab = mDefaultTab;
mDefaultModel->addSkill(skill);
mDefaultTab->setVisible(Visible_true);
+ mTabs->adjustTabPositions();
+ mTabs->setSelectedTabDefault();
mSkills[id] = skill;
mDefaultModel->updateVisibilities();