Skip to content

Commit

Permalink
IconLink component
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Aug 31, 2023
1 parent cb55d4b commit 25dda8c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions haxe/ui/components/IconLink.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package haxe.ui.components;

import haxe.ui.containers.HBox;
import haxe.ui.util.Variant;

@:xml('
<hbox>
<image id="linkIcon" verticalAlign="center" hidden="true" />
<link id="link" verticalAlign="center" hidden="true" />
</hbox>
')
class IconLink extends HBox {
public override function get_text():String {
return link.text;
}

public override function set_text(value:String):String {
link.text = value;
link.show();
return value;
}

public override function get_icon():Variant {
return linkIcon.resource;
}

public override function set_icon(value:Variant):Variant {
linkIcon.resource = value;
linkIcon.show();
return value;
}
}

0 comments on commit 25dda8c

Please sign in to comment.