Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lv_obj_set_style_border_side() doesn't work! #6149

Open
aliparto opened this issue Apr 29, 2024 · 7 comments
Open

lv_obj_set_style_border_side() doesn't work! #6149

aliparto opened this issue Apr 29, 2024 · 7 comments
Labels

Comments

@aliparto
Copy link

aliparto commented Apr 29, 2024

LVGL version

v9.1

What happened?

The function "lv_obj_set_style_border_side" is utilized to adjust the border side, as illustrated in the example. However, it encounters issues and fails to be applied to the buttons. The border always drawn at the bottom!

How to reproduce?

lv_obj_t * tabview;
tabview = lv_tabview_create(lv_screen_active());
lv_tabview_set_tab_bar_position(tabview, LV_DIR_LEFT);
lv_tabview_set_tab_bar_size(tabview, 80);

lv_obj_t * tab_buttons = lv_tabview_get_tab_bar(tabview);
lv_obj_set_style_border_side(tab_buttons, LV_BORDER_SIDE_RIGHT, LV_PART_ITEMS | LV_STATE_CHECKED);
@kisvegabor
Copy link
Member

Please send a code snippet to reproduce the issue. Note that the slight gray line here is a shadow and not a border:
image

@aliparto
Copy link
Author

Please send a code snippet to reproduce the issue. Note that the slight gray line here is a shadow and not a border: image

I tried to change the border side of the selected button of the tab view to the right but it didn't changed and stay at the bottom side (default theme value).
In v8.3 works fine.

@kisvegabor
Copy link
Member

Oh, I see now. This border is on the the button, but the container of the buttons. This style is applied on the tab view buttons.

@aliparto
Copy link
Author

aliparto commented May 7, 2024

Thanks, I got it.
Is it possible to customize the style of tab view buttons individually?
I mean if I want to have different tab views on various pages, how can I implement different styles for their respective buttons?

@kisvegabor
Copy link
Member

Yes, you can do this to get the buttons:

    lv_obj_t * tab_bar = lv_tabview_get_tab_bar(tv);
    lv_obj_t * btn1 = lv_obj_get_child(tab_bar, 0);
    lv_obj_t * btn2 = lv_obj_get_child(tab_bar, 1);

@lvgl-bot
Copy link

We need some feedback on this issue.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

@lvgl-bot lvgl-bot added the stale label May 23, 2024
@aliparto
Copy link
Author

btn1 

I'm able to access the buttons, but couldn't change the border side!
It seems the sides are following the global style.
I tried these:
lv_obj_set_style_border_side(lv_tabview_get_tab_btns(tab), LV_BORDER_SIDE_RIGHT, LV_PART_ITEMS | LV_STATE_CHECKED);
and
lv_obj_set_style_border_side(lv_tabview_get_tab_btns(tab), LV_BORDER_SIDE_RIGHT, LV_PART_MAIN | LV_STATE_CHECKED);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants