From d816cc261a2c185fa0a3c76f92e02e152ac1a6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Wed, 28 Aug 2019 15:41:38 +0200 Subject: [PATCH 1/4] desktop file: Use NoDisplay=true There's no point in having the keyboard in the list of installed applications and it has no icon either. --- data/sm.puri.Squeekboard.desktop.in | 1 + 1 file changed, 1 insertion(+) diff --git a/data/sm.puri.Squeekboard.desktop.in b/data/sm.puri.Squeekboard.desktop.in index 5b66c1fd..dba53f77 100644 --- a/data/sm.puri.Squeekboard.desktop.in +++ b/data/sm.puri.Squeekboard.desktop.in @@ -6,4 +6,5 @@ Exec=squeekboard Icon=squeekboard Terminal=false Type=Application +NoDisplay=true Categories=GTK;Utility; From ffc64c6d5652d7b14efe6c2df0406ae1a040ae72 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 29 Aug 2019 21:02:35 +0000 Subject: [PATCH 2/4] Apply symbol names to widget paths, add styles --- data/style.css | 8 ++++++++ eek/eek-renderer.c | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/data/style.css b/data/style.css index 7e3fa81d..e89253e1 100644 --- a/data/style.css +++ b/data/style.css @@ -17,3 +17,11 @@ background: #1c71d8; border-color: #3584e4; } + +#Return { + background: #6480ff +} + +#Shift_L { + background: #363438 +} diff --git a/eek/eek-renderer.c b/eek/eek-renderer.c index a8a46dca..af8f35b9 100644 --- a/eek/eek-renderer.c +++ b/eek/eek-renderer.c @@ -197,6 +197,20 @@ render_button_outline (EekRenderer *renderer, return; EekBounds bounds = squeek_button_get_bounds(button); + + /* Set the name of the button on the widget path, using the name obtained + from the button's symbol. */ + g_autoptr (GtkWidgetPath) path = NULL; + path = gtk_widget_path_copy (gtk_style_context_get_path (priv->key_context)); + struct squeek_symbol *symbol = squeek_button_get_symbol(button); + const char *name = squeek_symbol_get_name(symbol); + gtk_widget_path_iter_set_name (path, -1, name); + + /* Update the style context with the updated widget path. */ + gtk_style_context_set_path (priv->key_context, path); + + /* Set the state to take into account whether the button is active + (pressed) or normal. */ gtk_style_context_set_state(priv->key_context, active ? GTK_STATE_FLAG_ACTIVE : GTK_STATE_FLAG_NORMAL); From 521bcfc4849720bf96d79222362cca5e98bc0ad5 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 30 Aug 2019 15:15:01 +0000 Subject: [PATCH 3/4] Adjust width and height of keypad geometry --- data/keyboards/geometry/number-keypad.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/keyboards/geometry/number-keypad.xml b/data/keyboards/geometry/number-keypad.xml index 59e7678e..9c15302a 100644 --- a/data/keyboards/geometry/number-keypad.xml +++ b/data/keyboards/geometry/number-keypad.xml @@ -1,6 +1,6 @@ - + From baabcb1400e3776f16cd4384e6f7080acc3da45f Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Sun, 1 Sep 2019 11:42:02 +0000 Subject: [PATCH 4/4] layout: Remove unused C functions --- src/layout.h | 3 --- src/layout.rs | 25 +------------------------ 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/layout.h b/src/layout.h index d0615154..d8b6201f 100644 --- a/src/layout.h +++ b/src/layout.h @@ -15,11 +15,9 @@ struct squeek_button *squeek_row_create_button (struct squeek_row *row, guint keycode, guint oref); struct squeek_button *squeek_row_create_button_with_state(struct squeek_row *row, struct squeek_button *source); -void squeek_row_set_angle(struct squeek_row *row, int32_t angle); int32_t squeek_row_get_angle(const struct squeek_row*); EekBounds squeek_row_get_bounds(const struct squeek_row*); -void squeek_row_set_bounds(struct squeek_row* row, EekBounds bounds); uint32_t squeek_row_contains(struct squeek_row*, struct squeek_button *button); @@ -47,7 +45,6 @@ struct squeek_button *squeek_button_new(uint32_t keycode, uint32_t oref); struct squeek_button *squeek_button_new_with_state(const struct squeek_button* source); uint32_t squeek_button_get_oref(const struct squeek_button*); EekBounds squeek_button_get_bounds(const struct squeek_button*); -void squeek_button_set_bounds(struct squeek_button* button, EekBounds bounds); struct squeek_symbol *squeek_button_get_symbol ( const struct squeek_button *button); diff --git a/src/layout.rs b/src/layout.rs index 9a2cec85..6c6f2d26 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -178,14 +178,7 @@ pub mod c { // so returning a reference to its innards directly row.buttons[last_idx].as_mut() as *mut ::layout::Button } - - #[no_mangle] - pub extern "C" - fn squeek_row_set_angle(row: *mut ::layout::Row, angle: i32) { - let row = unsafe { &mut *row }; - row.angle = angle; - } - + #[no_mangle] pub extern "C" fn squeek_row_get_angle(row: *const ::layout::Row) -> i32 { @@ -202,14 +195,6 @@ pub mod c { None => panic!("Row doesn't have any bounds yet"), } } - - /// Set bounds by consuming the value - #[no_mangle] - pub extern "C" - fn squeek_row_set_bounds(row: *mut ::layout::Row, bounds: Bounds) { - let row = unsafe { &mut *row }; - row.bounds = Some(bounds); - } #[no_mangle] pub extern "C" @@ -276,14 +261,6 @@ pub mod c { } } - /// Set bounds by consuming the value - #[no_mangle] - pub extern "C" - fn squeek_button_set_bounds(button: *mut ::layout::Button, bounds: Bounds) { - let button = unsafe { &mut *button }; - button.bounds = Some(bounds); - } - /// Borrow a new reference to key state. Doesn't need freeing #[no_mangle] pub extern "C"