Page MenuHomePhabricator

elm_code_widget: resize cursor at time of font change.
ClosedPublic

Authored by netstar on Jul 16 2018, 9:18 AM.

Details

Summary

This ensures the cursor changes to meet the font size change
when a font change is made in an Elm_Code_Widget.

@fix T6470

Test Plan

Run ecrire or Edi. Open a text file and change the font settings.
Cursor should resize with the font when it is changed.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
netstar created this revision.Jul 16 2018, 9:18 AM
netstar requested review of this revision.Jul 16 2018, 9:18 AM

I have not looked into the details but I think this must have created a little duplicate code.
Can we use the same code for when it's set up in the first place and when it's resized through this method?

Apologies if that's not now it works, I am doing this from memory

netstar updated this revision to Diff 15705.Jul 17 2018, 1:23 AM

Use consistent type.

Hey andy. Yeah I had a look I'm not really sure about creating one method there. Let me know what you think.

Sorry, this is not quite there.
The cursor does not move to the correct location.
It seems to size correctly - but if you are not on the top line of the file it will hover in the wrong place (where the topleft was before).

As for a single method it looks like the geom_get, resize, move and show are almost identically grouped in widget_fill_cursor.
I'd say it should be possible to factor that and this patch into a single method.

Please shout if I'm missing something.

Cool :) Can have a look over the weekend when I get time!

netstar updated this revision to Diff 15778.Jul 21 2018, 6:24 AM

One method to rule them all!

I'm not understanding the cursor positioning problem. Seems to work fine here.

netstar updated this revision to Diff 15779.Jul 21 2018, 7:24 AM

Better method name

The move issue is no longer visible - perhaps that was due to be basing it off the 1.20 branch?
Other than the one comment inline this looks good.

src/lib/elementary/elm_code_widget.c
2093

Checking for cursor rect here seems wrong - as the method will create it if missing

ajwillia.ms accepted this revision.Jul 22 2018, 12:50 PM

Quite right, that check is needed

This revision is now accepted and ready to land.Jul 22 2018, 12:50 PM
This revision was automatically updated to reflect the committed changes.