Text selection enhancement (#1829)
* Corrected bug in styles of labels with selections Text selection color (text_selection_color) property was incorrectly being applied to the text color if there was a selection. The sel_color property in the label descriptor was initialized to blue. This property was intended to be the label background color under a selection. * Add new property for the color of selected text New property for labels: text_sel_font_color This property will change the color of the font within selected text. * Rename text selection color properties Per feedback from issue #1820, sel_color is now sel_bg_color and sel_font_color is now sel_color. This results in clearer naming. Co-authored-by: Ryan Powers <ryan.powers@envision-tek.com>
This commit is contained in:
@@ -3526,7 +3526,8 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_
|
||||
draw_dsc->font = lv_obj_get_style_text_font(obj, part);
|
||||
|
||||
if(draw_dsc->sel_start != LV_DRAW_LABEL_NO_TXT_SEL && draw_dsc->sel_end != LV_DRAW_LABEL_NO_TXT_SEL) {
|
||||
draw_dsc->color = lv_obj_get_style_text_sel_color(obj, part);
|
||||
draw_dsc->sel_color = lv_obj_get_style_text_sel_color(obj, part);
|
||||
draw_dsc->sel_bg_color = lv_obj_get_style_text_sel_bg_color(obj, part);
|
||||
}
|
||||
|
||||
#if LV_USE_BIDI
|
||||
|
||||
Reference in New Issue
Block a user