Add default theme.

This commit is contained in:
Daiki Ueno
2011-03-04 19:22:10 +09:00
parent d66318a031
commit a20224f969
6 changed files with 25 additions and 2 deletions

View File

@ -244,6 +244,7 @@ data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/scalable/Makefile
data/themes/Makefile
eek/eek-${EEK_API_VERSION}.pc
eek/eek-clutter-${EEK_API_VERSION}.pc
eek/eek-gtk-${EEK_API_VERSION}.pc

View File

@ -1 +1 @@
SUBDIRS = icons
SUBDIRS = icons themes

2
data/themes/Makefile.am Normal file
View File

@ -0,0 +1,2 @@
themedir = $(pkgdatadir)/themes
dist_theme_DATA = default.css

11
data/themes/default.css Normal file
View File

@ -0,0 +1,11 @@
.key {
color: #ffffff;
background-gradient-direction: radial;
background-gradient-start: #000000;
background-gradient-end: #232323;
}
.keyboard {
background-color: #000000;
color: #ffffff;
}

View File

@ -64,7 +64,8 @@ eekboard_desktop_client_SOURCES = desktop-client.c desktop-client-main.c
eekboard_server_CFLAGS = \
-I$(top_srcdir) \
$(GIO2_CFLAGS) \
$(GTK_CFLAGS)
$(GTK_CFLAGS) \
-DTHEMEDIR=\"$(pkgdatadir)/themes\"
eekboard_server_LDADD = \
$(top_builddir)/eekboard/libeekboard.la \

View File

@ -191,6 +191,8 @@ on_realize (GtkWidget *widget,
GDK_FUNC_CLOSE);
}
#define DEFAULT_THEME (THEMEDIR "/default.css")
static void
update_widget (ServerContext *context)
{
@ -199,6 +201,7 @@ update_widget (ServerContext *context)
gint monitor;
GdkRectangle rect;
EekBounds bounds;
EekTheme *theme;
#if HAVE_CLUTTER_GTK
ClutterActor *stage, *actor;
ClutterColor stage_color = { 0xff, 0xff, 0xff, 0xff };
@ -207,11 +210,14 @@ update_widget (ServerContext *context)
if (context->widget)
gtk_widget_destroy (context->widget);
theme = eek_theme_new (DEFAULT_THEME, NULL, NULL);
eek_element_get_bounds (EEK_ELEMENT(context->keyboard), &bounds);
#if HAVE_CLUTTER_GTK
context->widget = gtk_clutter_embed_new ();
stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED(context->widget));
actor = eek_clutter_keyboard_new (context->keyboard);
if (theme)
eek_clutter_keyboard_set_theme (EEK_CLUTTER_KEYBOARD(actor), theme);
clutter_container_add_actor (CLUTTER_CONTAINER(stage), actor);
clutter_stage_set_color (CLUTTER_STAGE(stage), &stage_color);
@ -225,6 +231,8 @@ update_widget (ServerContext *context)
actor);
#else
context->widget = eek_gtk_keyboard_new (context->keyboard);
if (theme)
eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget), theme);
#endif
gtk_widget_set_size_request (context->widget, bounds.width, bounds.height);