From f81dfd8be7a9fe9dd0b55afa36d86a756b3af65b Mon Sep 17 00:00:00 2001 From: hop311 Date: Sun, 28 Jul 2024 23:48:34 +0100 Subject: GUI::ListBox offsets + load search panel gui file --- src/openvic-simulation/interface/GUI.cpp | 6 +++--- src/openvic-simulation/interface/GUI.hpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/openvic-simulation/interface') diff --git a/src/openvic-simulation/interface/GUI.cpp b/src/openvic-simulation/interface/GUI.cpp index 9acb72c..87e3624 100644 --- a/src/openvic-simulation/interface/GUI.cpp +++ b/src/openvic-simulation/interface/GUI.cpp @@ -205,18 +205,18 @@ bool OverlappingElementsBox::_fill_key_map(NodeTools::case_insensitive_key_map_t return ret; } -ListBox::ListBox() : size {}, offset {}, spacing {}, scrollbar_name {} {} +ListBox::ListBox() : size {}, scrollbar_offset {}, items_offset {}, spacing {}, scrollbar_name {} {} bool ListBox::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map, UIManager const& ui_manager) { bool ret = Element::_fill_key_map(key_map, ui_manager); ret &= add_key_map_entries(key_map, "size", ONE_EXACTLY, expect_fvec2(assign_variable_callback(size)), - "offset", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(offset)), + "offset", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(scrollbar_offset)), + "borderSize", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(items_offset)), "spacing", ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(spacing)), "scrollbartype", ZERO_OR_ONE, expect_string(assign_variable_callback_string(scrollbar_name)), "backGround", ZERO_OR_ONE, success_callback, - "borderSize", ZERO_OR_ONE, success_callback, "horizontal", ZERO_OR_ONE, success_callback, "priority", ZERO_OR_ONE, success_callback, "allwaystransparent", ZERO_OR_ONE, success_callback diff --git a/src/openvic-simulation/interface/GUI.hpp b/src/openvic-simulation/interface/GUI.hpp index 74afbd1..4e1b062 100644 --- a/src/openvic-simulation/interface/GUI.hpp +++ b/src/openvic-simulation/interface/GUI.hpp @@ -240,11 +240,12 @@ namespace OpenVic::GUI { friend std::unique_ptr std::make_unique(); fvec2_t PROPERTY(size); - fvec2_t PROPERTY(offset); + fvec2_t PROPERTY(scrollbar_offset); + fvec2_t PROPERTY(items_offset); fixed_point_t PROPERTY(spacing); std::string PROPERTY(scrollbar_name); /* In vanilla this is always core's standardlistbox_slider */ - // TODO - backGround, borderSize + // TODO - backGround protected: ListBox(); -- cgit v1.2.3-56-ga3b1