Merge pull request #966 from LittleHuba/fix-953

Fix #953
presentation
Ulrich Huber 7 years ago committed by GitHub
commit 9536b447d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      src/gui/toolbarMenubar/ColorToolItem.cpp

@ -86,7 +86,11 @@ void ColorToolItem::enableColor(int color)
if (isSelector())
{
this->icon->setColor(color);
if (this->icon)
{
this->icon->setColor(color);
}
this->color = color;
if (GTK_IS_TOGGLE_BUTTON(this->item))
{
@ -191,7 +195,10 @@ void ColorToolItem::enable(bool enabled)
{
if (!enabled && toolHandler->getToolType() == TOOL_ERASER)
{
icon->setState(COLOR_ICON_STATE_PEN);
if (this->icon)
{
icon->setState(COLOR_ICON_STATE_PEN);
}
AbstractToolItem::enable(true);
switchToPen = true;
return;
@ -199,13 +206,15 @@ void ColorToolItem::enable(bool enabled)
switchToPen = false;
AbstractToolItem::enable(enabled);
if (enabled)
if (this->icon)
{
icon->setState(COLOR_ICON_STATE_ENABLED);
}
else
{
icon->setState(COLOR_ICON_STATE_DISABLED);
if (enabled)
{
icon->setState(COLOR_ICON_STATE_ENABLED);
} else
{
icon->setState(COLOR_ICON_STATE_DISABLED);
}
}
}

Loading…
Cancel
Save