aboutsummaryrefslogtreecommitdiffstats
path: root/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/data/themes/default.edc133
-rw-r--r--legacy/elementary/src/bin/test_layout.c27
2 files changed, 158 insertions, 2 deletions
diff --git a/legacy/elementary/data/themes/default.edc b/legacy/elementary/data/themes/default.edc
index 2fa7c39914..501105c3c6 100644
--- a/legacy/elementary/data/themes/default.edc
+++ b/legacy/elementary/data/themes/default.edc
@@ -31010,3 +31010,136 @@ collections {
}
}
}
+
+ /* a simple title layout, with a label and two icons */
+ group { name: "elm/layout/application/titlebar";
+ images {
+ image: "bt_dis_shine.png" COMP;
+ }
+ parts {
+ part { name: "base";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 30;
+ max: 99999 30;
+ color: 0 0 0 255;
+ }
+ }
+ part { name: "bg";
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ rel1.offset: -1 -1;
+ rel2.offset: 0 0;
+ image { normal: "bt_dis_shine.png";
+ border: 4 4 4 4;
+ }
+ }
+ }
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ rel1 {
+ to: "base";
+ relative: 0.0 0.0;
+ offset: 12 0;
+ }
+ rel2 {
+ to: "base";
+ relative: 0.0 1.0;
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "elm.swallow.end";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ fixed: 1 1;
+ align: 1.0 0.5;
+ rel1 {
+ to: "base";
+ relative: 1.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ to: "base";
+ relative: 1.0 1.0;
+ offset: -13 -1;
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part { name: "elm.text";
+ type: TEXT;
+ effect: SOFT_SHADOW;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 0.0 0.5;
+ fixed: 1 1;
+ rel1 {
+ to_x: "elm.swallow.icon";
+ to_y: "base";
+ relative: 1.0 0.0;
+ offset: 2 0;
+ }
+ rel2 {
+ to_x: "elm.swallow.end";
+ to_y: "base";
+ relative: 0.0 1.0;
+ offset: -3 -1;
+ }
+ text {
+ font: "Sans";
+ size: 12;
+ min: 0 0;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ }
+ programs {
+ program { name: "show_icon";
+ signal: "elm,state,icon,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.icon";
+ }
+ program { name: "hide_icon";
+ signal: "elm,state,icon,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.icon";
+ }
+ program { name: "show_end";
+ signal: "elm,state,end,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.end";
+ }
+ program { name: "hide_end";
+ signal: "elm,state,end,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.end";
+ }
+ }
+ }
+}
diff --git a/legacy/elementary/src/bin/test_layout.c b/legacy/elementary/src/bin/test_layout.c
index 05bf3d710d..251b9c177a 100644
--- a/legacy/elementary/src/bin/test_layout.c
+++ b/legacy/elementary/src/bin/test_layout.c
@@ -14,7 +14,7 @@ _clicked_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
void
test_layout(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *win, *bg, *ly, *bt;
+ Evas_Object *win, *bg, *box, *ly, *bt;
char buf[PATH_MAX];
win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
@@ -26,11 +26,34 @@ test_layout(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
+ box = elm_box_add(win);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_win_resize_object_add(win, box);
+ evas_object_show(box);
+
+ ly = elm_layout_add(win);
+ elm_layout_theme_set(ly, "layout", "application", "titlebar");
+ elm_layout_label_set(ly, "Some title");
+ elm_box_pack_end(box, ly);
+ evas_object_show(ly);
+
+ bt = elm_icon_add(win);
+ elm_icon_standard_set(bt, "chat");
+ evas_object_size_hint_min_set(bt, 20, 20);
+ elm_layout_icon_set(ly, bt);
+
+ bt = elm_icon_add(win);
+ elm_icon_standard_set(bt, "close");
+ evas_object_size_hint_min_set(bt, 20, 20);
+ elm_layout_end_set(ly, bt);
+
ly = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
elm_layout_file_set(ly, buf, "layout");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(win, ly);
+ elm_box_pack_end(box, ly);
+ //elm_win_resize_object_add(win, ly);
evas_object_show(ly);
bt = elm_button_add(win);