hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=e90df35c2c5cfbab0fc6d79909c049e75f0cd254

commit e90df35c2c5cfbab0fc6d79909c049e75f0cd254
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Fri Feb 5 15:57:00 2016 +0900

    Improve a behavior of mouse wheel for live view.
    
    Before this change, live view won't be scaled up/down with mouse wheel
    unless the live view size was fixed.
    
    Now, it automatically fixes the size of view then change the scale of view.
---
 src/bin/main.c      | 13 +++++++++++--
 src/bin/statusbar.c |  8 +++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/bin/main.c b/src/bin/main.c
index dfdc792..b91314a 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -166,13 +166,22 @@ main_mouse_wheel_cb(void *data, int type EINA_UNUSED, 
void *ev)
      {
         double scale = config_view_scale_get();
 
-        if (event->z < 0) scale += 0.1;
-        else scale -= 0.1;
+        if (event->z < 0) scale += 0.05;
+        else scale -= 0.05;
 
         config_view_scale_set(scale);
         scale = config_view_scale_get();
         enventor_object_live_view_scale_set(ad->enventor, scale);
 
+        //Toggle on the configurable view size forcely.
+        if (!config_view_size_configurable_get())
+          {
+             config_view_size_configurable_set(EINA_TRUE);
+             Evas_Coord w, h;
+             config_view_size_get(&w, &h);
+             enventor_object_live_view_size_set(base_enventor_get(), w, h);
+          }
+
         //Just in live edit mode case.
         live_edit_update();
 
diff --git a/src/bin/statusbar.c b/src/bin/statusbar.c
index 254afdc..131b354 100644
--- a/src/bin/statusbar.c
+++ b/src/bin/statusbar.c
@@ -23,10 +23,11 @@ slider_changed_cb(void *data, Evas_Object *obj,
 
    if ((rounded - scale) > 0) rounded -= 0.05;
 
+   /* Here logic is mostly duplicated with main_mouse_wheel_cb() in main.c */
+
    config_view_scale_set(rounded);
    scale = config_view_scale_get();
    enventor_object_live_view_scale_set(base_enventor_get(), scale);
-   stats_view_scale_update(scale);
 
    //Toggle on the configurable view size forcely.
    if (!config_view_size_configurable_get())
@@ -36,6 +37,11 @@ slider_changed_cb(void *data, Evas_Object *obj,
         config_view_size_get(&w, &h);
         enventor_object_live_view_size_set(base_enventor_get(), w, h);
      }
+
+   //Just in live edit mode case.
+   live_edit_update();
+
+   stats_view_scale_update(scale);
 }
 
 static void

-- 


Reply via email to