Commit Graph

52 Commits

Author SHA1 Message Date
Mike Blumenkrantz 823b7b05cd elm: resolve float comparison warnings
Summary: Depends on D11790

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11791
2020-05-09 09:25:21 +01:00
Marcel Hollerbach 1fb7facaa5 elm_slider: create timer for hiding later
Summary:
_popup_show deletes the hide timer, hence we need to create the timer
later on, or this will not automatically hide the indicator.

Reviewers: stefan_schmidt, zmike, Jaehyun_Cho

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11679
2020-04-14 11:29:28 -04:00
junsu choi 57531de444 elm_slider: Add return value check
Summary:
Calling eina_value_get() without checking return value.
CID: 1400991

Test Plan: N/A

Reviewers: YOhoho, Hermet, Jaehyun_Cho, CHAN

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11416
2020-02-26 16:35:28 +09:00
Jaehyun Cho c8f26d9691 Revert "elm_spinner: Fixed to apply the %d format."
This reverts commit b8a24679a6.

Differential Revision: https://phab.enlightenment.org/D11394
2020-02-24 10:15:32 +01:00
Woochanlee b8a24679a6 elm_spinner: Fixed to apply the %d format.
Summary:
The part object does not apply the logic in efl_ui_format, so it does not work correctly when you format it with %d.

This is the commit that gets the necessary part of the logic of efl_ui_format.

Test Plan: elementary_test

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11378
2020-02-19 21:09:15 +09:00
Bowon Ryu eb13df21d0 slider: fix behavior of slider when mirrored
Summary:
The vertical slider(!horizontal) should not be inverted when mirrored.
This patch fixes and cleans up this.

Test Plan:
elementary_test -to slider
elementary_test -to efl.ui.slider

UI-Mirroring on/off and observe vertical slides.

Reviewers: woohyun, cedric, bu5hm4n

Reviewed By: woohyun

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10693
2019-11-19 14:04:05 +09:00
Bowon Ryu c30176e7ff slider: fix value error from step
Summary:
When the slider moves using step,
_drag_value_fetch(), _val_fetch() calculates a value from position of edje_part.
Then the calculated value is updated.
However, this causes a slight error.

This patch updates value ​​first when moving with steps.

* Test Example

```
Evas_Object *sl = elm_slider_add(bx);
elm_slider_min_max_set(sl, -5, 5);
elm_slider_value_set(sl, 0.0);
elm_slider_step_set(sl, 0.1);
evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_smart_callback_add(sl, "changed", _change_cb, NULL);
```
```
void
_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
   double val = elm_slider_value_get(obj);

   if (val == -5.0) printf("val[%f] == -5.0 \n", val);
   if (val == -4.0) printf("val[%f] == -4.0 \n", val);
   if (val == -3.0) printf("val[%f] == -3.0 \n", val);
   if (val == -2.0) printf("val[%f] == -2.0 \n", val);
   if (val == -1.0) printf("val[%f] == -1.0 \n", val);
   if (val == 0.0) printf("val[%f] == 0.0 \n", val);
   if (val == 1.0) printf("val[%f] == 1.0 \n", val);
   if (val == 2.0) printf("val[%f] == 2.0 \n", val);
   if (val == 3.0) printf("val[%f] == 3.0 \n", val);
   if (val == 4.0) printf("val[%f] == 4.0 \n", val);
   if (val == 5.0) printf("val[%f] == 5.0 \n", val);
}
```

If you move the slider using step in this test,
You can see that some logs are not visible. (Some values ​​are incorrect)

Test Plan:
elementary_test -to slider
elementary_test -to efl.ui.slider

Reviewers: woohyun, cedric, bu5hm4n

Reviewed By: woohyun, bu5hm4n

Subscribers: bu5hm4n, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10662
2019-11-18 21:25:26 +09:00
Mike Blumenkrantz 105f016fc9 elm: rename layout part aliasing functions/macros
these are internal apis for managing part aliasing on the C side,
but they apply to efl_ui_layout and not elm_layout

no functional changes

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D10090
2019-09-24 13:56:11 -07:00
WooHyun Jung ebae12f06a elm_slider: remove dependency with efl_ui_slider
Summary:
This commit includes follwoing works.

