diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-10-30 12:11:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-30 12:11:49 +0100 |
commit | 21828209ec04807c9539dd5acc20de7d14033f37 (patch) | |
tree | 820d9fe60e6084c023791b0ae5529e8f7efa2f6e | |
parent | 1ee1a959abd10345febc79351df39dbd7378047e (diff) | |
parent | d517bc908f9c1e00503266ab9a639552660cf72c (diff) | |
download | redot-engine-21828209ec04807c9539dd5acc20de7d14033f37.tar.gz |
Merge pull request #6950 from rdb/master
Add "Never" underline mode to LinkButton
-rw-r--r-- | doc/base/classes.xml | 3 | ||||
-rw-r--r-- | scene/gui/link_button.cpp | 7 | ||||
-rw-r--r-- | scene/gui/link_button.h | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 47fa1deb55..977b44763e 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -20298,6 +20298,9 @@ <constant name="UNDERLINE_MODE_ON_HOVER" value="1"> The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. </constant> + <constant name="UNDERLINE_MODE_NEVER" value="2"> + The LinkButton will never show an underline at the bottom of its text. + </constant> </constants> <theme_items> <theme_item name="font" type="Font"> diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index 62829fd5a4..e6f85c5935 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -87,13 +87,13 @@ void LinkButton::_notification(int p_what) { else color=get_color("font_color"); - do_underline=true; + do_underline=underline_mode!=UNDERLINE_MODE_NEVER; } break; case DRAW_HOVER: { color=get_color("font_color_hover"); - do_underline=true; + do_underline=underline_mode!=UNDERLINE_MODE_NEVER; } break; case DRAW_DISABLED: { @@ -139,9 +139,10 @@ void LinkButton::_bind_methods() { BIND_CONSTANT( UNDERLINE_MODE_ALWAYS ); BIND_CONSTANT( UNDERLINE_MODE_ON_HOVER ); + BIND_CONSTANT( UNDERLINE_MODE_NEVER ); ADD_PROPERTYNZ(PropertyInfo(Variant::STRING,"text"), _SCS("set_text"), _SCS("get_text")); - ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"underline",PROPERTY_HINT_ENUM,"Always,On Hover"), _SCS("set_underline_mode"), _SCS("get_underline_mode")); + ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"underline",PROPERTY_HINT_ENUM,"Always,On Hover,Never"), _SCS("set_underline_mode"), _SCS("get_underline_mode")); } diff --git a/scene/gui/link_button.h b/scene/gui/link_button.h index 9978f66cc0..a44fc2ec1b 100644 --- a/scene/gui/link_button.h +++ b/scene/gui/link_button.h @@ -40,7 +40,8 @@ public: enum UnderlineMode { UNDERLINE_MODE_ALWAYS, - UNDERLINE_MODE_ON_HOVER + UNDERLINE_MODE_ON_HOVER, + UNDERLINE_MODE_NEVER }; private: String text; |