mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
hide sign if only positive values
This commit is contained in:
parent
dab042fe06
commit
dbccceea51
@ -381,17 +381,20 @@ static void lv_spinbox_updatevalue(lv_obj_t * spinbox)
|
||||
|
||||
char buf[LV_SPINBOX_MAX_DIGIT_COUNT + 8];
|
||||
memset(buf, 0, sizeof(buf));
|
||||
char * buf_p = buf;
|
||||
|
||||
/*Add the sign*/
|
||||
(*buf_p) = ext->value >= 0 ? '+' : '-';
|
||||
buf_p++;
|
||||
|
||||
char* buf_p = buf;
|
||||
int i;
|
||||
/*padding left*/
|
||||
for(i = 0; i < ext->digit_padding_left; i++) {
|
||||
(*buf_p) = ' ';
|
||||
|
||||
if (ext->range_min < 0) { // hide sign if there are only positive values
|
||||
|
||||
/*Add the sign*/
|
||||
(*buf_p) = ext->value >= 0 ? '+' : '-';
|
||||
buf_p++;
|
||||
|
||||
/*padding left*/
|
||||
for (i = 0; i < ext->digit_padding_left; i++) {
|
||||
(*buf_p) = ' ';
|
||||
buf_p++;
|
||||
}
|
||||
}
|
||||
|
||||
char digits[64];
|
||||
|
Loading…
x
Reference in New Issue
Block a user