Skip to content

Commit f4a6d71

Browse files
author
Guillaume Piolat
committed
UILabel now has configurable Emissive offset when hovered or dragged.
1 parent b9258b4 commit f4a6d71

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

pbrwidgets/dplug/pbrwidgets/label.d

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@ public:
1919
nothrow:
2020
@nogc:
2121

22-
/// Sets to true if this is clickable
23-
@ScriptProperty bool clickable = false;
22+
@ScriptProperty
23+
{
24+
/// Sets to true if this is clickable
25+
bool clickable = false;
26+
27+
/// Emissive offset when over
28+
int emissiveOver = 40;
29+
30+
/// Emissive offset when clicked
31+
int emissiveDrag = 80;
32+
}
2433
string targetURL = "http://example.com";
2534

2635
this(UIContext context, Font font, string text = "")
@@ -140,12 +149,12 @@ nothrow:
140149

141150
if (clickable && isMouseOver)
142151
{
143-
emissive += 40;
152+
emissive += emissiveOver;
144153
underline = true;
145154
}
146155
else if (clickable && isDragged)
147156
{
148-
emissive += 80;
157+
emissive += emissiveDrag;
149158
underline = true;
150159
}
151160
if (emissive > 255)

0 commit comments

Comments
 (0)