Skip to content

Commit

Permalink
Controls: more 0.0 minimum sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Sep 11, 2024
1 parent 8757349 commit 5bbcf2a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/feathers/controls/Header.hx
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,15 @@ class Header extends FeathersControl implements ITextControl {
this.layoutBackgroundSkin();

var textFieldMinX = this.paddingLeft;
var textFieldMaxX = this.actualWidth - this.paddingRight;
var textFieldMaxX = Math.max(this.paddingLeft, this.actualWidth - this.paddingRight);
var maxContentWidth = this.actualWidth - this.paddingLeft - this.paddingRight;
if (maxContentWidth < 0.0) {
maxContentWidth = 0.0;
}
var maxContentHeight = this.actualHeight - this.paddingTop - this.paddingBottom;
if (maxContentHeight < 0.0) {
maxContentHeight = 0.0;
}
var textFieldMaxWidth = maxContentWidth;

if (this._leftView != null) {
Expand Down
3 changes: 3 additions & 0 deletions src/feathers/controls/Label.hx
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,9 @@ class Label extends FeathersControl implements ITextControl implements IHTMLText

var textFieldHeight = this._textMeasuredHeight;
var maxHeight = this.actualHeight - this.paddingTop - this.paddingBottom;
if (maxHeight < 0.0) {
maxHeight = 0.0;
}
if (textFieldHeight > maxHeight) {
textFieldHeight = maxHeight;
}
Expand Down
3 changes: 3 additions & 0 deletions src/feathers/controls/TextInput.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,9 @@ class TextInput extends FeathersControl implements IStateContext<TextInputState>

var textFieldHeight = this._textMeasuredHeight;
var maxHeight = this.actualHeight - this.paddingTop - this.paddingBottom;
if (maxHeight < 0.0) {
maxHeight = 0.0;
}
if (textFieldHeight > maxHeight || this.verticalAlign == JUSTIFY) {
textFieldHeight = maxHeight;
}
Expand Down
6 changes: 6 additions & 0 deletions src/feathers/controls/dataRenderers/ItemRenderer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,13 @@ class ItemRenderer extends ToggleButton implements IFocusContainer implements IL
var hasSecondaryText = this.showSecondaryText && this._secondaryText != null;
var hasSecondaryHTMLText = this.showSecondaryText && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
var availableContentWidth = this.actualWidth - this.paddingLeft - this.paddingRight;
if (availableContentWidth < 0.0) {
availableContentWidth = 0.0;
}
var availableContentHeight = this.actualHeight - this.paddingTop - this.paddingBottom;
if (availableContentHeight < 0.0) {
availableContentHeight = 0.0;
}
var totalContentWidth = (hasText || hasHTMLText) ? this._textMeasuredWidth : 0.0;
var totalContentHeight = (hasText || hasHTMLText) ? this._textMeasuredHeight : 0.0;
if ((hasSecondaryText || hasSecondaryHTMLText) && this.secondaryTextField != null) {
Expand Down

0 comments on commit 5bbcf2a

Please sign in to comment.