From 0f9dffe8ea5eb0819eb171bcb9c02fdaba8cf6b0 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 10 Nov 2024 10:37:23 +0100 Subject: [PATCH] =?UTF-8?q?fix=20width,=20simplify=20css=20classes=20namin?= =?UTF-8?q?g,=20lighter=20=F0=9D=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/x49gpng/ui.c | 200 +++++++++++++++++++++++------------------------ 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/src/x49gpng/ui.c b/src/x49gpng/ui.c index e830be8..391ba9c 100644 --- a/src/x49gpng/ui.c +++ b/src/x49gpng/ui.c @@ -55,12 +55,12 @@ #define KEYBOARD_PADDING ( TINY_TEXT_HEIGHT + 2 ) #define KEYBOARD_WIDTH ( ui_keys[ NB_KEYS - 1 ].x + ui_keys[ NB_KEYS - 1 ].width ) -#define WINDOW_WIDTH ( ( 2 * KEYBOARD_PADDING ) + KEYBOARD_WIDTH ) +#define WINDOW_WIDTH ( KEYBOARD_WIDTH ) #define LCD_PADDING ( ( WINDOW_WIDTH - LCD_WIDTH ) / 2 ) static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { - {.css_class = "button-menu", + {.css_class = "menu", .label = "F1", .letter = "A", .left = "Y=", @@ -75,7 +75,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 5 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-menu", + {.css_class = "menu", .label = "F2", .letter = "B", .left = "WIN", @@ -90,7 +90,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 5 ), .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-menu", + {.css_class = "menu", .label = "F3", .letter = "C", .left = "GRAPH", @@ -105,7 +105,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 5 ), .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-menu", + {.css_class = "menu", .label = "F4", .letter = "D", .left = "2D/3D", @@ -120,7 +120,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 5 ), .rowbit = ( 1 << 4 ), .eint = 4}, - {.css_class = "button-menu", + {.css_class = "menu", .label = "F5", .letter = "E", .left = "TBLSET", @@ -135,7 +135,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 5 ), .rowbit = ( 1 << 5 ), .eint = 5}, - {.css_class = "button-menu", + {.css_class = "menu", .label = "F6", .letter = "F", .left = "TABLE", @@ -151,7 +151,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 6 ), .eint = 6}, - {.css_class = "button-function", + {.css_class = "function", .label = "APPS", .letter = "G", .left = "FILES", @@ -159,82 +159,82 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .below = NULL, .x = 0, .y = KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, + .width = KB_WIDTH_5_KEYS, .height = KB_HEIGHT_SMALL_KEYS, .column = 5, .row = 7, .columnbit = ( 1 << 5 ), .rowbit = ( 1 << 7 ), .eint = 7}, - {.css_class = "button-function", + {.css_class = "function", .label = "MODE", .letter = "H", .left = "CUSTOM", .right = "END", .below = NULL, - .x = KB_COLUMN_WIDTH_6_KEYS, + .x = KB_COLUMN_WIDTH_5_KEYS, .y = KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, + .width = KB_WIDTH_5_KEYS, .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 5, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 5 ), .eint = 5}, - {.css_class = "button-function", + {.css_class = "function", .label = "TOOL", .letter = "I", .left = "i", .right = "I", .below = NULL, - .x = 2 * KB_COLUMN_WIDTH_6_KEYS, + .x = 2 * KB_COLUMN_WIDTH_5_KEYS, .y = KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, + .width = KB_WIDTH_5_KEYS, .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 6, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 6 ), .eint = 6}, - {.css_class = "button-function", + {.css_class = "function", .label = "VAR", .letter = "J", .left = "UPDIR", .right = "COPY", .below = NULL, - .x = 0, - .y = 2 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, + .x = 4 * KB_COLUMN_WIDTH_5_KEYS, + .y = KB_LINE_HEIGHT, + .width = KB_WIDTH_5_KEYS, .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 7, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 7 ), .eint = 7}, - {.css_class = "button-function", + {.css_class = "function", .label = "STO⏵", .letter = "K", .left = "RCL", .right = "CUT", .below = NULL, - .x = KB_COLUMN_WIDTH_6_KEYS, + .x = 0, .y = 2 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, + .width = KB_WIDTH_5_KEYS, .height = KB_HEIGHT_SMALL_KEYS, .column = 7, .row = 1, .columnbit = ( 1 << 7 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-function", + {.css_class = "function", .label = "NXT", .letter = "L", .left = "PREV", .right = "PASTE", .below = NULL, - .x = 2 * KB_COLUMN_WIDTH_6_KEYS, + .x = KB_COLUMN_WIDTH_5_KEYS, .y = 2 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, + .width = KB_WIDTH_5_KEYS, .height = KB_HEIGHT_SMALL_KEYS, .column = 7, .row = 2, @@ -242,68 +242,68 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-arrow", - .label = "▲", + {.css_class = "arrow", + .label = "⬆", .letter = NULL, .left = NULL, .right = NULL, .below = NULL, - .x = 4 * KB_COLUMN_WIDTH_6_KEYS, - .y = 0.75 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, - .height = KB_HEIGHT_BIG_KEYS, + .x = 3 * KB_COLUMN_WIDTH_5_KEYS, + .y = KB_LINE_HEIGHT, + .width = KB_WIDTH_5_KEYS, + .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 1, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-arrow", - .label = "◀", + {.css_class = "arrow", + .label = "⬅", .letter = NULL, .left = NULL, .right = NULL, .below = NULL, - .x = 3.25 * KB_COLUMN_WIDTH_6_KEYS, - .y = 1.25 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, - .height = KB_HEIGHT_BIG_KEYS, + .x = 2 * KB_COLUMN_WIDTH_5_KEYS, + .y = 2 * KB_LINE_HEIGHT, + .width = KB_WIDTH_5_KEYS, + .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 2, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-arrow", - .label = "▼", + {.css_class = "arrow", + .label = "⬇", .letter = NULL, .left = NULL, .right = NULL, .below = NULL, - .x = 4 * KB_COLUMN_WIDTH_6_KEYS, - .y = 1.75 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, - .height = KB_HEIGHT_BIG_KEYS, + .x = 3 * KB_COLUMN_WIDTH_5_KEYS, + .y = 2 * KB_LINE_HEIGHT, + .width = KB_WIDTH_5_KEYS, + .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 3, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-arrow", - .label = "▶", + {.css_class = "arrow", + .label = "⮕", .letter = NULL, .left = NULL, .right = NULL, .below = NULL, - .x = 4.78 * KB_COLUMN_WIDTH_6_KEYS, - .y = 1.25 * KB_LINE_HEIGHT, - .width = KB_WIDTH_6_KEYS, - .height = KB_HEIGHT_BIG_KEYS, + .x = 4 * KB_COLUMN_WIDTH_5_KEYS, + .y = 2 * KB_LINE_HEIGHT, + .width = KB_WIDTH_5_KEYS, + .height = KB_HEIGHT_SMALL_KEYS, .column = 6, .row = 4, .columnbit = ( 1 << 6 ), .rowbit = ( 1 << 4 ), .eint = 4}, - {.css_class = "button-function", + {.css_class = "function", .label = "HIST", .letter = "M", .left = "CMD", @@ -318,7 +318,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 4 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-function", + {.css_class = "function", .label = "EVAL", .letter = "N", .left = "PRG", @@ -333,7 +333,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-function", + {.css_class = "function", .label = "'", .letter = "O", .left = "MTRW", @@ -348,7 +348,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-function", + {.css_class = "function", .label = "SYMB", .letter = "P", .left = "MTH", @@ -363,7 +363,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-function", + {.css_class = "function", .label = "⬅", .letter = NULL, .left = "DEL", @@ -379,7 +379,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 1 ), .eint = 1}, - {.css_class = "button-function", + {.css_class = "function", .label = "Yx", .letter = "Q", .left = "𝑒x", @@ -394,11 +394,11 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 4 ), .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-function", - .label = "√𝔁", + {.css_class = "function", + .label = "√𝓍", .letter = "R", - .left = "𝔁2", - .right = "x√y", + .left = "𝓍2", + .right = "x√𝓎", .below = NULL, .x = KB_COLUMN_WIDTH_5_KEYS, .y = 4 * KB_LINE_HEIGHT, @@ -409,7 +409,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-function", + {.css_class = "function", .label = "SIN", .letter = "S", .left = "ASIN", @@ -424,7 +424,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-function", + {.css_class = "function", .label = "COS", .letter = "T", .left = "ACOS", @@ -439,7 +439,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-function", + {.css_class = "function", .label = "TAN", .letter = "U", .left = "ATAN", @@ -455,10 +455,10 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 2 ), .eint = 2}, - {.css_class = "button-function", + {.css_class = "function", .label = "EEX", .letter = "V", - .left = "10𝔁", + .left = "10𝓍", .right = "LOG", .below = NULL, .x = 0, @@ -470,7 +470,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 4 ), .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-function", + {.css_class = "function", .label = "+/-", .letter = "W", .left = "≠", @@ -485,8 +485,8 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-function", - .label = "𝔁", + {.css_class = "function", + .label = "𝓍", .letter = "X", .left = "≤", .right = ">", @@ -500,8 +500,8 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-function", - .label = "1/𝔁", + {.css_class = "function", + .label = "1/𝓍", .letter = "Y", .left = "≥", .right = ">", @@ -515,7 +515,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "÷", .letter = "Z", .left = "ABS", @@ -531,7 +531,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 3 ), .eint = 3}, - {.css_class = "button-alpha", + {.css_class = "alpha", .label = "ALPHA", .letter = NULL, .left = "USER", @@ -546,7 +546,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = 0, .rowbit = 0, .eint = 4}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "7", .letter = NULL, .left = "S.SLV", @@ -561,7 +561,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 4 ), .eint = 4}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "8", .letter = NULL, .left = "EXP&LN", @@ -576,7 +576,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 4 ), .eint = 4}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "9", .letter = NULL, .left = "FINANCE", @@ -591,7 +591,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 4 ), .eint = 4}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "×", .letter = NULL, .left = "[ ]", @@ -607,7 +607,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 4 ), .eint = 4}, - {.css_class = "button-shift-left", + {.css_class = "shift-left", .label = "⮢", .letter = NULL, .left = NULL, @@ -622,7 +622,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = 0, .rowbit = 0, .eint = 5}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "4", .letter = NULL, .left = "CALC", @@ -637,7 +637,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 5 ), .eint = 5}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "5", .letter = NULL, .left = "MATRICES", @@ -652,7 +652,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 5 ), .eint = 5}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "6", .letter = NULL, .left = "CONVERT", @@ -667,7 +667,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 5 ), .eint = 5}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "-", .letter = NULL, .left = "( )", @@ -683,7 +683,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 5 ), .eint = 5}, - {.css_class = "button-shift-right", + {.css_class = "shift-right", .label = "⮣", .letter = NULL, .left = NULL, @@ -698,7 +698,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = 0, .rowbit = 0, .eint = 6}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "1", .letter = NULL, .left = "ARITH", @@ -713,7 +713,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 6 ), .eint = 6}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "2", .letter = NULL, .left = "DEF", @@ -728,7 +728,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 6 ), .eint = 6}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "3", .letter = NULL, .left = "#", @@ -743,7 +743,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 6 ), .eint = 6}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "+", .letter = NULL, .left = "{ }", @@ -759,7 +759,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .rowbit = ( 1 << 6 ), .eint = 6}, - {.css_class = "button-core", + {.css_class = "core", .label = "ON", .letter = NULL, .left = "CONT", @@ -774,7 +774,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = 0, .rowbit = 0, .eint = 0}, - {.css_class = "button-core-number", + {.css_class = "core-number", .label = "0", .letter = NULL, .left = "∞", @@ -789,7 +789,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 3 ), .rowbit = ( 1 << 7 ), .eint = 7}, - {.css_class = "button-core", + {.css_class = "core", .label = ".", .letter = NULL, .left = ": :", @@ -804,7 +804,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 2 ), .rowbit = ( 1 << 7 ), .eint = 7}, - {.css_class = "button-core", + {.css_class = "core", .label = "SPC", .letter = NULL, .left = "𝚷", @@ -819,7 +819,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { .columnbit = ( 1 << 1 ), .rowbit = ( 1 << 7 ), .eint = 7}, - {.css_class = "button-core", + {.css_class = "core", .label = "ENTER", .letter = NULL, .left = "ANS", @@ -853,35 +853,35 @@ char* css_global = "window {" " background-image: none;" " padding: 0px;" "}" - ".button-menu {" + "button.menu {" " background-color: #a9a9a9;" "}" - ".button-function {" + "button.function {" " background-color: #696969;" "}" - ".button-arrow {" + "button.arrow {" " background-color: #e0e0e0;" "}" - ".button-alpha {" + "button.alpha {" " background-color: #fae82c;" "}" - ".button-core, .button-core-number {" + "button.core, button.core-number {" " background-color: #080808;" "}" - ".button-alpha .label-key {" + "button.alpha .label-key, button.arrow .label-key, button.menu .label-key {" " color: #080808;" "}" - ".button-shift-left {" + "button.shift-left {" " background-color: %s;" "}" - ".button-shift-right {" + "button.shift-right {" " background-color: #8e2518;" "}" - ".button-shift-left .label-key, .button-shift-right .label-key, .button-arrow .label-key {" + "button.shift-left .label-key, button.shift-right .label-key {" " font-size: %ipx;" " color: #080808;" "}" - ".button-core-number .label-key {" + "button.core-number .label-key, button.arrow .label-key {" " font-size: %ipx;" "}" ".label-key {"