Skip to content

Commit

Permalink
Mass replace define renamed for consistency - WIP
Browse files Browse the repository at this point in the history
Update backButton component to simpler call for creation
Update choiceEditor component to simpler call for creation
Update listLine component to simpler call for creation
  • Loading branch information
luc-github committed Apr 30, 2024
1 parent 3ecfd41 commit 28cdb14
Show file tree
Hide file tree
Showing 79 changed files with 2,218 additions and 2,117 deletions.
2 changes: 1 addition & 1 deletion cmake/dev_tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Debug = 2
# Error only = 1
# Disabled = 0
add_compile_options(-DESP3D_TFT_LOG=0)
add_compile_options(-DESP3D_TFT_LOG=1)
# Disable ANSI color to fit some serial terminals
add_compile_options(-DDISABLE_COLOR_LOG=0)

Expand Down
246 changes: 123 additions & 123 deletions main/display/3dprinter/marlin/esp3d_styles.cpp

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions main/display/3dprinter/marlin/esp3d_styles.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,25 @@ namespace ESP3DStyle {
}; // namespace ESP3DStyle

//Colors definition

//Screen colors
#define ESP3D_SCREEN_BACKGROUND_COLOR lv_color_hex(0x000000)
#define ESP3D_SCREEN_BACKGROUND_TEXT_COLOR lv_color_hex(0xFFFFFF)

//Button colors
#define ESP3D_BUTTON_COLOR_PALETTE LV_PALETTE_GREY
#define ESP3D_BUTTON_COLOR_PALETTE_DARKEN 2
#define ESP3D_BUTTON_BORDER_COLOR lv_color_hex(0xFFFFFF)
#define ESP3D_BUTTON_TEXT_COLOR lv_color_hex(0xFFFFFF)
#define ESP3D_BUTTON_OUTLINE_COLOR_PALETTE LV_PALETTE_GREEN
#define ESP3D_BUTTON_PRESSED_COLOR_PALETTE LV_PALETTE_GREY
#define ESP3D_BUTTON_PRESSED_TEXT_COLOR lv_color_hex(0x00FF00)
#define ESP3D_BUTTON_PRESSED_BORDER_COLOR lv_color_hex(0x00FF00)

#define CURRENT_STATUS_BAR_TEXT_COLOR lv_color_hex(0x000000)
#define CURRENT_STATUS_BAR_BG_COLOR lv_color_hex(0xFFFFFF)
#define CURRENT_STATUS_BAR_BORDER_COLOR lv_palette_main(LV_PALETTE_GREY)
//Status bar colors
#define ESP3D_STATUS_BAR_TEXT_COLOR lv_color_hex(0x000000)
#define ESP3D_STATUS_BAR_BG_COLOR lv_color_hex(0xFFFFFF)
#define ESP3D_STATUS_BAR_BORDER_COLOR lv_palette_main(LV_PALETTE_GREY)

#define CURRENT_BUTTON_COLOR_PALETTE LV_PALETTE_GREY
#define CURRENT_BUTTON_COLOR_PALETTE_DARKEN 2

#define CURRENT_BUTTON_BORDER_COLOR \
lv_color_hex(0xFFFFFF) // lv_palette_main(LV_PALETTE_GREY)
#define CURRENT_BUTTON_TEXT_COLOR lv_color_hex(0xFFFFFF)
#define CURRENT_BUTTON_OUTLINE_COLOR_PALETTE LV_PALETTE_GREEN
#define CURRENT_BUTTON_PRESSED_COLOR_PALETTE LV_PALETTE_GREY
#define CURRENT_BUTTON_PRESSED_TEXT_COLOR lv_color_hex(0x00FF00)
#define CURRENT_BUTTON_PRESSED_BORDER_COLOR lv_color_hex(0x00FF00)

64 changes: 32 additions & 32 deletions main/display/3dprinter/marlin/res_320_240/esp3d_styles_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,46 @@

#pragma once

