newfile - new feature come.
now user choose a template at new file.
This commit is contained in:
parent
2659e31255
commit
70477f47a4
|
@ -99,7 +99,7 @@ data/images/Makefile
|
|||
data/themes/Makefile
|
||||
data/themes/default/Makefile
|
||||
data/themes/default/images/Makefile
|
||||
data/.proto/Makefile
|
||||
data/templates/Makefile
|
||||
data/color/Makefile
|
||||
])
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
filesdir = $(datadir)/$(PACKAGE)/.proto
|
||||
files_DATA = proto.edc
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
|
@ -1,3 +1,3 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
SUBDIRS = images themes .proto desktop icon color
|
||||
SUBDIRS = images themes templates desktop icon color
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EDJE_CC = @edje_cc@
|
||||
EDJE_FLAGS = -id $(top_srcdir)/data/images
|
||||
|
||||
filesdir = $(datadir)/$(PACKAGE)/templates
|
||||
files_DATA = basic.edc \
|
||||
basic.edj \
|
||||
empty.edc \
|
||||
empty.edj \
|
||||
textblock.edc \
|
||||
textblock.edj
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
||||
|
||||
basic.edj: Makefile $(EXTRA_DIST)
|
||||
$(EDJE_CC) $(EDJE_FLAGS) \
|
||||
$(top_srcdir)/data/templates/basic.edc \
|
||||
$(top_builddir)/data/templates/basic.edj
|
||||
|
||||
empty.edj: Makefile $(EXTRA_DIST)
|
||||
$(EDJE_CC) $(EDJE_FLAGS) \
|
||||
$(top_srcdir)/data/templates/empty.edc \
|
||||
$(top_builddir)/data/templates/empty.edj
|
||||
|
||||
textblock.edj: Makefile $(EXTRA_DIST)
|
||||
$(EDJE_CC) $(EDJE_FLAGS) \
|
||||
$(top_srcdir)/data/templates/textblock.edc \
|
||||
$(top_builddir)/data/templates/textblock.edj
|
||||
|
||||
clean-local:
|
||||
rm -f *.edj
|
|
@ -0,0 +1,6 @@
|
|||
collections {
|
||||
group { name: "main";
|
||||
parts {
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
collections {
|
||||
styles {
|
||||
style { name: "text_style";
|
||||
base: "font="Sans" font_size=25 text_class=entry color=#ffffff style=shadow,bottom shadow_color=#00000080 valign=0.5 ellipsis=1.0 wrap=none align=center";
|
||||
}
|
||||
}
|
||||
group { name: "main";
|
||||
parts {
|
||||
part { name: "text";
|
||||
type: TEXTBLOCK;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
rel1.relative: 0.0 0.0;
|
||||
rel2.relative: 1.0 1.0;
|
||||
text {
|
||||
style: "text_style";
|
||||
text: "Enventor";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ images {
|
|||
image: "warning.png" COMP;
|
||||
image: "setting_icon.png" COMP;
|
||||
image: "fileselect.png" COMP;
|
||||
image: "new.png" COMP;
|
||||
image: "logo.png" COMP;
|
||||
image: "shine.png" COMP;
|
||||
image: "bub_over_bot.png" COMP;
|
||||
|
@ -312,6 +313,194 @@ group { name: "fileselector_layout";
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "newfile_layout";
|
||||
parts {
|
||||
part { name: "clipper";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 127 127 127 127;
|
||||
}
|
||||
description { state: "show" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "bg";
|
||||
type: RECT;
|
||||
clip_to: "clipper";
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 175;
|
||||
}
|
||||
}
|
||||
part { name: "base_frame_img";
|
||||
type: IMAGE;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
min: 600 380;
|
||||
max: 600 380;
|
||||
fixed: 1 1;
|
||||
image.normal: "menu_layout.png";
|
||||
image.border: 10 10 10 10;
|
||||
image.border_scale: 1;
|
||||
}
|
||||
}
|
||||
part { name: "shine_img";
|
||||
type: IMAGE;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
rel1 { to: "base_frame_img"; relative: 0 0; }
|
||||
rel2 { to: "base_frame_img"; relative: 1 0; }
|
||||
align: 0.5 0;
|
||||
min: 600 3;
|
||||
fixed: 1 1;
|
||||
image.normal: "shine.png";
|
||||
}
|
||||
}
|
||||
part { name: "base_frame";
|
||||
type: SPACER;
|
||||
description {
|
||||
rel1 { to: "base_frame_img"; offset: 10 10; }
|
||||
rel2 { to: "base_frame_img"; offset: -11 -11; }
|
||||
}
|
||||
}
|
||||
part { name: "title_frame";
|
||||
type: RECT;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
rel1 { to: "base_frame"; }
|
||||
rel2 { to: "base_frame"; relative: 1 0; }
|
||||
align: 0.5 0;
|
||||
min: 0 23;
|
||||
fixed: 0 1;
|
||||
color: 0 0 0 255;
|
||||
}
|
||||
}
|
||||
part { name: "title_icon";
|
||||
type: IMAGE;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
align: 0 0.5;
|
||||
min: 20 20;
|
||||
max: 20 20;
|
||||
fixed: 1 1;
|
||||
rel1.to: "title_frame";
|
||||
rel2.to: "title_frame";
|
||||
image.normal: "new.png";
|
||||
}
|
||||
}
|
||||
part { name: "elm.text.title";
|
||||
type: TEXT;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
effect: GLOW;
|
||||
description {
|
||||
rel1.to: "title_frame";
|
||||
rel2.to: "title_frame";
|
||||
align: 0.5 0.5;
|
||||
fixed: 1 1;
|
||||
text {
|
||||
font: FN;
|
||||
size: 12;
|
||||
align: 0.5 0.5;
|
||||
min: 1 0;
|
||||
}
|
||||
color: 51 153 255 255;
|
||||
color2: 51 153 255 24;
|
||||
color3: 51 153 255 18;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.content";
|
||||
type: SWALLOW;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
rel1 { to: "title_frame"; relative: 0 1; offset: 0 5; }
|
||||
rel2 { to: "base_frame"; relative: 1 0.91; }
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.ok_btn";
|
||||
type: SWALLOW;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
align: 1 1;
|
||||
min: 50 25;
|
||||
fixed: 1 1;
|
||||
rel1.to: "base_frame";
|
||||
rel1.relative: 0.5 1;
|
||||
rel2.to: "base_frame";
|
||||
rel2.relative: 0.5 1;
|
||||
rel2.offset: -2 -1;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.cancel_btn";
|
||||
type: SWALLOW;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
align: 0 1;
|
||||
min: 50 25;
|
||||
fixed: 1 1;
|
||||
rel1.to: "base_frame";
|
||||
rel1.relative: 0.5 1;
|
||||
rel1.offset: 1 0;
|
||||
rel2.to: "base_frame";
|
||||
rel2.relative: 0.5 1;
|
||||
}
|
||||
}
|
||||
part { name: "event_blocker";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "hide" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "over_img";
|
||||
type: IMAGE;
|
||||
scale: 1;
|
||||
clip_to: "clipper";
|
||||
mouse_events: 0;
|
||||
description {
|
||||
rel1 { to: "base_frame_img"; relative: 0 0; }
|
||||
rel2 { to: "base_frame_img"; relative: 1 1; }
|
||||
image.normal: "bub_over_bot.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "load";
|
||||
signal: "load";
|
||||
action: STATE_SET "show" 0.0;
|
||||
transition: "DECELERATE" 0.5;
|
||||
target: "clipper";
|
||||
after: "event_blocker_hide";
|
||||
}
|
||||
program { name: "dismiss";
|
||||
signal: "elm,state,dismiss";
|
||||
source: "";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "clipper";
|
||||
target: "event_blocker";
|
||||
after: "dismiss_done";
|
||||
}
|
||||
program { name: "event_blocker_hide";
|
||||
signal: "elm,state,event_blocker,hide";
|
||||
source: "";
|
||||
action: STATE_SET "hide" 0.0;
|
||||
target: "event_blocker";
|
||||
}
|
||||
program { name: "dismiss_done";
|
||||
action: SIGNAL_EMIT "elm,state,dismiss,done" "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "warning_layout";
|
||||
parts {
|
||||
part { name: "clipper";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <Elementary.h>
|
||||
#include "common.h"
|
||||
|
||||
const char *PROTO_EDC_PATH = "/tmp/.proto.edc";
|
||||
const char *DEFAULT_EDC_PATH = "/tmp/enventor.edc";
|
||||
char EDJE_PATH[PATH_MAX];
|
||||
|
|
|
@ -34,9 +34,9 @@ edc_changed_cb(void *data, int type EINA_UNUSED, void *event)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
edc_proto_setup()
|
||||
edc_default_setup()
|
||||
{
|
||||
newfile_new(NULL, EINA_TRUE);
|
||||
newfile_default_set();
|
||||
build_edc();
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -442,7 +442,7 @@ args_dispatch(int argc, char **argv, char *edc_path, char *img_path,
|
|||
}
|
||||
|
||||
defaults:
|
||||
if (default_edc) sprintf(edc_path, "%s", PROTO_EDC_PATH);
|
||||
if (default_edc) sprintf(edc_path, "%s", DEFAULT_EDC_PATH);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -519,7 +519,7 @@ init(app_data *ad, int argc, char **argv)
|
|||
config_data_set(ad, argc, argv);
|
||||
|
||||
if (!build_init()) return EINA_FALSE;
|
||||
if (!edc_proto_setup()) return EINA_FALSE;
|
||||
if (!edc_default_setup()) return EINA_FALSE;
|
||||
if (!base_gui_init()) return EINA_FALSE;
|
||||
|
||||
edj_mgr_set();
|
||||
|
|
104
src/bin/menu.c
104
src/bin/menu.c
|
@ -4,6 +4,7 @@
|
|||
struct menu_s
|
||||
{
|
||||
Evas_Object *menu_layout;
|
||||
Evas_Object *newfile_layout;
|
||||
Evas_Object *setting_layout;
|
||||
Evas_Object *warning_layout;
|
||||
Evas_Object *fileselector_layout;
|
||||
|
@ -46,6 +47,13 @@ fileselector_close()
|
|||
elm_object_signal_emit(md->fileselector_layout, "elm,state,dismiss", "");
|
||||
}
|
||||
|
||||
static void
|
||||
newfile_close()
|
||||
{
|
||||
menu_data *md = g_md;
|
||||
elm_object_signal_emit(md->newfile_layout, "elm,state,dismiss", "");
|
||||
}
|
||||
|
||||
static void
|
||||
about_close()
|
||||
{
|
||||
|
@ -75,6 +83,22 @@ menu_close()
|
|||
elm_object_signal_emit(md->menu_layout, "elm,state,dismiss", "");
|
||||
}
|
||||
|
||||
static void
|
||||
newfile_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
const char *emission EINA_UNUSED,
|
||||
const char *source EINA_UNUSED)
|
||||
{
|
||||
menu_data *md = data;
|
||||
evas_object_del(md->newfile_layout);
|
||||
md->newfile_layout = NULL;
|
||||
md->open_depth--;
|
||||
if (md->menu_layout)
|
||||
{
|
||||
elm_object_disabled_set(md->menu_layout, EINA_FALSE);
|
||||
elm_object_focus_set(md->menu_layout, EINA_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fileselector_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
const char *emission EINA_UNUSED,
|
||||
|
@ -145,8 +169,61 @@ warning_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
static void
|
||||
warning_open(menu_data *md, Evas_Smart_Cb yes_cb,
|
||||
Evas_Smart_Cb save_cb)
|
||||
newfile_ok_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
menu_data *md = data;
|
||||
newfile_set(md->ed);
|
||||
newfile_close(md);
|
||||
menu_close(md);
|
||||
}
|
||||
|
||||
static void
|
||||
newfile_cancel_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
menu_data *md = data;
|
||||
newfile_close(md);
|
||||
}
|
||||
|
||||
void
|
||||
newfile_open(menu_data *md)
|
||||
{
|
||||
if (md->newfile_layout) return;
|
||||
|
||||
Evas_Object *layout = elm_layout_add(base_win_get());
|
||||
elm_layout_file_set(layout, EDJE_PATH, "newfile_layout");
|
||||
elm_object_part_text_set(layout, "elm.text.title", "New File: choose a template.");
|
||||
elm_object_signal_callback_add(layout, "elm,state,dismiss,done", "",
|
||||
newfile_dismiss_done, md);
|
||||
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_show(layout);
|
||||
base_win_resize_object_add(layout);
|
||||
|
||||
elm_object_part_content_set(layout, "elm.swallow.content",
|
||||
newfile_create(layout));
|
||||
Evas_Object *btn;
|
||||
|
||||
//Ok Button
|
||||
btn = elm_button_add(layout);
|
||||
elm_object_text_set(btn, "Ok");
|
||||
evas_object_smart_callback_add(btn, "clicked", newfile_ok_btn_cb, md);
|
||||
elm_object_part_content_set(layout, "elm.swallow.ok_btn", btn);
|
||||
|
||||
//Cancel Button
|
||||
btn = elm_button_add(layout);
|
||||
elm_object_text_set(btn, "Cancel");
|
||||
evas_object_smart_callback_add(btn, "clicked", newfile_cancel_btn_cb, md);
|
||||
elm_object_part_content_set(layout, "elm.swallow.cancel_btn", btn);
|
||||
|
||||
if (md->menu_layout) elm_object_disabled_set(md->menu_layout, EINA_TRUE);
|
||||
|
||||
md->newfile_layout = layout;
|
||||
md->open_depth++;
|
||||
}
|
||||
|
||||
static void
|
||||
warning_open(menu_data *md, Evas_Smart_Cb yes_cb, Evas_Smart_Cb save_cb)
|
||||
{
|
||||
if (md->warning_layout) return;
|
||||
|
||||
|
@ -603,7 +680,7 @@ new_yes_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
menu_data *md = data;
|
||||
newfile_new(md->ed, EINA_FALSE);
|
||||
newfile_open(md);
|
||||
warning_close(md);
|
||||
menu_close(md);
|
||||
}
|
||||
|
@ -674,7 +751,7 @@ new_save_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
menu_data *md = data;
|
||||
|
||||
edit_save(md->ed);
|
||||
newfile_new(md->ed, EINA_FALSE);
|
||||
newfile_open(md);
|
||||
warning_close(md);
|
||||
menu_close(md);
|
||||
}
|
||||
|
@ -1003,20 +1080,14 @@ menu_setting()
|
|||
setting_open(md);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
void
|
||||
menu_edc_new()
|
||||
{
|
||||
menu_data *md = g_md;
|
||||
if (edit_changed_get(md->ed))
|
||||
{
|
||||
warning_open(md, new_yes_btn_cb, new_save_btn_cb);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
newfile_new(md->ed, EINA_FALSE);
|
||||
menu_close(md);
|
||||
|
||||
return EINA_FALSE;
|
||||
warning_open(md, new_yes_btn_cb, new_save_btn_cb);
|
||||
else
|
||||
newfile_open(md);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1051,6 +1122,11 @@ menu_toggle()
|
|||
warning_close(md);
|
||||
return;
|
||||
}
|
||||
if (md->newfile_layout)
|
||||
{
|
||||
newfile_close(md);
|
||||
return;
|
||||
}
|
||||
if (md->fileselector_layout)
|
||||
{
|
||||
fileselector_close(md);
|
||||
|
|
|
@ -1,21 +1,54 @@
|
|||
#include <Elementary.h>
|
||||
#include "common.h"
|
||||
|
||||
typedef struct new_data_s {
|
||||
Evas_Object *list;
|
||||
Eina_List *templates;
|
||||
} new_data;
|
||||
|
||||
static new_data *g_nd = NULL;
|
||||
|
||||
static void
|
||||
list_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
new_data *nd = g_nd;
|
||||
free(g_nd);
|
||||
g_nd = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
newfile_new(edit_data *ed, Eina_Bool init)
|
||||
newfile_set(edit_data *ed)
|
||||
{
|
||||
new_data *nd = g_nd;
|
||||
if (!nd) return;
|
||||
|
||||
Elm_Object_Item *it = elm_list_selected_item_get(nd->list);
|
||||
if (!it) return;
|
||||
|
||||
Eina_Bool success = EINA_TRUE;
|
||||
char buf[PATH_MAX];
|
||||
snprintf(buf, sizeof(buf), "%s/templates/%s.edc",
|
||||
elm_app_data_dir_get(), elm_object_item_text_get(it));
|
||||
config_edc_path_set(DEFAULT_EDC_PATH);
|
||||
success = eina_file_copy(buf, config_edc_path_get(),
|
||||
EINA_FILE_COPY_DATA, NULL, NULL);
|
||||
if (!success)
|
||||
{
|
||||
EINA_LOG_ERR("Cannot find file! \"%s\"", buf);
|
||||
return;
|
||||
}
|
||||
edit_edc_reload(ed, DEFAULT_EDC_PATH);
|
||||
}
|
||||
|
||||
void
|
||||
newfile_default_set()
|
||||
{
|
||||
Eina_Bool success = EINA_TRUE;
|
||||
char buf[PATH_MAX];
|
||||
snprintf(buf, sizeof(buf), "%s/.proto/proto.edc",
|
||||
snprintf(buf, sizeof(buf), "%s/templates/basic.edc",
|
||||
elm_app_data_dir_get());
|
||||
if (!init)
|
||||
{
|
||||
config_edc_path_set(PROTO_EDC_PATH);
|
||||
success = eina_file_copy(buf, config_edc_path_get(),
|
||||
EINA_FILE_COPY_DATA, NULL, NULL);
|
||||
}
|
||||
else if (!ecore_file_exists(config_edc_path_get()))
|
||||
if (!ecore_file_exists(config_edc_path_get()))
|
||||
{
|
||||
success = eina_file_copy(buf,config_edc_path_get(),
|
||||
EINA_FILE_COPY_DATA, NULL, NULL);
|
||||
|
@ -25,6 +58,105 @@ newfile_new(edit_data *ed, Eina_Bool init)
|
|||
EINA_LOG_ERR("Cannot find file! \"%s\"", buf);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!init) edit_edc_reload(ed, PROTO_EDC_PATH);
|
||||
}
|
||||
|
||||
static void
|
||||
file_dir_list_cb(const char *name, const char *path, void *data)
|
||||
{
|
||||
new_data *nd = data;
|
||||
|
||||
char *ext = strrchr(name, '.');
|
||||
if (!ext || strcmp(ext, ".edc")) return;
|
||||
|
||||
char *file_name = ecore_file_strip_ext(name);
|
||||
nd->templates = eina_list_append(nd->templates,
|
||||
eina_stringshare_add(file_name));
|
||||
free(file_name);
|
||||
}
|
||||
|
||||
static void
|
||||
list_item_selected_cb(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *layout = data;
|
||||
Elm_Object_Item *it = event_info;
|
||||
|
||||
char buf[PATH_MAX];
|
||||
snprintf(buf, sizeof(buf), "%s/templates/%s.edj", elm_app_data_dir_get(),
|
||||
elm_object_item_text_get(it));
|
||||
|
||||
elm_layout_file_set(layout, buf, "main");
|
||||
}
|
||||
|
||||
static void
|
||||
templates_get(new_data *nd)
|
||||
{
|
||||
Eina_Iterator *itr;
|
||||
|
||||
char buf[PATH_MAX];
|
||||
snprintf(buf, sizeof(buf), "%s/templates", elm_app_data_dir_get());
|
||||
|
||||
if (!ecore_file_path_dir_exists(buf))
|
||||
{
|
||||
EINA_LOG_ERR("Cannot find templates folder! \"%s\"", buf);
|
||||
return;
|
||||
}
|
||||
|
||||
eina_file_dir_list(buf, EINA_FALSE, file_dir_list_cb, nd);
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
newfile_create(Evas_Object *parent)
|
||||
{
|
||||
new_data *nd = g_nd;
|
||||
if (!nd)
|
||||
{
|
||||
nd = calloc(1, sizeof(new_data));
|
||||
g_nd = nd;
|
||||
}
|
||||
|
||||
//Grid
|
||||
Evas_Object *grid = elm_grid_add(parent);
|
||||
|
||||
//Preview Layout
|
||||
Evas_Object *layout = elm_layout_add(grid);
|
||||
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_show(layout);
|
||||
|
||||
elm_grid_pack(grid, layout, 2, 2, 46, 98);
|
||||
|
||||
templates_get(nd);
|
||||
|
||||
//List
|
||||
Evas_Object *list = elm_list_add(grid);
|
||||
elm_object_focus_set(list, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
||||
Eina_List *l;
|
||||
Eina_Stringshare *name;
|
||||
Elm_Object_Item *it;
|
||||
Eina_Bool first_item = EINA_TRUE;
|
||||
|
||||
EINA_LIST_REVERSE_FOREACH(nd->templates, l, name)
|
||||
{
|
||||
it = elm_list_item_append(list, name, NULL, NULL, list_item_selected_cb,
|
||||
layout);
|
||||
if (first_item)
|
||||
{
|
||||
elm_list_item_selected_set(it, EINA_TRUE);
|
||||
first_item = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
evas_object_event_callback_add(list, EVAS_CALLBACK_DEL, list_del_cb, NULL);
|
||||
evas_object_show(list);
|
||||
|
||||
elm_grid_pack(grid, list, 50, 0, 50, 100);
|
||||
|
||||
EINA_LIST_FREE(nd->templates, name)
|
||||
eina_stringshare_del(name);
|
||||
|
||||
nd->list = list;
|
||||
|
||||
return grid;
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
extern const char *PROTO_EDC_PATH;
|
||||
extern const char *DEFAULT_EDC_PATH;
|
||||
extern char EDJE_PATH[PATH_MAX];
|
||||
|
|
|
@ -3,7 +3,7 @@ void menu_term();
|
|||
void menu_toggle();
|
||||
void menu_ctxpopup_register(Evas_Object *ctxpopup);
|
||||
void menu_ctxpopup_unregister(Evas_Object *ctxpopup);
|
||||
Eina_Bool menu_edc_new();
|
||||
void menu_edc_new();
|
||||
void menu_edc_save();
|
||||
void menu_edc_load();
|
||||
void menu_exit();
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
void newfile_new(edit_data *ed, Eina_Bool init);
|
||||
void newfile_default_set();
|
||||
void newfile_set(edit_data *ed);
|
||||
Evas_Object * newfile_create(Evas_Object *parent);
|
||||
|
|
Loading…
Reference in New Issue