summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tischer <simon@t-tischer.de>2020-04-09 08:18:09 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-04-11 10:52:39 +0200
commit3797ca2c958b951dd6e70123ccf503358d5f6843 (patch)
tree0da004d20e2c245beca43cd8ea73e74ceb7c2f5e
parent64b30b3a1fe785acb1da364d6a431fd1e12d5f87 (diff)
add count of wallpapers/themes to buttons
-rw-r--r--src/bin/extra_main.c11
-rw-r--r--src/lib/extra_private.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/src/bin/extra_main.c b/src/bin/extra_main.c
index 612fa9f..4980047 100644
--- a/src/bin/extra_main.c
+++ b/src/bin/extra_main.c
@@ -16,6 +16,9 @@
16 16
17#define COPYRIGHT "Copyright © 2016 Andy Williams <andy@andywilliams.me> and various contributors (see AUTHORS)." 17#define COPYRIGHT "Copyright © 2016 Andy Williams <andy@andywilliams.me> and various contributors (see AUTHORS)."
18 18
19Eina_List *_theme_list = NULL;
20Eina_List *_wallpaper_list = NULL;
21
19Ui _ui; 22Ui _ui;
20 23
21static void 24static void
@@ -42,6 +45,7 @@ _extra_win_sync_done_cb(void *data EINA_UNUSED)
42{ 45{
43 Elm_Table *table, *segcontrol, *ic; 46 Elm_Table *table, *segcontrol, *ic;
44 Elm_Object_Item *it; 47 Elm_Object_Item *it;
48 char buf[256], buf1[256];
45 49
46 table = elm_table_add(_ui.win); 50 table = elm_table_add(_ui.win);
47 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 51 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -61,14 +65,17 @@ _extra_win_sync_done_cb(void *data EINA_UNUSED)
61 evas_object_smart_callback_add(segcontrol, "changed", _item_changed, NULL); 65 evas_object_smart_callback_add(segcontrol, "changed", _item_changed, NULL);
62 evas_object_show(segcontrol); 66 evas_object_show(segcontrol);
63 67
68 snprintf(buf, sizeof(buf), "%s [%i]", _("Themes"), eina_list_count(_theme_list));
69 snprintf(buf1, sizeof(buf1), "%s [%i]", _("wallpapers"), eina_list_count(_wallpaper_list));
70
64#define IC_ADD(ic_txt, txt, obj) \ 71#define IC_ADD(ic_txt, txt, obj) \
65 ic = elm_icon_add(segcontrol); \ 72 ic = elm_icon_add(segcontrol); \
66 elm_icon_standard_set(ic, ic_txt); \ 73 elm_icon_standard_set(ic, ic_txt); \
67 it = elm_segment_control_item_add(segcontrol, ic, txt); \ 74 it = elm_segment_control_item_add(segcontrol, ic, txt); \
68 elm_object_item_data_set(it, obj); \ 75 elm_object_item_data_set(it, obj); \
69 76
70 IC_ADD("preferences-desktop-theme", _("Themes"), _ui.theme_selector); 77 IC_ADD("preferences-desktop-theme", buf, _ui.theme_selector);
71 IC_ADD("preferences-desktop-wallpaper", _("Wallpapers"), _ui.wallpaper_selector); 78 IC_ADD("preferences-desktop-wallpaper", buf1, _ui.wallpaper_selector);
72 79
73#undef IC_ADD 80#undef IC_ADD
74 81
diff --git a/src/lib/extra_private.h b/src/lib/extra_private.h
index 57a09de..a39ef5c 100644
--- a/src/lib/extra_private.h
+++ b/src/lib/extra_private.h
@@ -44,6 +44,9 @@ struct _Extra_Request
44 Extra_Progress progress; 44 Extra_Progress progress;
45}; 45};
46 46
47extern Eina_List *_theme_list;
48extern Eina_List *_wallpaper_list;
49
47#define EXTRA_STATE_DOWNLOAD_IN_PROGRESS 2 50#define EXTRA_STATE_DOWNLOAD_IN_PROGRESS 2
48 51
49 52