#define CURRENT_STATUS_BAR_RADIUS 4
#define CURRENT_STATUS_BAR_H_PAD 5
#define CURRENT_STATUS_BAR_V_PAD 3
#define CURRENT_STATUS_BAR_BORDER_VALUE 1
#define CURRENT_STATUS_AREA_HEIGHT 40
#define CURRENT_STATUS_AREA_WIDTH LV_HOR_RES - (2 * 10)
#define CURRENT_CHOICE_LIST_WIDTH LV_HOR_RES / 2
#define ESP3D_STATUS_BAR_RADIUS 4
#define ESP3D_STATUS_BAR_H_PAD 5
#define ESP3D_STATUS_BAR_V_PAD 3
#define ESP3D_STATUS_BAR_BORDER_VALUE 1
#define ESP3D_STATUS_BAR_HEIGHT 40
#define ESP3D_STATUS_BAR_WIDTH LV_HOR_RES - (2 * 10)
#define ESP3D_CHOICE_LIST_WIDTH LV_HOR_RES / 2

#define CURRENT_BUTTON_RADIUS_VALUE 4
#define CURRENT_BUTTON_BORDER_VALUE 2
#define ESP3D_BUTTON_RADIUS 4
#define ESP3D_BUTTON_BORDER_SIZE 2

#define CURRENT_BUTTON_PRESSED_OUTLINE 5
#define CURRENT_BUTTON_COLOR_PRESSED_SHADOW_OFFSET 3
#define CURRENT_BUTTON_PAD 3
#define ESP3D_BUTTON_PRESSED_OUTLINE 5
#define ESP3D_BUTTON_PRESSED_SHADOW_OFFSET 3
#define ESP3D_BUTTON_PAD 3

#define CURRENT_CONTAINER_RADIUS 5
#define ESP3D_CONTAINER_RADIUS 5

#define BUTTON_WIDTH 60
#define BUTTON_HEIGHT 60
#define ESP3D_BUTTON_WIDTH 60
#define ESP3D_BUTTON_HEIGHT 60

#define SYMBOL_BUTTON_WIDTH 50
#define SYMBOL_BUTTON_HEIGHT 44
#define ESP3D_SYMBOL_BUTTON_WIDTH 50
#define ESP3D_SYMBOL_BUTTON_HEIGHT 44

#ifndef BUTTON_ANIMATION_DELAY
#define BUTTON_ANIMATION_DELAY 0
#endif // BUTTON_ANIMATION_DELAY
#ifndef ESP3D_BUTTON_ANIMATION_DELAY
#define ESP3D_BUTTON_ANIMATION_DELAY 0
#endif // ESP3D_BUTTON_ANIMATION_DELAY

#define CURRENT_SPINNER_SIZE 70
#define ESP3D_SPINNER_SIZE 70

#define BACK_BUTTON_WIDTH 50
#define BACK_BUTTON_HEIGHT 40
#define MATRIX_BUTTON_WIDTH 48
#define MATRIX_BUTTON_HEIGHT 40
#define MSGBOX_BUTTON_WIDTH 100
#define ESP3D_BACK_BUTTON_WIDTH 50
#define ESP3D_BACK_BUTTON_HEIGHT 40
#define ESP3D_MATRIX_BUTTON_WIDTH 48
#define ESP3D_MATRIX_BUTTON_HEIGHT 40
#define ESP3D_MATRIX_BUTTON_WIDTH 100

#define LIST_CONTAINER_LR_PAD 6
#define LIST_LINE_HEIGHT 36
#define LIST_LINE_BORDER_WIDTH 2
#define LIST_LINE_BUTTON_WIDTH 40
#define ESP3D_LIST_CONTAINER_LR_PAD 6
#define ESP3D_LIST_LINE_HEIGHT 36
#define ESP3D_LIST_LINE_BORDER_SIZE 2
#define ESP3D_LIST_LINE_BUTTON_WIDTH 40

#define CURRENT_SCROLL_BAR_WIDTH 10
#define CURRENT_SCROLL_BAR_RADIUS 5
#define ESP3D_SCROLL_BAR_WIDTH 10
#define ESP3D_SCROLL_BAR_RADIUS 5

64 changes: 32 additions & 32 deletions main/display/3dprinter/marlin/res_480_272/esp3d_styles_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,48 @@

#pragma once

