style: Simplified layout styling

Layout background is styled in the same place as button background, and obtains the path "layout".
This commit is contained in:
Dorota Czaplejewicz
2019-09-26 11:03:08 +00:00
parent 6b15f69e00
commit 2889e50507
4 changed files with 18 additions and 45 deletions

View File

@ -52,8 +52,6 @@ typedef struct _EekGtkKeyboardPrivate
{
EekRenderer *renderer;
LevelKeyboard *keyboard;
GtkCssProvider *css_provider;
GtkStyleContext *scontext;
GdkEventSequence *sequence; // unowned reference
} EekGtkKeyboardPrivate;
@ -98,7 +96,7 @@ eek_gtk_keyboard_real_draw (GtkWidget *self,
if (!priv->renderer) {
PangoContext *pcontext = gtk_widget_get_pango_context (self);
priv->renderer = eek_renderer_new (priv->keyboard, pcontext, priv->scontext);
priv->renderer = eek_renderer_new (priv->keyboard, pcontext);
eek_renderer_set_allocation_size (priv->renderer,
allocation.width,
@ -383,22 +381,7 @@ eek_gtk_keyboard_class_init (EekGtkKeyboardClass *klass)
static void
eek_gtk_keyboard_init (EekGtkKeyboard *self)
{
EekGtkKeyboardPrivate *priv = eek_gtk_keyboard_get_instance_private (self);
/* Create a default CSS provider and load a style sheet */
priv->css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (priv->css_provider,
"/sm/puri/squeekboard/style.css");
/* Apply the style to the widget */
priv->scontext = gtk_widget_get_style_context (GTK_WIDGET(self));
gtk_style_context_add_class (priv->scontext, "keyboard");
gtk_style_context_add_provider (priv->scontext,
GTK_STYLE_PROVIDER(priv->css_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_style_context_set_state (priv->scontext, GTK_STATE_FLAG_NORMAL);
}
{}
/**
* eek_gtk_keyboard_new: