Re: [E-devel] Implementing default gadcon client size for EFM toolbar

2009-10-10 Thread The Rasterman
On Sat, 19 Sep 2009 20:04:31 +0400 victor  said:

> Hi guys
> 
> On adding a gadcon client to EFM toolbar, its width used hardcoded value
> regardless of gadcon client type. Here is patchset allowing to define
> default (preferred) width for each type of EFM toolbar client. 
> - edje changed so a collections.group of .edc collection file can have
> "prefer" value.
> - on creating a new, unconfigured gadcon client, it uses preferred size
> of underlying Evas object as its width.
> - appropriate sizes applied to EFM modules 
> Hope you'll find it useful.

hmm adding a preferred isze.. ok - i can see that, though i have used min and
max sizes for this kind of thing before as these are not enforced sizes by just
hints. but one thing.. your patch uses min ANd MAX sizes of something like
140x0 min and 140x0 max.. ie 0 height max (as a hint). a little odd... now here
comes a problem. that is... preferred size may be determines on data that is
swallowed, labels that are set by text and that change based on language. in
one they may be 2 or 3x the length that another is at. i'm not totally sure
this is the right solution. it needs something much more sophisticated. ie the
gadget should create the object, populate it with "sample data" like set labels
with real text and entries that may get text added - fill it with some sample
text to make it "nice" then do a calculation on that. what is the minimum size
if all text labels are limited to their current size (with all text showing) as
a minmum. same with any swallows, lists etc. - some of thsi should be done as
part of the edje in size calc - options for forcing all text parts to be min: 1
1; for the calculation purposes etc. etc.


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Implementing default gadcon client size for EFM toolbar

2009-09-22 Thread victor
В Втр, 22/09/2009 в 20:40 +0200, hannes.janet...@gmail.com пишет:
> Hello Victor,
> I'm not the one to ask for accepting edje changes. Anyway, I think
> this could be handled with using min_size of the edje group. If I
> recall correct the only problem with adding gadgets to toolbar were
> that they were smaller than the appropriate size for the gadget. I'll
> have a look into this.
> 
Hello Hannes,

Yes, you're right indeed. Initial size of those gadgets can be handled
by min_size parameter as well. Unfortunately, there is next problem with
that. EFM window with toolbar in that can be resized by user. I looking
for a way to make the gadgets having comfortable size on create but let
them to reduce to a size that they still will be usable yet on window
resizing. Last thing seems looking as min_size for me. Right now I
working on correct toolbar resizing. I'll fully understand that changing
the edje is worst thing could be happened ever, but failed to find
another way to achieve such behaviour that will make a human being
happy. Hope somebody will advise me about that.


Respectfully, 

Victor.


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Implementing default gadcon client size for EFM toolbar

2009-09-22 Thread hannes.janet...@gmail.com
Hello Victor,
I'm not the one to ask for accepting edje changes. Anyway, I think
this could be handled with using min_size of the edje group. If I
recall correct the only problem with adding gadgets to toolbar were
that they were smaller than the appropriate size for the gadget. I'll
have a look into this.

Regards,
Hannes

On Sat, Sep 19, 2009 at 6:04 PM, victor  wrote:
> Hi guys
>
> On adding a gadcon client to EFM toolbar, its width used hardcoded value
> regardless of gadcon client type. Here is patchset allowing to define
> default (preferred) width for each type of EFM toolbar client.
> - edje changed so a collections.group of .edc collection file can have
> "prefer" value.
> - on creating a new, unconfigured gadcon client, it uses preferred size
> of underlying Evas object as its width.
> - appropriate sizes applied to EFM modules
> Hope you'll find it useful.
>
> Sincerely, Victor.
>
> --
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] Implementing default gadcon client size for EFM toolbar

2009-09-19 Thread victor
Hi guys

On adding a gadcon client to EFM toolbar, its width used hardcoded value
regardless of gadcon client type. Here is patchset allowing to define
default (preferred) width for each type of EFM toolbar client. 
- edje changed so a collections.group of .edc collection file can have
"prefer" value.
- on creating a new, unconfigured gadcon client, it uses preferred size
of underlying Evas object as its width.
- appropriate sizes applied to EFM modules 
Hope you'll find it useful.

Sincerely, Victor.
On creating new gadcon client, make it honors size preferences of container Evas_Object. On loading scrollframe content from a file, apply preferred size of contained object as preferred size to scrollframe itself.
 e_gadcon.c  |   54 +++---
 e_scrollframe.c |7 +++
 2 files changed, 42 insertions(+), 19 deletions(-)
Index: e17-svn/src/bin/e_gadcon.c
===
--- e17-svn/src/bin/e_gadcon.c	(revision 42565)
+++ e17-svn/src/bin/e_gadcon.c	(working copy)
@@ -398,6 +398,36 @@
/* FIXME: delete container obj, re-pack all clients */
 }
 