#define CURRENT_STATUS_BAR_RADIUS 5
#define CURRENT_STATUS_BAR_H_PAD 5
#define CURRENT_STATUS_BAR_V_PAD 3
#define CURRENT_STATUS_BAR_BORDER_VALUE 1
#define CURRENT_STATUS_AREA_HEIGHT 50
#define CURRENT_STATUS_AREA_WIDTH LV_HOR_RES - (2 * 15)
#define CURRENT_CHOICE_LIST_WIDTH LV_HOR_RES / 3
#define ESP3D_STATUS_BAR_RADIUS 5
#define ESP3D_STATUS_BAR_H_PAD 5
#define ESP3D_STATUS_BAR_V_PAD 3
#define ESP3D_STATUS_BAR_BORDER_VALUE 1
#define ESP3D_STATUS_BAR_HEIGHT 50
#define ESP3D_STATUS_BAR_WIDTH LV_HOR_RES - (2 * 15)
#define ESP3D_CHOICE_LIST_WIDTH LV_HOR_RES / 3

#define CURRENT_BUTTON_RADIUS_VALUE 5
#define CURRENT_BUTTON_BORDER_VALUE 2
#define ESP3D_BUTTON_RADIUS 5
#define ESP3D_BUTTON_BORDER_SIZE 2

#define CURRENT_BUTTON_PRESSED_OUTLINE 8
#define CURRENT_BUTTON_COLOR_PRESSED_SHADOW_OFFSET 3
#define CURRENT_BUTTON_PAD 4
#define ESP3D_BUTTON_PRESSED_OUTLINE 8
#define ESP3D_BUTTON_PRESSED_SHADOW_OFFSET 3
#define ESP3D_BUTTON_PAD 4

#define CURRENT_CONTAINER_RADIUS 5
#define ESP3D_CONTAINER_RADIUS 5

#define BUTTON_WIDTH (LV_HOR_RES / 6)
#define BUTTON_HEIGHT BUTTON_WIDTH
#define ESP3D_BUTTON_WIDTH (LV_HOR_RES / 6)
#define ESP3D_BUTTON_HEIGHT ESP3D_BUTTON_WIDTH

#define SYMBOL_BUTTON_WIDTH 70
#define SYMBOL_BUTTON_HEIGHT 50
#define ESP3D_SYMBOL_BUTTON_WIDTH 70
#define ESP3D_SYMBOL_BUTTON_HEIGHT 50

#ifndef BUTTON_ANIMATION_DELAY
#define BUTTON_ANIMATION_DELAY 300
#endif // BUTTON_ANIMATION_DELAY
#ifndef ESP3D_BUTTON_ANIMATION_DELAY
#define ESP3D_BUTTON_ANIMATION_DELAY 300
#endif // ESP3D_BUTTON_ANIMATION_DELAY

#define CURRENT_SPINNER_SIZE 100
#define ESP3D_SPINNER_SIZE 100

#define BACK_BUTTON_WIDTH 70
#define BACK_BUTTON_HEIGHT 33
#define MATRIX_BUTTON_WIDTH 70
#define MATRIX_BUTTON_HEIGHT 33
#define MSGBOX_BUTTON_WIDTH 130
#define ESP3D_BACK_BUTTON_WIDTH 70
#define ESP3D_BACK_BUTTON_HEIGHT 33
#define ESP3D_MATRIX_BUTTON_WIDTH 70
#define ESP3D_MATRIX_BUTTON_HEIGHT 33
#define ESP3D_MATRIX_BUTTON_WIDTH 130

#define LIST_CONTAINER_LR_PAD 10
#define LIST_LINE_HEIGHT 42
#define LIST_LINE_BORDER_WIDTH 2
#define LIST_LINE_BUTTON_WIDTH 50
#define ESP3D_LIST_CONTAINER_LR_PAD 10
#define ESP3D_LIST_LINE_HEIGHT 42
#define ESP3D_LIST_LINE_BORDER_SIZE 2
#define ESP3D_LIST_LINE_BUTTON_WIDTH 50

#define CURRENT_SCROLL_BAR_WIDTH 10
#define CURRENT_SCROLL_BAR_RADIUS 5
#define ESP3D_SCROLL_BAR_WIDTH 10
#define ESP3D_SCROLL_BAR_RADIUS 5

#define FW_LOGO_X 10
#define FW_LOGO_Y -1
64 changes: 32 additions & 32 deletions main/display/3dprinter/marlin/res_480_320/esp3d_styles_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,48 @@

#pragma once

