aboutsummaryrefslogtreecommitdiff
path: root/src/gui/ComboBox.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-07 21:27:36 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-07 21:27:36 +0200
commit1a49f86e9841035fe670f6b42a3c988f737267d2 (patch)
tree9059935a17d2599ae9f366975472314a9c89e052 /src/gui/ComboBox.cpp
parentb709805cfac4d1fe1bfe28e497a3e48e224372a8 (diff)
Add settings icon, close window when pressing the close button
Diffstat (limited to 'src/gui/ComboBox.cpp')
-rw-r--r--src/gui/ComboBox.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/ComboBox.cpp b/src/gui/ComboBox.cpp
index 6aff979..373b06b 100644
--- a/src/gui/ComboBox.cpp
+++ b/src/gui/ComboBox.cpp
@@ -14,7 +14,7 @@ namespace gsr {
static const float padding_right_scale = 0.007f;
static const float border_scale = 0.0015f;
- ComboBox::ComboBox(mgl::Font *font) : font(font), dropdown_arrow(&get_theme().combobox_arrow) {
+ ComboBox::ComboBox(mgl::Font *font) : font(font), dropdown_arrow(&get_theme().combobox_arrow_texture) {
assert(font);
}
@@ -109,7 +109,7 @@ namespace gsr {
Item &item = items[selected_item];
item.text.set_position(pos.floor());
if(show_dropdown || mouse_inside) {
- const int border_size = border_scale * get_theme().window_height;
+ const int border_size = std::max(1.0f, border_scale * get_theme().window_height);
const mgl::Color border_color = get_theme().tint_color;
draw_rectangle_outline(window, pos - mgl::vec2f(padding_left, padding_top), item_size.floor(), border_color, border_size);
}