forked from enlightenment/enventor
tools: Make tool tabs scrollable
Summary: when some menu is hidden, it's scrollable. Test Plan: 1. run enventor 2. reduce enventor window size 3. scroll tool tabs Reviewers: Jaehyun_Cho, Hermet Differential Revision: https://phab.enlightenment.org/D4418
This commit is contained in:
parent
fc6f5d8d24
commit
0c47afc9a8
|
@ -2597,574 +2597,6 @@ group { "tools_layout";
|
|||
}
|
||||
}
|
||||
|
||||
group { "live_view_tools_layout";
|
||||
parts {
|
||||
spacer { "padding1";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 14 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.highlight";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding1";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding1";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding2";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.highlight";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.highlight";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.dummy";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding2";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding2";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding3";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.dummy";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.dummy";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.wireframes";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding3";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding3";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding_outline";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.wireframes";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.wireframes";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.mirror";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding_outline";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding_outline";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding4";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.mirror";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.mirror";
|
||||
min: 14 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
rect { "separator";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding4";
|
||||
relative: 1.0 0.5;
|
||||
}
|
||||
rel2 {
|
||||
to_x: "padding4";
|
||||
relative: 1.0 0.5;
|
||||
}
|
||||
min: 1 18;
|
||||
fixed: 1 1;
|
||||
align: 0.0 0.5;
|
||||
color: 48 48 48 255;
|
||||
}
|
||||
}
|
||||
spacer { "padding5";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "separator";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "separator";
|
||||
min: 14 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.live_edit1";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding5";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding5";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding6";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.live_edit1";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.live_edit1";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.live_edit2";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding6";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding6";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding7";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.live_edit2";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.live_edit2";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.live_edit3";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding7";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding7";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding8";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.live_edit3";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.live_edit3";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.live_edit4";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding8";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding8";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding9";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.live_edit4";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.live_edit4";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.live_edit5";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding9";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding9";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding10";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.live_edit5";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.live_edit5";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.live_edit6";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "padding10";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "padding10";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { "text_editor_tools_layout";
|
||||
parts {
|
||||
spacer { "base";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
min: 334 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding1";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "base";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 14 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.save";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding1";
|
||||
rel1.relative: 1.0 0.0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding2";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.save";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.undo";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding2";
|
||||
rel1.relative: 1.0 0.0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding3";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.undo";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.redo";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding3";
|
||||
rel1.relative: 1.0 0.0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding4";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.redo";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.find";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding4";
|
||||
rel1.relative: 1.0 0.0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding5";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.find";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.goto";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding5";
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel2.to_x: "padding5";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding6";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.goto";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.lines";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding6";
|
||||
rel1.relative: 1.0 0.0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding7";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.lines";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.template";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding7";
|
||||
rel1.relative: 1.0 0.0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding8";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "base";
|
||||
rel1.relative: 1.0 0.0;
|
||||
min: 14 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.menu";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding8";
|
||||
rel2.relative: 0.0 1.0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding9";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.menu";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 14 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
rect { "separator";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding9";
|
||||
rel1.relative: 0.0 0.5;
|
||||
rel2.relative: 0.0 0.5;
|
||||
min: 1 18;
|
||||
fixed: 1 1;
|
||||
align: 1.0 0.5;
|
||||
color: 48 48 48 255;
|
||||
}
|
||||
}
|
||||
spacer { "padding10";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "separator";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.file_tab";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding10";
|
||||
rel2.relative: 0.0 1.0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding11";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.file_tab";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.edc_navigator";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding11";
|
||||
rel2.relative: 0.0 1.0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding12";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.edc_navigator";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.file_browser";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to_x: "padding12";
|
||||
rel2.relative: 0.0 1.0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding13";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.file_browser";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.console";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding13";
|
||||
rel2.relative: 0.0 1.0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
spacer { "padding14";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.console";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
rect { "separator2";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding14";
|
||||
rel1.relative: 0.0 0.5;
|
||||
rel2.relative: 0.0 0.5;
|
||||
min: 1 18;
|
||||
fixed: 1 1;
|
||||
align: 1.0 0.5;
|
||||
color: 48 48 48 255;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
group { "rel_to_layout";
|
||||
parts {
|
||||
spacer { "base";
|
||||
|
|
192
src/bin/tools.c
192
src/bin/tools.c
|
@ -154,6 +154,30 @@ undo_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
stats_info_msg_update(_("No text to be undo."));
|
||||
}
|
||||
|
||||
static void
|
||||
tools_separator_insert(Evas_Object *box)
|
||||
{
|
||||
Evas_Object *separator = evas_object_rectangle_add(evas_object_evas_get(box));
|
||||
evas_object_color_set(separator, 48, 48, 48, 255);
|
||||
evas_object_size_hint_weight_set(separator, 0.0, 0.0);
|
||||
evas_object_size_hint_align_set(separator, 0.0, 0.5);
|
||||
evas_object_size_hint_min_set(separator, 1, 20);
|
||||
elm_box_pack_end(box, separator);
|
||||
evas_object_show(separator);
|
||||
}
|
||||
|
||||
static void
|
||||
tools_space_insert(Evas_Object *box, int size)
|
||||
{
|
||||
Evas_Object *space = evas_object_rectangle_add(evas_object_evas_get(box));
|
||||
evas_object_color_set(space, 0, 0, 0, 0);
|
||||
evas_object_size_hint_weight_set(space, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(space, 0.0, EVAS_HINT_FILL);
|
||||
evas_object_size_hint_min_set(space, size, 0);
|
||||
elm_box_pack_end(box, space);
|
||||
evas_object_show(space);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
tools_btn_create(Evas_Object *parent, const char *icon,
|
||||
const char *tooltip_msg, Evas_Smart_Cb func)
|
||||
|
@ -197,136 +221,186 @@ tools_init(Evas_Object *parent)
|
|||
g_td = td;
|
||||
|
||||
//Live view tools
|
||||
Evas_Object *live_view_ly = elm_layout_add(parent);
|
||||
elm_layout_file_set(live_view_ly, EDJE_PATH, "live_view_tools_layout");
|
||||
evas_object_size_hint_weight_set(live_view_ly, EVAS_HINT_EXPAND,
|
||||
Evas_Object *live_view_scr = elm_scroller_add(parent);
|
||||
evas_object_size_hint_weight_set(live_view_scr, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(live_view_ly, EVAS_HINT_FILL,
|
||||
evas_object_size_hint_align_set(live_view_scr, EVAS_HINT_FILL,
|
||||
EVAS_HINT_FILL);
|
||||
elm_scroller_bounce_set(live_view_scr, EINA_FALSE, EINA_FALSE);
|
||||
elm_scroller_policy_set(live_view_scr, ELM_SCROLLER_POLICY_OFF,
|
||||
ELM_SCROLLER_POLICY_OFF);
|
||||
evas_object_show(live_view_scr);
|
||||
|
||||
Evas_Object *box = elm_box_add(live_view_scr);
|
||||
elm_box_horizontal_set(box, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(box, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(box, 0.0, EVAS_HINT_FILL);
|
||||
elm_object_content_set(live_view_scr, box);
|
||||
evas_object_show(box);
|
||||
|
||||
tools_space_insert(box, 14);
|
||||
Evas_Object *btn;
|
||||
btn = tools_btn_create(live_view_ly, "highlight",
|
||||
btn = tools_btn_create(box, "highlight",
|
||||
_("Part highlighting (Ctrl + H)<br>"
|
||||
"Show a highlight effect on the selected part<br>"
|
||||
"in the live view."),
|
||||
highlight_cb);
|
||||
elm_object_tooltip_orient_set(btn, ELM_TOOLTIP_ORIENT_BOTTOM_RIGHT);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(live_view_ly, "elm.swallow.highlight", btn);
|
||||
evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
td->highlight_btn = btn;
|
||||
|
||||
btn = tools_btn_create(live_view_ly, "dummy",
|
||||
tools_space_insert(box, 8);
|
||||
btn = tools_btn_create(box, "dummy",
|
||||
_("Dummy parts (Ctrl + U)<br>"
|
||||
"Display virtual images for the swallow and<br>"
|
||||
"spacer parts."),
|
||||
dummy_cb);
|
||||
elm_object_tooltip_orient_set(btn, ELM_TOOLTIP_ORIENT_BOTTOM_RIGHT);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(live_view_ly, "elm.swallow.dummy", btn);
|
||||
evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
td->swallow_btn = btn;
|
||||
|
||||
btn = tools_btn_create(live_view_ly, "wireframes_icon",
|
||||
tools_space_insert(box, 8);
|
||||
btn = tools_btn_create(box, "wireframes_icon",
|
||||
_("Wireframes (Ctrl + W)<br>"
|
||||
"Display wireframes to identify the parts<br>"
|
||||
"boundaries."),
|
||||
wireframes_cb);
|
||||
elm_object_tooltip_orient_set(btn, ELM_TOOLTIP_ORIENT_BOTTOM_RIGHT);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(live_view_ly, "elm.swallow.wireframes", btn);
|
||||
evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
td->wireframes_btn = btn;
|
||||
|
||||
btn = tools_btn_create(live_view_ly, "mirror",
|
||||
tools_space_insert(box, 8);
|
||||
btn = tools_btn_create(box, "mirror",
|
||||
_("Mirror mode (Ctrl + M)<br>"
|
||||
"Invert the layout horizontally and review<br>"
|
||||
"the designed layout in RTL(right-to-left)<br>"
|
||||
"LTR(left-to-right) settings."),
|
||||
mirror_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(live_view_ly, "elm.swallow.mirror", btn);
|
||||
evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
td->mirror_btn = btn;
|
||||
|
||||
tools_space_insert(box, 14);
|
||||
tools_separator_insert(box);
|
||||
tools_space_insert(box, 14);
|
||||
//Live edit tools
|
||||
Eina_List *btn_list = live_edit_tools_create(live_view_ly);
|
||||
Eina_List *btn_list = live_edit_tools_create(box);
|
||||
Eina_List *l = NULL;
|
||||
int i = 1;
|
||||
EINA_LIST_FOREACH(btn_list, l, btn)
|
||||
{
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 1.0, EVAS_HINT_FILL);
|
||||
|
||||
char swallow_part[32];
|
||||
snprintf(swallow_part, sizeof(swallow_part), "elm.swallow.live_edit%d",
|
||||
i);
|
||||
elm_object_part_content_set(live_view_ly, swallow_part, btn);
|
||||
elm_box_pack_end(box, btn);
|
||||
tools_space_insert(box, 8);
|
||||
i++;
|
||||
}
|
||||
eina_list_free(btn_list);
|
||||
|
||||
td->live_view_ly = live_view_ly;
|
||||
td->live_view_ly = live_view_scr;
|
||||
|
||||
//Text editor tools
|
||||
Evas_Object *text_editor_ly = elm_layout_add(parent);
|
||||
elm_layout_file_set(text_editor_ly, EDJE_PATH, "text_editor_tools_layout");
|
||||
evas_object_size_hint_weight_set(text_editor_ly, EVAS_HINT_EXPAND,
|
||||
Evas_Object *text_editor_scr = elm_scroller_add(parent);
|
||||
evas_object_size_hint_weight_set(text_editor_scr, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(text_editor_ly, EVAS_HINT_FILL,
|
||||
evas_object_size_hint_align_set(text_editor_scr, EVAS_HINT_FILL,
|
||||
EVAS_HINT_FILL);
|
||||
elm_scroller_bounce_set(text_editor_scr, EINA_FALSE, EINA_FALSE);
|
||||
elm_scroller_policy_set(text_editor_scr, ELM_SCROLLER_POLICY_OFF,
|
||||
ELM_SCROLLER_POLICY_OFF);
|
||||
evas_object_show(text_editor_scr);
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "save",
|
||||
box = elm_box_add(text_editor_scr);
|
||||
elm_box_horizontal_set(box, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_content_set(text_editor_scr, box);
|
||||
|
||||
Evas_Object *box_left = elm_box_add(box);
|
||||
elm_box_horizontal_set(box_left, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(box_left, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(box_left, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, box_left);
|
||||
evas_object_show(box_left);
|
||||
|
||||
Evas_Object *box_right = elm_box_add(box);
|
||||
elm_box_horizontal_set(box_right, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(box_right, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(box_right, 1.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, box_right);
|
||||
evas_object_show(box_right);
|
||||
|
||||
tools_space_insert(box_left, 14);
|
||||
btn = tools_btn_create(box_left, "save",
|
||||
_("Save the file (Ctrl + S)<br>"
|
||||
"Save the current script to a file."),
|
||||
save_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.save", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "undo",
|
||||
tools_space_insert(box_left, 8);
|
||||
btn = tools_btn_create(box_left, "undo",
|
||||
_("Undo text (Ctrl + Z)"),
|
||||
undo_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.undo", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "redo",
|
||||
tools_space_insert(box_left, 8);
|
||||
btn = tools_btn_create(box_left, "redo",
|
||||
_("Redo text (Ctrl + R)"),
|
||||
redo_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.redo", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "find",
|
||||
tools_space_insert(box_left, 8);
|
||||
btn = tools_btn_create(box_left, "find",
|
||||
_("Find/Replace (Ctrl + F)<br>"
|
||||
"Find or replace text."),
|
||||
find_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.find", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
td->find_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "goto",
|
||||
tools_space_insert(box_left, 8);
|
||||
btn = tools_btn_create(box_left, "goto",
|
||||
_("Go to line (Ctrl + L)<br>"
|
||||
"Open the Go to window to move the cursor<br>"
|
||||
"line position."),
|
||||
goto_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.goto", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
td->goto_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "lines",
|
||||
tools_space_insert(box_left, 8);
|
||||
btn = tools_btn_create(box_left, "lines",
|
||||
_("Line numbers<br>"
|
||||
"Display the script line numbers."),
|
||||
lines_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.lines", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
td->lines_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "template",
|
||||
tools_space_insert(box_left, 8);
|
||||
btn = tools_btn_create(box_left, "template",
|
||||
_("Insert a code snippet (Ctrl + T)<br>"
|
||||
"Enventor chooses the best code with regards<br>"
|
||||
"to the current editing context. For instance,<br>"
|
||||
|
@ -335,10 +409,12 @@ tools_init(Evas_Object *parent)
|
|||
template_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.template", btn);
|
||||
elm_box_pack_end(box_left, btn);
|
||||
td->template_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "console",
|
||||
tools_separator_insert(box_right);
|
||||
tools_space_insert(box_right, 8);
|
||||
btn = tools_btn_create(box_right, "console",
|
||||
_("Console box (Alt + Down)<br>"
|
||||
"Display the console box, which shows the EDC<br>"
|
||||
"build logs, such as error messages. It pops<br>"
|
||||
|
@ -346,20 +422,22 @@ tools_init(Evas_Object *parent)
|
|||
console_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.console", btn);
|
||||
elm_box_pack_end(box_right, btn);
|
||||
td->console_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "file_browser",
|
||||
tools_space_insert(box_right, 8);
|
||||
btn = tools_btn_create(box_right, "file_browser",
|
||||
_("File browser (F9)<br>"
|
||||
"Display the file browser, which shows a file list<br>"
|
||||
"in current workspace."),
|
||||
file_browser_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.file_browser", btn);
|
||||
elm_box_pack_end(box_right, btn);
|
||||
td->file_browser_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "edc_navigator",
|
||||
tools_space_insert(box_right, 8);
|
||||
btn = tools_btn_create(box_right, "edc_navigator",
|
||||
_("EDC navigator (F10)<br>"
|
||||
"Display the EDC navigator, which shows the current<br>"
|
||||
"group hierarchy tree that contains parts,<br>"
|
||||
|
@ -367,11 +445,11 @@ tools_init(Evas_Object *parent)
|
|||
edc_navigator_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.edc_navigator",
|
||||
btn);
|
||||
elm_box_pack_end(box_right, btn);
|
||||
td->edc_navigator_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "filetab",
|
||||
tools_space_insert(box_right, 8);
|
||||
btn = tools_btn_create(box_right, "filetab",
|
||||
_("File tab (F11)<br>"
|
||||
"Display the file tab in the bottom area<br>"
|
||||
"It shows an opened file list to switch<br>"
|
||||
|
@ -379,20 +457,24 @@ tools_init(Evas_Object *parent)
|
|||
file_tab_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.file_tab", btn);
|
||||
elm_box_pack_end(box_right, btn);
|
||||
td->file_tab = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "menu",
|
||||
tools_space_insert(box_right, 8);
|
||||
tools_separator_insert(box_right);
|
||||
tools_space_insert(box_right, 14);
|
||||
btn = tools_btn_create(box_right, "menu",
|
||||
_("Enventor menu (Esc)<br>"
|
||||
"Open the Enventor main menu."),
|
||||
menu_cb);
|
||||
elm_object_tooltip_orient_set(btn, ELM_TOOLTIP_ORIENT_BOTTOM_LEFT);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.menu", btn);
|
||||
elm_box_pack_end(box_right, btn);
|
||||
td->menu_btn = btn;
|
||||
|
||||
td->text_editor_ly = text_editor_ly;
|
||||
tools_space_insert(box_right, 14);
|
||||
td->text_editor_ly = text_editor_scr;
|
||||
|
||||
//Turn on if console is valid size.
|
||||
if (!config_console_get() && (config_console_size_get() > 0))
|
||||
|
|
Loading…
Reference in New Issue