#define CURRENT_STATUS_BAR_RADIUS 5
#define CURRENT_STATUS_BAR_H_PAD 5
#define CURRENT_STATUS_BAR_V_PAD 3
#define CURRENT_STATUS_BAR_BORDER_VALUE 1
#define CURRENT_STATUS_AREA_HEIGHT 50
#define CURRENT_STATUS_AREA_WIDTH LV_HOR_RES - (2 * 15)
#define CURRENT_CHOICE_LIST_WIDTH LV_HOR_RES / 3
#define ESP3D_STATUS_BAR_RADIUS 5
#define ESP3D_STATUS_BAR_H_PAD 5
#define ESP3D_STATUS_BAR_V_PAD 3
#define ESP3D_STATUS_BAR_BORDER_VALUE 1
#define ESP3D_STATUS_BAR_HEIGHT 50
#define ESP3D_STATUS_BAR_WIDTH LV_HOR_RES - (2 * 15)
#define ESP3D_CHOICE_LIST_WIDTH LV_HOR_RES / 3

#define CURRENT_BUTTON_RADIUS_VALUE 5
#define CURRENT_BUTTON_BORDER_VALUE 2
#define ESP3D_BUTTON_RADIUS 5
#define ESP3D_BUTTON_BORDER_SIZE 2

#define CURRENT_BUTTON_PRESSED_OUTLINE 10
#define CURRENT_BUTTON_COLOR_PRESSED_SHADOW_OFFSET 3
#define CURRENT_BUTTON_PAD 4
#define ESP3D_BUTTON_PRESSED_OUTLINE 10
#define ESP3D_BUTTON_PRESSED_SHADOW_OFFSET 3
#define ESP3D_BUTTON_PAD 4

#define CURRENT_CONTAINER_RADIUS 5
#define ESP3D_CONTAINER_RADIUS 5

#define BUTTON_WIDTH (LV_HOR_RES / 6)
#define BUTTON_HEIGHT BUTTON_WIDTH
#define ESP3D_BUTTON_WIDTH (LV_HOR_RES / 6)
#define ESP3D_BUTTON_HEIGHT ESP3D_BUTTON_WIDTH

#define SYMBOL_BUTTON_WIDTH 70
#define SYMBOL_BUTTON_HEIGHT 56
#define ESP3D_SYMBOL_BUTTON_WIDTH 70
#define ESP3D_SYMBOL_BUTTON_HEIGHT 56

#ifndef BUTTON_ANIMATION_DELAY
#define BUTTON_ANIMATION_DELAY 300
#endif // BUTTON_ANIMATION_DELAY
#ifndef ESP3D_BUTTON_ANIMATION_DELAY
#define ESP3D_BUTTON_ANIMATION_DELAY 300
#endif // ESP3D_BUTTON_ANIMATION_DELAY

#define CURRENT_SPINNER_SIZE 100
#define ESP3D_SPINNER_SIZE 100

#define BACK_BUTTON_WIDTH 70
#define BACK_BUTTON_HEIGHT 50
#define MATRIX_BUTTON_WIDTH 70
#define MATRIX_BUTTON_HEIGHT 50
#define MSGBOX_BUTTON_WIDTH 130
#define ESP3D_BACK_BUTTON_WIDTH 70
#define ESP3D_BACK_BUTTON_HEIGHT 50
#define ESP3D_MATRIX_BUTTON_WIDTH 70
#define ESP3D_MATRIX_BUTTON_HEIGHT 50
#define ESP3D_MATRIX_BUTTON_WIDTH 130

#define LIST_CONTAINER_LR_PAD 10
#define LIST_LINE_HEIGHT 45
#define LIST_LINE_BORDER_WIDTH 3
#define LIST_LINE_BUTTON_WIDTH 50
#define ESP3D_LIST_CONTAINER_LR_PAD 10
#define ESP3D_LIST_LINE_HEIGHT 45
#define ESP3D_LIST_LINE_BORDER_SIZE 3
#define ESP3D_LIST_LINE_BUTTON_WIDTH 50

#define CURRENT_SCROLL_BAR_WIDTH 10
#define CURRENT_SCROLL_BAR_RADIUS 5
#define ESP3D_SCROLL_BAR_WIDTH 10
#define ESP3D_SCROLL_BAR_RADIUS 5

#define FW_LOGO_X 10
#define FW_LOGO_Y -10
99 changes: 58 additions & 41 deletions main/display/3dprinter/marlin/res_800_480/esp3d_styles_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,61 @@

#pragma once

#define CURRENT_STATUS_BAR_RADIUS 10
#define CURRENT_STATUS_BAR_H_PAD 10
#define CURRENT_STATUS_BAR_V_PAD 4
#define CURRENT_STATUS_BAR_BORDER_VALUE 2
#define CURRENT_STATUS_AREA_HEIGHT 80
#define CURRENT_STATUS_AREA_WIDTH LV_HOR_RES - (2 * 30)
#define CURRENT_CHOICE_LIST_WIDTH LV_HOR_RES / 3

#define CURRENT_BUTTON_RADIUS_VALUE 10
#define CURRENT_BUTTON_BORDER_VALUE 2

#define CURRENT_BUTTON_PRESSED_OUTLINE 20
#define CURRENT_BUTTON_COLOR_PRESSED_SHADOW_OFFSET 3
#define CURRENT_BUTTON_PAD 10

#define CURRENT_CONTAINER_RADIUS 10

#define BUTTON_WIDTH (LV_HOR_RES / 6)
#define BUTTON_HEIGHT BUTTON_WIDTH

#define SYMBOL_BUTTON_WIDTH 100
#define SYMBOL_BUTTON_HEIGHT 85
#ifndef BUTTON_ANIMATION_DELAY
#define BUTTON_ANIMATION_DELAY 300
#endif // BUTTON_ANIMATION_DELAY

#define CURRENT_SPINNER_SIZE 100

#define BACK_BUTTON_WIDTH 100
#define BACK_BUTTON_HEIGHT 75
#define MATRIX_BUTTON_WIDTH 100
#define MATRIX_BUTTON_HEIGHT 75
#define MSGBOX_BUTTON_WIDTH 220

#define LIST_CONTAINER_LR_PAD 20
#define LIST_LINE_HEIGHT 64
#define LIST_LINE_BORDER_WIDTH 4
#define LIST_LINE_BUTTON_WIDTH 80

#define CURRENT_SCROLL_BAR_WIDTH 10
#define CURRENT_SCROLL_BAR_RADIUS 5
//Styles for common controls

//Back button size
#define ESP3D_BACK_BUTTON_WIDTH 100
#define ESP3D_BACK_BUTTON_HEIGHT 75

//Buttons
#define ESP3D_BUTTON_RADIUS 10
#define ESP3D_BUTTON_BORDER_SIZE 2
#define ESP3D_BUTTON_PRESSED_OUTLINE 20
#define ESP3D_BUTTON_PRESSED_SHADOW_OFFSET 3
#define ESP3D_BUTTON_PAD 10
#define ESP3D_BUTTON_WIDTH (LV_HOR_RES / 6)
#define ESP3D_BUTTON_HEIGHT ESP3D_BUTTON_WIDTH
#ifndef ESP3D_BUTTON_ANIMATION_DELAY
#define ESP3D_BUTTON_ANIMATION_DELAY 300
#endif // ESP3D_BUTTON_ANIMATION_DELAY

//Symbol buttons
#define ESP3D_SYMBOL_BUTTON_WIDTH 100
#define ESP3D_SYMBOL_BUTTON_HEIGHT 85

//Matrix buttons
#define ESP3D_MATRIX_BUTTON_WIDTH 100
#define ESP3D_MATRIX_BUTTON_HEIGHT 75

//Message box buttons
#define ESP3D_MSGBOX_BUTTON_WIDTH 220

//Spinner size
#define ESP3D_SPINNER_SIZE 100

//List styles
#define ESP3D_LIST_CONTAINER_LR_PAD 20
#define ESP3D_LIST_LINE_HEIGHT 64
#define ESP3D_LIST_LINE_BORDER_SIZE 4
#define ESP3D_LIST_LINE_BUTTON_WIDTH 80

//Container styles
#define ESP3D_CONTAINER_RADIUS 10

//Scroll bar styles
#define ESP3D_SCROLL_BAR_WIDTH 10
#define ESP3D_SCROLL_BAR_RADIUS 5

//Choice List styles
#define ESP3D_CHOICE_LIST_WIDTH (LV_HOR_RES / 3)

//Status bar styles
#define ESP3D_STATUS_BAR_RADIUS 10
#define ESP3D_STATUS_BAR_H_PAD 10
#define ESP3D_STATUS_BAR_V_PAD 4
#define ESP3D_STATUS_BAR_BORDER_VALUE 2
#define ESP3D_STATUS_BAR_HEIGHT 80
#define ESP3D_STATUS_BAR_WIDTH (LV_HOR_RES - (2 * 30))



Loading

0 comments on commit 28cdb14

Please sign in to comment.