Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 28, 2024
2 parents f5004b9 + ce51357 commit 2433a5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion haxe/ui/containers/Panel.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Panel extends VBox {
return super.set_percentHeight(value);
}

#if ((haxeui_openfl || haxeui_nme) && !haxeui_flixel)
#if (haxeui_openfl || haxeui_nme || haxeui_flixel)

public override function set_height(value:Float):Float {
contentContainer.percentHeight = 100;
Expand Down
16 changes: 16 additions & 0 deletions haxe/ui/styles/Style.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ enum StyleBorderType {
Compound;
}

enum abstract FontWeight(Int) from Int {
var THIN = 100;
var EXTRA_LIGHT = 200;
var LIGHT = 300;
var REGULAR = 400;
var MEDIUM = 500;
var SEMI_BOLD = 600;
var BOLD = 700;
var EXTRA_BOLD = 800;
var BLACK = 900;
}

@:structInit
class Style {
/** The left (x) position relative to its parent. **/ @:optional public var left:Null<Float>;
Expand Down Expand Up @@ -118,6 +130,7 @@ class Style {
/** A path to a font file to be used for the text inside the object **/ @:optional public var fontName:Null<String>;
/** The visual size of the font **/ @:optional public var fontSize:Null<Float>;
/** Whether or not this text should use the **bold** variation of its font **/ @:optional public var fontBold:Null<Bool>;
/** The weight of the font in increments of 100 **/ @:optional public var fontWeight:Null<FontWeight>;
/** Whether or not to underline the text **/ @:optional public var fontUnderline:Null<Bool>;
/** Whether or not this text should use the *italic* variation of its font **/ @:optional public var fontItalic:Null<Bool>;
@:optional public var fontStrikeThrough:Null<Bool>;
Expand Down Expand Up @@ -412,6 +425,7 @@ class Style {
if (ValueTools.string(v.value) != null) {
fontBold = ValueTools.string(v.value).toLowerCase() == "bold";
}
fontWeight = ValueTools.int(v.value);
case "font-bold":
fontBold = ValueTools.bool(v.value);
case "font-underline":
Expand Down Expand Up @@ -673,6 +687,7 @@ class Style {
if (s.fontName != null) fontName = s.fontName;
if (s.fontSize != null) fontSize = s.fontSize;
if (s.fontBold != null) fontBold = s.fontBold;
if (s.fontWeight != null) fontWeight = s.fontWeight;
if (s.fontUnderline != null) fontUnderline = s.fontUnderline;
if (s.fontStrikeThrough != null) fontStrikeThrough = s.fontStrikeThrough;
if (s.fontItalic != null) fontItalic = s.fontItalic;
Expand Down Expand Up @@ -836,6 +851,7 @@ class Style {
if (s.fontName != fontName) return false;
if (s.fontSize != fontSize) return false;
if (s.fontBold != fontBold) return false;
if (s.fontWeight != fontWeight) return false;
if (s.fontUnderline != fontUnderline) return false;
if (s.fontStrikeThrough != fontStrikeThrough) return false;
if (s.fontItalic != fontItalic) return false;
Expand Down

0 comments on commit 2433a5d

Please sign in to comment.