diff options
Diffstat (limited to 'src/eulogium.c')
-rw-r--r-- | src/eulogium.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/eulogium.c b/src/eulogium.c index e1198ee..cdfff46 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -15,8 +15,6 @@ #define COPYRIGHT "Copyright © 2015 Olliver Schinagl <oliver@schinagl.nl> and various contributors (see AUTHORS)." #define EULOGIUM_THEME "eulogium.edj" -#define WIDTH 128 -#define HEIGHT 64 int main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { @@ -55,6 +53,7 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED) int prefix_size; char *theme_file; int theme_file_size; + int height, width; #if ENABLE_NLS setlocale(LC_ALL, ""); @@ -87,7 +86,11 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED) return EXIT_FAILURE; } - window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + /* Initialize the window with fake dimensions, we'll set the proper dimensions via the theme */ + height = 0; + width = 0; + + window = ecore_evas_new(NULL, 0, 0, height, width, NULL); canvas = ecore_evas_get(window); edje = edje_object_add(canvas); if (!edje) { @@ -108,9 +111,17 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED) evas_object_del(edje); return EXIT_FAILURE; } + + height = atoi(edje_file_data_get(theme_file, "height")); + width = atoi(edje_file_data_get(theme_file, "width")); + if (height < 1 || width < 1) { + EINA_LOG_ERR("Invalid height (%d) or width (%d) parameter in %s", height, width, theme_file); + return EXIT_FAILURE; + } free(theme_file); evas_object_show(edje); + ecore_evas_resize(window, height, width); ecore_evas_title_set(window, PACKAGE_NAME); ecore_evas_show(window); |