Changeset 5484


Ignore:
Timestamp:
08/19/09 01:49:54 (4 years ago)
Author:
werner
Message:
  • fixed precedence of unary minus, so that -(a+b) isn't printed as -a+b
  • removed in_path logic (never missed not having it) and made selected vectors a little brighter
Location:
trunk/eda/fped
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/eda/fped/gui_inst.c

    r5461 r5484  
    112112        if (selected_inst == self) 
    113113                return mode_selected; 
    114         if (self->active) 
    115                 return self->in_path ? mode_active_in_path : mode_active; 
    116         return self->in_path ? mode_inactive_in_path : mode_inactive; 
     114        return self->active ? mode_active : mode_inactive; 
    117115} 
    118116 
  • trunk/eda/fped/gui_style.c

    r5423 r5484  
    5050 
    5151static void style(GdkGC *gcs[mode_n], 
    52     const char *in, const char *in_path, const char *act, const char *act_path, 
    53     const char *sel) 
     52    const char *in, const char *act, const char *sel) 
    5453{ 
    5554        gcs[mode_inactive]              = gc(in, 1); 
    56         gcs[mode_inactive_in_path]      = gc(in_path, 1); 
    5755        gcs[mode_active]                = gc(act, 1); 
    58         gcs[mode_active_in_path]        = gc(act_path, 1); 
    5956        gcs[mode_selected]              = gc(sel, 2); 
    6057} 
     
    6663        gc_bg_error = gc("#000040", 0); 
    6764        gc_drag = gc("#ffffff", 2); 
    68         /*              inactive   in+path    active     act+path   selected */ 
    69         style(gc_vec,   "#202000", "#404020", "#909040", "#c0c080", "#ffff80"); 
    70         style(gc_obj,   "#006060", INVALID,   "#00ffff", INVALID,  "#ffff80"); 
    71         style(gc_pad,   "#400000", INVALID,   "#ff0000", INVALID,  "#ffff80"); 
    72         style(gc_ptext, "#404040", INVALID,   "#ffffff", INVALID,  "#ffffff"); 
    73         style(gc_meas,  "#280040", INVALID,   "#ff00ff", INVALID,  "#ffff80"); 
    74         style(gc_frame, "#004000", "#205020", "#009000", INVALID,  "#ffff80"); 
     65        /*              inactive   active     selected */ 
     66        style(gc_vec,   "#202000", "#b0b050", "#ffff80"); 
     67        style(gc_obj,   "#006060", "#00ffff", "#ffff80"); 
     68        style(gc_pad,   "#400000", "#ff0000", "#ffff80"); 
     69        style(gc_ptext, "#404040", "#ffffff", "#ffffff"); 
     70        style(gc_meas,  "#280040", "#ff00ff", "#ffff80"); 
     71        style(gc_frame, "#004000", "#009000", "#ffff80"); 
    7572 
    7673        gc_active_frame = gc("#00ff00", 2); 
  • trunk/eda/fped/inst.c

    r5482 r5484  
    128128 
    129129 
    130 static void set_path(int on) 
    131 { 
    132         struct inst *inst; 
    133 return; 
    134         if (inst->ops != &vec_ops && inst->ops != &frame_ops) 
    135                 return; 
    136 /* @@@ wrong */ 
    137         for (inst = selected_inst; inst; inst = inst->outer) { 
    138                 if (inst->ops != &vec_ops && inst->ops != &frame_ops) 
    139                         break; 
    140                 inst->in_path = on; 
    141         } 
    142 } 
    143  
    144  
    145130static void inst_select_inst(struct inst *inst) 
    146131{ 
    147132        selected_inst = inst; 
    148         set_path(1); 
    149133        tool_selected_inst(inst); 
    150134        gui_frame_select_inst(inst); 
     
    316300{ 
    317301        if (selected_inst) { 
    318                 set_path(0); 
    319302                tool_selected_inst(NULL); 
    320303                gui_frame_deselect_inst(selected_inst); 
     
    449432        inst->outer = curr_frame; 
    450433        inst->active = IS_ACTIVE; 
    451         inst->in_path = 0; 
    452434        inst->next = NULL; 
    453435        *curr_pkg->next_inst[prio] = inst; 
  • trunk/eda/fped/inst.h

    r5482 r5484  
    2424enum mode { 
    2525        mode_inactive,          /* on inactive frame */ 
    26         mode_inactive_in_path,  /* inactive but is in path to selected */ 
    2726        mode_active,            /* on active frame */ 
    28         mode_active_in_path,    /* active and is in path to selected */ 
    2927        mode_selected,          /* item is selected */ 
    3028        mode_hover,             /* hovering over item's contact area */ 
     
    8179        struct inst *outer; /* frame containing this item */ 
    8280        int active; 
    83         int in_path; 
    8481        union { 
    8582                struct { 
  • trunk/eda/fped/unparse.c

    r5421 r5484  
    9191                return stralloc(expr->u.var); 
    9292        if (expr->op == op_minus) 
    93                 return merge2("-", unparse_op(expr->u.op.a, prec_add)); 
     93                return merge2("-", unparse_op(expr->u.op.a, prec_unary)); 
    9494        if (expr->op == op_add) 
    9595                return merge3(unparse_op(expr->u.op.a, prec_add), "+", 
Note: See TracChangeset for help on using the changeset viewer.