Commit Graph

12 Commits

Author SHA1 Message Date
Elyes HAOUAS 17151e2eb8 Get rid of trailing whitespaces (10 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12009
2020-06-23 10:30:36 +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
Xavi Artigas 8a0cad6435 Efl.Ui.Progressbar: Add explicit display control of progress label
Summary:
Add a property (show_progress_label) to allow controlling whether the progress
label displaying the exact progress is shown or not.
This was possible in Legacy but the functionality was lost in Unified.

Updated elementary_test to showcase this property, and also the other label
formatting options, which where not tested anywhere.

Added a simple progressbar unit test. It only checks that retrieved value is the
same as the set value, so it is more of a placeholder for future tests.

**This is needed by a future patch which will introduce more formatting options that clash with the current implementation.**
The presence of a formatting function was used to decide if the progress label was shown or not. This explicit property simplifies things.

Test Plan:
Everything builds and passes tests.
`elementary_test -to Efl.Ui.Progressbar` should show a few more bars with different formatting labels, and a checkbox to toggle rendering of one of them.

Reviewers: bu5hm4n, zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9202
2019-07-03 08:34:03 +02:00
Mike Blumenkrantz f1b12b92e4 efl_ui/progressbar: check for part existence before using parts
Summary:
some progressbar styles do not have certain parts, so it's necessary to
check part existence on theme load to avoid triggering unnecessary
errors

@fix

Depends on D8981

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8982
2019-05-29 12:29:04 -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
Amitesh Singh c99b37ad47 Efl.Ui.Progressbar: implement range min max 2018-01-31 17:44:20 +09:00
Amitesh Singh 21259e411d Efl.Ui.Progressbar: fix val to be val when legacy format_function_set() is called
In Pb, the legacy units_format_set's user callback uses value to
be 100*value (0.0 to 100.0) and legacy format_function_set uses
value of range "0.0 to 1.0". This was broken after my patch.
Lets keep this behaviour in legacy APIs.

In case of new EO APIs, the value will be always from 0.0 to 1.0
in both format_string() and format_cb callbacks.
2017-10-27 11:56:22 +09:00
Amitesh Singh 3092c0fdea Efl.Ui.Progressbar: implement format_cb.set
Also remove format_string.set/get implmentation
since it takes care by base Efl.Ui.Format.format_string

Ref T6204
2017-10-26 21:11:36 +09:00
Jean-Philippe Andre 112edeeea8 elm: Remove range "span_size" API in EO
Reasons:
 - This API has been confused with the min size of the widget, resulting
   in badly laid out applications.
 - The EO API was not very nice (Range is about numbers, the Gfx size
   hint in a part is really ugly).

While I understand the value of this API and how it can be used in
scalable applications, it is in fact not absolutely necessary.
Alternatively to that span size, the widget min size can already be
defined from the application side, or the widget can simply be expanded
to fill in its parent.

This can obviously be reinstated later if the need arises for EO. For
now, keep this feature as legacy-only.
2017-09-21 12:27:34 +09:00
Jean-Philippe Andre c87f6018f9 progressbar: Switch to Efl.Ui.Dir (EO)
Ref T5870
2017-08-10 14:42:08 +09:00
Amitesh Singh 0851d568a1 Efl.Ui.Progressbar: rename data get macros. 2017-06-16 16:32:46 +09:00
Amitesh Singh f6b81f0a1e elm: rename elm_progressbar to Efl.Ui.Progressbar
ref T5360

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-23 19:05:48 +09:00