Skip to content

Commit 98ea136

Browse files
uncellonAndy-Big
authored andcommitted
🚸 TS35 portrait display (MarlinFirmware#25629)
1 parent ea5c0f8 commit 98ea136

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

Marlin/src/inc/Conditionals_LCD.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,8 +1686,13 @@
16861686
#define TFT_HEIGHT 272
16871687
#define GRAPHICAL_TFT_UPSCALE 2
16881688
#elif ENABLED(TFT_RES_480x320)
1689-
#define TFT_WIDTH 480
1690-
#define TFT_HEIGHT 320
1689+
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
1690+
#define TFT_WIDTH 320
1691+
#define TFT_HEIGHT 480
1692+
#else
1693+
#define TFT_WIDTH 480
1694+
#define TFT_HEIGHT 320
1695+
#endif
16911696
#define GRAPHICAL_TFT_UPSCALE 3
16921697
#elif ENABLED(TFT_RES_1024x600)
16931698
#define TFT_WIDTH 1024
@@ -1708,7 +1713,7 @@
17081713
#elif ENABLED(TFT_INTERFACE_FSMC)
17091714
#define TFT_320x240
17101715
#endif
1711-
#elif TFT_HEIGHT == 320
1716+
#elif TFT_HEIGHT == 320 || (TFT_HEIGHT == 480 && ENABLED(TFT_COLOR_UI_PORTRAIT))
17121717
#if ENABLED(TFT_INTERFACE_SPI)
17131718
#define TFT_480x320_SPI
17141719
#elif ENABLED(TFT_INTERFACE_FSMC)

Marlin/src/lcd/tft/ui_480x320.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ void MarlinUI::tft_idle() {
5151
#if ENABLED(TOUCH_SCREEN)
5252
if (TERN0(HAS_TOUCH_SLEEP, lcd_sleep_task())) return;
5353
if (draw_menu_navigation) {
54-
add_control(104, TFT_HEIGHT - 34, PAGE_UP, imgPageUp, encoderTopLine > 0);
55-
add_control(344, TFT_HEIGHT - 34, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items);
56-
add_control(224, TFT_HEIGHT - 34, BACK, imgBack);
54+
add_control(TFT_WIDTH / 6 - 16, TFT_HEIGHT - 34, PAGE_UP, imgPageUp, encoderTopLine > 0);
55+
add_control(TFT_WIDTH / 2 - 16, TFT_HEIGHT - 34, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items);
56+
add_control(5 * TFT_WIDTH / 6 - 16, TFT_HEIGHT - 34, BACK, imgBack);
5757
draw_menu_navigation = false;
5858
}
5959
#endif
@@ -607,9 +607,9 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va
607607

608608
void TFT::draw_edit_screen_buttons() {
609609
#if ENABLED(TOUCH_SCREEN)
610-
add_control(64, TFT_HEIGHT - 64, DECREASE, imgDecrease);
611-
add_control(352, TFT_HEIGHT - 64, INCREASE, imgIncrease);
612-
add_control(208, TFT_HEIGHT - 64, CLICK, imgConfirm);
610+
add_control((TFT_WIDTH - 3 * 64) / 6, TFT_HEIGHT - 64, DECREASE, imgDecrease);
611+
add_control((TFT_WIDTH - 64) / 2, TFT_HEIGHT - 64, INCREASE, imgIncrease);
612+
add_control((TFT_WIDTH * 5 - 3 * 64) / 6, TFT_HEIGHT - 64, CLICK, imgConfirm);
613613
#endif
614614
}
615615

@@ -1185,7 +1185,7 @@ void MarlinUI::move_axis_screen() {
11851185
drawAxisValue(Z_AXIS);
11861186

11871187
// ROW 4 -> step_size disable steppers back
1188-
y = TFT_HEIGHT - Y_MARGIN - 32; //
1188+
y = TFT_HEIGHT - Y_MARGIN - 32;
11891189
x = TFT_WIDTH / 2 - CUR_STEP_VALUE_WIDTH / 2;
11901190
motionAxisState.stepValuePos.x = x;
11911191
motionAxisState.stepValuePos.y = y;

0 commit comments

Comments
 (0)