Sidebar
This commit is contained in:
parent
b30cae39d2
commit
51e10eae4d
85
src/main.c
85
src/main.c
|
@ -7,6 +7,25 @@
|
||||||
void
|
void
|
||||||
explode_win_enable(Evas_Object* win);
|
explode_win_enable(Evas_Object* win);
|
||||||
|
|
||||||
|
Evas_Object*
|
||||||
|
create_sidebar(Evas_Object* parent)
|
||||||
|
{
|
||||||
|
Evas_Object* o;
|
||||||
|
Evas_Object* sb = elm_toolbar_add(parent);
|
||||||
|
evas_object_size_hint_weight_set(sb, 0.0, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(sb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
elm_toolbar_horizontal_set(sb, EINA_FALSE);
|
||||||
|
elm_toolbar_homogeneous_set(sb, EINA_TRUE);
|
||||||
|
elm_toolbar_shrink_mode_set(sb, ELM_TOOLBAR_SHRINK_MENU);
|
||||||
|
|
||||||
|
o = elm_toolbar_item_append(sb, "home", "Home", NULL, NULL);
|
||||||
|
elm_toolbar_item_priority_set(o, -100);
|
||||||
|
o = elm_toolbar_item_append(sb, "mail-unread", "Unread", NULL, NULL);
|
||||||
|
elm_toolbar_item_priority_set(o, 100);
|
||||||
|
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI_MAIN int
|
EAPI_MAIN int
|
||||||
elm_main(int argc, char** argv)
|
elm_main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
@ -16,40 +35,50 @@ elm_main(int argc, char** argv)
|
||||||
elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
|
elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
|
||||||
elm_app_info_set(elm_main, "exclaim", "checkme");
|
elm_app_info_set(elm_main, "exclaim", "checkme");
|
||||||
|
|
||||||
Evas_Object* win = elm_win_util_standard_add("exclaim_root", "Exclaim");
|
Evas_Object* win = E_SHOW(elm_win_util_standard_add("exclaim_root", "Exclaim"));
|
||||||
E_BEGIN(win);
|
E_BEGIN(win);
|
||||||
elm_win_icon_name_set(win, "email-unread");
|
elm_win_icon_name_set(win, "email-unread");
|
||||||
elm_win_autodel_set(win, EINA_TRUE);
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
|
||||||
explode_win_enable(win);
|
explode_win_enable(win);
|
||||||
|
|
||||||
Evas_Object* status_scr = E_SHOW(elm_scroller_add(win));
|
Evas_Object* root = E_SHOW(elm_box_add(win));
|
||||||
E_BEGIN(status_scr);
|
E_BEGIN(root);
|
||||||
evas_object_fullsize(status_scr);
|
elm_box_horizontal_set(root, EINA_TRUE);
|
||||||
|
evas_object_fullsize(root);
|
||||||
Evas_Object* status_content = E_SHOW(elm_box_add(status_scr));
|
|
||||||
E_BEGIN(status_content);
|
|
||||||
evas_object_fullsize(status_content);
|
|
||||||
elm_object_content_set(status_scr, status_content);
|
|
||||||
|
|
||||||
for (int i = 0; i < 30; ++i)
|
|
||||||
{
|
|
||||||
struct exc_status st_test = {
|
|
||||||
.title = "wow",
|
|
||||||
};
|
|
||||||
Evas_Object* status = E_SHOW(exc_status_add(status_content, st_test));
|
|
||||||
|
|
||||||
elm_box_pack_end(status_content, status);
|
|
||||||
}
|
|
||||||
Evas_Object* lol = E_SHOW(elm_label_add(status_content));
|
|
||||||
elm_object_text_set(lol, "sdfjkfhjkahgkljsghklfjghdsjkghsdf");
|
|
||||||
elm_box_pack_end(status_content, lol);
|
|
||||||
E_END(status_content);
|
|
||||||
E_END(status_scr);
|
|
||||||
|
|
||||||
evas_object_resize(win, ELM_SCALE_SIZE(700), ELM_SCALE_SIZE(300));
|
Evas_Object* sidebar = E_SHOW(create_sidebar(win));
|
||||||
elm_win_resize_object_add(win, status_scr);
|
elm_box_pack_end(root, sidebar);
|
||||||
E_SHOW(win);
|
|
||||||
|
Evas_Object* status_scr = E_SHOW(elm_scroller_add(win));
|
||||||
|
E_BEGIN(status_scr);
|
||||||
|
evas_object_fullsize(status_scr);
|
||||||
|
|
||||||
|
Evas_Object* status_content = E_SHOW(elm_box_add(status_scr));
|
||||||
|
E_BEGIN(status_content);
|
||||||
|
evas_object_fullsize(status_content);
|
||||||
|
elm_object_content_set(status_scr, status_content);
|
||||||
|
|
||||||
|
for (int i = 0; i < 30; ++i)
|
||||||
|
{
|
||||||
|
struct exc_status st_test = {
|
||||||
|
.title = "wow",
|
||||||
|
};
|
||||||
|
Evas_Object* status = E_SHOW(exc_status_add(status_content, st_test));
|
||||||
|
|
||||||
|
elm_box_pack_end(status_content, status);
|
||||||
|
}
|
||||||
|
Evas_Object* lol = E_SHOW(elm_label_add(status_content));
|
||||||
|
elm_object_text_set(lol, "sdfjkfhjkahgkljsghklfjghdsjkghsdf");
|
||||||
|
elm_box_pack_end(status_content, lol);
|
||||||
|
E_END(status_content);
|
||||||
|
|
||||||
|
elm_box_pack_end(root, status_scr);
|
||||||
|
E_END(status_scr);
|
||||||
|
|
||||||
|
evas_object_resize(win, ELM_SCALE_SIZE(700), ELM_SCALE_SIZE(300));
|
||||||
|
elm_win_resize_object_add(win, root);
|
||||||
|
E_END(root);
|
||||||
E_END(win);
|
E_END(win);
|
||||||
|
|
||||||
elm_run();
|
elm_run();
|
||||||
|
|
Loading…
Reference in New Issue