mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-29 05:02:27 +02:00
When deleting frame "foo" in root->foo->bar and then linking bar from root,
bar didn't automatically become active, which was rather confusing. We now also try harder to keep a frame active. - when deleting a frame, also reset all outbound active references - when removing the active frame reference, search for a suitable replacement instead of just setting it to NULL - gui_style.c: made inactive frames a little more visible git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5516 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
parent
a6f73ae297
commit
347ef8aad5
24
delete.c
24
delete.c
@ -74,6 +74,9 @@ static void do_delete_vec(struct vec *vec);
|
|||||||
static void do_delete_obj(struct obj *obj);
|
static void do_delete_obj(struct obj *obj);
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- helper functions -------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static struct deletion *new_deletion(enum del_type type)
|
static struct deletion *new_deletion(enum del_type type)
|
||||||
{
|
{
|
||||||
struct deletion *del;
|
struct deletion *del;
|
||||||
@ -87,6 +90,19 @@ static struct deletion *new_deletion(enum del_type type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void reset_active_ref(struct frame *ref)
|
||||||
|
{
|
||||||
|
const struct frame *frame;
|
||||||
|
struct obj *obj = NULL;
|
||||||
|
|
||||||
|
for (frame = frames; frame; frame = frame->next)
|
||||||
|
for (obj = frame->objs; obj; obj = obj->next)
|
||||||
|
if (obj->type == ot_frame && obj->u.frame.ref == ref)
|
||||||
|
break;
|
||||||
|
ref->active_ref = obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ----- vectors ----------------------------------------------------------- */
|
/* ----- vectors ----------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
@ -189,7 +205,7 @@ static void destroy_obj(struct obj *obj)
|
|||||||
switch (obj->type) {
|
switch (obj->type) {
|
||||||
case ot_frame:
|
case ot_frame:
|
||||||
if (obj->u.frame.ref->active_ref == obj)
|
if (obj->u.frame.ref->active_ref == obj)
|
||||||
obj->u.frame.ref->active_ref = NULL;
|
reset_active_ref(obj->u.frame.ref);
|
||||||
break;
|
break;
|
||||||
case ot_pad:
|
case ot_pad:
|
||||||
free(obj->u.pad.name);
|
free(obj->u.pad.name);
|
||||||
@ -232,7 +248,7 @@ static void do_delete_obj(struct obj *obj)
|
|||||||
del->u.obj.ref = obj;
|
del->u.obj.ref = obj;
|
||||||
del->u.obj.prev = prev;
|
del->u.obj.prev = prev;
|
||||||
if (obj->type == ot_frame && obj->u.frame.ref->active_ref == obj)
|
if (obj->type == ot_frame && obj->u.frame.ref->active_ref == obj)
|
||||||
obj->u.frame.ref->active_ref = NULL;
|
reset_active_ref(obj->u.frame.ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -502,6 +518,10 @@ static void delete_references(const struct frame *ref)
|
|||||||
if (obj->type == ot_frame)
|
if (obj->type == ot_frame)
|
||||||
if (obj->u.frame.ref == ref)
|
if (obj->u.frame.ref == ref)
|
||||||
do_delete_obj(obj);
|
do_delete_obj(obj);
|
||||||
|
for (obj = ref->objs; obj; obj = obj->next)
|
||||||
|
if (obj->type == ot_frame)
|
||||||
|
if (obj->u.frame.ref->active_ref == obj)
|
||||||
|
reset_active_ref(obj->u.frame.ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ void gui_setup_style(GdkDrawable *drawable)
|
|||||||
style(gc_pad, "#400000", "#ff0000", "#ffff80");
|
style(gc_pad, "#400000", "#ff0000", "#ffff80");
|
||||||
style(gc_ptext, "#404040", "#ffffff", "#ffffff");
|
style(gc_ptext, "#404040", "#ffffff", "#ffffff");
|
||||||
style(gc_meas, "#280040", "#ff00ff", "#ffff80");
|
style(gc_meas, "#280040", "#ff00ff", "#ffff80");
|
||||||
style(gc_frame, "#004000", "#009000", "#ffff80");
|
style(gc_frame, "#005000", "#009000", "#ffff80");
|
||||||
|
|
||||||
gc_active_frame = gc("#00ff00", 2);
|
gc_active_frame = gc("#00ff00", 2);
|
||||||
// gc_highlight = gc("#ff8020", 2);
|
// gc_highlight = gc("#ff8020", 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user