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 @@ - + 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; 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 edbe53a6..95634915 100644 --- a/eek/eek-renderer.c +++ b/eek/eek-renderer.c @@ -187,6 +187,19 @@ render_button_outline (EekRenderer *renderer, { EekRendererPrivate *priv = eek_renderer_get_instance_private (renderer); 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)); + const char *name = squeek_button_get_name(button); + 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); diff --git a/src/layout.h b/src/layout.h index ef5bd900..f3ba2eaf 100644 --- a/src/layout.h +++ b/src/layout.h @@ -12,6 +12,7 @@ struct squeek_view; struct squeek_layout; int32_t squeek_row_get_angle(const struct squeek_row*); + EekBounds squeek_row_get_bounds(const struct squeek_row*); uint32_t squeek_row_contains(struct squeek_row*, struct squeek_button *button); @@ -28,10 +29,9 @@ void squeek_row_free(struct squeek_row*); 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); const char *squeek_button_get_label(const struct squeek_button*); const char *squeek_button_get_icon_name(const struct squeek_button*); -const char *squeek_button_get_name(struct squeek_button*); +const char *squeek_button_get_name(const struct squeek_button*); struct squeek_key *squeek_button_get_key(const struct squeek_button*); uint32_t *squeek_button_has_key(const struct squeek_button* button, diff --git a/src/layout.rs b/src/layout.rs index e72a6937..f6a27034 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -105,6 +105,14 @@ pub mod c { } } + /// 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" fn squeek_row_foreach(