mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-10 19:23:31 -07:00
New Locale Settings API & Fix for long filenames
This commit is contained in:
@@ -532,6 +532,20 @@ void elements_bubble_str(
|
||||
canvas_draw_line(canvas, x2, y2, x3, y3);
|
||||
}
|
||||
|
||||
void elements_string_fit_width(Canvas* canvas, FuriString* string, uint8_t width) {
|
||||
furi_assert(canvas);
|
||||
furi_assert(string);
|
||||
|
||||
uint16_t len_px = canvas_string_width(canvas, furi_string_get_cstr(string));
|
||||
if(len_px > width) {
|
||||
width -= canvas_string_width(canvas, "...");
|
||||
do {
|
||||
furi_string_left(string, furi_string_size(string) - 1);
|
||||
len_px = canvas_string_width(canvas, furi_string_get_cstr(string));
|
||||
} while(len_px > width);
|
||||
furi_string_cat(string, "...");
|
||||
}
|
||||
}
|
||||
|
||||
void elements_string_fit_width_trunc(Canvas* canvas, FuriString* string, uint8_t width) {
|
||||
furi_assert(canvas);
|
||||
@@ -546,7 +560,6 @@ void elements_string_fit_width_trunc(Canvas* canvas, FuriString* string, uint8_t
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void elements_text_box(
|
||||
Canvas* canvas,
|
||||
uint8_t x,
|
||||
@@ -754,4 +767,4 @@ void elements_text_box(
|
||||
}
|
||||
}
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ DEBUG = 0
|
||||
|
||||
# Suffix to add to files when building distribution
|
||||
# If OS environment has DIST_SUFFIX set, it will be used instead
|
||||
DIST_SUFFIX = "CC_CL-0012"
|
||||
DIST_SUFFIX = "CC_CL-0013"
|
||||
|
||||
# Coprocessor firmware
|
||||
COPRO_OB_DATA = "scripts/ob.data"
|
||||
|
||||
Reference in New Issue
Block a user