Spacing adjustment to menu_edit* macro
This commit is contained in:
parent
4938ae5caf
commit
517f411999
@ -1025,21 +1025,21 @@ void lcd_sdcard_menu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define menu_edit_type(_type, _name, _strFunc, scale) \
|
#define menu_edit_type(_type, _name, _strFunc, scale) \
|
||||||
bool menu_edit_ ## _name () { \
|
bool menu_edit_ ## _name () { \
|
||||||
bool isClicked = LCD_CLICKED; \
|
bool isClicked = LCD_CLICKED; \
|
||||||
if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
|
if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
|
||||||
if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
|
if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
|
||||||
if (lcdDrawUpdate) \
|
if (lcdDrawUpdate) \
|
||||||
lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
|
lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
|
||||||
if (isClicked) { \
|
if (isClicked) { \
|
||||||
*((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
|
*((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
|
||||||
lcd_goto_menu(prevMenu, prevEncoderPosition); \
|
lcd_goto_menu(prevMenu, prevEncoderPosition); \
|
||||||
} \
|
|
||||||
return isClicked; \
|
|
||||||
} \
|
|
||||||
void menu_edit_callback_ ## _name () { \
|
|
||||||
if (menu_edit_ ## _name ()) (*callbackFunc)(); \
|
|
||||||
} \
|
} \
|
||||||
|
return isClicked; \
|
||||||
|
} \
|
||||||
|
void menu_edit_callback_ ## _name () { \
|
||||||
|
if (menu_edit_ ## _name ()) (*callbackFunc)(); \
|
||||||
|
} \
|
||||||
static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
|
static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
|
||||||
prevMenu = currentMenu; \
|
prevMenu = currentMenu; \
|
||||||
prevEncoderPosition = encoderPosition; \
|
prevEncoderPosition = encoderPosition; \
|
||||||
|
Loading…
Reference in New Issue
Block a user