From 401dc359171ff1179abece095ea9354f0064ea19 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 31 Mar 2025 18:10:26 +0100 Subject: Use new SVG icons on main toolbar --- ui/gameMainWindow.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ui/gameMainWindow.cpp') diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index 322c6e5..bcda649 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -1,10 +1,10 @@ #include "gameMainWindow.h" #include "editNetwork.h" #include "gameMainSelector.h" -#include "icon.h" #include "imgui_extras.h" #include "manualCameraController.h" #include "queryTool.h" +#include "svgIcon.h" #include #include #include @@ -20,7 +20,7 @@ class GameMainToolbar : public UIComponent { public: static constexpr auto TOOLBAR_HEIGHT = 54.F; - static constexpr ImVec2 TOOLBAR_ICON_SIZE {32, 32}; + template static constexpr T TOOLBAR_ICON_SIZE {32, 32}; explicit GameMainToolbar(GameMainSelector * gms) : gms {gms} { } @@ -28,10 +28,10 @@ public: render() override { if (IltGui::BeginToolbar("bottomBar", ImGuiDir_Down, TOOLBAR_HEIGHT)) { - if (ImGui::ImageButton("Build rails", *buildRailsIcon, TOOLBAR_ICON_SIZE)) { + if (ImGui::ImageButton("Build rails", *buildRailsIcon, TOOLBAR_ICON_SIZE)) { gms->target = std::make_unique>(); - } - if (ImGui::ImageButton("Query", *buildRailsIcon, TOOLBAR_ICON_SIZE)) { + } + if (ImGui::ImageButton("Query", *queryToolIcon, TOOLBAR_ICON_SIZE)) { gms->target = std::make_unique(); } IltGui::EndToolbar(); @@ -45,7 +45,8 @@ public: } private: - Icon buildRailsIcon {"ui/icon/network.png"}; + SvgIcon buildRailsIcon {TOOLBAR_ICON_SIZE, "ui/icon/rails.svg"}; + SvgIcon queryToolIcon {TOOLBAR_ICON_SIZE, "ui/icon/magnifier.svg"}; GameMainSelector * gms; }; -- cgit v1.2.3