diff options
author | Yeshwanth Reddivari <r.yeshwanth@samsung.com> | 2016-05-06 11:23:17 +0530 |
---|---|---|
committer | Amitesh Singh <amitesh.sh@samsung.com> | 2016-05-06 11:23:17 +0530 |
commit | aa01d5c7cb0e2b079a89736a6eb42b087ecb6c1e (patch) | |
tree | c7ceb41246579a4f1f63823df5ebd8e681e3f066 | |
parent | c7d652ade119116677b2c920cf936ea9572c12b0 (diff) |
Toolbar: Use orientation interface APIs instead of horizontal set/get APIs
Test Plan: elementary_test
Reviewers: raster, jpeg, cedric, singh.amitesh
Reviewed By: singh.amitesh
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3890
-rw-r--r-- | src/lib/elementary/elm_toolbar.c | 110 | ||||
-rw-r--r-- | src/lib/elementary/elm_toolbar.eo | 15 | ||||
-rw-r--r-- | src/lib/elementary/elm_toolbar_legacy.h | 24 | ||||
-rw-r--r-- | src/lib/elementary/elm_widget_toolbar.h | 2 |
4 files changed, 98 insertions, 53 deletions
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index f0ca109e18..506ae5331c 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c | |||
@@ -112,7 +112,7 @@ _items_visibility_fix(Elm_Toolbar_Data *sd, | |||
112 | if (sd->more_item) | 112 | if (sd->more_item) |
113 | { | 113 | { |
114 | evas_object_geometry_get(sd->VIEW(more_item), NULL, NULL, &ciw, &cih); | 114 | evas_object_geometry_get(sd->VIEW(more_item), NULL, NULL, &ciw, &cih); |
115 | if (sd->vertical) *iw += cih; | 115 | if (sd->orientation == EFL_ORIENT_VERTICAL) *iw += cih; |
116 | else *iw += ciw; | 116 | else *iw += ciw; |
117 | } | 117 | } |
118 | 118 | ||
@@ -121,7 +121,7 @@ _items_visibility_fix(Elm_Toolbar_Data *sd, | |||
121 | if (it->prio.priority > sd->standard_priority) | 121 | if (it->prio.priority > sd->standard_priority) |
122 | { | 122 | { |
123 | evas_object_geometry_get(VIEW(it), NULL, NULL, &ciw, &cih); | 123 | evas_object_geometry_get(VIEW(it), NULL, NULL, &ciw, &cih); |
124 | if (sd->vertical) *iw += cih; | 124 | if (sd->orientation == EFL_ORIENT_VERTICAL) *iw += cih; |
125 | else *iw += ciw; | 125 | else *iw += ciw; |
126 | it->prio.visible = (*iw <= vw); | 126 | it->prio.visible = (*iw <= vw); |
127 | it->in_box = sd->bx; | 127 | it->in_box = sd->bx; |
@@ -279,7 +279,7 @@ _items_size_fit(Evas_Object *obj, Evas_Coord *bl, Evas_Coord view) | |||
279 | 279 | ||
280 | if (mw != -1 || mh != -1) | 280 | if (mw != -1 || mh != -1) |
281 | { | 281 | { |
282 | if (sd->vertical) min = mh; | 282 | if (sd->orientation == EFL_ORIENT_VERTICAL) min = mh; |
283 | else min = mw; | 283 | else min = mw; |
284 | 284 | ||
285 | if ((!full) && ((sumf + min) > view)) | 285 | if ((!full) && ((sumf + min) > view)) |
@@ -377,7 +377,7 @@ _resize_job(void *data) | |||
377 | { | 377 | { |
378 | Evas_Coord iw = 0, ih = 0, more_w = 0, more_h = 0; | 378 | Evas_Coord iw = 0, ih = 0, more_w = 0, more_h = 0; |
379 | 379 | ||
380 | if (sd->vertical) | 380 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
381 | { | 381 | { |
382 | h = vh; | 382 | h = vh; |
383 | _items_visibility_fix(sd, &ih, vh, &more); | 383 | _items_visibility_fix(sd, &ih, vh, &more); |
@@ -390,7 +390,7 @@ _resize_job(void *data) | |||
390 | evas_object_geometry_get | 390 | evas_object_geometry_get |
391 | (sd->VIEW(more_item), NULL, NULL, &more_w, &more_h); | 391 | (sd->VIEW(more_item), NULL, NULL, &more_w, &more_h); |
392 | 392 | ||
393 | if (sd->vertical) | 393 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
394 | { | 394 | { |
395 | if ((ih - more_h) <= vh) ih -= more_h; | 395 | if ((ih - more_h) <= vh) ih -= more_h; |
396 | } | 396 | } |
@@ -403,8 +403,8 @@ _resize_job(void *data) | |||
403 | * individual items won't trigger a resize. Items are be | 403 | * individual items won't trigger a resize. Items are be |
404 | * readded below. */ | 404 | * readded below. */ |
405 | evas_object_box_remove_all(sd->bx, EINA_FALSE); | 405 | evas_object_box_remove_all(sd->bx, EINA_FALSE); |
406 | if (((sd->vertical) && (ih > vh)) || | 406 | if (((sd->orientation == EFL_ORIENT_VERTICAL) && (ih > vh)) || |
407 | ((!sd->vertical) && (iw > vw)) || more) | 407 | ((sd->orientation == EFL_ORIENT_HORIZONTAL) && (iw > vw)) || more) |
408 | { | 408 | { |
409 | Evas_Object *menu; | 409 | Evas_Object *menu; |
410 | 410 | ||
@@ -457,7 +457,7 @@ _resize_job(void *data) | |||
457 | { | 457 | { |
458 | Evas_Coord iw = 0, ih = 0; | 458 | Evas_Coord iw = 0, ih = 0; |
459 | 459 | ||
460 | if (sd->vertical) | 460 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
461 | { | 461 | { |
462 | h = vh; | 462 | h = vh; |
463 | _items_visibility_fix(sd, &ih, vh, &more); | 463 | _items_visibility_fix(sd, &ih, vh, &more); |
@@ -468,8 +468,8 @@ _resize_job(void *data) | |||
468 | _items_visibility_fix(sd, &iw, vw, &more); | 468 | _items_visibility_fix(sd, &iw, vw, &more); |
469 | } | 469 | } |
470 | evas_object_box_remove_all(sd->bx, EINA_FALSE); | 470 | evas_object_box_remove_all(sd->bx, EINA_FALSE); |
471 | if (((sd->vertical) && (ih > vh)) || | 471 | if (((sd->orientation == EFL_ORIENT_VERTICAL) && (ih > vh)) || |
472 | ((!sd->vertical) && (iw > vw)) || more) | 472 | ((sd->orientation == EFL_ORIENT_HORIZONTAL) && (iw > vw)) || more) |
473 | { | 473 | { |
474 | EINA_INLIST_FOREACH(sd->items, it) | 474 | EINA_INLIST_FOREACH(sd->items, it) |
475 | { | 475 | { |
@@ -496,12 +496,12 @@ _resize_job(void *data) | |||
496 | { | 496 | { |
497 | Evas_Coord iw = 0, ih = 0; | 497 | Evas_Coord iw = 0, ih = 0; |
498 | 498 | ||
499 | if (sd->vertical) | 499 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
500 | h = (vh >= mh) ? vh : mh; | 500 | h = (vh >= mh) ? vh : mh; |
501 | else | 501 | else |
502 | w = (vw >= mw) ? vw : mw; | 502 | w = (vw >= mw) ? vw : mw; |
503 | 503 | ||
504 | if (sd->vertical) | 504 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
505 | _items_visibility_fix(sd, &ih, vh, &more); | 505 | _items_visibility_fix(sd, &ih, vh, &more); |
506 | else | 506 | else |
507 | _items_visibility_fix(sd, &iw, vw, &more); | 507 | _items_visibility_fix(sd, &iw, vw, &more); |
@@ -526,7 +526,7 @@ _resize_job(void *data) | |||
526 | else | 526 | else |
527 | evas_object_hide(sd->VIEW(more_item)); | 527 | evas_object_hide(sd->VIEW(more_item)); |
528 | 528 | ||
529 | if (sd->vertical) | 529 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
530 | { | 530 | { |
531 | if (h > vh) _items_size_fit(obj, &h, vh); | 531 | if (h > vh) _items_size_fit(obj, &h, vh); |
532 | if (sd->item_count - sd->separator_count > 0) | 532 | if (sd->item_count - sd->separator_count > 0) |
@@ -543,7 +543,7 @@ _resize_job(void *data) | |||
543 | } | 543 | } |
544 | else | 544 | else |
545 | { | 545 | { |
546 | if (sd->vertical) | 546 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
547 | h = (vh >= mh) ? vh : mh; | 547 | h = (vh >= mh) ? vh : mh; |
548 | else | 548 | else |
549 | w = (vw >= mw) ? vw : mw; | 549 | w = (vw >= mw) ? vw : mw; |
@@ -557,7 +557,7 @@ _resize_job(void *data) | |||
557 | 557 | ||
558 | if (sd->transverse_expanded) | 558 | if (sd->transverse_expanded) |
559 | { | 559 | { |
560 | if (sd->vertical) | 560 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
561 | w = vw; | 561 | w = vw; |
562 | else | 562 | else |
563 | h = vh; | 563 | h = vh; |
@@ -700,8 +700,8 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it) | |||
700 | 700 | ||
701 | item_list = evas_object_box_children_get(sd->bx); | 701 | item_list = evas_object_box_children_get(sd->bx); |
702 | 702 | ||
703 | if ((sd->vertical && (iy < vy)) || | 703 | if ((sd->orientation == EFL_ORIENT_VERTICAL && (iy < vy)) || |
704 | (!sd->vertical && (iw < vw)) || | 704 | (sd->orientation == EFL_ORIENT_HORIZONTAL && (iw < vw)) || |
705 | search_next) | 705 | search_next) |
706 | { | 706 | { |
707 | while ((item_list = eina_list_next(item_list))) | 707 | while ((item_list = eina_list_next(item_list))) |
@@ -884,8 +884,8 @@ _item_focused_next( Evas_Object *obj, | |||
884 | if (!next_focused_item) | 884 | if (!next_focused_item) |
885 | return EINA_FALSE; | 885 | return EINA_FALSE; |
886 | 886 | ||
887 | if ((!sd->vertical && (dir == ELM_FOCUS_LEFT || dir == ELM_FOCUS_RIGHT)) | 887 | if ((sd->orientation == EFL_ORIENT_HORIZONTAL && (dir == ELM_FOCUS_LEFT || dir == ELM_FOCUS_RIGHT)) |
888 | || (sd->vertical && (dir == ELM_FOCUS_UP || dir == ELM_FOCUS_DOWN))) | 888 | || (sd->orientation == EFL_ORIENT_VERTICAL && (dir == ELM_FOCUS_UP || dir == ELM_FOCUS_DOWN))) |
889 | { | 889 | { |
890 | elm_object_item_focus_set(EO_OBJ(next_focused_item), EINA_TRUE); | 890 | elm_object_item_focus_set(EO_OBJ(next_focused_item), EINA_TRUE); |
891 | return EINA_TRUE; | 891 | return EINA_TRUE; |
@@ -1400,7 +1400,7 @@ _item_theme_hook(Evas_Object *obj, | |||
1400 | 1400 | ||
1401 | _item_shrink_signal_emit(view, sd->shrink_mode); | 1401 | _item_shrink_signal_emit(view, sd->shrink_mode); |
1402 | 1402 | ||
1403 | if (sd->vertical) | 1403 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1404 | elm_layout_signal_emit(view, "elm,orient,vertical", "elm"); | 1404 | elm_layout_signal_emit(view, "elm,orient,vertical", "elm"); |
1405 | else | 1405 | else |
1406 | elm_layout_signal_emit(view, "elm,orient,horizontal", "elm"); | 1406 | elm_layout_signal_emit(view, "elm,orient,horizontal", "elm"); |
@@ -1410,7 +1410,7 @@ _item_theme_hook(Evas_Object *obj, | |||
1410 | elm_coords_finger_size_adjust(1, &mw, 1, &mh); | 1410 | elm_coords_finger_size_adjust(1, &mw, 1, &mh); |
1411 | if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND) | 1411 | if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND) |
1412 | { | 1412 | { |
1413 | if (sd->vertical) | 1413 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1414 | { | 1414 | { |
1415 | evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, -1.0); | 1415 | evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, -1.0); |
1416 | evas_object_size_hint_align_set | 1416 | evas_object_size_hint_align_set |
@@ -1502,7 +1502,7 @@ _sizing_eval(Evas_Object *obj) | |||
1502 | } | 1502 | } |
1503 | else if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND) | 1503 | else if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND) |
1504 | { | 1504 | { |
1505 | if (sd->vertical) | 1505 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1506 | { | 1506 | { |
1507 | minw = minw_bx + (w - vw); | 1507 | minw = minw_bx + (w - vw); |
1508 | if (minh_bx <= vh) minh_bx = vh; | 1508 | if (minh_bx <= vh) minh_bx = vh; |
@@ -1517,7 +1517,7 @@ _sizing_eval(Evas_Object *obj) | |||
1517 | } | 1517 | } |
1518 | else | 1518 | else |
1519 | { | 1519 | { |
1520 | if (sd->vertical) | 1520 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1521 | { | 1521 | { |
1522 | minw = minw_bx + (w - vw); | 1522 | minw = minw_bx + (w - vw); |
1523 | minh = h - vh; | 1523 | minh = h - vh; |
@@ -1531,7 +1531,7 @@ _sizing_eval(Evas_Object *obj) | |||
1531 | 1531 | ||
1532 | if (sd->transverse_expanded) | 1532 | if (sd->transverse_expanded) |
1533 | { | 1533 | { |
1534 | if (sd->vertical) | 1534 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1535 | minw_bx = vw; | 1535 | minw_bx = vw; |
1536 | else | 1536 | else |
1537 | minh_bx = vh; | 1537 | minh_bx = vh; |
@@ -1578,7 +1578,7 @@ _elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd) | |||
1578 | elm_widget_theme_object_set | 1578 | elm_widget_theme_object_set |
1579 | (obj, wd->resize_obj, "toolbar", "base", | 1579 | (obj, wd->resize_obj, "toolbar", "base", |
1580 | elm_widget_style_get(obj)); | 1580 | elm_widget_style_get(obj)); |
1581 | if (sd->vertical) | 1581 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1582 | edje_object_signal_emit(wd->resize_obj, "elm,orient,vertical", "elm"); | 1582 | edje_object_signal_emit(wd->resize_obj, "elm,orient,vertical", "elm"); |
1583 | else | 1583 | else |
1584 | edje_object_signal_emit(wd->resize_obj, "elm,orient,horizontal", "elm"); | 1584 | edje_object_signal_emit(wd->resize_obj, "elm,orient,horizontal", "elm"); |
@@ -1586,7 +1586,7 @@ _elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd) | |||
1586 | if (!elm_layout_theme_set | 1586 | if (!elm_layout_theme_set |
1587 | (sd->more, "toolbar", "more", elm_widget_style_get(obj))) | 1587 | (sd->more, "toolbar", "more", elm_widget_style_get(obj))) |
1588 | CRI("Failed to set layout!"); | 1588 | CRI("Failed to set layout!"); |
1589 | if (sd->vertical) | 1589 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
1590 | elm_object_signal_emit(sd->more, "elm,orient,vertical", "elm"); | 1590 | elm_object_signal_emit(sd->more, "elm,orient,vertical", "elm"); |
1591 | else | 1591 | else |
1592 | elm_object_signal_emit(sd->more, "elm,orient,horizontal", "elm"); | 1592 | elm_object_signal_emit(sd->more, "elm,orient,horizontal", "elm"); |
@@ -2071,7 +2071,7 @@ _mouse_move_reorder(Elm_Toolbar_Item_Data *item, | |||
2071 | ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); | 2071 | ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); |
2072 | 2072 | ||
2073 | evas_object_geometry_get(VIEW(item), &x, &y, &w, &h); | 2073 | evas_object_geometry_get(VIEW(item), &x, &y, &w, &h); |
2074 | if (sd->vertical) | 2074 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
2075 | evas_object_move(item->proxy, x, ev->cur.canvas.y - (h / 2)); | 2075 | evas_object_move(item->proxy, x, ev->cur.canvas.y - (h / 2)); |
2076 | else | 2076 | else |
2077 | evas_object_move(item->proxy, ev->cur.canvas.x - (w / 2), y); | 2077 | evas_object_move(item->proxy, ev->cur.canvas.x - (w / 2), y); |
@@ -2346,10 +2346,14 @@ _layout(Evas_Object *o, | |||
2346 | void *data) | 2346 | void *data) |
2347 | { | 2347 | { |
2348 | Evas_Object *obj = (Evas_Object *)data; | 2348 | Evas_Object *obj = (Evas_Object *)data; |
2349 | Eina_Bool horizontal; | ||
2349 | 2350 | ||
2350 | ELM_TOOLBAR_DATA_GET(obj, sd); | 2351 | ELM_TOOLBAR_DATA_GET(obj, sd); |
2352 | |||
2353 | horizontal = sd->orientation ? EINA_TRUE : EINA_FALSE; | ||
2354 | |||
2351 | _els_box_layout | 2355 | _els_box_layout |
2352 | (o, priv, !sd->vertical, sd->homogeneous, elm_widget_mirrored_get(obj)); | 2356 | (o, priv, horizontal, sd->homogeneous, elm_widget_mirrored_get(obj)); |
2353 | } | 2357 | } |
2354 | 2358 | ||
2355 | static char * | 2359 | static char * |
@@ -2832,6 +2836,7 @@ _elm_toolbar_evas_object_smart_add(Eo *obj, Elm_Toolbar_Data *priv) | |||
2832 | elm_interface_scrollable_objects_set(obj, edje, priv->hit_rect); | 2836 | elm_interface_scrollable_objects_set(obj, edje, priv->hit_rect); |
2833 | 2837 | ||
2834 | priv->standard_priority = -99999; | 2838 | priv->standard_priority = -99999; |
2839 | priv->orientation = EFL_ORIENT_HORIZONTAL; | ||
2835 | 2840 | ||
2836 | elm_interface_scrollable_bounce_allow_set | 2841 | elm_interface_scrollable_bounce_allow_set |
2837 | (obj, _elm_config->thumbscroll_bounce_enable, EINA_FALSE); | 2842 | (obj, _elm_config->thumbscroll_bounce_enable, EINA_FALSE); |
@@ -2869,7 +2874,7 @@ _elm_toolbar_evas_object_smart_add(Eo *obj, Elm_Toolbar_Data *priv) | |||
2869 | priv->more = elm_layout_add(obj); | 2874 | priv->more = elm_layout_add(obj); |
2870 | if (!elm_layout_theme_set(priv->more, "toolbar", "more", "default")) | 2875 | if (!elm_layout_theme_set(priv->more, "toolbar", "more", "default")) |
2871 | CRI("Failed to set layout!"); | 2876 | CRI("Failed to set layout!"); |
2872 | if (priv->vertical) | 2877 | if (priv->orientation == EFL_ORIENT_VERTICAL) |
2873 | elm_object_signal_emit(priv->more, "elm,orient,vertical", "elm"); | 2878 | elm_object_signal_emit(priv->more, "elm,orient,vertical", "elm"); |
2874 | else | 2879 | else |
2875 | elm_object_signal_emit(priv->more, "elm,orient,horizontal", "elm"); | 2880 | elm_object_signal_emit(priv->more, "elm,orient,horizontal", "elm"); |
@@ -3045,7 +3050,7 @@ _elm_toolbar_coordinates_adjust(Elm_Toolbar_Item_Data *it, | |||
3045 | *y = iy; | 3050 | *y = iy; |
3046 | *w = iw; | 3051 | *w = iw; |
3047 | *h = ih; | 3052 | *h = ih; |
3048 | if (sd->vertical) | 3053 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
3049 | { | 3054 | { |
3050 | //TODO: Enhance it later. | 3055 | //TODO: Enhance it later. |
3051 | if ((ix < vx) || (ix + iw) > (vx + vw) || (iy + ih) > (vy + vh)) | 3056 | if ((ix < vx) || (ix + iw) > (vx + vw) || (iy + ih) > (vy + vh)) |
@@ -3582,7 +3587,7 @@ _elm_toolbar_menu_parent_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) | |||
3582 | EOLIAN static void | 3587 | EOLIAN static void |
3583 | _elm_toolbar_align_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, double align) | 3588 | _elm_toolbar_align_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, double align) |
3584 | { | 3589 | { |
3585 | if (sd->vertical) | 3590 | if (sd->orientation == EFL_ORIENT_VERTICAL) |
3586 | { | 3591 | { |
3587 | if (sd->align != align) | 3592 | if (sd->align != align) |
3588 | evas_object_box_align_set(sd->bx, 0.5, align); | 3593 | evas_object_box_align_set(sd->bx, 0.5, align); |
@@ -3811,12 +3816,15 @@ _elm_toolbar_item_state_prev(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *ite | |||
3811 | } | 3816 | } |
3812 | 3817 | ||
3813 | EOLIAN static void | 3818 | EOLIAN static void |
3814 | _elm_toolbar_horizontal_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Bool horizontal) | 3819 | _elm_toolbar_efl_orientation_orientation_set(Eo *obj, Elm_Toolbar_Data *sd, Efl_Orient dir) |
3815 | { | 3820 | { |
3816 | horizontal = !!horizontal; | 3821 | if (dir != EFL_ORIENT_VERTICAL && |
3817 | if (horizontal != sd->vertical) return; | 3822 | dir != EFL_ORIENT_HORIZONTAL) |
3818 | sd->vertical = !horizontal; | 3823 | return; |
3819 | if (sd->vertical) | 3824 | |
3825 | sd->orientation = dir; | ||
3826 | |||
3827 | if (sd->orientation == EFL_ORIENT_VERTICAL) | ||
3820 | evas_object_box_align_set(sd->bx, 0.5, sd->align); | 3828 | evas_object_box_align_set(sd->bx, 0.5, sd->align); |
3821 | else | 3829 | else |
3822 | evas_object_box_align_set(sd->bx, sd->align, 0.5); | 3830 | evas_object_box_align_set(sd->bx, sd->align, 0.5); |
@@ -3824,10 +3832,34 @@ _elm_toolbar_horizontal_set(Eo *obj, Elm_Toolbar_Data *sd, Eina_Bool horizontal) | |||
3824 | _sizing_eval(obj); | 3832 | _sizing_eval(obj); |
3825 | } | 3833 | } |
3826 | 3834 | ||
3827 | EOLIAN static Eina_Bool | 3835 | EOLIAN static Efl_Orient |
3828 | _elm_toolbar_horizontal_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) | 3836 | _elm_toolbar_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) |
3829 | { | 3837 | { |
3830 | return !sd->vertical; | 3838 | return sd->orientation; |
3839 | } | ||
3840 | |||
3841 | EAPI void | ||
3842 | elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) | ||
3843 | { | ||
3844 | Efl_Orient orient; | ||
3845 | |||
3846 | if (horizontal) | ||
3847 | orient = EFL_ORIENT_HORIZONTAL; | ||
3848 | else | ||
3849 | orient = EFL_ORIENT_VERTICAL; | ||
3850 | |||
3851 | efl_orientation_set(obj, orient); | ||
3852 | } | ||
3853 | |||
3854 | EAPI Eina_Bool | ||
3855 | elm_toolbar_horizontal_get(const Evas_Object *obj) | ||
3856 | { | ||
3857 | ELM_TOOLBAR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE); | ||
3858 | |||
3859 | if (sd->orientation == EFL_ORIENT_VERTICAL) | ||
3860 | return EINA_FALSE; | ||
3861 | else | ||
3862 | return EINA_TRUE; | ||
3831 | } | 3863 | } |
3832 | 3864 | ||
3833 | EOLIAN static unsigned int | 3865 | EOLIAN static unsigned int |
diff --git a/src/lib/elementary/elm_toolbar.eo b/src/lib/elementary/elm_toolbar.eo index 1d9b53216b..c578f0a3f0 100644 --- a/src/lib/elementary/elm_toolbar.eo +++ b/src/lib/elementary/elm_toolbar.eo | |||
@@ -24,7 +24,7 @@ enum Elm.Toolbar.Shrink_Mode | |||
24 | last [[Indicates error if returned by elm_toolbar_shrink_mode_get()]] | 24 | last [[Indicates error if returned by elm_toolbar_shrink_mode_get()]] |
25 | } | 25 | } |
26 | 26 | ||
27 | class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable, | 27 | class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable, Efl.Orientation, |
28 | Elm.Interface_Atspi_Widget_Action, Elm.Interface_Atspi_Selection, | 28 | Elm.Interface_Atspi_Widget_Action, Elm.Interface_Atspi_Selection, |
29 | Evas.Clickable_Interface, Evas.Selectable_Interface) | 29 | Evas.Clickable_Interface, Evas.Selectable_Interface) |
30 | { | 30 | { |
@@ -90,18 +90,6 @@ class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable, | |||
90 | icon_size: int; [[The icon size in pixels]] | 90 | icon_size: int; [[The icon size in pixels]] |
91 | } | 91 | } |
92 | } | 92 | } |
93 | @property horizontal { | ||
94 | [[Change a toolbar's orientation | ||
95 | |||
96 | By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.]] | ||
97 | set { | ||
98 | } | ||
99 | get { | ||
100 | } | ||
101 | values { | ||
102 | horizontal: bool; [[If $true, the toolbar is horizontal.]] | ||
103 | } | ||
104 | } | ||
105 | @property shrink_mode { | 93 | @property shrink_mode { |
106 | [[Control the item displaying mode of a given toolbar widget $obj. | 94 | [[Control the item displaying mode of a given toolbar widget $obj. |
107 | 95 | ||
@@ -370,6 +358,7 @@ class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable, | |||
370 | Elm.Widget.event; | 358 | Elm.Widget.event; |
371 | Elm.Widget.focus_highlight_geometry_get; | 359 | Elm.Widget.focus_highlight_geometry_get; |
372 | Elm.Widget.focused_item.get; | 360 | Elm.Widget.focused_item.get; |
361 | Efl.Orientation.orientation; | ||
373 | Elm.Interface_Atspi_Widget_Action.elm_actions.get; | 362 | Elm.Interface_Atspi_Widget_Action.elm_actions.get; |
374 | Elm.Interface_Atspi_Accessible.children.get; | 363 | Elm.Interface_Atspi_Accessible.children.get; |
375 | Elm.Interface_Atspi_Accessible.state_set.get; | 364 | Elm.Interface_Atspi_Accessible.state_set.get; |
diff --git a/src/lib/elementary/elm_toolbar_legacy.h b/src/lib/elementary/elm_toolbar_legacy.h index db92865056..9d0fe5b007 100644 --- a/src/lib/elementary/elm_toolbar_legacy.h +++ b/src/lib/elementary/elm_toolbar_legacy.h | |||
@@ -85,5 +85,29 @@ EAPI void elm_toolbar_icon_order_lookup_set(Evas_Object *obj EINA_UNUSED, Elm_Ic | |||
85 | * @ingroup Elm_Toolbar | 85 | * @ingroup Elm_Toolbar |
86 | */ | 86 | */ |
87 | EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj EINA_UNUSED); | 87 | EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj EINA_UNUSED); |
88 | |||
89 | /** | ||
90 | * @brief Change a toolbar's orientation | ||
91 | * | ||
92 | * By default, a toolbar will be horizontal. Use this function to create a | ||
93 | * vertical toolbar. | ||
94 | * | ||
95 | * @param[in] horizontal If @c true, the toolbar is horizontal. | ||
96 | * | ||
97 | * @ingroup Elm_Toolbar | ||
98 | */ | ||
99 | EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); | ||
100 | |||
101 | /** | ||
102 | * @brief Get toolbar's current orientation | ||
103 | * | ||
104 | * Use this function to get orientation of toolbar. | ||
105 | * | ||
106 | * @return If @c true, the toolbar is horizontal. | ||
107 | * | ||
108 | * @ingroup Elm_Toolbar | ||
109 | */ | ||
110 | EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj); | ||
111 | |||
88 | #include "elm_toolbar_item.eo.legacy.h" | 112 | #include "elm_toolbar_item.eo.legacy.h" |
89 | #include "elm_toolbar.eo.legacy.h" | 113 | #include "elm_toolbar.eo.legacy.h" |
diff --git a/src/lib/elementary/elm_widget_toolbar.h b/src/lib/elementary/elm_widget_toolbar.h index 42d9a2a167..15d9e23775 100644 --- a/src/lib/elementary/elm_widget_toolbar.h +++ b/src/lib/elementary/elm_widget_toolbar.h | |||
@@ -49,8 +49,8 @@ struct _Elm_Toolbar_Data | |||
49 | Elm_Object_Select_Mode select_mode; | 49 | Elm_Object_Select_Mode select_mode; |
50 | Ecore_Timer *long_timer; | 50 | Ecore_Timer *long_timer; |
51 | Ecore_Job *resize_job; | 51 | Ecore_Job *resize_job; |
52 | Efl_Orient orientation; | ||
52 | 53 | ||
53 | Eina_Bool vertical : 1; | ||
54 | Eina_Bool long_press : 1; | 54 | Eina_Bool long_press : 1; |
55 | Eina_Bool homogeneous : 1; | 55 | Eina_Bool homogeneous : 1; |
56 | Eina_Bool delete_me : 1; | 56 | Eina_Bool delete_me : 1; |