1. change parent class from EFL_UI_SLIDER_INTERVAL
  to EFL_UI_LAYOUT_BASE
2. get all necessary codes from efl_ui_slider and
   efl_ui_slider_interval to elm_slider
3. add callbacks to slider test code

ref T7893

Test Plan:
1. elementary_test
2. slider
3. operate sliders on the window

Reviewers: bu5hm4n, segfaultxavi, eagleeye, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7893

Differential Revision: https://phab.enlightenment.org/D9623
2019-08-20 09:09:14 -04:00
Carsten Haitzler ae5fbe49ef elm slider - delete timers on destruction that should be deleted
also use safe free to set to null
2019-08-18 10:28:51 +01:00
Marcel Hollerbach c0082b1c71 efl_ui_range_display: move events from spin
we concluded min,reached and max,reached should be on every widget that
implements range_display. This here is the start of that work, the
events are moved, next commit fixes all widgets, the last commits
enables tests in the spec unit test.

ref T7897
ref T7895

Differential Revision: https://phab.enlightenment.org/D9371
2019-07-31 10:18:20 +02:00
Mike Blumenkrantz 7e517e2a11 elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)

the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split

this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync

the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size

Depends on D9438

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9439
2019-07-30 13:12:52 -04:00
Shinwoo Kim a3a07f6e83 Efl.Ui.Format: fix regressions
(1) Following commit did not care of efl_ui_format_string_get(set) of
elm_slider_part_indicator_eo.c

   e776f5f Efl.Ui.Format revamp

Even though you call elm_slider_indicator_format_set with "%1.0f",
elm_slider_indicator_format_get returns NULL.

(2) The commit does not initialize format variables
   - elm_slider_indicator_format_get
   - elm_slider_unit_format_get
   - elm_progressbar_unit_format_get

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9276
2019-07-11 13:19:54 +02:00
Xavi Artigas e776f5f0d7 Efl.Ui.Format revamp
This class helps widgets which contain a numerical value and must display it,
like Progressbar (units label), Spin, Spin_Button, Slider (both units and popup
labels, in legacy), Tags (when in shrunk mode) or Calendar (year_month label).

Previously this was a mix of interface and mixin: widgets had to support setting a
formatting func, and the mixin offered support for formatting strings, by setting
an internal formatting func. On top of that, the spinner widget supported "special
values", a list of values that should be shown as certain strings instead.

This has now been simplified and unified:
Widgets including this mixin can use the formatted_value_get() method which accepts
an Eina_Value and returns a string. Thats's it.
The mixin adds three properties to the widget (format_values, format_func and
format_string) which users can use to tailor formatting. The widget does not need
to know which method has been used, it just retrieves the resulting string.
This removes a lot of duplicated widget code, and adds functionality which was
missing before. For example, all widgets support passing a list of values now.

Widgets must implement the apply_formatted_value() method so they are notified
of changes in the format and they can redraw anything they need.

Tests have been added to the Elementary Spec suite for all cases.

Legacy widgets behavior has not been modified, although a few needed some code
changes.
2019-07-04 19:38:20 +02:00
WooHyun Jung 7919ccbc29 elm_slider: fix to call legacy "delay,changed" callback
Just fixed a backward compatibility issue in elm_slider.
Now it calls "delay,changed" as it had done previously.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9130
2019-06-20 11:03:14 +02:00
Xavi Artigas 2b7d26790a Fix miscellaneous build warnings
Nothing serious, but they were driving me mad.
2019-06-19 10:19:49 +02:00
Mike Blumenkrantz 969c7f7287 efl_ui_range_display: range_min_max -> range_limits
Summary: ref T7895

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7895

Differential Revision: https://phab.enlightenment.org/D9110
2019-06-19 10:03:21 +02:00
Xavi Artigas bc98c94dc9 Efl.Ui.Slider: Rename event delay,changed to steady
Summary:
And update the docs to explain its purpose.

Related to T7893

Test Plan: Everything builds and tests pass

