Skip to content

Commit

Permalink
[component/tgui/simple_view] support corner tile for text list
Browse files Browse the repository at this point in the history
  • Loading branch information
versaloon committed Jan 10, 2025
1 parent abc4856 commit 5092f4b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describ_tgui_panel(stopwatch_t, main_panel_descriptor,
tgui_text_list(tNumberList, &(tgui_null_parent(stopwatch_t)->tLeftContainer.tContainerA), tNumberList, tVContainer,
tgui_size(100, 100),
tgui_margin(0, 0, 8, 0),
#if VSF_TGUI_CFG_TEXT_LIST_SUPPORT_SLIDE == ENABELD
#if VSF_TGUI_CFG_TEXT_LIST_SUPPORT_SLIDE == ENABLED
//tgui_attribute(tSlider, 400),
#endif
tgui_msgmap(
Expand Down
4 changes: 2 additions & 2 deletions source/component/ui/tgui/controls/vsf_tgui_text_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@
__VA_ARGS__ \
VSF_TGUI_V_LABEL_STATIC_INIT_OVERRIDE \
VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE \
.id = VSF_TGUI_COMPONENT_ID_LABEL, \
.id = VSF_TGUI_COMPONENT_ID_LABEL, \
.Offset = { \
.next = sizeof(vsf_tgui_label_t), \
}, \
__tgui_name_string_tag(tContent, vsf_tgui_label_t) \
__tgui_name_string_tag(tContent, vsf_tgui_label_t) \
.bIsEnabled = true, \
.bIsVisible = true, \
.tLabel.bIsAutoSize = true, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fsm_rt_t vsf_tgui_control_v_rendering( vsf_tgui_t* gui_ptr,
vsf_tgui_v_color_t color = vsf_tgui_sv_get_background_color(control_ptr);
vsf_tgui_v_color_t bg_color = vsf_tgui_sv_get_parent_background_color(control_ptr);
uint_fast8_t trans_rate = vsf_tgui_sv_color_get_trans_rate(color);
if (trans_rate) {
if (trans_rate && !control_ptr->__skip_frame) {
vsf_tgui_region_t region = {
.tLocation = {.iX = 0, .iY = 0},
.tSize = *vsf_tgui_control_get_size(control_ptr),
Expand Down
4 changes: 2 additions & 2 deletions source/component/ui/tgui/view/simple_view/vsf_tgui_sv_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ vsf_tgui_v_color_t vsf_tgui_sv_get_text_color(vsf_tgui_label_t* label_ptr)
{
#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
if (label_ptr->bIsEnabled) {
return label_ptr->font_color;
return label_ptr->text_color;
} else {
return vsf_tgui_sv_color_mix(label_ptr->font_color,
return vsf_tgui_sv_color_mix(label_ptr->text_color,
VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR,
VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ fsm_rt_t vsf_tgui_text_list_v_init(vsf_tgui_t *gui_ptr, vsf_tgui_text_list_t* te
#endif
vsf_tgui_container_v_init(gui_ptr, &(text_list_ptr->use_as__vsf_tgui_container_t));
vsf_tgui_container_v_init(gui_ptr, &(text_list_ptr->tList.use_as__vsf_tgui_container_t));

#if (VSF_TGUI_CFG_COLOR_MODE == VSF_TGUI_COLOR_ARGB_8888) \
|| (VSF_TGUI_SV_CFG_COLOR_HAS_ALPHA == ENABLED)
text_list_ptr->tList.__skip_frame = true;
text_list_ptr->tList.tContent.__skip_frame = true;
#endif
return fsm_rt_on_going;
}

Expand All @@ -65,12 +71,10 @@ fsm_rt_t vsf_tgui_text_list_v_rendering(vsf_tgui_t *gui_ptr,
vsf_tgui_control_get_node_name((vsf_tgui_control_t*)text_list_ptr), text_list_ptr);
#endif

vsf_tgui_container_v_rendering( gui_ptr,
return vsf_tgui_container_v_rendering( gui_ptr,
&(text_list_ptr->use_as__vsf_tgui_container_t),
ptDirtyRegion,
tMode);

return fsm_rt_cpl;
}

fsm_rt_t vsf_tgui_text_list_v_post_rendering( vsf_tgui_t *gui_ptr,
Expand Down
9 changes: 5 additions & 4 deletions source/component/ui/tgui/view/simple_view/vsf_tgui_v_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,17 @@
__SV_TEXT_COLOR(VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR)

#define VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
__SV_SHOW_CORNER_TILE(false) \
__SV_SHOW_CORNER_TILE(true) \
__SV_TILE_TRANS_RATE(0xFF) \
__SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR)

#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_DEFAULT \
__SV_SHOW_CORNER_TILE(false) \
__SV_SHOW_CORNER_TILE(true) \
__SV_TILE_TRANS_RATE(0xFF) \
__SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR)

#define VSF_TGUI_V_LIST_STATIC_INIT_DEFAULT \
__SV_SHOW_CORNER_TILE(false) \
__SV_SHOW_CORNER_TILE(true) \
__SV_TILE_TRANS_RATE(0xFF)

#define VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
Expand Down Expand Up @@ -234,7 +234,8 @@

declare_structure(vsf_tgui_v_control_t)
def_structure(vsf_tgui_v_control_t)
uint8_t font_index : 7;
uint8_t font_index : 6;
uint8_t __skip_frame : 1;
#if VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE == ENABLED
uint8_t show_corner_tile : 1;
#endif
Expand Down

0 comments on commit 5092f4b

Please sign in to comment.