adjust gui

This commit is contained in:
Gwenhael Le Moine 2024-04-13 09:41:13 +02:00
parent 071a6b8f69
commit ee465ed4fb
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 4 additions and 4 deletions

View file

@ -11,14 +11,14 @@
#define ANNUNC_X UI_PADDING #define ANNUNC_X UI_PADDING
#define ANNUNC_Y UI_PADDING #define ANNUNC_Y UI_PADDING
#define ANNUNC_HEIGHT 32 #define ANNUNC_HEIGHT 8
#define LCD_X UI_PADDING #define LCD_X UI_PADDING
#define LCD_Y ( UI_PADDING + ANNUNC_HEIGHT ) #define LCD_Y ( UI_PADDING + ANNUNC_HEIGHT )
#define LCD_WIDTH 131 #define LCD_WIDTH 131
#define LCD_HEIGHT 64 #define LCD_HEIGHT 64
#define UI_K_WIDTH_1 ( LCD_WIDTH / 8 ) #define UI_K_WIDTH_1 ( LCD_WIDTH / 7.75 )
#define UI_KB_GAP_X ( UI_K_WIDTH_1 / 2.66 ) #define UI_KB_GAP_X ( UI_K_WIDTH_1 / 2.66 )
#define UI_K_HEIGHT_1 10 #define UI_K_HEIGHT_1 10
@ -26,7 +26,7 @@
#define UI_KB_GAP_X2 UI_KB_GAP_X #define UI_KB_GAP_X2 UI_KB_GAP_X
#define UI_K_HEIGHT_2 12 #define UI_K_HEIGHT_2 12
#define UI_KB_OFFSET_Y ( LCD_Y + LCD_HEIGHT ) #define UI_KB_OFFSET_Y ( UI_PADDING + ANNUNC_HEIGHT + LCD_HEIGHT + UI_PADDING + UI_K_HEIGHT_2 )
#define UI_KB_GAP_Y 6 #define UI_KB_GAP_Y 6
#define UI_K_WIDTH_enter ( ( UI_K_WIDTH_1 * 2 ) + UI_KB_GAP_X ) #define UI_K_WIDTH_enter ( ( UI_K_WIDTH_1 * 2 ) + UI_KB_GAP_X )

View file

@ -71,7 +71,7 @@ static void program_init( void )
ttffont = TTF_OpenFont( FONT_FILENAME, 6 * UI_SCALE ); ttffont = TTF_OpenFont( FONT_FILENAME, 6 * UI_SCALE );
ttffont2 = TTF_OpenFont( FONT_FILENAME, 4 * UI_SCALE ); ttffont2 = TTF_OpenFont( FONT_FILENAME, 4 * UI_SCALE );
int window_width = LCD_WIDTH * UI_SCALE + ( 2 * UI_PADDING ); int window_width = ( LCD_WIDTH + ( 2 * UI_PADDING ) ) * UI_SCALE;
int window_height = ( UI_KB_OFFSET_Y + UI_KB_HEIGHT ) + 2 * UI_PADDING; int window_height = ( UI_KB_OFFSET_Y + UI_KB_HEIGHT ) + 2 * UI_PADDING;
window = SDL_CreateWindow( "hpemu", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, window_width, window_height, SDL_WINDOW_SHOWN ); window = SDL_CreateWindow( "hpemu", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, window_width, window_height, SDL_WINDOW_SHOWN );