extra: reapply selected state to the grid when the state changes

This commit is contained in:
Marcel Hollerbach 2017-02-15 22:09:39 +01:00
parent 6aa58f27c0
commit 39e8e45008
4 changed files with 17 additions and 12 deletions

View File

@ -12,21 +12,12 @@ static Extra_Ui_Small_Preview_Accessor acc = {
((Extra_ui_preview_download*) extra_background_preview_download),
};
static void
_reapply_tooltip(void)
{
Elm_Object_Item *item;
item = elm_gengrid_selected_item_get(_selector);
elm_gengrid_item_selected_set(item, EINA_FALSE);
elm_gengrid_item_selected_set(item, EINA_TRUE);
}
static void
_background_installed(void *data EINA_UNUSED)
{
/*TODO FIND A WAY TO REMOTE OPEN ENLIGHTENMENT BACKGROUND SELECTOR*/
_reapply_tooltip();
gengrid_reapply_state(_selector);
}
static void
@ -45,7 +36,7 @@ _uninstall_background(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
Extra_Background *b = data;
extra_background_delete(b);
_reapply_tooltip();
gengrid_reapply_state(_selector);
}
static void

View File

@ -29,5 +29,6 @@ typedef struct {
Evas_Object* extra_ui_small_preview_new(Extra_Ui_Small_Preview_Accessor acc, Evas_Object *par, void *data);
void extra_ui_fullscreen_preview(char *path);
void extra_ui_show_popup_toolbar(Evas_Object *content);
void gengrid_reapply_state(Evas_Object *grid);
#endif

View File

@ -46,7 +46,6 @@ static void
_install_done(void *data)
{
Extra_Theme *theme = data;
Elm_Object_Item *item;
if (extra_theme_installed(theme))
extra_ui_theme_ask_for_default(theme);
@ -70,18 +69,21 @@ _install_theme(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U
extra_theme_download(progress, candidate);
}
static void
_set_as_default(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Extra_Theme *candidate = data;
extra_theme_use(candidate);
gengrid_reapply_state(_selector);
}
static void
_back_to_default(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
extra_theme_reset();
gengrid_reapply_state(_selector);
}
static Evas_Object*

View File

@ -2,6 +2,17 @@
#include "extra_private.h"
#include "../lib/extra.h"
void
gengrid_reapply_state(Evas_Object *grid)
{
Elm_Object_Item *item;
item = elm_gengrid_selected_item_get(grid);
elm_gengrid_item_selected_set(item, EINA_FALSE);
elm_gengrid_item_selected_set(item, EINA_TRUE);
}
void
extra_win_progress_popup_show(const char *title)
{