Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace FTDI {
strcat_P(str, (const char*) units);
}

cmd.text(VAL_POS, str);
cmd.tag(0).text(VAL_POS, str);
}

void draw_adjuster(CommandProcessor& cmd, int16_t x, int16_t y, int16_t w, int16_t h, uint8_t tag, float value, progmem_str units, int8_t width, uint8_t precision, draw_mode_t what) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

#if ENABLED(FTDI_EXTENDED)

#define IS_LINE_SEPARATOR(c) c == '\n' || c == '\t'
#define IS_WORD_SEPARATOR(c) c == ' '
#define IS_SEPARATOR(c) IS_LINE_SEPARATOR(c) || IS_WORD_SEPARATOR(c)

namespace FTDI {
/**
* Given a str, end will be set to the position at which a line needs to
Expand All @@ -37,11 +41,11 @@ namespace FTDI {
const char *next = p;
const utf8_char_t c = get_utf8_char_and_inc(next);
// Decide whether to break the string at this location
if (c == '\n' || c == '\0' || c == ' ') {
if (IS_SEPARATOR(c) || c == '\0' ) {
end = p;
result = lw;
}
if (c == '\n' || c == '\0') break;
if (IS_LINE_SEPARATOR(c) || c == '\0') break;
// Measure the next character
const uint16_t cw = use_utf8 ? utf8_fm.get_char_width(c) : clcd_fm.char_widths[(uint8_t)c];
// Stop processing once string exceeds the display width
Expand Down Expand Up @@ -69,7 +73,7 @@ namespace FTDI {
const uint16_t line_width = find_line_break(utf8_fm, clcd_fm, wrap_width, line_start, line_end, use_utf8);
width = max(width, line_width);
height += utf8_fm.get_height();
if (*line_end == '\n' || *line_end == ' ') line_end++;
if (IS_SEPARATOR(*line_end)) line_end++;
if (*line_end == '\0') break;
if (line_end == line_start) break;
line_start = line_end;
Expand Down Expand Up @@ -124,7 +128,7 @@ namespace FTDI {
}
y += utf8_fm.get_height();

if (*line_end == '\n' || *line_end == ' ') line_end++;
if (IS_SEPARATOR(*line_end)) line_end++;
if (*line_end == '\0') break;
if (line_end == line_start) break;
line_start = line_end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ using namespace Theme;
constexpr static SpinnerDialogBoxData &mydata = screen_data.SpinnerDialogBox;

void SpinnerDialogBox::onEntry() {
UIScreen::onEntry();
mydata.auto_hide = true;
}

Expand Down Expand Up @@ -98,7 +99,7 @@ void SpinnerDialogBox::enqueueAndWait(progmem_str message, char *commands) {
}

void SpinnerDialogBox::onIdle() {
if (mydata.auto_hide && !commandsInQueue()) {
if (mydata.auto_hide && !commandsInQueue() && TERN1(HOST_KEEPALIVE_FEATURE, GcodeSuite::busy_state == GcodeSuite::NOT_BUSY)) {
mydata.auto_hide = false;
hide();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct SpinnerDialogBoxData {
bool auto_hide;
};

class SpinnerDialogBox : public BaseScreen {
class SpinnerDialogBox : public UIScreen {
public:
static void onEntry();
static void onExit();
Expand Down
26 changes: 26 additions & 0 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,31 @@ namespace Theme {
0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00
};

constexpr PROGMEM bitmap_info_t Light_Bulb_Info = {
.format = L1,
.linestride = 4,
.filter = BILINEAR,
.wrapx = BORDER,
.wrapy = BORDER,
.RAMG_offset = 8685,
.width = 31,
.height = 32,
};

const unsigned char Light_Bulb[128] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40,
0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00,
0x00, 0x0F, 0xE0, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x36, 0x18, 0x00,
0x00, 0x2C, 0x08, 0x00, 0x00, 0x58, 0x04, 0x00, 0x00, 0x50, 0x04, 0x00,
0x7C, 0x50, 0x04, 0x7C, 0x00, 0x40, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00,
0x00, 0x60, 0x0C, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00,
0x00, 0x10, 0x10, 0x00, 0x00, 0x88, 0x22, 0x00, 0x01, 0x08, 0x21, 0x00,
0x02, 0x08, 0x20, 0x80, 0x04, 0x0F, 0xE0, 0x40, 0x00, 0x07, 0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
};

constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000;
constexpr PROGMEM uint32_t BACKGROUND_OFFSET = 40000;
}; // namespace Theme