Changeset View
Changeset View
Standalone View
Standalone View
src/lib/elementary/efl_ui_widget_scrollable_content.eo
1 | import eina_types; | 1 | import eina_types; | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | mixin @beta Efl.Ui.Widget_Scrollable_Content requires Efl.Object | 3 | mixin @beta Efl.Ui.Widget_Scrollable_Content requires Efl.Object | ||
4 | { | 4 | { | ||
5 | [[Efl widget scrollable content mixin | 5 | [[Efl widget scrollable content mixin | ||
6 | 6 | | |||
7 | This can be used to provide scrollable contents and text for widgets. | 7 | This can be used to provide scrollable contents and text for widgets. When a scrollable | ||
8 | text or content is set, this mixin will create and manage an internal scroller object which | ||||
9 | will be the container of that text or content. | ||||
8 | 10 | | |||
9 | Widgets can set the "__efl_scrollable_content_scroller_style" key data during | 11 | Only a single content or text can be set at any given time. Setting @.scrollable_content | ||
10 | their constructor to apply a style to the internal scroller widget. | 12 | will unset @.scrollable_text and vice versa. | ||
13 | | ||||
14 | @since 1.23 | ||||
11 | ]] | 15 | ]] | ||
12 | c_prefix: efl_ui_widget; | 16 | c_prefix: efl_ui_widget; | ||
13 | event_prefix: efl_ui_widget_scrollable_content; | 17 | event_prefix: efl_ui_widget_scrollable_content; | ||
14 | data: Efl_Ui_Widget_Scrollable_Content_Data; | 18 | data: Efl_Ui_Widget_Scrollable_Content_Data; | ||
15 | methods { | 19 | methods { | ||
16 | @property scrollable_content_did_group_calc @protected @beta { | 20 | @property scrollable_content_did_group_calc @protected @beta { | ||
17 | [[Widgets can call this function during their @Efl.Canvas.Group.group_calculate | 21 | [[Widgets can call this function during their @Efl.Canvas.Group.group_calculate | ||
18 | implementation after the super call to determine whether the internal scroller | 22 | implementation after the super call to determine whether the internal scroller | ||
19 | has performed sizing calculations. | 23 | has performed sizing calculations. | ||
20 | 24 | | |||
21 | The optimal_size,calc event will have been emitted during the super call if | 25 | The optimal_size,calc event will have been emitted during the super call if | ||
22 | this method returns $true. | 26 | this method returns $true. | ||
23 | 27 | | |||
24 | In the case that this returns $true, it's likely that the widget should be completing | 28 | In the case that this returns $true, it's likely that the widget should be completing | ||
25 | its internal sizing calculations from the optimal_size,calc callback using | 29 | its internal sizing calculations from the @[Efl.Ui.Widget.Scrollable_Content.optimal_size,calc] callback using | ||
26 | 30 | | |||
27 | `efl_canvas_group_calculate(efl_super(ev->object, EFL_UI_WIDGET_SCROLLABLE_CONTENT_MIXIN));` | 31 | efl_canvas_group_calculate(efl_super(ev->object, EFL_UI_WIDGET_SCROLLABLE_CONTENT_MIXIN)); | ||
28 | 32 | | |||
29 | in order to skip the scrollable sizing calc. | 33 | in order to skip the scrollable sizing calc. | ||
34 | | ||||
35 | @since 1.23 | ||||
30 | ]] | 36 | ]] | ||
31 | get {} | 37 | get {} | ||
32 | values { | 38 | values { | ||
33 | did_group_calc: bool; [[Whether the internal scroller has done sizing calcs.]] | 39 | did_group_calc: bool; [[Whether the internal scroller has done sizing calcs.]] | ||
34 | } | 40 | } | ||
35 | } | 41 | } | ||
36 | @property scrollable_content { | 42 | @property scrollable_content { | ||
37 | [[This is the content which will be placed in the internal scroller. | 43 | [[This is the content which will be placed in the internal scroller. | ||
44 | | ||||
45 | @since 1.23 | ||||
38 | ]] | 46 | ]] | ||
39 | set { | 47 | set { | ||
40 | return: bool; [[True on success]] | 48 | return: bool; [[True on success]] | ||
41 | } | 49 | } | ||
42 | get {} | 50 | get {} | ||
43 | values { | 51 | values { | ||
44 | content: Efl.Canvas.Object; [[The content object.]] | 52 | content: Efl.Canvas.Object; [[The content object.]] | ||
45 | } | 53 | } | ||
46 | } | 54 | } | ||
47 | @property scrollable_text { | 55 | @property scrollable_text { | ||
48 | set { | 56 | set { | ||
49 | [[Sets the text string to be displayed by the given text object. | 57 | [[Sets the text string to be displayed by the given text object. | ||
50 | The text will be scrollable depending on its size relative to the | 58 | The text will use @Efl.Text_Format_Wrap.mixed wrapping, | ||
59 | and it will be scrollable depending on its size relative to the | ||||
51 | object's geometry. | 60 | object's geometry. | ||
52 | 61 | | |||
53 | See also @.scrollable_text.get. | 62 | See also @.scrollable_text.get. | ||
63 | | ||||
64 | @since 1.23 | ||||
54 | ]] | 65 | ]] | ||
55 | } | 66 | } | ||
56 | get { | 67 | get { | ||
57 | [[Retrieves the text string currently being displayed by the given | 68 | [[Retrieves the text string currently being displayed by the given | ||
58 | text object. | 69 | text object. | ||
59 | 70 | | |||
60 | Do not free() the return value. | 71 | Do not free() the return value. | ||
61 | 72 | | |||
62 | See also @.scrollable_text.set. | 73 | See also @.scrollable_text.set. | ||
74 | | ||||
75 | @since 1.23 | ||||
63 | ]] | 76 | ]] | ||
64 | } | 77 | } | ||
65 | values { | 78 | values { | ||
66 | text: string; [[Text string to display on it.]] | 79 | text: string; [[Text string to display on it.]] | ||
67 | } | 80 | } | ||
68 | } | 81 | } | ||
69 | } | 82 | } | ||
70 | events { | 83 | events { | ||
71 | optimal_size,calc: Eina.Size2D; [[The optimal size for the widget based on scrollable content.]] | 84 | optimal_size,calc: Eina.Size2D; [[The optimal size for the widget based on scrollable content.]] | ||
72 | } | 85 | } | ||
73 | implements { | 86 | implements { | ||
74 | Efl.Object.destructor; | 87 | Efl.Object.destructor; | ||
75 | } | 88 | } | ||
76 | } | 89 | } |