mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add 'min-length' panel property
This commit is contained in:
parent
8e8fed2aa2
commit
0ce5e23a2a
6 changed files with 24 additions and 5 deletions
|
|
@ -23,6 +23,14 @@ int Panel::getMaxLength() const {
|
|||
return maxLength;
|
||||
}
|
||||
|
||||
void Panel::setMinLength(int value) {
|
||||
minLength = value;
|
||||
}
|
||||
|
||||
int Panel::getMinLength() const {
|
||||
return minLength;
|
||||
}
|
||||
|
||||
void Panel::setPadding(glm::vec4 padding) {
|
||||
this->padding = padding;
|
||||
refresh();
|
||||
|
|
@ -34,9 +42,11 @@ glm::vec4 Panel::getPadding() const {
|
|||
|
||||
void Panel::cropToContent() {
|
||||
if (maxLength > 0.0f) {
|
||||
setSize(glm::vec2(getSize().x, glm::min(maxLength, actualLength)));
|
||||
setSize(glm::vec2(
|
||||
getSize().x, glm::max(minLength, glm::min(maxLength, actualLength))
|
||||
));
|
||||
} else {
|
||||
setSize(glm::vec2(getSize().x, actualLength));
|
||||
setSize(glm::vec2(getSize().x, glm::max(minLength, actualLength)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue