Commit bf777335 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Create the "no content to display" layout using edje

elm_bg_add is broken and didn't work for setting a background on a
parent object. Using ejde is the only working way I've found.
parent 69b20c86
......@@ -68,6 +68,7 @@
#define IMAGESPATH "images"
#define VIDEOPLAYEREDJ get_resource_path( EDJPATH "/video_player.edj")
#define AUDIOPLAYERMINIEDJ get_resource_path( EDJPATH "/audio_player_mini.edj")
#define NOCONTENTEDJ get_resource_path( EDJPATH "/no_content.edj")
#define RES_DIR "/opt/usr/apps/" PACKAGE "/res/"
#define ICON_DIR RES_DIR "/images/"
......
/*****************************************************************************
* Copyright © 2015 VideoLAN, VideoLabs SAS
*****************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*
* By committing to this project, you allow VideoLAN and VideoLabs to relicense
* the code to a different OSI approved license, in case it is required for
* compatibility with the Store
*****************************************************************************/
collections {
base_scale: 1.8;
group {
name: "no_content";
parts {
part{
name: "hub_background";
type: RECT;
description {
color: 255 255 255 255;
}
}
part {
name: "swallow.title";
type: TEXT;
description {
color: 120 120 120 255;
visible: 1;
text {
text: "No content to display";
size: 28;
ellipsis: 0;
}
}
}
} //parts
}
}
......@@ -62,8 +62,8 @@ list_view_toggle_empty(list_sys* p_list_sys, bool b_empty)
return;
p_list_sys->b_empty = b_empty;
Evas_Object* p_list = p_list_sys->p_list;
Evas_Object* p_show = b_empty ? p_list_sys->p_empty_label : p_list;
Evas_Object* p_hide = b_empty ? p_list : p_list_sys->p_empty_label;
Evas_Object* p_show = b_empty ? p_list_sys->p_empty : p_list;
Evas_Object* p_hide = b_empty ? p_list : p_list_sys->p_empty;
elm_box_unpack_all(p_list_sys->p_container);
elm_box_pack_end(p_list_sys->p_container, p_show);
......@@ -80,9 +80,11 @@ list_view_common_setup(list_view* p_list_view, list_sys* p_list_sys, interface*
/* Container box */
p_list_sys->p_container = elm_box_add(p_parent);
/* Empty list label */
p_list_sys->p_empty_label = elm_label_add(p_list_sys->p_container);
elm_object_text_set(p_list_sys->p_empty_label, "No content to display");
/* Empty list */
p_list_sys->p_empty = elm_layout_add(p_list_sys->p_container);
elm_layout_file_set(p_list_sys->p_empty, NOCONTENTEDJ, "no_content");
evas_object_size_hint_weight_set(p_list_sys->p_empty, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(p_list_sys->p_empty, EVAS_HINT_FILL, EVAS_HINT_FILL);
/* Create genlist (if required) */
if (opts & LIST_CREATE_LIST)
......
......@@ -37,7 +37,7 @@
media_library_controller* p_ctrl; \
Elm_Genlist_Item_Class* p_default_item_class; \
Evas_Object* p_container; \
Evas_Object* p_empty_label; \
Evas_Object* p_empty; \
bool b_empty;
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment