Hello,

Sorry it took me a bit of time to react: I've progressed at the
incredible rate of 3 lines of code per evening this week. :) 

On Mon, Nov 16, 2015, Carsten Haitzler wrote:
> On Sun, 15 Nov 2015 22:30:39 +0100 Adrien Nader <adr...@notk.org> said:
> 
> > Hi,
> > 
> > Let's say I have a genlist with two items with only text:
> > [ foo bar baz ]
> > [ foooooooo baaaaaaarrrrr baaaazzzzzzz ]
> > 
> > I would like to give some horizontal alignment to the text I put there:
> > [ foo       bar           baz ]
> > [ foooooooo baaaaaaarrrrr baaaazzzzzzz ]
> > 
> > This shouldn't assume text widths in the theme because 1- that wouldn't
> > be a real solution, 2- I would be asking if I were to be satisfied with
> > that.
> > 
> > I'm looking for a solution available now (1.16).
> 
> 3 swallows, put 1 table in each swallow. put rect in each table and in same
> cell put label. set min width of rectangle to width you want. :) allow label 
> to
> wrap. :)

Well, this has two issues. First wrapping is not wished. Second it
requires a lot of widgets and that's really bad for performance (with
genlist it might be ok-ish). I'm partly to blame on that because I think
I still haven't opened a ticket about it.

After some discussions with cedric on IRC, I finally wrote the
following: http://pastebin.notk.org/pastebin.php?show=f4373cd46 .
It's OCaml code but the binding is straight-forward and the approach
can be reduced to:
- create an elm_layout with the theme that will be used for the
  swallower
- create the swallowee
- for each possible content, set it in the swallowee, call
  elm_layout_sizing_eval(layout) and get the effective size with
  evas_object_size_hint_min_get()
- get the max of each of the possible sizes
- clean up the layout you've just created
- when adding an actual element, use evas_object_size_hint_min_set() to
  give it a minimal size

That ended up working well without being complicated (although it felt
quite dirty).

However due to usability concerns, I ended up dropping the column
approach for now and I'll be putting everything back when there is a
full support for spreadsheet-like widgets in elementary (or that I make
one myself; wouldn't be bad to prototype).

Right now I'm trying to disable a specific item of a segment control and
can't get things to work at all. Screenshot is at
http://i.imgur.com/WEKuQTT.png . That's pretty much the only remaining
blocker. Is it even possible?

Thanks,

-- 
Adrien Nader

------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to