Define default tools

Before this change all the tools were used in the editor, now
there is a list of tools enabled by default.
This commit is contained in:
lupoDharkael
2018-04-16 18:46:00 +02:00
parent 595e778673
commit 17a9000beb
2 changed files with 30 additions and 6 deletions

View File

@@ -61,7 +61,12 @@ void ButtonListView::updateActiveButtons(QListWidgetItem *item) {
CaptureButton::ButtonType bType = m_buttonTypeByName[item->text()];
if (item->checkState() == Qt::Checked) {
m_listButtons.append(bType);
std::sort(m_listButtons.begin(), m_listButtons.end());
// TODO refactor so we don't need external sorts
using bt = CaptureButton::ButtonType;
std::sort(m_listButtons.begin(), m_listButtons.end(), [](bt a, bt b){
return CaptureButton::getPriorityByButton(a) <
CaptureButton::getPriorityByButton(b);
});
} else {
m_listButtons.remove(m_listButtons.indexOf(bType));
}