summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-02-15 22:35:00 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-05 12:54:39 +0200
commit6f00127d444213a2a3b2fc4788ef5cb3b9882be9 (patch)
treea276aa1663748d3cfb081ea460dad1a046547feb
parent85868dc0b083ca4d0615a45c65d4edf413eb294b (diff)
settingswidget: added a swallowpart
-rw-r--r--data/themes/edc/elm/settingspane.edc12
-rw-r--r--src/bin/test_settingspane.c7
-rw-r--r--src/lib/elc_settingspane.c15
-rw-r--r--src/lib/elm_settingspane.eo1
4 files changed, 34 insertions, 1 deletions
diff --git a/data/themes/edc/elm/settingspane.edc b/data/themes/edc/elm/settingspane.edc
index c13f5a5f8..74869843b 100644
--- a/data/themes/edc/elm/settingspane.edc
+++ b/data/themes/edc/elm/settingspane.edc
@@ -102,6 +102,18 @@ group { name: "elm/settingspane/base/default";
102 fixed: 0 1; 102 fixed: 0 1;
103 } 103 }
104 } 104 }
105 part { name: "elm.swallow.options"; type: SWALLOW;
106 description { state: "default" 0.0;
107 align: 1.0 0.5;
108 rel1.to_x: "elm.swallow.search";
109 rel1.to_y: "title_base";
110 rel1.relative: 1.0 0.0;
111 rel2.to_x: "elm.swallow.search";
112 rel2.to_y: "title_base";
113 rel2.relative: 0.0 1.0;
114 fixed: 1 1;
115 }
116 }
105 part { name: "back"; type: RECT; scale: 1; 117 part { name: "back"; type: RECT; scale: 1;
106 description { state: "default" 0.0; 118 description { state: "default" 0.0;
107 aspect: 1.0 1.0; aspect_preference: VERTICAL; 119 aspect: 1.0 1.0; aspect_preference: VERTICAL;
diff --git a/src/bin/test_settingspane.c b/src/bin/test_settingspane.c
index 4efac888a..832b5c3e1 100644
--- a/src/bin/test_settingspane.c
+++ b/src/bin/test_settingspane.c
@@ -217,7 +217,7 @@ recreate_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E
217void 217void
218test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 218test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
219{ 219{
220 Evas_Object *win, *o, *box, *sw, *btnbox, *ic; 220 Evas_Object *win, *o, *box, *sw, *btnbox, *ic, *swallow;
221 Elm_Settingspane_Item *it, *it2; 221 Elm_Settingspane_Item *it, *it2;
222 char buf[PATH_MAX]; 222 char buf[PATH_MAX];
223 223
@@ -231,9 +231,14 @@ test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
231 elm_win_resize_object_add(win, box); 231 elm_win_resize_object_add(win, box);
232 evas_object_show(box); 232 evas_object_show(box);
233 233
234 swallow = elm_button_add(win);
235 elm_object_text_set(swallow, "I am the options part");
236 evas_object_show(swallow);
237
234 sw = elm_settingspane_add(win); 238 sw = elm_settingspane_add(win);
235 evas_object_size_hint_weight_set(sw, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 239 evas_object_size_hint_weight_set(sw, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
236 evas_object_size_hint_align_set(sw, EVAS_HINT_FILL, EVAS_HINT_FILL); 240 evas_object_size_hint_align_set(sw, EVAS_HINT_FILL, EVAS_HINT_FILL);
241 elm_object_part_content_set(sw, "options", swallow);
237 elm_box_pack_end(box, sw); 242 elm_box_pack_end(box, sw);
238 243
239 int i = 0; 244 int i = 0;
diff --git a/src/lib/elc_settingspane.c b/src/lib/elc_settingspane.c
index e45fccdfc..5debafcb7 100644
--- a/src/lib/elc_settingspane.c
+++ b/src/lib/elc_settingspane.c
@@ -5,6 +5,7 @@
5#include <Elementary.h> 5#include <Elementary.h>
6 6
7#include <elm_priv.h> 7#include <elm_priv.h>
8#include "elm_widget_layout.h"
8 9
9/** 10/**
10 * This widget has a internal stack for displaying panels. 11 * This widget has a internal stack for displaying panels.
@@ -156,6 +157,12 @@ static void _search_panel_stop(Evas_Object *w);
156#define IC_DATA_L(v) eo_data_scope_get(v, ELM_SETTINGSPANE_ITEM_CLASS) 157#define IC_DATA_L(v) eo_data_scope_get(v, ELM_SETTINGSPANE_ITEM_CLASS)
157#define C_DATA(v) Elm_Settingspane_Data *wd = eo_data_scope_get(v, ELM_SETTINGSPANE_CLASS) 158#define C_DATA(v) Elm_Settingspane_Data *wd = eo_data_scope_get(v, ELM_SETTINGSPANE_CLASS)
158 159
160static const Elm_Layout_Part_Alias_Description _content_aliases[] =
161{
162 {"options", "elm.swallow.options"},
163 {NULL, NULL}
164};
165
159static void 166static void
160conf_menu_back_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 167conf_menu_back_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
161{ 168{
@@ -1314,6 +1321,14 @@ _history_menu_show_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emis
1314 _history_menu_show(obj, x, y); 1321 _history_menu_show(obj, x, y);
1315} 1322}
1316 1323
1324
1325EOLIAN static const Elm_Layout_Part_Alias_Description*
1326_elm_settingspane_elm_layout_content_aliases_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Data *_pd EINA_UNUSED)
1327{
1328 return _content_aliases;
1329}
1330
1331
1317EOLIAN static Elm_Settingspane_Item* 1332EOLIAN static Elm_Settingspane_Item*
1318_elm_settingspane_focused_get(Eo *obj, Elm_Settingspane_Data *pd EINA_UNUSED) 1333_elm_settingspane_focused_get(Eo *obj, Elm_Settingspane_Data *pd EINA_UNUSED)
1319{ 1334{
diff --git a/src/lib/elm_settingspane.eo b/src/lib/elm_settingspane.eo
index edb750e72..87184860e 100644
--- a/src/lib/elm_settingspane.eo
+++ b/src/lib/elm_settingspane.eo
@@ -112,5 +112,6 @@ class Elm_Settingspane(Elm_Layout)
112 Eo.Base.constructor; 112 Eo.Base.constructor;
113 Eo.Base.destructor; 113 Eo.Base.destructor;
114 Evas.Object_Smart.add; 114 Evas.Object_Smart.add;
115 Elm_Layout.content_aliases.get;
115 } 116 }
116} 117}