From 1c7f9c76c1907017792122ae269902ef55853c1a Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Fri, 6 Dec 2024 21:49:07 +0100 Subject: [PATCH] Code simplification --- src/ui/GenioWindow.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/ui/GenioWindow.cpp b/src/ui/GenioWindow.cpp index f2db6b76..e9c93550 100644 --- a/src/ui/GenioWindow.cpp +++ b/src/ui/GenioWindow.cpp @@ -4530,17 +4530,16 @@ GenioWindow::_HandleConfigurationChanged(BMessage* message) } else if (key.Compare("show_statusbar") == 0) { _ShowView(fStatusView, bool(gCFG["show_statusbar"]), MSG_TOGGLE_STATUSBAR); } else if (key.Compare("use_small_icons") == 0) { - if (gCFG["use_small_icons"]) { - fToolBar->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSizeSmall).Width()); - fFindGroup->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSizeSmall).Width()); - fReplaceGroup->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSizeSmall).Width()); - fRunGroup->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSizeSmall).Width()); - } else { - fToolBar->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSize).Width()); - fFindGroup->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSize).Width()); - fReplaceGroup->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSize).Width()); - fRunGroup->ChangeIconSize(be_control_look->ComposeIconSize(kDefaultIconSize).Width()); - } + float iconSize = 0; + if (message->GetBool("value", false)) + iconSize = be_control_look->ComposeIconSize(kDefaultIconSizeSmall).Width(); + else + iconSize = be_control_look->ComposeIconSize(kDefaultIconSize).Width(); + + fToolBar->ChangeIconSize(iconSize); + fFindGroup->ChangeIconSize(iconSize); + fReplaceGroup->ChangeIconSize(iconSize); + fRunGroup->ChangeIconSize(iconSize); } Editor* selected = fTabManager->SelectedEditor();