On Tue, 28 Apr 2009 11:47:21 +0200 Viktor Kojouharov <[email protected]>
said:

> On Tue, 2009-04-28 at 13:30 +0400, Sergey P. Semernin wrote:
> > Hello, All.
> > 
> > For example, I'm creating a TEXTBLOCK part in widget:
> > 
> > part {
> >   name: "text.block";
> >   type: TEXTBLOCK;
> >   ...
> >   description {
> >     state: "default" 0.0;
> >     ...
> >     text {
> >       style: "textblock_style_1";
> >       ...
> >     }
> >   }
> >   description {
> >     state: "another" 0.0;
> >     ...
> >     text {
> >       style: "textblock_style_2";
> >       ...
> >     }
> >   }
> > }
> > 
> > And I overriding text { } attribute in another state: changing font style.
> > But accually no style of text changed runtime when part state changed by
> > signal. Visible/Invisible, Color and others changed successfully, but not
> > text style. All styles are defined properly and working.
> > If I create two same parts with different font styles and selectively
> > shown it - working well, but more beautiful is changing state within
> > one part...
> > 
> > Is it possible to redefine text { } attribute for TEXTBLOCK or no?
> > 
> Unfortunately, edje doesn't yet seem to support switching between
> different styles for a textblock. You could look in edje_calc.c (and
> maybe even in _edje_part_recalc) if you want to try to implement it. I'm
> sure a lot of people will be pleased :)

works for me:

   group { name: "elm/label/base/default";
      styles
        {
           style { name: "textblock_style";
              base: "font=Sans font_size=10 align=left color=#000 wrap=word";

              tag:  "br" "\n";
              tag:  "hilight" "+ font=Sans:style=Bold";
              tag:  "b" "+ font=Sans:style=Bold";
              tag:  "tab" "\t";
           }
           style { name: "textblock_style2";
              base: "font=Sans font_size=20 align=left color=#f00 wrap=word";

              tag:  "br" "\n";
              tag:  "hilight" "+ font=Sans:style=Bold";
              tag:  "b" "+ font=Sans:style=Bold";
              tag:  "tab" "\t";
           }
        }
      parts {
         part { name: "elm.text";
            type: TEXTBLOCK;
            mouse_events: 1;
            scale: 1;
            description { state: "default" 0.0;
               text {
                  style: "textblock_style";
                  min: 1 1;
               }
            }
            description { state: "two" 0.0;
               inherit: "default" 0.0;
               text {
                  style: "textblock_style2";
               }
            }
         }
      }
      programs {
         program {
            name:   "button_click";
            signal: "mouse,down,1";
            source: "elm.text";
            action: STATE_SET "two" 0.0;
            target: "elm.text";
         }
         program {
            name:   "button_click2";
            signal: "mouse,up,1";
            source: "elm.text";
            action: STATE_SET "default" 0.0;
            target: "elm.text";
         }
      }
   }



-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [email protected]


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to