+static void
+_e_gadcon_client_adjust_size(E_Gadcon_Client *gcc, E_Config_Gadcon_Client *cf_gcc)
+{
+   Evas_Coord w = 0;
+   Evas_Object *obj = NULL;
+
+   cf_gcc->geom.res = 800;
+   if (gcc->o_frame)
+ obj = gcc->o_frame;
+   else if (gcc->o_base)
+ obj = gcc->o_base;
+   if (0 == cf_gcc->geom.size)
+ {
+	/* this gadcon client don't configured yet */
+	if (obj)
+	  evas_object_size_hint_request_get(obj, &w, NULL);
+	if (0 == w)
+	  /* evas object don't provide size hint, use default */
+	  cf_gcc->geom.size = 80;
+	else
+	  /* use evas object size hint */
+	  cf_gcc->geom.size = w;
+ }
+   gcc->config.pos = cf_gcc->geom.pos;
+   gcc->config.size = cf_gcc->geom.size;
+   gcc->config.res = cf_gcc->geom.res;
+   if (obj)
+ e_gadcon_layout_pack_options_set(obj, gcc);
+}
+
 EAPI void
 e_gadcon_populate(E_Gadcon *gc)
 {
@@ -437,16 +467,9 @@
 	   {
 		  gcc->cf = cf_gcc;
 		  gcc->client_class = cc;
-		  gcc->config.pos = cf_gcc->geom.pos;
-		  gcc->config.size = cf_gcc->geom.size;
-		  gcc->config.res = cf_gcc->geom.res;
 		  gcc->state_info.seq = cf_gcc->state_info.seq;
 		  gcc->state_info.flags = cf_gcc->state_info.flags;
-		  if (gcc->o_frame)
-		e_gadcon_layout_pack_options_set(gcc->o_frame, gcc);
-		  else if (gcc->o_base)
-		e_gadcon_layout_pack_options_set(gcc->o_base, gcc);
-
+		  _e_gadcon_client_adjust_size(gcc, cf_gcc);
 		  e_gadcon_client_autoscroll_set(gcc, cf_gcc->autoscroll);
 		  e_gadcon_client_resizable_set(gcc, cf_gcc->resizable);
 		  if (gcc->client_class->func.orient)
@@ -510,16 +533,9 @@
 	   {
 		  gcc->cf = cf_gcc;
 		  gcc->client_class = cc;
-		  gcc->config.pos = cf_gcc->geom.pos;
-		  gcc->config.size = cf_gcc->geom.size;
-		  gcc->config.res = cf_gcc->geom.res;
 		  gcc->state_info.seq = cf_gcc->state_info.seq;
 		  gcc->state_info.flags = cf_gcc->state_info.flags;
-		  if (gcc->o_frame)
-		e_gadcon_layout_pack_options_set(gcc->o_frame, gcc);
-		  else if (gcc->o_base)
-		e_gadcon_layout_pack_options_set(gcc->o_base, gcc);
-
+		  _e_gadcon_client_adjust_size(gcc, cf_gcc);
 		  e_gadcon_client_autoscroll_set(gcc, cf_gcc->autoscroll);
 		  e_gadcon_client_resizable_set(gcc, cf_gcc->resizable);
 		  if (gcc->client_class->func.orient)
@@ -794,9 +810,9 @@
if (!cf_gcc) return NULL;
cf_gcc->name = eina_stringshare_add(name);
cf_gcc->id = eina_stringshare_add(cc->func.id_new(cc));
-   cf_gcc->geom.res = 800;
-   cf_gcc->geom.size = 80;
-   cf_gcc->geom.pos = cf_gcc->geom.res - cf_gcc->geom.size;
+   cf_gcc->geom.res = 0;
+   cf_gcc->geom.size = 0;
+   cf_gcc->geom.pos = 0;
cf_gcc->style = NULL;
cf_gcc->autoscroll = 0;
cf_gcc->resizable = 0;
Index: e17-svn/src/bin/e_scrollframe.c
===
--- e17-svn/src/bin/e_scrollframe.c	(revision 42565)
+++ e17-svn/src/bin/e_scrollframe.c	(working copy)
@@ -215,8 +215,15 @@
 e_scrollframe_custom_edje_file_set(Evas_Object *obj, char *file, char *group)
 {
API_ENTRY return 0;
+   Evas_Coord w = 0, h = 0;
 
if (!edje_object_file_set(sd->edje_obj, file, group)) return 0;
+
+   /* use same size hints for container object */
+   evas_object_size_hint_request_get(sd->edje_obj, &w, &h);
+   if (0 != w || 0 != h)
+ evas_object_size_hint_request_set(obj, w, h);
+   
if (sd->pan_obj)
  edje_object_part_swallow(sd->edje_obj, "e.swallow.content", sd->pan_obj);
sd->vbar_visible = !sd->vbar_visible;
Adds "prefer" keyword support to collections.group of .edc files.
 bin/edje_cc_handlers.c |   25 +
 lib/edje_data.c|2 ++
 lib/edje_load.c|3 ++-
 lib/edje_private.h |2 +-
 4 files changed, 30 insertions(+), 2 deletions(-)
Index: edje-svn/src/lib/edje_data.c
==