Skip to content

Commit

Permalink
defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed May 5, 2024
1 parent 7c951b6 commit f4ab15e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 40 deletions.
2 changes: 1 addition & 1 deletion tulip/fs/app/juno6/juno6.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class JunoSection(UIElement):

header_color = 224
bg_color = 73
header_font = lv.font_montserrat_16
header_font = lv.font_tulip_14
text_color = 255
section_gap = 10

Expand Down
7 changes: 7 additions & 0 deletions tulip/fs/app/voices/voices.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import amy
from patches import patches

label_font = lv.font_tulip_14

def redraw(app):
# draw bg_x stuff, like the piano
(app.screen_w, app.screen_h) = tulip.screen_size()
Expand All @@ -26,6 +28,7 @@ def __init__(self, width=350, height=300):
self.group.set_size(width, height)
self.group.remove_flag(lv.obj.FLAG.SCROLLABLE)
self.label = lv.label(self.group)
self.label.set_style_text_font(label_font, 0)
self.label.set_text("sequencer and arpeggiator")
self.rect = lv.obj(self.group)
self.rect.set_style_bg_color(tulip.pal_to_lv(9), 0)
Expand All @@ -42,12 +45,14 @@ def __init__(self, width=350, height=300):
self.tempo.set_style_bg_color(tulip.pal_to_lv(129), lv.PART.KNOB)
self.tempo.align_to(self.rect, lv.ALIGN.TOP_LEFT,0,0)
self.tempo_label = lv.label(self.rect)
self.tempo_label.set_style_text_font(label_font, 0)
self.tempo.set_value(int(tulip.seq_bpm() / 2.4),lv.ANIM.OFF)
self.tempo_label.set_text("%d BPM" % (tulip.seq_bpm()))
self.tempo_label.align_to(self.tempo, lv.ALIGN.OUT_RIGHT_MID,10,0)
self.tempo.add_event_cb(self.tempo_cb, lv.EVENT.VALUE_CHANGED, None)

alabel = lv.label(self.rect)
alabel.set_style_text_font(label_font, 0)
alabel.set_text("Arpeggiator:")
alabel.align_to(self.tempo, lv.ALIGN.OUT_BOTTOM_LEFT,0,30)
self.arpegg = lv.switch(self.rect)
Expand All @@ -56,6 +61,7 @@ def __init__(self, width=350, height=300):
self.arpegg.align_to(alabel, lv.ALIGN.OUT_RIGHT_MID,10,0)
self.arpegg.add_event_cb(self.arpegg_cb, lv.EVENT.VALUE_CHANGED, None)
hlabel = lv.label(self.rect)
hlabel.set_style_text_font(label_font, 0)
hlabel.set_text("Hold:")
hlabel.align_to(self.arpegg, lv.ALIGN.OUT_RIGHT_MID,10,0)
self.hold = lv.switch(self.rect)
Expand Down Expand Up @@ -99,6 +105,7 @@ def __init__(self, name, items=None, selected=None, width=175, height=300):
self.group.set_size(width,height)
self.group.remove_flag(lv.obj.FLAG.SCROLLABLE)
self.label = lv.label(self.group)
self.label.set_style_text_font(label_font, 0)
self.label.set_text(name)
self.list = lv.list(self.group)
self.list.set_size(width-25,height-20)
Expand Down
76 changes: 38 additions & 38 deletions tulip/shared/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,25 +1065,25 @@ void my_log_cb(lv_log_level_t level, const char * buf)


extern void get_lvgl_font_from_tulip(uint8_t font_no, lv_font_t *outfont);
lv_font_t lv_tulip_font_0;
lv_font_t lv_tulip_font_1;
lv_font_t lv_tulip_font_2;
lv_font_t lv_tulip_font_3;
lv_font_t lv_tulip_font_4;
lv_font_t lv_tulip_font_5;
lv_font_t lv_tulip_font_6;
lv_font_t lv_tulip_font_7;
lv_font_t lv_tulip_font_8;
lv_font_t lv_tulip_font_9;
lv_font_t lv_tulip_font_10;
lv_font_t lv_tulip_font_11;
lv_font_t lv_tulip_font_12;
lv_font_t lv_tulip_font_13;
lv_font_t lv_tulip_font_14;
lv_font_t lv_tulip_font_15;
lv_font_t lv_tulip_font_16;
lv_font_t lv_tulip_font_17;
lv_font_t lv_tulip_font_18;
lv_font_t lv_font_tulip_0;
lv_font_t lv_font_tulip_1;
lv_font_t lv_font_tulip_2;
lv_font_t lv_font_tulip_3;
lv_font_t lv_font_tulip_4;
lv_font_t lv_font_tulip_5;
lv_font_t lv_font_tulip_6;
lv_font_t lv_font_tulip_7;
lv_font_t lv_font_tulip_8;
lv_font_t lv_font_tulip_9;
lv_font_t lv_font_tulip_10;
lv_font_t lv_font_tulip_11;
lv_font_t lv_font_tulip_12;
lv_font_t lv_font_tulip_13;
lv_font_t lv_font_tulip_14;
lv_font_t lv_font_tulip_15;
lv_font_t lv_font_tulip_16;
lv_font_t lv_font_tulip_17;
lv_font_t lv_font_tulip_18;

