void ToolSettings::selectTool(tools::Type tool)
{
	tools::ToolSettings *ts = getToolSettingsPage(tool);
	if(!ts) {
		qWarning("selectTool: invalid tool %d", tool);
		return;
	}

	_currenttool = ts;

	// Deselect annotation on tool change
	if(tool != tools::ANNOTATION) {
		int a = _textsettings->selected();
		if(a)
			_textsettings->setSelection(0);
	}

	setWindowTitle(_currenttool->getTitle());
	_widgets->setCurrentWidget(_currenttool->getUi());
	_currenttool->setForeground(foregroundColor());
	_currenttool->setBackground(backgroundColor());
	_currenttool->restoreToolSettings(_toolprops[currentToolSlot()].tool(_currenttool->getName()));
	_toolprops[_currentQuickslot].setCurrentTool(tool);

	updateToolSlot(currentToolSlot(), true);
	emit toolChanged(tool);
	emit sizeChanged(_currenttool->getSize());
	updateSubpixelMode();
}
void ToolSettings::selectTool(tools::Tool::Type tool)
{
	tools::ToolSettings *ts = getToolSettingsPage(tool);
	if(!ts) {
		qWarning("selectTool: invalid tool %d", tool);
		return;
	}

	_currenttool = ts;

	setWindowTitle(QStringLiteral("%1. %2").arg(currentToolSlot()+1).arg(_currenttool->getTitle()));
	m_widgets->setCurrentWidget(_currenttool->getUi());
	_currenttool->setForeground(foregroundColor());
	_currenttool->restoreToolSettings(_toolprops[currentToolSlot()].tool(_currenttool->getName()));
	_toolprops[_currentQuickslot].setCurrentTool(tool);

	updateToolSlot(currentToolSlot(), true);
	emit toolChanged(tool);
	emit sizeChanged(_currenttool->getSize());
	updateSubpixelMode();
}