This commit is contained in:
2024-11-25 16:35:13 -06:00
parent 423dc188cd
commit 0ffb750f82
3 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
//
// Created by dawsh on 11/24/24.
//
#ifndef LISTBOX_HPP
#define LISTBOX_HPP
#endif //LISTBOX_HPP

View File

@@ -13,6 +13,11 @@ namespace JUI {
void Draw() override;
[[nodiscard]] bool FitText() const { return fit_text; }
void FitText(bool on) { fit_text = on; }
bool AutoFitSizeToText();
void AutoFitSizeToText(bool resize);
bool AutoFitTextToSize();
void AutoFitTextToSize(bool resize);
protected:
void DrawInScissor() override;
bool fit_text = false;

View File

@@ -276,7 +276,6 @@ namespace JUI {
return absolute_position - anchor_offset;
}
// TODO: implement padding shrinking abs_size
Vector2 Widget::GetAbsoluteSize() const {
if (this->GetParent() == nullptr)
@@ -291,7 +290,6 @@ namespace JUI {
Vector2 abs_size = child_size_px + (parent_abs_size * child_size_scale) - pad_size_reduction;
// TODO: Take into account constraints on widgets.
return abs_size;
}