Skip to content

Commit e6ad163

Browse files
committed
feat(gui): add Widget_SetOpacity()
1 parent b484532 commit e6ad163

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

include/LCUI/gui/widget_helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ LCUI_API void Widget_Hide(LCUI_Widget w);
6666

6767
LCUI_API void Widget_SetPosition(LCUI_Widget w, LCUI_StyleValue position);
6868

69+
LCUI_API void Widget_SetOpacity(LCUI_Widget w, float opacity);
70+
6971
LCUI_API void Widget_SetBoxSizing(LCUI_Widget w, LCUI_StyleValue sizing);
7072

7173
LCUI_END_HEADER

src/gui/widget_helper.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ void Widget_SetPosition(LCUI_Widget w, LCUI_StyleValue position)
118118
Widget_UpdateStyle(w, FALSE);
119119
}
120120

121+
void Widget_SetOpacity(LCUI_Widget w, float opacity)
122+
{
123+
Widget_SetStyle(w, key_opacity, opacity, scale);
124+
Widget_UpdateStyle(w, FALSE);
125+
}
126+
121127
void Widget_SetBoxSizing(LCUI_Widget w, LCUI_StyleValue sizing)
122128
{
123129
Widget_SetStyle(w, key_box_sizing, sizing, style);

0 commit comments

Comments
 (0)