main - Modified font size short cut key.

Now you can change font size by using mouse wheel.

If the cursor is on the edje view, the view scale will be changed,
if the cursor on the editor, on the other hand, the font size will be changed.
This commit is contained in:
ChunEon Park 2014-05-12 23:44:49 +09:00
parent f8595e62d2
commit b653cf3b28
2 changed files with 43 additions and 28 deletions

6
README
View File

@ -51,11 +51,9 @@ Ctrl+W = Show/Hide Dummy Swallow
Ctrl+H = On/Off Part Highlighting
Ctrl+, = Full Edit View / Split View
Ctrl+. = Full Edje View / Split View
Ctrl++ = Font Size Up
Ctrl+- = Font Size Down
Ctrl+T = Insert Defaut Template Code
Ctrl+Mouse Wheel Up = View Scale Up
Ctrl+Mouse Wheel Down = View Scale Down
Ctrl+Mouse Wheel Up = View Scale Up / Font Size Up
Ctrl+Mouse Wheel Down = View Scale Down / Font Size Down
Ctrl+Shift+B = Insert Part Template Code: Textblock
Ctrl+Shift+I = Insert Part Template Code: Image
Ctrl+Shift+R = Insert Part Template Code: Rectangle

View File

@ -179,20 +179,6 @@ ctrl_func(app_data *ad, const char *key)
auto_indentation_toggle();
return ECORE_CALLBACK_DONE;
}
//Font Size Up
if (!strcmp(key, "equal"))
{
config_font_size_set(config_font_size_get() + 0.1f);
edit_font_size_update(ad->ed, EINA_TRUE);
return ECORE_CALLBACK_DONE;
}
//Font Size Down
if (!strcmp(key, "minus"))
{
config_font_size_set(config_font_size_get() - 0.1f);
edit_font_size_update(ad->ed, EINA_TRUE);
return ECORE_CALLBACK_DONE;
}
return ECORE_CALLBACK_DONE;
}
@ -296,23 +282,54 @@ main_mouse_wheel_cb(void *data, int type EINA_UNUSED, void *ev)
{
Ecore_Event_Mouse_Wheel *event = ev;
app_data *ad = data;
Evas_Coord x, y, w, h;
if (!ad->ctrl_pressed) return ECORE_CALLBACK_PASS_ON;
//Scale up/down layout
//View Scale
view_data *vd = edj_mgr_view_get(NULL);
double scale = config_view_scale_get();
Evas_Object *view = view_obj_get(vd);
evas_object_geometry_get(view, &x, &y, &w, &h);
if (event->z < 0) scale += 0.1;
else scale -= 0.1;
if ((event->x >= x) && (event->x <= (x + w)) &&
(event->y >= y) && (event->y <= (y + h)))
{
double scale = config_view_scale_get();
config_view_scale_set(scale);
scale = config_view_scale_get();
view_scale_set(vd, scale);
if (event->z < 0) scale += 0.1;
else scale -= 0.1;
char buf[256];
snprintf(buf, sizeof(buf), "View Scale: %2.2fx", scale);
stats_info_msg_update(buf);
config_view_scale_set(scale);
scale = config_view_scale_get();
view_scale_set(vd, scale);
char buf[256];
snprintf(buf, sizeof(buf), "View Scale: %2.2fx", scale);
stats_info_msg_update(buf);
return ECORE_CALLBACK_PASS_ON;
}
//Font Size
Evas_Object *editor = edit_obj_get(ad->ed);
evas_object_geometry_get(editor, &x, &y, &w, &h);
if ((event->x >= x) && (event->x <= (x + w)) &&
(event->y >= y) && (event->y <= (y + h)))
{
if (event->z < 0)
{
config_font_size_set(config_font_size_get() + 0.1f);
edit_font_size_update(ad->ed, EINA_TRUE);
}
else
{
config_font_size_set(config_font_size_get() - 0.1f);
edit_font_size_update(ad->ed, EINA_TRUE);
}
return ECORE_CALLBACK_PASS_ON;
}
return ECORE_CALLBACK_PASS_ON;
}