void setup_lvgl() {
// Setup LVGL for UI etc
Expand All @@ -1110,25 +1110,25 @@ void setup_lvgl() {
lv_indev_set_type(indev_kb, LV_INDEV_TYPE_KEYPAD);
lv_indev_set_read_cb(indev_kb, lvgl_input_kb_read_cb);

get_lvgl_font_from_tulip(0, &lv_tulip_font_0);
get_lvgl_font_from_tulip(1, &lv_tulip_font_1);
get_lvgl_font_from_tulip(2, &lv_tulip_font_2);
get_lvgl_font_from_tulip(3, &lv_tulip_font_3);
get_lvgl_font_from_tulip(4, &lv_tulip_font_4);
get_lvgl_font_from_tulip(5, &lv_tulip_font_5);
get_lvgl_font_from_tulip(6, &lv_tulip_font_6);
get_lvgl_font_from_tulip(7, &lv_tulip_font_7);
get_lvgl_font_from_tulip(8, &lv_tulip_font_8);
get_lvgl_font_from_tulip(9, &lv_tulip_font_9);
get_lvgl_font_from_tulip(10, &lv_tulip_font_10);
get_lvgl_font_from_tulip(11, &lv_tulip_font_11);
get_lvgl_font_from_tulip(12, &lv_tulip_font_12);
get_lvgl_font_from_tulip(13, &lv_tulip_font_13);
get_lvgl_font_from_tulip(14, &lv_tulip_font_14);
get_lvgl_font_from_tulip(15, &lv_tulip_font_15);
get_lvgl_font_from_tulip(16, &lv_tulip_font_16);
get_lvgl_font_from_tulip(17, &lv_tulip_font_17);
get_lvgl_font_from_tulip(18, &lv_tulip_font_18);
get_lvgl_font_from_tulip(0, &lv_font_tulip_0);
get_lvgl_font_from_tulip(1, &lv_font_tulip_1);
get_lvgl_font_from_tulip(2, &lv_font_tulip_2);
get_lvgl_font_from_tulip(3, &lv_font_tulip_3);
get_lvgl_font_from_tulip(4, &lv_font_tulip_4);
get_lvgl_font_from_tulip(5, &lv_font_tulip_5);
get_lvgl_font_from_tulip(6, &lv_font_tulip_6);
get_lvgl_font_from_tulip(7, &lv_font_tulip_7);
get_lvgl_font_from_tulip(8, &lv_font_tulip_8);
get_lvgl_font_from_tulip(9, &lv_font_tulip_9);
get_lvgl_font_from_tulip(10, &lv_font_tulip_10);
get_lvgl_font_from_tulip(11, &lv_font_tulip_11);
get_lvgl_font_from_tulip(12, &lv_font_tulip_12);
get_lvgl_font_from_tulip(13, &lv_font_tulip_13);
get_lvgl_font_from_tulip(14, &lv_font_tulip_14);
get_lvgl_font_from_tulip(15, &lv_font_tulip_15);
get_lvgl_font_from_tulip(16, &lv_font_tulip_16);
get_lvgl_font_from_tulip(17, &lv_font_tulip_17);
get_lvgl_font_from_tulip(18, &lv_font_tulip_18);
}


Expand Down
1 change: 0 additions & 1 deletion tulip/shared/lvgl_u8g2.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ bool my_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out,
// drawing CB will use the same bit of ram without having to re-draw.
// unfortunately this function seems to be called 3 times per glyph, so maybe try to not draw so much
uint32_t font_no = *((uint32_t*)(font->user_data));
fprintf(stderr, "font_no is %d\n", font_no);
u8g2_font_t ufont;
ufont.font = NULL;
ufont.font_decode.fg_color = 1;
Expand Down

0 comments on commit f4ab15e

Please sign in to comment.