Skip to content

Commit b22f064

Browse files
committed
PoweredByFeathersUI: better callout placement on the icon if the component is resized
1 parent b85f440 commit b22f064

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

samples/custom-theme/src/com/feathersui/controls/PoweredByFeathersUI.hx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,22 @@ class PoweredByFeathersUI extends LayoutGroup {
3535
label.text = "Powered by ";
3636
this.addChild(label);
3737

38-
var icon = new AssetLoader();
38+
this.icon = new AssetLoader();
3939
// <assets id="feathersui-logo" path="assets/img/feathersui-logo.png" embed="false"/>
40-
icon.source = "feathersui-logo";
41-
icon.height = 16.0;
42-
this.addChild(icon);
40+
this.icon.source = "feathersui-logo";
41+
this.icon.height = 16.0;
42+
this.addChild(this.icon);
4343

4444
this.addEventListener(MouseEvent.ROLL_OVER, poweredBy_rollOverHandler);
4545
this.addEventListener(MouseEvent.ROLL_OUT, poweredBy_rollOutHandler);
4646
this.addEventListener(MouseEvent.CLICK, poweredBy_clickHandler);
4747
}
4848

49+
private var icon:AssetLoader;
4950
private var callout:TextCallout;
5051

5152
private function poweredBy_rollOverHandler(event:MouseEvent):Void {
52-
this.callout = TextCallout.show("Learn more at feathersui.com", this, null, false);
53+
this.callout = TextCallout.show("Learn more at feathersui.com", this.icon, null, false);
5354
}
5455

5556
private function poweredBy_rollOutHandler(event:MouseEvent):Void {

samples/horizontal-layout-percentage-sizing/src/com/feathersui/controls/PoweredByFeathersUI.hx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,22 @@ class PoweredByFeathersUI extends LayoutGroup {
3535
label.text = "Powered by ";
3636
this.addChild(label);
3737

38-
var icon = new AssetLoader();
38+
this.icon = new AssetLoader();
3939
// <assets id="feathersui-logo" path="assets/img/feathersui-logo.png" embed="false"/>
40-
icon.source = "feathersui-logo";
41-
icon.height = 16.0;
42-
this.addChild(icon);
40+
this.icon.source = "feathersui-logo";
41+
this.icon.height = 16.0;
42+
this.addChild(this.icon);
4343

4444
this.addEventListener(MouseEvent.ROLL_OVER, poweredBy_rollOverHandler);
4545
this.addEventListener(MouseEvent.ROLL_OUT, poweredBy_rollOutHandler);
4646
this.addEventListener(MouseEvent.CLICK, poweredBy_clickHandler);
4747
}
4848

49+
private var icon:AssetLoader;
4950
private var callout:TextCallout;
5051

5152
private function poweredBy_rollOverHandler(event:MouseEvent):Void {
52-
this.callout = TextCallout.show("Learn more at feathersui.com", this, null, false);
53+
this.callout = TextCallout.show("Learn more at feathersui.com", this.icon, null, false);
5354
}
5455

5556
private function poweredBy_rollOutHandler(event:MouseEvent):Void {

samples/list-view-data-provider-collection-sorting/src/com/feathersui/controls/PoweredByFeathersUI.hx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,22 @@ class PoweredByFeathersUI extends LayoutGroup {
3535
label.text = "Powered by ";
3636
this.addChild(label);
3737

38-
var icon = new AssetLoader();
38+
this.icon = new AssetLoader();
3939
// <assets id="feathersui-logo" path="assets/img/feathersui-logo.png" embed="false"/>
40-
icon.source = "feathersui-logo";
41-
icon.height = 16.0;
42-
this.addChild(icon);
40+
this.icon.source = "feathersui-logo";
41+
this.icon.height = 16.0;
42+
this.addChild(this.icon);
4343

4444
this.addEventListener(MouseEvent.ROLL_OVER, poweredBy_rollOverHandler);
4545
this.addEventListener(MouseEvent.ROLL_OUT, poweredBy_rollOutHandler);
4646
this.addEventListener(MouseEvent.CLICK, poweredBy_clickHandler);
4747
}
4848

49+
private var icon:AssetLoader;
4950
private var callout:TextCallout;
5051

5152
private function poweredBy_rollOverHandler(event:MouseEvent):Void {
52-
this.callout = TextCallout.show("Learn more at feathersui.com", this, null, false);
53+
this.callout = TextCallout.show("Learn more at feathersui.com", this.icon, null, false);
5354
}
5455

5556
private function poweredBy_rollOutHandler(event:MouseEvent):Void {

0 commit comments

Comments
 (0)