forked from Miroirs/x49gp
fix/improve keyboard esthetics
This commit is contained in:
parent
be6235686e
commit
3e1479b1da
1 changed files with 42 additions and 66 deletions
108
src/x49gpng/ui.c
108
src/x49gpng/ui.c
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#define FONT_SIZE_KEY opt.font_size
|
#define FONT_SIZE_KEY opt.font_size
|
||||||
#define FONT_SIZE_SYMBOL ( 2 * opt.font_size )
|
#define FONT_SIZE_SYMBOL ( 2 * opt.font_size )
|
||||||
#define FONT_SIZE_NUMBER ( ( int )( 1.5 * opt.font_size ) )
|
#define FONT_SIZE_NUMBER ( ( int )( 1.75 * opt.font_size ) )
|
||||||
#define FONT_SIZE_TINY ( ( int )( 0.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_HEIGHT ( FONT_SIZE_TINY + 2 )
|
||||||
|
@ -39,11 +39,11 @@
|
||||||
#define KB_WIDTH_6_KEYS ( 3 * opt.font_size )
|
#define KB_WIDTH_6_KEYS ( 3 * opt.font_size )
|
||||||
#define KB_WIDTH_5_KEYS ( 4 * opt.font_size )
|
#define KB_WIDTH_5_KEYS ( 4 * opt.font_size )
|
||||||
|
|
||||||
#define KB_HEIGHT_MENU_KEYS ( 2 * opt.font_size )
|
#define KB_HEIGHT_MENU_KEYS ( ( int )( 1.75 * opt.font_size ) )
|
||||||
#define KB_HEIGHT_SMALL_KEYS ( ( int )( 1.5 * opt.font_size ) )
|
#define KB_HEIGHT_SMALL_KEYS ( ( int )( 2 * opt.font_size ) )
|
||||||
#define KB_HEIGHT_BIG_KEYS ( 3 * opt.font_size )
|
#define KB_HEIGHT_BIG_KEYS ( ( int )( 2.5 * opt.font_size ) )
|
||||||
|
|
||||||
#define KB_SPACING_KEYS TINY_TEXT_WIDTH
|
#define KB_SPACING_KEYS ( ( int )( 0.5 * TINY_TEXT_WIDTH ) )
|
||||||
#define KB_COLUMN_WIDTH_6_KEYS ( KB_WIDTH_6_KEYS + KB_SPACING_KEYS )
|
#define KB_COLUMN_WIDTH_6_KEYS ( KB_WIDTH_6_KEYS + KB_SPACING_KEYS )
|
||||||
#define KB_COLUMN_WIDTH_5_KEYS ( KB_WIDTH_5_KEYS + KB_SPACING_KEYS )
|
#define KB_COLUMN_WIDTH_5_KEYS ( KB_WIDTH_5_KEYS + KB_SPACING_KEYS )
|
||||||
|
|
||||||
|
@ -55,12 +55,8 @@
|
||||||
#define LCD_WIDTH ( 131 * LCD_PIXEL_SCALE )
|
#define LCD_WIDTH ( 131 * LCD_PIXEL_SCALE )
|
||||||
#define LCD_HEIGHT ( 80 * LCD_PIXEL_SCALE )
|
#define LCD_HEIGHT ( 80 * LCD_PIXEL_SCALE )
|
||||||
|
|
||||||
#define KEYBOARD_PADDING ( TINY_TEXT_HEIGHT + 2 )
|
|
||||||
|
|
||||||
#define WINDOW_WIDTH ( 384 )
|
#define WINDOW_WIDTH ( 384 )
|
||||||
|
|
||||||
#define LCD_PADDING ( ( WINDOW_WIDTH - LCD_WIDTH ) / 2 )
|
|
||||||
|
|
||||||
static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
{.css_class = "menu",
|
{.css_class = "menu",
|
||||||
.label = "F1",
|
.label = "F1",
|
||||||
|
@ -411,7 +407,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
|
|
||||||
{.css_class = "alpha",
|
{.css_class = "alpha",
|
||||||
.label = "ALPHA",
|
.label = "ALPHA",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "USER",
|
.left = "USER",
|
||||||
.right = "ENTRY",
|
.right = "ENTRY",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -422,7 +418,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 4},
|
.eint = 4},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "7",
|
.label = "7",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "S.SLV",
|
.left = "S.SLV",
|
||||||
.right = "NUM.SLV",
|
.right = "NUM.SLV",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -433,7 +429,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 4},
|
.eint = 4},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "8",
|
.label = "8",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "EXP&LN",
|
.left = "EXP&LN",
|
||||||
.right = "TRIG",
|
.right = "TRIG",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -444,7 +440,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 4},
|
.eint = 4},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "9",
|
.label = "9",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "FINANCE",
|
.left = "FINANCE",
|
||||||
.right = "TIME",
|
.right = "TIME",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -455,7 +451,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 4},
|
.eint = 4},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "×",
|
.label = "×",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "[ ]",
|
.left = "[ ]",
|
||||||
.right = "\" \"",
|
.right = "\" \"",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -467,7 +463,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
|
|
||||||
{.css_class = "shift-left",
|
{.css_class = "shift-left",
|
||||||
.label = "⮢",
|
.label = "⮢",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "",
|
.left = "",
|
||||||
.right = NULL,
|
.right = NULL,
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -478,7 +474,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 5},
|
.eint = 5},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "4",
|
.label = "4",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "CALC",
|
.left = "CALC",
|
||||||
.right = "ALG",
|
.right = "ALG",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -489,7 +485,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 5},
|
.eint = 5},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "5",
|
.label = "5",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "MATRICES",
|
.left = "MATRICES",
|
||||||
.right = "STAT",
|
.right = "STAT",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -500,7 +496,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 5},
|
.eint = 5},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "6",
|
.label = "6",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "CONVERT",
|
.left = "CONVERT",
|
||||||
.right = "UNITS",
|
.right = "UNITS",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -511,7 +507,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 5},
|
.eint = 5},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "-",
|
.label = "-",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "( )",
|
.left = "( )",
|
||||||
.right = "_",
|
.right = "_",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -523,7 +519,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
|
|
||||||
{.css_class = "shift-right",
|
{.css_class = "shift-right",
|
||||||
.label = "⮣",
|
.label = "⮣",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "",
|
.left = "",
|
||||||
.right = NULL,
|
.right = NULL,
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -534,7 +530,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 6},
|
.eint = 6},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "1",
|
.label = "1",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "ARITH",
|
.left = "ARITH",
|
||||||
.right = "CMPLX",
|
.right = "CMPLX",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -545,7 +541,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 6},
|
.eint = 6},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "2",
|
.label = "2",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "DEF",
|
.left = "DEF",
|
||||||
.right = "LIB",
|
.right = "LIB",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -556,7 +552,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 6},
|
.eint = 6},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "3",
|
.label = "3",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "#",
|
.left = "#",
|
||||||
.right = "BASE",
|
.right = "BASE",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -567,7 +563,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 6},
|
.eint = 6},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "+",
|
.label = "+",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "{ }",
|
.left = "{ }",
|
||||||
.right = "« »",
|
.right = "« »",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -579,7 +575,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
|
|
||||||
{.css_class = "core",
|
{.css_class = "core",
|
||||||
.label = "ON",
|
.label = "ON",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "CONT",
|
.left = "CONT",
|
||||||
.right = "OFF",
|
.right = "OFF",
|
||||||
.below = "CANCEL",
|
.below = "CANCEL",
|
||||||
|
@ -590,7 +586,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 0},
|
.eint = 0},
|
||||||
{.css_class = "core-number",
|
{.css_class = "core-number",
|
||||||
.label = "0",
|
.label = "0",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "∞",
|
.left = "∞",
|
||||||
.right = "→",
|
.right = "→",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -601,7 +597,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 7},
|
.eint = 7},
|
||||||
{.css_class = "core",
|
{.css_class = "core",
|
||||||
.label = ".",
|
.label = ".",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = ": :",
|
.left = ": :",
|
||||||
.right = "↲",
|
.right = "↲",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -612,7 +608,7 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
|
||||||
.eint = 7},
|
.eint = 7},
|
||||||
{.css_class = "core",
|
{.css_class = "core",
|
||||||
.label = "SPC",
|
.label = "SPC",
|
||||||
.letter = "",
|
.letter = NULL,
|
||||||
.left = "𝚷",
|
.left = "𝚷",
|
||||||
.right = ",",
|
.right = ",",
|
||||||
.below = NULL,
|
.below = NULL,
|
||||||
|
@ -640,18 +636,20 @@ char* css_global = "window {"
|
||||||
"window * {"
|
"window * {"
|
||||||
" font-weight: bold;"
|
" font-weight: bold;"
|
||||||
"}"
|
"}"
|
||||||
|
/* "box { border: 1px dashed red; }" */
|
||||||
|
/* "label { border: 1px dotted yellow; }" */
|
||||||
".annunciator {"
|
".annunciator {"
|
||||||
" padding: 0px;"
|
" padding: 0px;"
|
||||||
" color: #080808;"
|
" color: #080808;"
|
||||||
"}"
|
"}"
|
||||||
".lcd-container, .annunciators-container {"
|
".lcd-container, .annunciators-container {"
|
||||||
" background-color: #abd2b4;"
|
" background-color: #a9d0b2;"
|
||||||
"}"
|
"}"
|
||||||
"button {"
|
"button {"
|
||||||
" background-image: none;"
|
" background-image: none;"
|
||||||
" padding: 0px;"
|
" padding: 0px;"
|
||||||
" margin-left: 5px;"
|
" margin-left: 15px;"
|
||||||
" margin-right: 5px;"
|
" margin-right: 15px;"
|
||||||
"}"
|
"}"
|
||||||
"button.menu {"
|
"button.menu {"
|
||||||
" background-color: #a9a9a9;"
|
" background-color: #a9a9a9;"
|
||||||
|
@ -801,12 +799,8 @@ static gboolean react_to_button_release( GtkWidget* widget, GdkEventButton* even
|
||||||
if ( event->type != GDK_BUTTON_RELEASE )
|
if ( event->type != GDK_BUTTON_RELEASE )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch ( event->button ) {
|
if ( event->button != 1 )
|
||||||
case 1:
|
return true;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ui->buttons_down > 0 )
|
if ( ui->buttons_down > 0 )
|
||||||
ui->buttons_down--;
|
ui->buttons_down--;
|
||||||
|
@ -1175,21 +1169,13 @@ static gboolean react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpoin
|
||||||
bev.button = 1;
|
bev.button = 1;
|
||||||
bev.state = event->state;
|
bev.state = event->state;
|
||||||
|
|
||||||
/* save_in = GTK_BUTTON( button->button )->in_button; */
|
|
||||||
|
|
||||||
switch ( event->type ) {
|
switch ( event->type ) {
|
||||||
case GDK_KEY_PRESS:
|
case GDK_KEY_PRESS:
|
||||||
bev.type = GDK_BUTTON_PRESS;
|
bev.type = GDK_BUTTON_PRESS;
|
||||||
react_to_button_press( button->button, &bev, button );
|
react_to_button_press( button->button, &bev, button );
|
||||||
/* GTK_BUTTON( button->button )->in_button = true; */
|
|
||||||
key_to_button( button->button, true );
|
|
||||||
/* GTK_BUTTON( button->button )->in_button = save_in; */
|
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_RELEASE:
|
case GDK_KEY_RELEASE:
|
||||||
bev.type = GDK_BUTTON_RELEASE;
|
bev.type = GDK_BUTTON_RELEASE;
|
||||||
/* GTK_BUTTON( button->button )->in_button = true; */
|
|
||||||
key_to_button( button->button, false );
|
|
||||||
/* GTK_BUTTON( button->button )->in_button = save_in; */
|
|
||||||
react_to_button_release( button->button, &bev, button );
|
react_to_button_release( button->button, &bev, button );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1219,11 +1205,11 @@ static gboolean react_to_window_click( GtkWidget* widget, GdkEventButton* event,
|
||||||
case 1: // left click
|
case 1: // left click
|
||||||
gdk_window_begin_move_drag( gtk_widget_get_window( widget ), event->button, event->x_root, event->y_root, event->time );
|
gdk_window_begin_move_drag( gtk_widget_get_window( widget ), event->button, event->x_root, event->y_root, event->time );
|
||||||
break;
|
break;
|
||||||
case 2: // middle click
|
/* case 2: // middle click */
|
||||||
GtkClipboard* clip = gtk_clipboard_get( GDK_SELECTION_CLIPBOARD );
|
/* GtkClipboard* clip = gtk_clipboard_get( GDK_SELECTION_CLIPBOARD ); */
|
||||||
gchar* text = gtk_clipboard_wait_for_text( clip );
|
/* gchar* text = gtk_clipboard_wait_for_text( clip ); */
|
||||||
fprintf( stderr, "clipboard: %s\n", text );
|
/* fprintf( stderr, "clipboard: %s\n", text ); */
|
||||||
break;
|
/* break; */
|
||||||
case 3: // right click
|
case 3: // right click
|
||||||
gtk_menu_popup_at_pointer( GTK_MENU( ui->menu ), NULL );
|
gtk_menu_popup_at_pointer( GTK_MENU( ui->menu ), NULL );
|
||||||
return true;
|
return true;
|
||||||
|
@ -1471,10 +1457,6 @@ static int ui_load( x49gp_module_t* module, GKeyFile* keyfile )
|
||||||
|
|
||||||
GtkWidget* display_container = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
|
GtkWidget* display_container = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
|
||||||
gtk_style_context_add_class( gtk_widget_get_style_context( annunciators_container ), "display-container" );
|
gtk_style_context_add_class( gtk_widget_get_style_context( annunciators_container ), "display-container" );
|
||||||
gtk_widget_set_margin_top( display_container, LCD_PADDING );
|
|
||||||
gtk_widget_set_margin_bottom( display_container, LCD_PADDING );
|
|
||||||
gtk_widget_set_margin_start( display_container, LCD_PADDING );
|
|
||||||
gtk_widget_set_margin_end( display_container, WINDOW_WIDTH - ( LCD_PADDING + LCD_WIDTH ) );
|
|
||||||
gtk_container_add( GTK_CONTAINER( display_container ), annunciators_container );
|
gtk_container_add( GTK_CONTAINER( display_container ), annunciators_container );
|
||||||
gtk_container_add( GTK_CONTAINER( display_container ), lcd_container );
|
gtk_container_add( GTK_CONTAINER( display_container ), lcd_container );
|
||||||
|
|
||||||
|
@ -1484,10 +1466,6 @@ static int ui_load( x49gp_module_t* module, GKeyFile* keyfile )
|
||||||
GtkWidget* keyboard_container = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
|
GtkWidget* keyboard_container = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
|
||||||
gtk_style_context_add_class( gtk_widget_get_style_context( keyboard_container ), "keyboard-container" );
|
gtk_style_context_add_class( gtk_widget_get_style_context( keyboard_container ), "keyboard-container" );
|
||||||
gtk_box_set_homogeneous( GTK_BOX( keyboard_container ), true );
|
gtk_box_set_homogeneous( GTK_BOX( keyboard_container ), true );
|
||||||
gtk_widget_set_margin_top( keyboard_container, KEYBOARD_PADDING );
|
|
||||||
gtk_widget_set_margin_bottom( keyboard_container, KEYBOARD_PADDING );
|
|
||||||
gtk_widget_set_margin_start( keyboard_container, KEYBOARD_PADDING );
|
|
||||||
gtk_widget_set_margin_end( keyboard_container, KEYBOARD_PADDING );
|
|
||||||
|
|
||||||
gtk_container_add( GTK_CONTAINER( window_container ), keyboard_container );
|
gtk_container_add( GTK_CONTAINER( window_container ), keyboard_container );
|
||||||
|
|
||||||
|
@ -1533,18 +1511,18 @@ static int ui_load( x49gp_module_t* module, GKeyFile* keyfile )
|
||||||
gtk_style_context_add_class( gtk_widget_get_style_context( button->button ), button->key->css_class );
|
gtk_style_context_add_class( gtk_widget_get_style_context( button->button ), button->key->css_class );
|
||||||
gtk_widget_set_size_request( button->button, ( row == 0 ) ? KB_WIDTH_6_KEYS : KB_WIDTH_5_KEYS,
|
gtk_widget_set_size_request( button->button, ( row == 0 ) ? KB_WIDTH_6_KEYS : KB_WIDTH_5_KEYS,
|
||||||
( row == 0 ) ? KB_HEIGHT_MENU_KEYS
|
( row == 0 ) ? KB_HEIGHT_MENU_KEYS
|
||||||
: ( key_index < 40 ) ? KB_HEIGHT_SMALL_KEYS
|
: ( key_index < 30 ) ? KB_HEIGHT_SMALL_KEYS
|
||||||
: KB_HEIGHT_BIG_KEYS );
|
: KB_HEIGHT_BIG_KEYS );
|
||||||
gtk_widget_set_can_focus( button->button, false );
|
gtk_widget_set_can_focus( button->button, false );
|
||||||
gtk_widget_add_events( button->button, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK );
|
gtk_widget_add_events( button->button, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK );
|
||||||
g_signal_connect( G_OBJECT( button->button ), "button-press-event", G_CALLBACK( react_to_button_press ), button );
|
g_signal_connect( G_OBJECT( button->button ), "button-press-event", G_CALLBACK( react_to_button_press ), button );
|
||||||
g_signal_connect( G_OBJECT( button->button ), "button-release-event", G_CALLBACK( react_to_button_release ), button );
|
g_signal_connect( G_OBJECT( button->button ), "button-release-event", G_CALLBACK( react_to_button_release ), button );
|
||||||
g_signal_connect( G_OBJECT( button->button ), "leave-notify-event", G_CALLBACK( react_to_button_leave ), button );
|
g_signal_connect( G_OBJECT( button->button ), "leave-notify-event", G_CALLBACK( react_to_button_leave ), button );
|
||||||
|
gtk_container_add( GTK_CONTAINER( keys_containers[ key_index ] ), button->button );
|
||||||
|
|
||||||
if ( button->key->label )
|
if ( button->key->label )
|
||||||
gtk_container_add( GTK_CONTAINER( button->button ), _ui_load__create_label( "label-key", button->key->label ) );
|
gtk_container_add( GTK_CONTAINER( button->button ), _ui_load__create_label( "label-key", button->key->label ) );
|
||||||
|
|
||||||
gtk_container_add( GTK_CONTAINER( keys_containers[ key_index ] ), button->button );
|
|
||||||
|
|
||||||
if ( button->key->below )
|
if ( button->key->below )
|
||||||
gtk_container_add( GTK_CONTAINER( keys_containers[ key_index ] ),
|
gtk_container_add( GTK_CONTAINER( keys_containers[ key_index ] ),
|
||||||
_ui_load__create_label( "label-below", button->key->below ) );
|
_ui_load__create_label( "label-below", button->key->below ) );
|
||||||
|
@ -1687,7 +1665,7 @@ int gui_init( x49gp_t* x49gp )
|
||||||
|
|
||||||
if ( opt.verbose ) {
|
if ( opt.verbose ) {
|
||||||
fprintf( stderr,
|
fprintf( stderr,
|
||||||
" FONT_SIZE_KEY = %i\n"
|
"\n FONT_SIZE_KEY = %i\n"
|
||||||
" FONT_SIZE_SYMBOL = %i\n"
|
" FONT_SIZE_SYMBOL = %i\n"
|
||||||
" FONT_SIZE_NUMBER = %i\n"
|
" FONT_SIZE_NUMBER = %i\n"
|
||||||
" FONT_SIZE_TINY = %i\n"
|
" FONT_SIZE_TINY = %i\n"
|
||||||
|
@ -1707,13 +1685,11 @@ int gui_init( x49gp_t* x49gp )
|
||||||
" LCD_PIXEL_SCALE = %i\n"
|
" LCD_PIXEL_SCALE = %i\n"
|
||||||
" LCD_WIDTH = %i\n"
|
" LCD_WIDTH = %i\n"
|
||||||
" LCD_HEIGHT = %i\n"
|
" LCD_HEIGHT = %i\n"
|
||||||
" KEYBOARD_PADDING = %i\n"
|
" WINDOW_WIDTH = %i\n",
|
||||||
" WINDOW_WIDTH = %i\n"
|
|
||||||
" LCD_PADDING = %i\n",
|
|
||||||
FONT_SIZE_KEY, FONT_SIZE_SYMBOL, FONT_SIZE_NUMBER, FONT_SIZE_TINY, TINY_TEXT_HEIGHT, TINY_TEXT_WIDTH, KB_WIDTH_6_KEYS,
|
FONT_SIZE_KEY, FONT_SIZE_SYMBOL, FONT_SIZE_NUMBER, FONT_SIZE_TINY, TINY_TEXT_HEIGHT, TINY_TEXT_WIDTH, KB_WIDTH_6_KEYS,
|
||||||
KB_WIDTH_5_KEYS, KB_HEIGHT_MENU_KEYS, KB_HEIGHT_SMALL_KEYS, KB_HEIGHT_BIG_KEYS, KB_SPACING_KEYS, KB_COLUMN_WIDTH_6_KEYS,
|
KB_WIDTH_5_KEYS, KB_HEIGHT_MENU_KEYS, KB_HEIGHT_SMALL_KEYS, KB_HEIGHT_BIG_KEYS, KB_SPACING_KEYS, KB_COLUMN_WIDTH_6_KEYS,
|
||||||
KB_COLUMN_WIDTH_5_KEYS, ANNUNCIATOR_WIDTH, ANNUNCIATOR_HEIGHT, ANNUNCIATORS_HEIGHT, LCD_PIXEL_SCALE, LCD_WIDTH, LCD_HEIGHT,
|
KB_COLUMN_WIDTH_5_KEYS, ANNUNCIATOR_WIDTH, ANNUNCIATOR_HEIGHT, ANNUNCIATORS_HEIGHT, LCD_PIXEL_SCALE, LCD_WIDTH, LCD_HEIGHT,
|
||||||
KEYBOARD_PADDING, WINDOW_WIDTH, LCD_PADDING );
|
WINDOW_WIDTH );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( x49gp_module_init( x49gp, "gui", ui_init, ui_exit, ui_reset, ui_load, ui_save, NULL, &module ) )
|
if ( x49gp_module_init( x49gp, "gui", ui_init, ui_exit, ui_reset, ui_load, ui_save, NULL, &module ) )
|
||||||
|
|
Loading…
Reference in a new issue