forked from enlightenment/enventor
bin/tools: add button - redo, undo.
This commit is contained in:
parent
94fb905d65
commit
f7b15998d8
|
@ -10,6 +10,8 @@ images {
|
|||
image: "swallow_s.png" COMP;
|
||||
image: "goto.png" COMP;
|
||||
image: "save.png" COMP;
|
||||
image: "redo.png" COMP;
|
||||
image: "undo.png" COMP;
|
||||
image: "live_image.png" COMP;
|
||||
image: "live_rectangle.png" COMP;
|
||||
image: "live_swallow.png" COMP;
|
||||
|
@ -151,6 +153,28 @@ group { name: "save";
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "undo";
|
||||
parts {
|
||||
part { name: "img";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "undo.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "redo";
|
||||
parts {
|
||||
part { name: "img";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "redo.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define ADD_LIVE_EDIT_ICON_GROUP(_group_name, _image_path) \
|
||||
group { name: _group_name; \
|
||||
parts { \
|
||||
|
|
|
@ -65,4 +65,6 @@ EXTRA_DIST = \
|
|||
new.png \
|
||||
slider_up.png \
|
||||
slider_down.png \
|
||||
save.png
|
||||
save.png \
|
||||
redo.png \
|
||||
undo.png
|
||||
|
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
@ -100,6 +100,28 @@ save_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
file_mgr_edc_save();
|
||||
}
|
||||
|
||||
static void
|
||||
redo_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *enventor = data;
|
||||
if (enventor_object_redo(enventor))
|
||||
stats_info_msg_update("Redo text.");
|
||||
else
|
||||
stats_info_msg_update("No text to be redo.");
|
||||
}
|
||||
|
||||
static void
|
||||
undo_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *enventor = data;
|
||||
if (enventor_object_undo(enventor))
|
||||
stats_info_msg_update("Undo text.");
|
||||
else
|
||||
stats_info_msg_update("No text to be undo.");
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
tools_btn_create(Evas_Object *parent, const char *icon,
|
||||
const char *tooltip_msg, Evas_Smart_Cb func, void *data)
|
||||
|
@ -149,6 +171,18 @@ tools_create(Evas_Object *parent, Evas_Object *enventor)
|
|||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
|
||||
btn = tools_btn_create(box, "undo", "Undo Text (Ctrl + Z)",
|
||||
undo_cb, enventor);
|
||||
evas_object_size_hint_weight_set(btn, 0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
|
||||
btn = tools_btn_create(box, "redo", "Redo Text (Ctrl + R)",
|
||||
redo_cb, enventor);
|
||||
evas_object_size_hint_weight_set(btn, 0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, btn);
|
||||
|
||||
btn = tools_btn_create(box, "find", "Find/Replace (Ctrl + F)",
|
||||
find_cb, enventor);
|
||||
evas_object_size_hint_weight_set(btn, 0, EVAS_HINT_EXPAND);
|
||||
|
|
Loading…
Reference in New Issue