Daniel
Daniel

Reputation: 2592

How to send a signal to custom theme?

In Tizen it's very easy to send signals to my theme (EDC) from C/C++ code by elm_layout_signal_emit.

I have a genlist named myList, and I created a custom theme for it (with EDC):

group { "elm/genlist/base/mystyle";
   parts { ... }

   programs {
      program { "myprogram";
         source: "app";
         signal: "mysignal";
         ...
      }
   }
}

I'm applying this theme to myList: elm_object_style_set(myList, "mystyle").

What is the way to run the myprogram program with this genlist?

I tried

Upvotes: 0

Views: 72

Answers (1)

Jade Lee
Jade Lee

Reputation: 241

elm_object_signal_emit should works. but I have a doupt about those theme is properly applied. if you want to set the custom style to an object, you must change the theme firstly. you can extend your custom theme by calling elm_theme_extension_add(NULL, your_edc_path); //NULL means default theme. see more details on https://docs.tizen.org/application/native/guides/ui/efl/component-custom/

and I wonder... you really want to change genlist not genlist_item. if you want to change genlist widget theme, which is very rarely changed, you need to copy scroller theme or default genlist theme, as genlist is special type of scroller. genlist styles are located in widgets/scroller.edc in https://review.tizen.org/gerrit/#/admin/projects/profile/wearable/platform/core/uifw/efl-theme-tizen-wearable

to make sure, I tested simply signal changes in scroller.edc(genlist/default)

  part { name: "myrect"; type: RECT;
     description { state: "default" 0.0;
        visible: 0;
     }
     description { state: "show" 0.0;
        inherit: "default" 0.0;
        visible: 1;
        color: 255 0 0 255;
     }
  }
  program { name: "myprogram";
     signal: "mysignal";
     source: "app";
     action: STATE_SET "show" 0.0;
     target: "myrect";
  }

and send a signal, elm_object_signal_emit(myList, "mysignal", "app");

which change the background color to red properly.

Upvotes: 1

Related Questions