From 657fafe20882f741fd09b9797b1e37ca492d453f Mon Sep 17 00:00:00 2001 From: T1ti <40864460+T1ti@users.noreply.github.com> Date: Sat, 25 May 2024 02:05:07 +0200 Subject: [PATCH] optimize icons --- src/noggit/ui/FontAwesome.cpp | 7 ++----- src/noggit/ui/FontNoggit.cpp | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) 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;