From e29b38693f3c9581dda7ebd1f4af65177d444de2 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Thu, 14 Nov 2024 13:27:35 +0100 Subject: [PATCH] simplify and remove unused constants --- src/x49gpng/ui.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/x49gpng/ui.c b/src/x49gpng/ui.c index c9eec71..0dba7ce 100644 --- a/src/x49gpng/ui.c +++ b/src/x49gpng/ui.c @@ -28,9 +28,6 @@ #define FONT_SIZE_NUMBER ( ( int )( 1.75 * opt.font_size ) ) #define FONT_SIZE_TINY ( ( int )( 0.75 * opt.font_size ) ) -#define TINY_TEXT_HEIGHT ( FONT_SIZE_TINY + 2 ) -#define TINY_TEXT_WIDTH ( TINY_TEXT_HEIGHT / 2 ) - #define KB_NB_ROWS 10 #define KB_NB_COLS_MENU 6 #define KB_NB_COLS 5 @@ -44,15 +41,9 @@ #define KB_SPACING_KEYS ( opt.display_scale ) -#define ANNUNCIATOR_WIDTH 16 -#define ANNUNCIATOR_HEIGHT 16 -#define ANNUNCIATORS_HEIGHT ANNUNCIATOR_HEIGHT - #define LCD_WIDTH ( 131 * opt.display_scale ) #define LCD_HEIGHT ( 80 * opt.display_scale ) -#define WINDOW_WIDTH ( 384 ) - static x49gp_ui_key_t ui_keys[ NB_KEYS ] = { {.css_class = "menu", .label = "F1", @@ -679,7 +670,7 @@ char* css_global = "window {" " font-size: %ipx;" " color: #080808;" "}" - "button.core-number .label-key, button.arrow .label-key {" + "button.core-number .label-key, button.arrow .label-key, .annunciator {" " font-size: %ipx;" "}" ".label-key {" @@ -1321,7 +1312,6 @@ static GtkWidget* _ui_load__create_annunciator_widget( x49gp_ui_t* ui, const cha #endif gtk_label_set_use_markup( GTK_LABEL( ui_ann ), true ); gtk_label_set_markup( GTK_LABEL( ui_ann ), label ); - gtk_widget_set_size_request( ui_ann, ANNUNCIATOR_WIDTH, ANNUNCIATOR_HEIGHT ); return ui_ann; } @@ -1424,7 +1414,8 @@ static int ui_load( x49gp_module_t* module, GKeyFile* keyfile ) gtk_widget_set_margin_bottom( lcd_container, 3 ); gtk_box_set_center_widget( GTK_BOX( lcd_container ), ui->lcd_canvas ); - GtkWidget* annunciators_container = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, ( LCD_WIDTH - ( 6 * ANNUNCIATOR_WIDTH ) ) / 5 ); + GtkWidget* annunciators_container = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 ); + gtk_box_set_homogeneous( GTK_BOX( annunciators_container ), true ); #if GTK_MAJOR_VERSION == 4 gtk_widget_add_css_class( annunciators_container, "annunciators-container" ); #else