diff --git a/src/noggit/ui/FontAwesome.cpp b/src/noggit/ui/FontAwesome.cpp index 08ee7c1d..4d8a13e0 100755 --- a/src/noggit/ui/FontAwesome.cpp +++ b/src/noggit/ui/FontAwesome.cpp @@ -37,18 +37,15 @@ namespace Noggit temp_btn->ensurePolished(); - QColor color; if (state == QIcon::On) { - color = temp_btn->palette().color(QPalette::WindowText); + painter->setPen(temp_btn->palette().color(QPalette::WindowText)); } else if (state == QIcon::Off) { - color = temp_btn->palette().color(QPalette::Disabled, QPalette::WindowText); + painter->setPen(temp_btn->palette().color(QPalette::Disabled, QPalette::WindowText)); } - painter->setPen(color); - delete temp_btn; diff --git a/src/noggit/ui/FontNoggit.cpp b/src/noggit/ui/FontNoggit.cpp index ed06fe15..8e16124f 100755 --- a/src/noggit/ui/FontNoggit.cpp +++ b/src/noggit/ui/FontNoggit.cpp @@ -37,18 +37,15 @@ namespace Noggit temp_btn->ensurePolished(); - QColor color; if (state == QIcon::On) { - color = temp_btn->palette().color(QPalette::WindowText); + painter->setPen(temp_btn->palette().color(QPalette::WindowText)); } else if (state == QIcon::Off) { - color = temp_btn->palette().color(QPalette::Disabled, QPalette::WindowText); + painter->setPen(temp_btn->palette().color(QPalette::Disabled, QPalette::WindowText)); } - painter->setPen(color); - delete temp_btn;