Reviewers: zmike, bu5hm4n

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9090
2019-06-14 12:03:32 -04:00
Mike Blumenkrantz 695dfb650a elm/slider: check for interval/range state before using that functionality
Summary:
the part elm.dragable2.slider only exists when the slider is set to range
mode, so verify that this mode is active before attempting to use that part

@fix

Depends on D8968

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8969
2019-05-29 12:29:03 -04:00
Mike Blumenkrantz 1051a1ca46 elm/slider: avoid emitting double events when range slider value changes
Summary:
in range mode, there are two slider endpoints, but only one event should be
emitted if a change is detected during update

@fix
Depends on D8967

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8968
2019-05-29 12:29:03 -04:00
Xavi Artigas 38d7d33354 Rename Efl.Ui.Direction -> Efl.Ui.Layout_Orientation
Summary:
This clarifies a bit the whole Orientation vs. Direction confusion, at the
expense of longer names (Image_Orientation vs. Layout_Orientation).
Also, the interfaces are now adjectives (Orientable) and the enums have long
names (*_Orientation).

Pretty big patch, but no functional changes.

Relates to T7863

Test Plan:
Everything builds and passes tests.
Elementary_tests show same behavior, including the "inverted" widgets, which
are the only parts which received a bit of code changes.
Proof:
https://travis-ci.org/Enlightenment/efl/builds/536277282

Reviewers: zmike, bu5hm4n, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8946
2019-05-24 12:30:32 -04:00
Mike Blumenkrantz 824e1b8109 elm_slider*: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8199
2019-03-07 14:16:20 -08:00
Mike Blumenkrantz bc0c50c507 efl.ui.widget: widget_event -> widget_input_event_handler
Summary:
ref T7553
Depends on D8081

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7553

Differential Revision: https://phab.enlightenment.org/D8082
2019-03-04 13:37:18 -05:00
Mike Blumenkrantz bb6caaa471 efl.ui: remove Efl.Ui.Theme_Apply_Error
Summary:
now that the error codes have been change to be compatible with eina_error,
this can be removed and will work through eina_error naturally

fix T7718

Depends on D8067

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7718

Differential Revision: https://phab.enlightenment.org/D8068
2019-03-04 13:37:07 -05:00
Mike Blumenkrantz 644b771fe4 efl.ui: Efl.Ui.Theme_Apply_Result -> Efl.Ui.Theme_Apply_Error
Summary:
this swaps the values of "no error" and "error" in order to maintain
consistency with the rest of efl where the zero value means "no error"
Depends on D8060

Reviewers: cedric

Reviewed By: cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_api

Differential Revision: https://phab.enlightenment.org/D8063
2019-03-04 13:36:41 -05:00
Jaehyun Cho 4f9c8d524c efl_ui_theme: Introduce Efl.Ui.Theme class
Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.

This patch fixes T7357.

Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee

Reviewed By: segfaultxavi, SanghyeonLee

Subscribers: SanghyeonLee, herdsman, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7357

Differential Revision: https://phab.enlightenment.org/D7244
2018-11-20 13:56:37 +09:00
Daniel Zaoui 84f82be847 Slider: fix callback invocation
Summary:
efl_event_callback_legacy_call already invokes legacy and non-legacy
callbacks. Therefore, there is no reason to call
efl_event_callback_call as well.

Reviewers: eagleeye, Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7237
2018-11-05 14:03:15 +09:00
Chris Michael 124703826f elementary: Check for valid resize object
Summary:
Fix an issue where elm_slider was passing NULL to eo functions due to
wd->resize_obj being NULL. Discovered via Enlightenment mixer popup
dialog

ref T7030
Depends on D6639

Reviewers: zmike

Reviewed By: zmike

Subscribers: Hermet, bu5hm4n, cedric, #committers

Tags: #efl

Maniphest Tasks: T7030

Differential Revision: https://phab.enlightenment.org/D6640
2018-07-25 14:57:52 -04:00
Bowon Ryu ddeae96421 elm_slider: add null check to avoid seg fault.
Summary: a segmentation fault occurs once the argument is not valid.

Test Plan: N/A

Reviewers: eagleeye, devilhorns, zmike

