Hello all,
I've noticed there has been a new set of Illume-conformat APIs going
into Elementary. I guess it hints whoever that needs it about the
compatibility? I assume that by 'conformant' it states it's
maximized, but I'm not sure.
By adding
elm_win_conformant_set(win, 1);
and the patch, the positioning problem is gone. The modified code is
also attached.
Is it the proper fix? Please have a look at the patch and correct it
as you see fit. There's probably some indentation issue.
Thanks.
brian
--
brian
------------------
Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/
iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
Index: elementary/src/lib/elm_win.c
===================================================================
--- elementary/src/lib/elm_win.c (revision 46502)
+++ elementary/src/lib/elm_win.c (working copy)
@@ -282,6 +282,7 @@
int xx = 1, xy = 1;
double wx, wy;
+ if (!elm_win_conformant_get(obj)) {
EINA_LIST_FOREACH(win->subobjs, l, child)
{
evas_object_size_hint_weight_get(child, &wx, &wy);
@@ -302,6 +303,7 @@
if (maxh == -1) maxh = h;
else if ((h > 0) && (h < maxh)) maxh = h;
}
+ }
if ((maxw >= 0) && (maxw < minw)) maxw = minw;
if ((maxh >= 0) && (maxh < minh)) maxh = minh;
if (!xx) maxw = minw;
#include <Elementary.h>
static void inwin_close(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *inwin = data;
evas_object_del(inwin);
}
static void inwin_show(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *win = data;
Evas_Object *inwin, *bx, *lb, *bt;
inwin = elm_win_inwin_add(win);
elm_win_resize_object_add(win, inwin);
evas_object_show(inwin);
bx = elm_box_add(win);
elm_win_resize_object_add(win, bx); // FIXME: this is the line that
cause the problem
evas_object_show(bx);
lb = elm_label_add(win);
elm_label_label_set(lb, "inwin stuff");
evas_object_size_hint_weight_set(lb, 1.0, 1.0);
elm_win_resize_object_add(win, lb);
elm_box_pack_end(bx, lb);
evas_object_show(lb);
bt = elm_button_add(win);
elm_button_label_set(bt, "close");
elm_box_pack_end(bx, bt);
evas_object_smart_callback_add(bt, "clicked", inwin_close, inwin);
evas_object_show(bt);
elm_win_inwin_content_set(inwin, bx);
}
static void notify_show(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *win = data;
Evas_Object *notify, *lb;
notify = elm_notify_add(win);
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
evas_object_show(notify);
lb = elm_label_add(win);
elm_label_label_set(lb, "Hello World!");
evas_object_size_hint_weight_set(lb, 1.0, 1.0);
elm_win_resize_object_add(win, lb);
evas_object_show(lb);
elm_notify_content_set(notify, lb);
}
Evas_Object *xxx_win;
void xxx(void)
{
int x, y, w, h;
evas_object_geometry_get(xxx_win, &x, &y, &w, &h);
printf("%d,%d,%d,%d\n", x, y, w, h);
}
EAPI int elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *lb, *notify, *bx, *bt;
xxx_win = win = elm_win_add(NULL, "hello", ELM_WIN_BASIC);
elm_win_conformant_set(win, 1);
printf("win=%p\n", win);
elm_win_title_set(win, "Hello");
elm_win_autodel_set(win, 1);
evas_object_resize(win, 320, 240);
bg = elm_bg_add(win);
//evas_object_size_hint_min_set(bg, 320, 204);
evas_object_size_hint_weight_set(bg, 1.0, 1.0);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_show(bx);
bt = elm_button_add(win);
elm_button_label_set(bt, "inwin");
evas_object_smart_callback_add(bt, "clicked", inwin_show, win);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_button_label_set(bt, "notify");
evas_object_smart_callback_add(bt, "clicked", notify_show, win);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
evas_object_show(win);
elm_run();
elm_shutdown();
return 0;
}
ELM_MAIN()
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel