2019-02-28 07:23:11 -08:00
|
|
|
class @beta Efl.Ui.Tags extends Efl.Ui.Layout_Base implements Efl.Text, Efl.Ui.Format
|
2018-05-02 01:23:25 -07:00
|
|
|
{
|
2019-01-30 03:49:31 -08:00
|
|
|
[[A widget displaying a list of tags. The user can remove tags by clicking
|
|
|
|
on each tag "close" button and add new tags by typing text in the text
|
|
|
|
entry at the end of the list.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
methods {
|
|
|
|
@property editable {
|
2019-01-30 03:49:31 -08:00
|
|
|
[[Control if the tag list is to be editable by the user or not.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-01-30 03:49:31 -08:00
|
|
|
editable: bool; [[If $true, the user can add/delete tags to the tag list,
|
|
|
|
if not, the tag list is non-editable.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property expanded {
|
2019-01-30 03:49:31 -08:00
|
|
|
[[Control whether the tag list is expanded or not.
|
2018-05-02 01:23:25 -07:00
|
|
|
|
2019-01-30 03:49:31 -08:00
|
|
|
In the expanded state, all tags will be displayed.
|
|
|
|
Otherwise, only a single line of tags will be displayed with a marker to
|
|
|
|
indicate that there is more content.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-01-30 03:49:31 -08:00
|
|
|
expanded: bool; [[The expanded state. Set this to $true to allow multiple
|
|
|
|
lines of tags. Set to $false for a single line.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property items {
|
2019-01-30 03:49:31 -08:00
|
|
|
[[List of tags in the tag list. Tags can be added and removed by the user
|
|
|
|
using the UI, and by the program by modifying this property.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-01-30 03:49:31 -08:00
|
|
|
items: const(array<string>); [[The array of items, or NULL if none.]]
|
2018-05-02 01:23:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
implements {
|
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.destructor;
|
2019-03-04 10:37:18 -08:00
|
|
|
Efl.Ui.Widget.widget_input_event_handler;
|
2018-05-02 01:23:25 -07:00
|
|
|
Efl.Text.text { get; set; }
|
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-02 05:40:06 -07:00
|
|
|
Efl.Ui.Format.apply_formatted_value;
|
2018-05-02 01:23:25 -07:00
|
|
|
}
|
|
|
|
events {
|
efl: Add missing event types
Summary:
All events must have a type now, otherwise bindings don't know how to handle
the event_info field.
Most of the missing event types were actually "void" (no event_info present).
Some struct definitions had to be moved to eo instead of h files, so they
are available to bindings. Some have not, and are marked with FIXME.
Some namespaces have been fixed (like Efl_Event_Cb -> Efl.Event_Cb).
In general, there are hundreds of changed files, but mostly to add a type which
was not present before, so there's no harm done.
Also, A lot of FIXMEs have been added which should be, like, fixed.
For example, some events can send different types of event_info, which is
very inconvenient (and error prone).
Test Plan: make with c# bindings works, make check and make examples work too.
Reviewers: cedric, q66, lauromoura
Subscribers: zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6169
2018-05-11 08:20:40 -07:00
|
|
|
/* FIXME: Returning a basic type is not future-proof, better return a struct */
|
|
|
|
item,selected: string; [[Called when item was selected]]
|
|
|
|
item,added: string; [[Called when item was added]]
|
|
|
|
item,deleted: string; [[Called when item was deleted]]
|
|
|
|
item,clicked: string; [[Called when item was clicked]]
|
|
|
|
item,longpressed: string; [[Called when item got a longpress]]
|
|
|
|
expanded: void; [[Called when expanded]]
|
|
|
|
contracted: void; [[Called when contracted]]
|
|
|
|
/* FIXME: Not future-proof */
|
|
|
|
expand,state,changed: int; [[Called when expanded state changed]]
|
2018-05-02 01:23:25 -07:00
|
|
|
}
|
2019-01-23 11:55:44 -08:00
|
|
|
composite {
|
|
|
|
Efl.Text;
|
|
|
|
}
|
2018-05-02 01:23:25 -07:00
|
|
|
}
|