Apply ENABLED in ExiUI / FTDI

This commit is contained in:
Scott Lahteine 2020-12-23 15:33:34 -06:00
parent 2844086772
commit 59de35e749
41 changed files with 91 additions and 165 deletions

View File

@ -45,7 +45,7 @@
static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \ static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \
static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv"); static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv");
#ifdef TOUCH_UI_320x240 #if ENABLED(TOUCH_UI_320x240)
namespace FTDI { namespace FTDI {
constexpr uint8_t Pclk = 8; constexpr uint8_t Pclk = 8;
constexpr uint8_t Pclkpol = 0; constexpr uint8_t Pclkpol = 0;

View File

@ -21,7 +21,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func; CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func;
bool CommandProcessor::is_tracking = false; bool CommandProcessor::is_tracking = false;

View File

@ -312,12 +312,12 @@ class CommandProcessor : public CLCD::CommandFifo {
int8_t apply_fit_text(int16_t w, int16_t h, T text) { int8_t apply_fit_text(int16_t w, int16_t h, T text) {
using namespace FTDI; using namespace FTDI;
int8_t font = _font; int8_t font = _font;
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
const bool is_utf8 = has_utf8_chars(text); const bool is_utf8 = has_utf8_chars(text);
#endif #endif
for (;font > 26;) { for (;font > 26;) {
int16_t width, height; int16_t width, height;
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
if (is_utf8) { if (is_utf8) {
width = get_utf8_text_width(text, font_size_t::from_romfont(font)); width = get_utf8_text_width(text, font_size_t::from_romfont(font));
height = font_size_t::from_romfont(font).get_height(); height = font_size_t::from_romfont(font).get_height();
@ -345,7 +345,7 @@ class CommandProcessor : public CLCD::CommandFifo {
template<typename T> template<typename T>
uint16_t text_width(T text) { uint16_t text_width(T text) {
using namespace FTDI; using namespace FTDI;
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
if (has_utf8_chars(text)) if (has_utf8_chars(text))
return get_utf8_text_width(text, font_size_t::from_romfont(_font)); return get_utf8_text_width(text, font_size_t::from_romfont(_font));
#endif #endif
@ -362,7 +362,7 @@ class CommandProcessor : public CLCD::CommandFifo {
#else #else
const int8_t font = _font; const int8_t font = _font;
#endif #endif
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
if (has_utf8_chars(text)) if (has_utf8_chars(text))
draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), options); draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), options);
else else
@ -401,7 +401,7 @@ class CommandProcessor : public CLCD::CommandFifo {
const int8_t font = _font; const int8_t font = _font;
#endif #endif
CLCD::CommandFifo::button(x, y, w, h, font, options); CLCD::CommandFifo::button(x, y, w, h, font, options);
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
if (has_utf8_chars(text)) { if (has_utf8_chars(text)) {
CLCD::CommandFifo::str(F("")); CLCD::CommandFifo::str(F(""));
apply_text_alignment(x, y, w, h, OPT_CENTER); apply_text_alignment(x, y, w, h, OPT_CENTER);

View File

@ -22,7 +22,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
/* The Display List Cache mechanism stores the display list corresponding /* The Display List Cache mechanism stores the display list corresponding
* to a menu into RAM_G so that on subsequent calls drawing the menu does * to a menu into RAM_G so that on subsequent calls drawing the menu does

View File

@ -22,7 +22,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
using namespace FTDI; using namespace FTDI;
enum { enum {

View File

@ -29,7 +29,7 @@
#define FTDI_EXTENDED #define FTDI_EXTENDED
#endif #endif
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
#include "unicode/font_size_t.h" #include "unicode/font_size_t.h"
#include "unicode/unicode.h" #include "unicode/unicode.h"
#include "unicode/standard_char_set.h" #include "unicode/standard_char_set.h"

View File

@ -88,7 +88,7 @@
} }
namespace FTDI { namespace FTDI {
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
constexpr uint16_t display_width = Vsize; constexpr uint16_t display_width = Vsize;
constexpr uint16_t display_height = Hsize; constexpr uint16_t display_height = Hsize;
#else #else

View File

@ -66,7 +66,7 @@ namespace FTDI {
cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255));
// Drawing the edge strip along scan lines // Drawing the edge strip along scan lines
// seems to yield the best performance // seems to yield the best performance
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
path_initiator = EDGE_STRIP_B; path_initiator = EDGE_STRIP_B;
#else #else
path_initiator = EDGE_STRIP_R; path_initiator = EDGE_STRIP_R;

View File

@ -21,7 +21,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
/********************** VIRTUAL DISPATCH DATA TYPE ******************************/ /********************** VIRTUAL DISPATCH DATA TYPE ******************************/

View File

@ -158,7 +158,7 @@ class UncachedScreen {
using namespace FTDI; using namespace FTDI;
CommandProcessor cmd; CommandProcessor cmd;
cmd.cmd(CMD_DLSTART); cmd.cmd(CMD_DLSTART);
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); load_utf8_bitmaps(cmd);
#endif #endif
@ -199,7 +199,7 @@ class CachedScreen {
CommandProcessor cmd; CommandProcessor cmd;
cmd.cmd(CMD_DLSTART); cmd.cmd(CMD_DLSTART);
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); load_utf8_bitmaps(cmd);
#endif #endif
current_screen.onRedraw(BACKGROUND); current_screen.onRedraw(BACKGROUND);
@ -222,7 +222,7 @@ class CachedScreen {
dlcache.append(); dlcache.append();
} }
else { else {
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); load_utf8_bitmaps(cmd);
#endif #endif
current_screen.onRedraw(BACKGROUND); current_screen.onRedraw(BACKGROUND);

View File

@ -21,7 +21,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
namespace FTDI { namespace FTDI {
SoundPlayer sound; // Global sound player object SoundPlayer sound; // Global sound player object

View File

@ -21,7 +21,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
namespace FTDI { namespace FTDI {
/** /**
@ -103,7 +103,7 @@ namespace FTDI {
if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ') if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ')
line[line_len - 1] = 0; line[line_len - 1] = 0;
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
if (has_utf8_chars(line)) { if (has_utf8_chars(line)) {
draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY); draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY);
} else } else

View File

@ -21,7 +21,7 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
namespace FTDI { namespace FTDI {
@ -60,7 +60,7 @@ namespace FTDI {
} }
cmd.apply_text_alignment(x, y, w, h, options); cmd.apply_text_alignment(x, y, w, h, options);
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
if (has_utf8_chars(str)) { if (has_utf8_chars(str)) {
draw_utf8_text(cmd, x, y, str, font_size_t::from_romfont(font), options); draw_utf8_text(cmd, x, y, str, font_size_t::from_romfont(font), options);
} else } else

View File

@ -21,15 +21,11 @@
#include "ftdi_extended.h" #include "ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
bool tiny_timer_t::elapsed(tiny_time_t duration) { bool tiny_timer_t::elapsed(tiny_time_t duration) {
uint8_t now = tiny_time_t::tiny_time( uint8_t now = tiny_time_t::tiny_time(
#ifdef __MARLIN_FIRMWARE__ TERN(__MARLIN_FIRMWARE__, ExtUI::safe_millis(), millis())
ExtUI::safe_millis()
#else
millis()
#endif
); );
uint8_t elapsed = now - _start; uint8_t elapsed = now - _start;
return elapsed >= duration._duration; return elapsed >= duration._duration;
@ -37,11 +33,7 @@ bool tiny_timer_t::elapsed(tiny_time_t duration) {
void tiny_timer_t::start() { void tiny_timer_t::start() {
_start = tiny_time_t::tiny_time( _start = tiny_time_t::tiny_time(
#ifdef __MARLIN_FIRMWARE__ TERN(__MARLIN_FIRMWARE__, ExtUI::safe_millis(), millis())
ExtUI::safe_millis()
#else
millis()
#endif
); );
} }
#endif // FTDI_EXTENDED #endif // FTDI_EXTENDED

View File

@ -21,7 +21,7 @@
#include "../ftdi_extended.h" #include "../ftdi_extended.h"
#ifdef FTDI_EXTENDED #if ENABLED(FTDI_EXTENDED)
namespace FTDI { namespace FTDI {

View File

@ -24,7 +24,7 @@
class CommandProcessor; class CommandProcessor;
namespace FTDI { namespace FTDI {
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
typedef uint16_t utf8_char_t; typedef uint16_t utf8_char_t;
/** /**
@ -75,14 +75,14 @@ namespace FTDI {
// Similar to CLCD::FontMetrics, but can be used with UTF8 encoded strings. // Similar to CLCD::FontMetrics, but can be used with UTF8 encoded strings.
struct FontMetrics { struct FontMetrics {
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
font_size_t fs; font_size_t fs;
#else #else
CLCD::FontMetrics fm; CLCD::FontMetrics fm;
#endif #endif
inline void load(uint8_t rom_font_size) { inline void load(uint8_t rom_font_size) {
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
fs = font_size_t::from_romfont(rom_font_size); fs = font_size_t::from_romfont(rom_font_size);
#else #else
fm.load(rom_font_size); fm.load(rom_font_size);
@ -90,7 +90,7 @@ namespace FTDI {
} }
inline uint16_t get_char_width(utf8_char_t c) const { inline uint16_t get_char_width(utf8_char_t c) const {
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
return get_utf8_char_width(c, fs); return get_utf8_char_width(c, fs);
#else #else
return fm.char_widths[(uint8_t)c]; return fm.char_widths[(uint8_t)c];
@ -98,7 +98,7 @@ namespace FTDI {
} }
inline uint8_t get_height() const { inline uint8_t get_height() const {
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
return fs.get_height(); return fs.get_height();
#else #else
return fm.height; return fm.height;

View File

@ -146,7 +146,7 @@ namespace Language_en {
PROGMEM Language_Str MSG_LEVELING = u8"Leveling"; PROGMEM Language_Str MSG_LEVELING = u8"Leveling";
PROGMEM Language_Str MSG_SHOW_MESH = u8"Show Bed Mesh"; PROGMEM Language_Str MSG_SHOW_MESH = u8"Show Bed Mesh";
#ifdef TOUCH_UI_LULZBOT_BIO #if ENABLED(TOUCH_UI_LULZBOT_BIO)
PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home";
PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger";
PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis";

View File

@ -37,7 +37,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
.cmd(CLEAR(true,true,true)); .cmd(CLEAR(true,true,true));
} }
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#if EITHER(HAS_MULTI_HOTEND, SENSORLESS_HOMING) #if EITHER(HAS_MULTI_HOTEND, SENSORLESS_HOMING)
#define GRID_ROWS 9 #define GRID_ROWS 9
#else #else

View File

@ -30,7 +30,7 @@
using namespace FTDI; using namespace FTDI;
using namespace Theme; using namespace Theme;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 13 #define GRID_COLS 13
#define GRID_ROWS 10 #define GRID_ROWS 10
#define LAYOUT_FONT font_small #define LAYOUT_FONT font_small
@ -53,7 +53,7 @@ BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what
cmd.font(font_medium); cmd.font(font_medium);
_button(cmd, 1, _button(cmd, 1,
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
BTN_POS(1,10), BTN_SIZE(13,1), BTN_POS(1,10), BTN_SIZE(13,1),
#else #else
BTN_POS(15,7), BTN_SIZE(4,1), BTN_POS(15,7), BTN_SIZE(4,1),
@ -129,7 +129,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) {
cmd.font(font_medium) cmd.font(font_medium)
.tag(0) .tag(0)
.text( .text(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
BTN_POS(1, _line), BTN_SIZE(12,1), BTN_POS(1, _line), BTN_SIZE(12,1),
#else #else
BTN_POS(5, _line), BTN_SIZE(8,1), BTN_POS(5, _line), BTN_SIZE(8,1),
@ -141,7 +141,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) {
_line++; _line++;
} }
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#ifdef TOUCH_UI_800x480 #ifdef TOUCH_UI_800x480
#undef EDGE_R #undef EDGE_R
#define EDGE_R 20 #define EDGE_R 20
@ -172,7 +172,7 @@ void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcesso
const bool highlight = (_what & FOREGROUND) && (increment == tag); const bool highlight = (_what & FOREGROUND) && (increment == tag);
switch (pos) { switch (pos) {
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break;
@ -192,7 +192,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() {
if (_what & BACKGROUND) { if (_what & BACKGROUND) {
_button_style(cmd, TEXT_LABEL); _button_style(cmd, TEXT_LABEL);
cmd.tag(0).text( cmd.tag(0).text(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
BTN_POS(1, _line), BTN_SIZE(4,1), BTN_POS(1, _line), BTN_SIZE(4,1),
#else #else
BTN_POS(15, 1), BTN_SIZE(4,1), BTN_POS(15, 1), BTN_SIZE(4,1),
@ -205,7 +205,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() {
_draw_increment_btn(cmd, _line+1, 244 - _decimals); _draw_increment_btn(cmd, _line+1, 244 - _decimals);
_draw_increment_btn(cmd, _line+1, 243 - _decimals); _draw_increment_btn(cmd, _line+1, 243 - _decimals);
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
_line++; _line++;
#endif #endif
} }
@ -308,7 +308,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab
_button_style(cmd, TEXT_LABEL); _button_style(cmd, TEXT_LABEL);
cmd.font(font_small) cmd.font(font_small)
.text( .text(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
BTN_POS(1, _line), BTN_SIZE( 8,1), BTN_POS(1, _line), BTN_SIZE( 8,1),
#else #else
BTN_POS(1, _line), BTN_SIZE(10,1), BTN_POS(1, _line), BTN_SIZE(10,1),
@ -323,7 +323,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab
.enabled(is_enabled) .enabled(is_enabled)
.font(font_small) .font(font_small)
.toggle2( .toggle2(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
BTN_POS( 9,_line), BTN_SIZE(5,1), BTN_POS( 9,_line), BTN_SIZE(5,1),
#else #else
BTN_POS(10,_line), BTN_SIZE(4,1), BTN_POS(10,_line), BTN_SIZE(4,1),

View File

@ -30,7 +30,7 @@ using namespace FTDI;
using namespace Theme; using namespace Theme;
using namespace ExtUI; using namespace ExtUI;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 2 #define GRID_COLS 2
#define GRID_ROWS 10 #define GRID_ROWS 10

View File

@ -73,7 +73,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
// The LulzBot Bio shows the temperature for // The LulzBot Bio shows the temperature for
// the bed. // the bed.
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
// Draw touch surfaces // Draw touch surfaces
ui.bounds(POLY(target_temp), x, y, h, v); ui.bounds(POLY(target_temp), x, y, h, v);
cmd.rectangle(x, y, h, v); cmd.rectangle(x, y, h, v);
@ -95,7 +95,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
.cmd(COLOR_RGB(bg_text_enabled)) .cmd(COLOR_RGB(bg_text_enabled))
.icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2);
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); // Restore font bitmap handles load_utf8_bitmaps(cmd); // Restore font bitmap handles
#endif #endif
} }
@ -105,7 +105,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
cmd.cmd(COLOR_RGB(bg_text_enabled)); cmd.cmd(COLOR_RGB(bg_text_enabled));
cmd.font(font_medium); cmd.font(font_medium);
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0)
format_temp(str, getTargetTemp_celsius(BED)); format_temp(str, getTargetTemp_celsius(BED));
else else
@ -204,7 +204,7 @@ void StatusScreen::draw_fine_motion(draw_mode_t what) {
PolyUI ui(cmd, what); PolyUI ui(cmd, what);
cmd.font( cmd.font(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
font_medium font_medium
#else #else
font_small font_small
@ -273,7 +273,7 @@ void StatusScreen::loadBitmaps() {
CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon));
// Load fonts for internationalization // Load fonts for internationalization
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_data(base + UTF8_FONT_OFFSET); load_utf8_data(base + UTF8_FONT_OFFSET);
#endif #endif
} }

View File

@ -30,14 +30,14 @@
#include "../ftdi_eve_lib/extras/poly_ui.h" #include "../ftdi_eve_lib/extras/poly_ui.h"
#include "../archim2-flash/flash_storage.h" #include "../archim2-flash/flash_storage.h"
#ifdef SHOW_CUSTOM_BOOTSCREEN #if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#include "../theme/bootscreen_logo_portrait.h" #include "../theme/bootscreen_logo_portrait.h"
#else #else
#include "../theme/_bootscreen_landscape.h" #include "../theme/_bootscreen_landscape.h"
#endif #endif
#else #else
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#include "../theme/marlin_bootscreen_portrait.h" #include "../theme/marlin_bootscreen_portrait.h"
#else #else
#include "../theme/marlin_bootscreen_landscape.h" #include "../theme/marlin_bootscreen_landscape.h"
@ -92,7 +92,7 @@ void BootScreen::onIdle() {
StatusScreen::loadBitmaps(); StatusScreen::loadBitmaps();
#ifdef TOUCH_UI_LULZBOT_BIO #if ENABLED(TOUCH_UI_LULZBOT_BIO)
GOTO_SCREEN(BioConfirmHomeXYZ); GOTO_SCREEN(BioConfirmHomeXYZ);
current_screen.forget(); current_screen.forget();
PUSH_SCREEN(StatusScreen); PUSH_SCREEN(StatusScreen);

View File

@ -101,7 +101,7 @@ void ChangeFilamentScreen::onExit() {
void ChangeFilamentScreen::onRedraw(draw_mode_t what) { void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
CommandProcessor cmd; CommandProcessor cmd;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 2 #define GRID_COLS 2
#define GRID_ROWS 11 #define GRID_ROWS 11
#else #else
@ -114,13 +114,13 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
.cmd(CLEAR(true,true,true)) .cmd(CLEAR(true,true,true))
.cmd(COLOR_RGB(bg_text_enabled)) .cmd(COLOR_RGB(bg_text_enabled))
.tag(0) .tag(0)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.font(font_large) .font(font_large)
#else #else
.font(font_medium) .font(font_medium)
#endif #endif
.text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION)) .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION))
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.text(BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) .text(BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE))
#else #else
.text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE))
@ -142,14 +142,14 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP);
cmd.cmd(COLOR_RGB(tcol)) cmd.cmd(COLOR_RGB(tcol))
.tag(15) .tag(15)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.rectangle(BTN_POS(2,7), BTN_SIZE(1,1)) .rectangle(BTN_POS(2,7), BTN_SIZE(1,1))
#else #else
.rectangle(BTN_POS(3,2), BTN_SIZE(2,1)) .rectangle(BTN_POS(3,2), BTN_SIZE(2,1))
#endif #endif
.cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF)) .cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF))
.font(font_medium) .font(font_medium)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.text(BTN_POS(2,7), BTN_SIZE(1,1), e_str) .text(BTN_POS(2,7), BTN_SIZE(1,1), e_str)
#else #else
.text(BTN_POS(3,2), BTN_SIZE(2,1), e_str) .text(BTN_POS(3,2), BTN_SIZE(2,1), e_str)
@ -177,7 +177,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11;
#endif #endif
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
cmd.font(font_large) cmd.font(font_large)
#else #else
cmd.font(font_medium) cmd.font(font_medium)
@ -198,7 +198,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
cmd.font( cmd.font(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
font_large font_large
#else #else
font_small font_small
@ -227,7 +227,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
.cmd(COLOR_MASK(1,1,1,1)) .cmd(COLOR_MASK(1,1,1,1))
.cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) .cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled))
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.font(font_large) .font(font_large)
.tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT))
.text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT))

View File

@ -45,7 +45,7 @@ void StatusScreen::loadBitmaps() {
constexpr uint32_t base = ftdi_memory_map::RAM_G; constexpr uint32_t base = ftdi_memory_map::RAM_G;
// Load fonts for internationalization // Load fonts for internationalization
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_data(base + UTF8_FONT_OFFSET); load_utf8_data(base + UTF8_FONT_OFFSET);
#endif #endif
} }
@ -111,7 +111,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
ui.bounds(POLY(h3_label), x, y, h, v); ui.bounds(POLY(h3_label), x, y, h, v);
cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER));
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); // Restore font bitmap handles load_utf8_bitmaps(cmd); // Restore font bitmap handles
#endif #endif
} }

View File

@ -57,7 +57,7 @@ void CustomUserMenus::onRedraw(draw_mode_t what) {
#define _MORE_THAN_TEN 0 #define _MORE_THAN_TEN 0
#endif #endif
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 11 #define GRID_ROWS 11
#define GRID_COLS (1 + _MORE_THAN_TEN) #define GRID_COLS (1 + _MORE_THAN_TEN)
#define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1) #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1)

View File

@ -52,7 +52,7 @@ void DeveloperMenu::onRedraw(draw_mode_t what) {
#endif #endif
cmd.cmd(COLOR_RGB(bg_text_enabled)); cmd.cmd(COLOR_RGB(bg_text_enabled));
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 10 #define GRID_ROWS 10
#define GRID_COLS 1 #define GRID_COLS 1
cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu"))

View File

@ -53,7 +53,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
#define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL);
cmd.font( cmd.font(
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
font_large font_large
#else #else
font_medium font_medium

View File

@ -30,7 +30,7 @@ using namespace FTDI;
using namespace ExtUI; using namespace ExtUI;
using namespace Theme; using namespace Theme;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 9 #define GRID_ROWS 9
#define GRID_COLS 2 #define GRID_COLS 2
#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1)

View File

@ -67,7 +67,7 @@ uint16_t FilesScreen::getFileForTag(uint8_t tag) {
return screen_data.FilesScreen.cur_page * files_per_page + tag - 2; return screen_data.FilesScreen.cur_page * files_per_page + tag - 2;
} }
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 6 #define GRID_COLS 6
#define GRID_ROWS (files_per_page + header_h + footer_h) #define GRID_ROWS (files_per_page + header_h + footer_h)
#else #else
@ -151,7 +151,7 @@ void FilesScreen::drawHeader() {
void FilesScreen::drawFooter() { void FilesScreen::drawFooter() {
#undef MARGIN_T #undef MARGIN_T
#undef MARGIN_B #undef MARGIN_B
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define MARGIN_T 15 #define MARGIN_T 15
#define MARGIN_B 5 #define MARGIN_B 5
#else #else

View File

@ -58,7 +58,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) { if (what & BACKGROUND) {
#define GRID_COLS 4 #define GRID_COLS 4
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 7 #define GRID_ROWS 7
#else #else
#define GRID_ROWS 6 #define GRID_ROWS 6
@ -86,7 +86,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
} }
if (what & FOREGROUND) { if (what & FOREGROUND) {
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
constexpr uint8_t w = 2; constexpr uint8_t w = 2;
#else #else
constexpr uint8_t w = 1; constexpr uint8_t w = 1;
@ -106,7 +106,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
#endif #endif
#undef EDGE_R #undef EDGE_R
#define EDGE_R 0 #define EDGE_R 0
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.colors(normal_btn) .colors(normal_btn)
.tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_SOUNDS)) .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_SOUNDS))
.colors(action_btn) .colors(action_btn)

View File

@ -84,7 +84,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) {
} }
if (what & FOREGROUND) { if (what & FOREGROUND) {
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
constexpr uint8_t w = 2; constexpr uint8_t w = 2;
#else #else
constexpr uint8_t w = 1; constexpr uint8_t w = 1;

View File

@ -34,7 +34,7 @@ using namespace FTDI;
using namespace ExtUI; using namespace ExtUI;
using namespace Theme; using namespace Theme;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 9 #define GRID_ROWS 9
#define GRID_COLS 2 #define GRID_COLS 2
#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1)

View File

@ -50,7 +50,7 @@ void LockScreen::onRedraw(draw_mode_t what) {
} }
if (what & FOREGROUND) { if (what & FOREGROUND) {
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 1 #define GRID_COLS 1
#define GRID_ROWS 10 #define GRID_ROWS 10
#else #else
@ -81,7 +81,7 @@ void LockScreen::onRedraw(draw_mode_t what) {
const uint8_t pressed = EventLoop::get_pressed_tag(); const uint8_t pressed = EventLoop::get_pressed_tag();
cmd.font(font_large) cmd.font(font_large)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
.text(BTN_POS(1,2), BTN_SIZE(1,1), message) .text(BTN_POS(1,2), BTN_SIZE(1,1), message)
.font(font_xlarge) .font(font_xlarge)
.text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.LockScreen.passcode) .text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.LockScreen.passcode)

View File

@ -1,25 +1,3 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/***************** /*****************
* main_menu.cpp * * main_menu.cpp *
*****************/ *****************/
@ -59,7 +37,7 @@ void MainMenu::onRedraw(draw_mode_t what) {
.cmd(CLEAR(true,true,true)); .cmd(CLEAR(true,true,true));
} }
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 8 #define GRID_ROWS 8
#define GRID_COLS 2 #define GRID_COLS 2
#define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1) #define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1)
@ -129,15 +107,15 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break;
#if ENABLED(NOZZLE_CLEAN_FEATURE) #if ENABLED(NOZZLE_CLEAN_FEATURE)
case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
#endif #endif
case 4: GOTO_SCREEN(MoveAxisScreen); break; case 4: GOTO_SCREEN(MoveAxisScreen); break;
case 5: injectCommands_P(PSTR("M84")); break; case 5: injectCommands_P(PSTR("M84")); break;
case 6: GOTO_SCREEN(TemperatureScreen); break; case 6: GOTO_SCREEN(TemperatureScreen); break;
case 7: GOTO_SCREEN(ChangeFilamentScreen); break; case 7: GOTO_SCREEN(ChangeFilamentScreen); break;
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
#ifdef HAS_LEVELING #if HAS_LEVELING
case 9: GOTO_SCREEN(LevelingMenu); break; case 9: GOTO_SCREEN(LevelingMenu); break;
#endif #endif
case 10: GOTO_SCREEN(AboutScreen); break; case 10: GOTO_SCREEN(AboutScreen); break;
#if ENABLED(CUSTOM_USER_MENUS) #if ENABLED(CUSTOM_USER_MENUS)

View File

@ -1,25 +1,3 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/*************** /***************
* screens.cpp * * screens.cpp *
***************/ ***************/

View File

@ -1,25 +1,3 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/************* /*************
* screens.h * * screens.h *
*************/ *************/
@ -767,7 +745,7 @@ class LockScreen : public BaseScreen, public CachedScreen<LOCK_SCREEN_CACHE> {
class FilesScreen : public BaseScreen, public CachedScreen<FILES_SCREEN_CACHE, FILE_SCREEN_DL_SIZE> { class FilesScreen : public BaseScreen, public CachedScreen<FILES_SCREEN_CACHE, FILE_SCREEN_DL_SIZE> {
private: private:
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
static constexpr uint8_t header_h = 2; static constexpr uint8_t header_h = 2;
static constexpr uint8_t footer_h = 2; static constexpr uint8_t footer_h = 2;
static constexpr uint8_t files_per_page = 11; static constexpr uint8_t files_per_page = 11;

View File

@ -32,7 +32,7 @@
using namespace FTDI; using namespace FTDI;
using namespace Theme; using namespace Theme;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 8 #define GRID_ROWS 8
#else #else
#define GRID_ROWS 8 #define GRID_ROWS 8
@ -43,7 +43,7 @@ void StatusScreen::draw_axis_position(draw_mode_t what) {
#define GRID_COLS 3 #define GRID_COLS 3
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define X_LBL_POS BTN_POS(1,5), BTN_SIZE(1,1) #define X_LBL_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define Y_LBL_POS BTN_POS(1,6), BTN_SIZE(1,1) #define Y_LBL_POS BTN_POS(1,6), BTN_SIZE(1,1)
#define Z_LBL_POS BTN_POS(1,7), BTN_SIZE(1,1) #define Z_LBL_POS BTN_POS(1,7), BTN_SIZE(1,1)
@ -111,7 +111,7 @@ void StatusScreen::draw_axis_position(draw_mode_t what) {
#undef GRID_COLS #undef GRID_COLS
} }
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 8 #define GRID_COLS 8
#else #else
#define GRID_COLS 12 #define GRID_COLS 12
@ -164,7 +164,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
.cmd (BITMAP_SIZE (Fan_Icon_Info)) .cmd (BITMAP_SIZE (Fan_Icon_Info))
.icon(ICON_POS(FAN_POS), Fan_Icon_Info, icon_scale); .icon(ICON_POS(FAN_POS), Fan_Icon_Info, icon_scale);
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); // Restore font bitmap handles load_utf8_bitmaps(cmd); // Restore font bitmap handles
#endif #endif
} }
@ -334,7 +334,7 @@ void StatusScreen::loadBitmaps() {
CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon));
// Load fonts for internationalization // Load fonts for internationalization
#ifdef TOUCH_UI_USE_UTF8 #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_data(base + UTF8_FONT_OFFSET); load_utf8_data(base + UTF8_FONT_OFFSET);
#endif #endif
} }

View File

@ -41,7 +41,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) {
w.heading(GET_TEXT_F(MSG_TEMPERATURE)); w.heading(GET_TEXT_F(MSG_TEMPERATURE));
w.button(30, GET_TEXT_F(MSG_COOLDOWN)); w.button(30, GET_TEXT_F(MSG_COOLDOWN));
#ifndef NO_TOOLHEAD_HEATER_GCODE #ifndef NO_TOOLHEAD_HEATER_GCODE
#ifdef TOUCH_UI_COCOA_PRESS #if ENABLED(TOUCH_UI_COCOA_PRESS)
w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0));
w.adjuster( 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1)); w.adjuster( 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1));
#if ENABLED(COCOA_PRESS_EXTRA_HEATER) #if ENABLED(COCOA_PRESS_EXTRA_HEATER)

View File

@ -38,7 +38,7 @@ void TuneMenu::onRedraw(draw_mode_t what) {
.cmd(CLEAR(true,true,true)); .cmd(CLEAR(true,true,true));
} }
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_ROWS 9 #define GRID_ROWS 9
#define GRID_COLS 2 #define GRID_COLS 2
#define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1)

View File

@ -51,7 +51,7 @@ void WidgetsScreen::onRedraw(draw_mode_t) {
const uint16_t m = (slider_val*12*60/0xFFFFU)%60; const uint16_t m = (slider_val*12*60/0xFFFFU)%60;
const uint16_t s = (slider_val*12*60*60/0xFFFFU)%60; const uint16_t s = (slider_val*12*60*60/0xFFFFU)%60;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
#define GRID_COLS 3 #define GRID_COLS 3
#define GRID_ROWS 8 #define GRID_ROWS 8
cmd.font(font_large) cmd.font(font_large)
@ -113,7 +113,7 @@ bool WidgetsScreen::onTouchStart(uint8_t tag) {
CommandProcessor cmd; CommandProcessor cmd;
switch (tag) { switch (tag) {
case 1: GOTO_PREVIOUS(); break; case 1: GOTO_PREVIOUS(); break;
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,2), 2).execute(); break; case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,2), 2).execute(); break;
case 4: cmd.track_linear (BTN_POS(2,3), BTN_SIZE(2,1), 4).execute(); break; case 4: cmd.track_linear (BTN_POS(2,3), BTN_SIZE(2,1), 4).execute(); break;
case 5: cmd.track_linear (BTN_POS(2,4), BTN_SIZE(2,1), 5).execute(); break; case 5: cmd.track_linear (BTN_POS(2,4), BTN_SIZE(2,1), 5).execute(); break;

View File

@ -24,7 +24,7 @@
namespace Theme { namespace Theme {
#ifdef TOUCH_UI_800x480 #ifdef TOUCH_UI_800x480
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
constexpr int16_t font_tiny = 26; constexpr int16_t font_tiny = 26;
constexpr int16_t font_xsmall = 28; constexpr int16_t font_xsmall = 28;
constexpr int16_t font_small = 29; constexpr int16_t font_small = 29;
@ -41,7 +41,7 @@ namespace Theme {
#endif #endif
constexpr float icon_scale = 1.0; constexpr float icon_scale = 1.0;
#elif defined(TOUCH_UI_480x272) #elif defined(TOUCH_UI_480x272)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
constexpr int16_t font_tiny = 26; constexpr int16_t font_tiny = 26;
constexpr int16_t font_xsmall = 26; constexpr int16_t font_xsmall = 26;
constexpr int16_t font_small = 26; constexpr int16_t font_small = 26;
@ -59,7 +59,7 @@ namespace Theme {
constexpr float icon_scale = 0.6; constexpr float icon_scale = 0.6;
#endif #endif
#elif defined(TOUCH_UI_320x240) #elif defined(TOUCH_UI_320x240)
#ifdef TOUCH_UI_PORTRAIT #if ENABLED(TOUCH_UI_PORTRAIT)
constexpr int16_t font_tiny = 26; constexpr int16_t font_tiny = 26;
constexpr int16_t font_xsmall = 26; constexpr int16_t font_xsmall = 26;
constexpr int16_t font_small = 26; constexpr int16_t font_small = 26;