Editor: redesign visual no Material 3 (Roboto, Material Symbols, cores de sempre)

- Fontes em assets/fonts (Roboto Regular/Medium, Material Symbols contorno e
  preenchido; Apache 2.0). TB_DRAW_TEXT escolhe a fonte pelo param
  (tb_draw_text_font, TB_FONT_*); backend SDL2 com cache por familia e
  DejaVu de reserva. Pacotes AppImage/Android/Windows levam as fontes.
- tb_editor_m3.h: papeis de cor do M3 sobre a paleta do editor, formas,
  tipografia, camadas de estado, elevacao, icones e componentes (botoes,
  icon button, menu, campo, dialogo, chip, snackbar, switch).
- Top app bar, abas primarias, navigation rail das categorias, FAB de
  extensoes, palco, saida, menus, snackbars, dialogos, explorador,
  Bibliotecas, Configuracoes, previa scratchblocks, editores de codigo e
  de imagem no estilo M3.
- Widgets: icon, text_f e shadow. Backend: TINYBLOCKS_SHOT salva a janela
  (conferir o visual); editor: TINYBLOCKS_OPEN abre uma tela no inicio.
- Console: linhas roladas continuam na arvore acessivel (OFFSCREEN).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mguinhosandClaude Opus 5.5 committed 2026-10-28 21:34:04 -03:00
1 parent f180eaf75a
commit 0cb2019704
22 files changed
+1451 -516

No files matched your search

@@ -57,15 +57,16 @@ typedef struct TinyBlocks_A11yTree TinyBlocks_A11yTree;
* === */
#define WIN_W_DEFAULT 1280
#define WIN_H_DEFAULT 720
#define MENU_H 44
#define TAB_H 36
#define MENU_H 56 /* top app bar do M3 (densidade -2) */
#define TAB_H 40 /* cabecalho das areas / abas (M3, densidade -2) */
#define CAT_W 68
#define FLY_W 250
#define FLY_PAD 12
#define FLY_BTN_W 150
#define PALETTE_W (CAT_W + FLY_W) /* largura padrao da paleta */
#define STAGE_W 360 /* largura padrao da coluna do palco */
#define STAGE_BAR_H 44
#define STAGE_BAR_H TAB_H
#define STAGE_TOP (STAGE_BAR_H + 4) /* onde a vista do palco comeca */
#define WIN_W (ed->win_w)
#define WIN_H (ed->win_h)
@@ -88,8 +89,8 @@ typedef struct TinyBlocks_A11yTree TinyBlocks_A11yTree;
#define PLUS_W 28
/* Menu do botao "+" (nova aba) */
#define PLUS_MENU_W 208
#define PLUS_MENU_ITEM_H 36
#define PLUS_MENU_W 260
#define PLUS_MENU_ITEM_H 52 /* item de duas linhas (M3) */
#define PLUS_MENU_N 4
/* Editor de codigo (aba de codigo) */
@@ -143,8 +144,8 @@ enum { IT_SEL = 0, IT_BRUSH, IT_LINE, IT_RECT, IT_ELLIPSE,
(menu_layout em tb_editor.c): o que nao cabe vai para o menu "☰". */
enum { MB_OPEN, MB_SAVE, MB_EXPORT, MB_LIBMAN, MB_LIB, MB_CFG, MB_COUNT };
typedef struct { float x, w; bool shown; } MenuBtn;
#define MENU_BTN_Y 7
#define MENU_BTN_H (MENU_H - 14)
#define MENU_BTN_H 36
#define MENU_BTN_Y ((MENU_H - MENU_BTN_H) / 2)
#define MENU_MORE_W 40
/* Modo compacto (janela estreita / celular): uma area de cada vez.
@@ -245,6 +246,9 @@ typedef struct {
#define rb_text_c tb_ed_w.text_c
#define tw tb_ed_w.text_width
#define in_rect tb_ed_w.in_rect
#define rb_text_f tb_ed_w.text_f
#define rb_icon tb_ed_w.icon
#define rb_shadow tb_ed_w.shadow
static const Col COL_MENU TB_EW_UNUSED = C( 76,151,255); /* #4C97FF */
static const Col COL_MENU_DARK TB_EW_UNUSED = C( 61,121,204);
@@ -296,6 +300,8 @@ static const Col s_user_colors[USER_COLOR_COUNT] TB_EW_UNUSED = {
C(255,191, 0), C(255,171, 25), C( 89,192, 89), C( 15,189,140),
};
#include "tb_editor_m3.h" /* Material 3 sobre a paleta acima */
/* == Rótulos dos blocos (%N - campo de entrada N) === */
typedef struct {
const char* type;