Reviewed By: eagleeye, zmike

Subscribers: #committers, cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6362
2018-06-25 06:55:57 -04:00
YeongJong Lee 55cd0f4970 efl_part: remove unnecessary default_xxx_part_get
Summary:
They can call default_xxx_part_get of layout.

ref 6e49db0739

Test Plan:
elementary_test -to button
elementary_test -to 'efl.ui.button'
elementary_test -to 'efl.ui.popup'
elementary_test -to 'progressbar'
elementary_test -to 'slider'

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #committers, herb, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6218
2018-05-28 17:32:46 +09:00
Cedric BAIL 8a513a522e efl: major rewrite of efl_part.
The interface efl_part_get should not be directly called from C, but the efl_part
wrapper should. It rely on efl_noref to properly destroy the object. Binding can
control the lifecycle of the reference the way they want by either calling the
wrapper or efl_part_get directly. It also means that the ugly ___efl_auto_unref_set
doesn't need to be exposed outside of EFL anymore.

Differential Revision: https://phab.enlightenment.org/D6098
2018-05-24 16:02:18 -07:00
Hosang Kim 5db61e4d64 efl_ui_slider: refactor slider widget.
Test Plan: elementary_test -> Efl.Ui.Slider, Efl.Ui.Slider_Interval, slider

Reviewers: woohyun, cedric, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: zmike, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5908
2018-05-15 14:16:00 +09:00
Amitesh Singh e5922c0720 elm: rename elm slider to Efl.Ui.Slider
ref T5361
2017-06-12 16:45:47 +09:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Jee-Yong Um 6d0a2398ad Elm.Widget: rename "event.*" methods to solve name conflict
Summary:
Elm.Widget.event_callback_add conflicts with Efl.Object.event_callback_add.
To solve this problem, "widget_" prefix is added to methods starting with
"event".

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4521
2017-01-03 10:59:49 +09:00
Shinwoo Kim 15687ad75d elementary: slider uses max value when atspi tries to set value.
Because double type value could be 1.00000000000000022204.
2016-12-14 20:21:50 +09:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jinyong Park 3271ec8d18 theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum

* related history : 4ca3ef4514
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.

@fix

Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4073
2016-07-01 15:09:43 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Jean-Philippe Andre 52f9220b3f Evas: Rename smart object into Efl.Canvas.Group 2016-06-17 19:32:43 +09:00
Jean-Philippe Andre 42b63f5507 Evas: Add smart_ prefix to all smart functions (eo)
This is a first step at separating legacy smart
object features away from standard efl interfaces.
2016-06-17 19:25:48 +09:00
Jean-Philippe Andre 9a052a740d Evas: Move smart_callbacks_descriptions to legacy 2016-06-17 19:25:47 +09:00
Amitesh Singh fbed817fca slider: no need to destroy & create popups again
already theme_apply() instantiates popups
2016-05-25 12:47:33 +05:30
Amitesh Singh c983b3e1e6 slider: move range as a group in theme
Most of the used cases would be slider without range, hence move
range feature to a new theme.
"elm/slider/range/../.."
2016-05-25 10:35:38 +05:30
Jean-Philippe Andre d962705e41 Elm.Layout: Protect some functions 2016-04-26 11:36:23 +09:00
Yeshwanth Reddivari ce22fa292a efl.progress: Rename property from value to progress_value
Reviewers: jpeg, singh.amitesh

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3872
2016-04-07 19:06:09 +09:00
Yeshwanth Reddivari 7f9036dce5 Interface: Progress - Add common interface for Slider and Progressbar
Summary:
Implement common interface efl_ui_progress and inherit slider and progressbar from common interface.
Currently legacy APIs will also call interface functions and later it can be deprecated.
This interface will be moved to EFL in src/lib/efl/interfaces when elementary is merged into efl.

Test Plan:
elementary_test -to 'slider'
elementary_test -to 'progressbar'

Reviewers: singh.amitesh, raster, tasn, felipealmeida, woohyun, cedric, jpeg

Subscribers: saurabhbunty, alok25

Differential Revision: https://phab.enlightenment.org/D3759
2016-04-07 16:50:57 +09:00