Commit Graph

123 Commits

Author SHA1 Message Date
Alastair Poole 08d23ea582 elm_code_widget: fix select and drag (scrolling).
Summary:
Currently when selecting with the mouse and scrollling,
the selection will only continue in one direction. With
this patch, the selection can move freely between "pages".

Test Plan: select text and drag up and down in elm_code widget (Edi).

Reviewers: #committers, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6632
2018-07-24 10:04:28 +01:00
Andy Williams 1485cf9df5 elm_code: (cherry-pick) Support indentation styles that are purely tab based
read: Allow non-EFL style indentation.
This is off by default but is switched on if you turn 'tabs insert spaces' off
2018-07-22 17:02:23 +01:00
Alastair Poole a92b80ff86 elm_code: add EOAPI to refresh theme after a user layout change.
Hopefully this retains the object hierarchy. Gives us a method
to update the widget theme after a layout change.
2018-05-13 17:16:13 +01:00
Alastair Poole 4d61374872 elm_code_widget: on theme change update the background widget.
This ensures consistency between the colours of the widget and
its parent. When theme changes the whole visible region changes
and matches so that it isn't bogus and ugly.
2018-05-13 13:43:08 +01:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Andy Williams cc2b7a10a8 elm_code: Remove a render test and complex workarounds required
Fixes issues with Windows and general unused method warnings
2018-03-28 17:30:17 +01:00
Andy Williams 2aa580b073 elm_code: Fix issue where text selection menu did not show 2018-02-16 14:38:25 +00:00
Sungtaek Hong cb25699dac efl_ui_legacy: add new interface to indicate legacy widget
Summary:
For now, how to check whether a widget is legacy or not
is to check flags in private data or static flag, which is set
during elm_legacy_add.
If Efl.Ui.Legacy interface is added, it can be easilly checked
by efl_isa(obj, EFL_UI_LEGACY_INTERFACE)

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5748
2018-01-24 18:14:26 +09:00
Jean-Philippe Andre e592a0ab5b code widget: Fix order of operations
super functions, when creating stuff, should be called first.
2018-01-16 19:35:54 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Andy Williams 14d10e8b7b elm_code: Cancel selection if clicked outside of the editor area 2017-12-21 22:05:42 +00:00
Andy Williams fcdf4e9d10 elm_code: Correct tooltip behaviour for elm_cde_widget 2017-12-14 08:55:01 +00:00
Andy Williams 433c7ef8fe elm_code: Fix tooltip crash 2017-12-13 22:44:31 +00:00
Sungtaek Hong 3490da0fff elm_code_widget: change efl_add to legacy_add
Summary:
elm_code_widget is legacy add, thus efl_add is not available.

Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>

Reviewers: jpeg, cedric, ajwillia.ms, woohyun

Differential Revision: https://phab.enlightenment.org/D5548
2017-12-08 16:02:22 +09:00
Sungtaek Hong fc8cc4a9b3 efl_ui_widget: find theme just once in layout inherited widget
When a widget inherits layout in tries to set theme in group_add or in
constructor. When another widget inherits the previous widget, it sets
layout again with new klass name. This sets klass in the widget and
sets layout in super class, so that it can set layout only once.

Test Plan: Run efl_ui_widget related elementary test.

Reviewers: jpeg, cedric, woohyun, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D5473
2017-12-08 16:02:22 +09:00
Andy Williams bdcd034af5 elm_code: Update background handling to work with transparency better 2017-12-07 23:39:49 +00:00
Andy Williams 1a5d6fa93a elm_code: Adding initial support for alpha channel 2017-12-07 23:39:49 +00:00
Andy Williams 756964c493 Revert "elm_code: Call parent theme_apply when we're applying"
This reverts commit 3e5e994360.
This crashes within Edi. The partial solution is not good enough.
2017-12-01 16:44:34 +00:00
Andy Williams 3e5e994360 elm_code: Call parent theme_apply when we're applying 2017-11-30 17:36:30 +00:00
Andy Williams 54d3091133 elm_code: Don't bold beginnings of lines
Fixes T6444
2017-11-29 16:17:27 +00:00
Andy Williams d43fe6c16f elm_code: Reload grid colours on theme change 2017-11-27 21:23:55 +00:00
Al Poole 5abeeb980a elm_code: set the color scheme from the default edc.
This allows us to override in the application also. Work from
myself and @ajwillia.ms.
2017-11-26 12:36:42 +00:00
Lauro Moura 0dbeb91bb9 elementary: fix compilation of elm_code test on windows
Summary:
Added some guards to avoid redefinition of functions.

Partially fixes T5866, as there is still the question whether we should
test internal functions or not, as stated by jpeg in the comments.

Reviewers: vtorri, felipealmeida, jpeg, cedric

Reviewed By: cedric

Subscribers: jenkins, cedric

Maniphest Tasks: T5866

Differential Revision: https://phab.enlightenment.org/D5521

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-11-23 15:30:32 -08:00
Jean-Philippe Andre b798005e80 elm: Add hack to make test case work
Because of the way elm_code test case is written, by directly including
the C file, we end up with two symbols for the internal _elm_legacy_add
flag. This makes some test case fail (after applying a pending patch).

Solution found by Sungtaek Hong.

elm_code test case needs to be fixed. Don't include the C files
directly, testing static inlines should be done through a common .x or
something, but not by including the C file itself. This has led and will
lead to many issues.
2017-11-23 15:45:49 +09:00
Andy Williams 06778385f1 elm_code: don't crash on NULL scope
This could be triggerd with the cursor was not in the file
2017-11-22 19:31:19 +00:00
Andy Williams 95b0d7ca68 elm_code: Add basic scope parsing to syntax highlighting.
This is currently displayed by showing scope in the widget gutter
2017-11-14 19:12:56 +00:00
Al Poole e63e2d7e21 elm_code_widget: keep track of visibility.
Keep track of visibility and ensure the cursor can never be
filled when hidden. This should finally end any issue with the
cursor and visibility with the new focus system. Didn't see this
previously until working on Edi's bottom panes which caused redraw
on resize of the widgets.

@fix
2017-11-09 00:55:36 +00:00
Jean-Philippe Andre d39bbc1491 elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set:
if the widget is legacy or pure eo we may need to select a different
style. So in the constructor we need to know whether we are legacy or
eo. Note that calling style_set in finalize only is too late as we would
lose information such as efl_text_set() called inside efl_add().
2017-11-07 14:50:31 +09:00
Al Poole e663e4d009 elm_code: hide cursor if we hide the widget.
The cursor isn't clipped so if we decide to hide the widget
this ensures the cursor also is hidden. This should not affect
any existing application using elm_code API.
2017-10-26 22:39:21 +01:00
Al Poole eeb25519b3 elm_code_widget: make sure the widget is cleared properly.
This ensures the widget is clearer if the file has been cleared.
@fix T6185
2017-10-21 01:28:06 +01:00
Marcel Hollerbach 9d5cc349da elm_code: remove those parts
they are not anymore needed, before they existed for keeping the focus
in the window, even if the keystrokes should be focus movements. This is
already working without this.
2017-10-10 19:28:48 +02:00
Al Poole 9ab866f32c elm_code_widget: set appropriate background colour. 2017-10-01 11:10:28 +01:00
Andy Williams ad6a858aad elm_code: respect event hold for key_down 2017-09-21 12:24:51 +01:00
Jean-Philippe Andre b6bab481aa widget: Mark old focus API as beta.
It's not beta. It's about to die.
Also, move #define ELM_WIDGET_BETA to the common header file, as it is
consequently required by ALL widgets. :(

Ping @bu5hm4n :)

Ref T5363
2017-08-31 11:22:04 +09:00
Jean-Philippe Andre c4ac589455 widget: Remove all legacy event stuff in propagate
The EO API is now clean! Yay!

Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 66d241eadf elm: Process all input events with EO
This removes all uses of type & event_info in the method widget_event.

Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 069747b9de widget: Add eo event info inside widget_event
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.

Ref T5363
2017-08-23 11:16:45 +09:00
Andy Williams 91293d3b25 elm_code: small optimisation for large files 2017-08-02 10:32:13 +01:00
Carsten Haitzler 20333c7905 elm code - remove unneded extra check from copy and pasta it seems
extra check already done in if above - no need. looks like copy &
paste of the checks from above thus why it's there, but not needed.
not a bug, byt analysers dont like it so remove

found by PVS studio
2017-07-29 10:56:53 +09:00
Andy Williams 77db870b61 elm_code: Fix missing middle button selection paste
Resolves task T5520
@fix
2017-07-25 23:54:21 +01:00
Andy Williams 292e9e9ecf elm_code: Fix crash with long lines
Also fixes issue where widget would sometimes blank when scrolling
@fix
2017-07-23 21:30:35 +01:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Andy Williams 77800dd9b4 elm_code: fix whitespace highlighting 2017-06-27 16:19:16 +01:00
Andy Williams a7830b9c42 elm_code: Add a matched token so we can highlight searches
Should make dense matches in a text editor clearer.
2017-06-26 22:17:07 +01:00
Sanjeev BA ed201d7f30 Add support for select all with ctrl-a
Summary: Signed-off-by: Sanjeev BA <iamsanjeev@gmail.com>

Test Plan: Test with edi.

Reviewers: ajwillia.ms, jpeg, cedric

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4971
2017-06-17 17:42:18 +01:00
Andy Williams 57a0343775 elm_code: Allow multibyte characters to be entered
@fix T5496
2017-05-26 23:07:52 +01:00
Al Poole 66fd9839a0 elm_code: fix cursor position (100%)
Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4905
2017-05-24 21:25:24 +01:00
Andy Williams 6058401590 elm_code: reduce race conditions in rendering cursor
This code is slowly getting neater as we get to the bottom of it
2017-05-23 23:03:08 +01:00
Andy Williams 7f1ef4e2d4 elm_code: improving cursor move behavior.
There is a blank line off the scroller but for now it's better
2017-05-21 23:19:24 +01:00
Al Poole 6d7a73c68f elm_code: fix carriage return at EOF scroller behaviour
Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4890
2017-05-19 19:04:46 +01:00