aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-03-18 01:41:14 +0100
committer hop311 <hop3114@gmail.com>2024-03-20 23:31:32 +0100
commitc11d262a4d2c987c8cf8e0d4b24929cbe56bb289 (patch)
tree74562764d9f1be88eedb9a14c5d087c1320bb288 /src/openvic-simulation/interface
parenteece77afebf0e4d36b4c9ace3b1044f2c3da50f1 (diff)
Add GUI Text border_size
Diffstat (limited to 'src/openvic-simulation/interface')
-rw-r--r--src/openvic-simulation/interface/GUI.cpp4
-rw-r--r--src/openvic-simulation/interface/GUI.hpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/openvic-simulation/interface/GUI.cpp b/src/openvic-simulation/interface/GUI.cpp
index ae4cf0e..9acb72c 100644
--- a/src/openvic-simulation/interface/GUI.cpp
+++ b/src/openvic-simulation/interface/GUI.cpp
@@ -174,7 +174,7 @@ bool AlignedElement::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_ma
return ret;
}
-Text::Text() : text {}, font { nullptr }, max_size {} {}
+Text::Text() : text {}, font { nullptr }, max_size {}, border_size {} {}
bool Text::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map, UIManager const& ui_manager) {
bool ret = AlignedElement::_fill_key_map(key_map, ui_manager);
@@ -183,8 +183,8 @@ bool Text::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map, UIManag
"font", ONE_EXACTLY, ui_manager.expect_font_string(assign_variable_callback_pointer(font)),
"maxWidth", ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(max_size.x)),
"maxHeight", ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(max_size.y)),
+ "borderSize", ZERO_OR_ONE, expect_fvec2(assign_variable_callback(border_size)),
- "borderSize", ZERO_OR_ONE, success_callback,
"fixedsize", 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 7551d1a..d839188 100644
--- a/src/openvic-simulation/interface/GUI.hpp
+++ b/src/openvic-simulation/interface/GUI.hpp
@@ -202,8 +202,9 @@ namespace OpenVic::GUI {
std::string PROPERTY(text);
GFX::Font const* PROPERTY(font);
fvec2_t PROPERTY(max_size); /* Defines keys: maxWidth, maxHeight */
+ fvec2_t PROPERTY(border_size);
- // TODO - borderSize, fixedsize, textureFile
+ // TODO - fixedsize, textureFile
protected:
Text();