diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | data/themes/edc/elm/button.edc | 303 | ||||
-rw-r--r-- | data/themes/edc/elm/entry.edc | 5 | ||||
-rw-r--r-- | data/themes/edc/elm/spinner.edc | 331 | ||||
-rw-r--r-- | src/lib/elm_authors.h | 1 | ||||
-rw-r--r-- | src/lib/elm_spinner.c | 557 | ||||
-rw-r--r-- | src/lib/elm_spinner.eo | 3 | ||||
-rw-r--r-- | src/lib/elm_widget_spinner.h | 2 |
8 files changed, 725 insertions, 478 deletions
@@ -162,3 +162,4 @@ Woochan Lee <wc0917.lee@samsung.com> | |||
162 | Vitalii Vorobiov <vi.vorobiov@samsung.com> | 162 | Vitalii Vorobiov <vi.vorobiov@samsung.com> |
163 | Jee-Yong Um <conr2d@gmail.com> | 163 | Jee-Yong Um <conr2d@gmail.com> |
164 | Ji-In Moon <jiin.moon@samsung.com> | 164 | Ji-In Moon <jiin.moon@samsung.com> |
165 | Subodh Kumar <s7158.kumar@samsung.com> | ||
diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc index 03c335658..938bee742 100644 --- a/data/themes/edc/elm/button.edc +++ b/data/themes/edc/elm/button.edc | |||
@@ -1328,3 +1328,306 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default"; | |||
1328 | } | 1328 | } |
1329 | } | 1329 | } |
1330 | } | 1330 | } |
1331 | |||
1332 | /******************* SPINNER BUTTONS STYLES **********************/ | ||
1333 | group { name: "elm/button/base/spinner/increase/default"; | ||
1334 | images.image: "sym_right_light_normal.png" COMP; | ||
1335 | images.image: "sym_right_glow_normal.png" COMP; | ||
1336 | images.image: "sym_right_dark_normal.png" COMP; | ||
1337 | script { | ||
1338 | public mouse_down = 0; | ||
1339 | public multi_down = 0; | ||
1340 | } | ||
1341 | parts { | ||
1342 | part { name: "arrow.image"; | ||
1343 | scale: 1; | ||
1344 | description { state: "default" 0.0; | ||
1345 | min: 15 15; | ||
1346 | max: 15 15; | ||
1347 | color_class: "F032L1"; | ||
1348 | image.normal: "sym_right_light_normal.png"; | ||
1349 | } | ||
1350 | description { state: "pressed" 0.0; | ||
1351 | inherit: "default" 0.0; | ||
1352 | image.normal: "sym_right_glow_normal.png"; | ||
1353 | } | ||
1354 | description { state: "disabled" 0.0; | ||
1355 | inherit: "default" 0.0; | ||
1356 | image.normal: "sym_right_dark_normal.png"; | ||
1357 | } | ||
1358 | } | ||
1359 | part { name: "over"; | ||
1360 | type: RECT; | ||
1361 | repeat_events: 1; | ||
1362 | description { state: "default" 0.0; | ||
1363 | color: 0 0 0 0; | ||
1364 | } | ||
1365 | } | ||
1366 | part { name: "disabler"; | ||
1367 | type: RECT; | ||
1368 | description { state: "default" 0.0; | ||
1369 | color: 0 0 0 0; | ||
1370 | visible: 0; | ||
1371 | } | ||
1372 | description { state: "disabled" 0.0; | ||
1373 | inherit: "default" 0.0; | ||
1374 | visible: 1; | ||
1375 | } | ||
1376 | } | ||
1377 | } | ||
1378 | programs { | ||
1379 | program { name: "button_press"; | ||
1380 | signal: "mouse,down,1"; | ||
1381 | source: "over"; | ||
1382 | script { | ||
1383 | if ((get_int(multi_down) == 0) && | ||
1384 | (get_int(mouse_down) == 0)) { | ||
1385 | set_int(mouse_down, 1); | ||
1386 | run_program(PROGRAM:"button_press2"); | ||
1387 | } | ||
1388 | } | ||
1389 | } | ||
1390 | program { name: "button_press2"; | ||
1391 | action: SIGNAL_EMIT "elm,action,press" ""; | ||
1392 | after: "button_press_anim"; | ||
1393 | } | ||
1394 | program { name: "button_press_anim"; | ||
1395 | action: STATE_SET "pressed" 0.0; | ||
1396 | target: "arrow.image"; | ||
1397 | } | ||
1398 | program { name: "button_unpress"; | ||
1399 | signal: "mouse,up,1"; | ||
1400 | source: "over"; | ||
1401 | script { | ||
1402 | if (get_int(mouse_down) == 1) { | ||
1403 | set_int(mouse_down, 0); | ||
1404 | run_program(PROGRAM:"button_unpress2"); | ||
1405 | run_program(PROGRAM:"button_unpress_anim"); | ||
1406 | } | ||
1407 | } | ||
1408 | } | ||
1409 | program { name: "button_unpress2"; | ||
1410 | action: SIGNAL_EMIT "elm,action,unpress" ""; | ||
1411 | } | ||
1412 | program { name: "button_unpress_anim"; | ||
1413 | action: STATE_SET "default" 0.0; | ||
1414 | target: "arrow.image"; | ||
1415 | } | ||
1416 | program { name: "button_click"; | ||
1417 | signal: "mouse,clicked,1"; | ||
1418 | source: "over"; | ||
1419 | script { | ||
1420 | if (get_int(multi_down) == 0) { | ||
1421 | run_program(PROGRAM:"button_click2"); | ||
1422 | } | ||
1423 | } | ||
1424 | } | ||
1425 | program { name: "action_unpressed"; | ||
1426 | signal: "elm,action,unpressed"; | ||
1427 | source: "elm"; | ||
1428 | after: "button_unpress_anim"; | ||
1429 | } | ||
1430 | program { name: "action_pressed"; | ||
1431 | signal: "elm,action,pressed"; | ||
1432 | source: "elm"; | ||
1433 | after: "button_press_anim"; | ||
1434 | } | ||
1435 | program { name: "button_click2"; | ||
1436 | action: SIGNAL_EMIT "elm,action,click" ""; | ||
1437 | } | ||
1438 | program { name: "access_pressed"; | ||
1439 | signal: "elm,action,anim,activate"; | ||
1440 | source: "elm"; | ||
1441 | action: STATE_SET "pressed" 0.0; | ||
1442 | target: "arrow.image"; | ||
1443 | after: "access_pressed_anim"; | ||
1444 | } | ||
1445 | program { name: "access_pressed_anim"; | ||
1446 | action: STATE_SET "default" 0.0; | ||
1447 | transition: DECELERATE 0.1; | ||
1448 | target: "arrow.image"; | ||
1449 | } | ||
1450 | program { name: "disable"; | ||
1451 | signal: "elm,state,disabled"; | ||
1452 | source: "elm"; | ||
1453 | action: STATE_SET "disabled" 0.0; | ||
1454 | target: "arrow.image"; | ||
1455 | target: "disabler"; | ||
1456 | } | ||
1457 | program { name: "enable"; | ||
1458 | signal: "elm,state,enabled"; | ||
1459 | source: "elm"; | ||
1460 | action: STATE_SET "default" 0.0; | ||
1461 | target: "arrow.image"; | ||
1462 | target: "disabler"; | ||
1463 | } | ||
1464 | program { | ||
1465 | name: "multi_down"; | ||
1466 | signal: "elm,action,multi,down"; | ||
1467 | source: "elm"; | ||
1468 | script { | ||
1469 | set_int(multi_down, 1); | ||
1470 | } | ||
1471 | } | ||
1472 | program { | ||
1473 | name: "multi_up"; | ||
1474 | signal: "elm,action,multi,up"; | ||
1475 | source: "elm"; | ||
1476 | script { | ||
1477 | set_int(multi_down, 0); | ||
1478 | } | ||
1479 | } | ||
1480 | } | ||
1481 | } | ||
1482 | |||
1483 | group { name: "elm/button/base/spinner/decrease/default"; | ||
1484 | inherit: "elm/button/base/spinner/increase/default"; | ||
1485 | images.image: "sym_left_light_normal.png" COMP; | ||
1486 | images.image: "sym_left_glow_normal.png" COMP; | ||
1487 | images.image: "sym_left_dark_normal.png" COMP; | ||
1488 | parts { | ||
1489 | part { name: "arrow.image"; | ||
1490 | scale: 1; | ||
1491 | description { state: "default" 0.0; | ||
1492 | min: 15 15; | ||
1493 | max: 15 15; | ||
1494 | image.normal: "sym_left_light_normal.png"; | ||
1495 | } | ||
1496 | description { state: "pressed" 0.0; | ||
1497 | inherit: "default" 0.0; | ||
1498 | image.normal: "sym_left_glow_normal.png"; | ||
1499 | } | ||
1500 | description { state: "disabled" 0.0; | ||
1501 | inherit: "default" 0.0; | ||
1502 | image.normal: "sym_left_dark_normal.png"; | ||
1503 | } | ||
1504 | } | ||
1505 | } | ||
1506 | } | ||
1507 | |||
1508 | group { name: "elm/button/base/spinner/default"; | ||
1509 | alias: "elm/button/base/spinner/vertical"; | ||
1510 | parts { | ||
1511 | part { name: "bg"; | ||
1512 | type: SPACER; | ||
1513 | scale: 1; | ||
1514 | description { state: "default" 0.0; | ||
1515 | } | ||
1516 | } | ||
1517 | part { name: "elm.text"; | ||
1518 | type: TEXT; | ||
1519 | scale: 1; | ||
1520 | effect: SHADOW BOTTOM; | ||
1521 | description { state: "default" 0.0; | ||
1522 | color: FN_COL_DEFAULT; | ||
1523 | color_class: "spinner"; | ||
1524 | rel1.to: "bg"; | ||
1525 | rel2.to: "bg"; | ||
1526 | text { font: FN; size: 10; | ||
1527 | min: 1 1; | ||
1528 | text_class: "spinner"; | ||
1529 | ellipsis: -1; | ||
1530 | } | ||
1531 | } | ||
1532 | description { state: "disabled" 0.0; | ||
1533 | inherit: "default" 0 0 ; | ||
1534 | color: FN_COL_DISABLE; | ||
1535 | color_class: "spinner_disabled"; | ||
1536 | } | ||
1537 | } | ||
1538 | part { name: "over"; | ||
1539 | type: RECT; | ||
1540 | repeat_events: 1; | ||
1541 | description { state: "default" 0.0; | ||
1542 | color: 0 0 0 0; | ||
1543 | } | ||
1544 | } | ||
1545 | part { name: "disabler"; | ||
1546 | type: RECT; | ||
1547 | description { state: "default" 0.0; | ||
1548 | color: 0 0 0 0; | ||
1549 | visible: 0; | ||
1550 | } | ||
1551 | description { state: "disabled" 0.0; | ||
1552 | inherit: "default" 0.0; | ||
1553 | visible: 1; | ||
1554 | } | ||
1555 | } | ||
1556 | } | ||
1557 | programs { | ||
1558 | program { name: "button_click"; | ||
1559 | signal: "mouse,clicked,1"; | ||
1560 | source: "over"; | ||
1561 | script { | ||
1562 | run_program(PROGRAM:"button_click2"); | ||
1563 | } | ||
1564 | } | ||
1565 | program { name: "button_click2"; | ||
1566 | action: SIGNAL_EMIT "elm,action,click" ""; | ||
1567 | } | ||
1568 | program { name: "disable"; | ||
1569 | signal: "elm,state,disabled"; | ||
1570 | source: "elm"; | ||
1571 | action: STATE_SET "disabled" 0.0; | ||
1572 | target: "disabler"; | ||
1573 | target: "elm.text"; | ||
1574 | } | ||
1575 | program { name: "enable"; | ||
1576 | signal: "elm,state,enabled"; | ||
1577 | source: "elm"; | ||
1578 | action: STATE_SET "default" 0.0; | ||
1579 | target: "disabler"; | ||
1580 | target: "elm.text"; | ||
1581 | } | ||
1582 | } | ||
1583 | } | ||
1584 | group { name: "elm/button/base/spinner/increase/vertical"; | ||
1585 | inherit: "elm/button/base/spinner/increase/default"; | ||
1586 | images.image: "sym_up_light_normal.png" COMP; | ||
1587 | images.image: "sym_up_glow_normal.png" COMP; | ||
1588 | images.image: "sym_up_dark_normal.png" COMP; | ||
1589 | parts { | ||
1590 | part { name: "arrow.image"; | ||
1591 | scale: 1; | ||
1592 | description { state: "default" 0.0; | ||
1593 | min: 15 15; | ||
1594 | max: 15 15; | ||
1595 | image.normal: "sym_up_light_normal.png"; | ||
1596 | } | ||
1597 | description { state: "pressed" 0.0; | ||
1598 | inherit: "default" 0.0; | ||
1599 | image.normal: "sym_up_glow_normal.png"; | ||
1600 | } | ||
1601 | description { state: "disabled" 0.0; | ||
1602 | inherit: "default" 0.0; | ||
1603 | image.normal: "sym_up_dark_normal.png"; | ||
1604 | } | ||
1605 | } | ||
1606 | } | ||
1607 | } | ||
1608 | |||
1609 | group { name: "elm/button/base/spinner/decrease/vertical"; | ||
1610 | inherit: "elm/button/base/spinner/decrease/default"; | ||
1611 | images.image: "sym_down_light_normal.png" COMP; | ||
1612 | images.image: "sym_down_glow_normal.png" COMP; | ||
1613 | images.image: "sym_down_dark_normal.png" COMP; | ||
1614 | parts { | ||
1615 | part { name: "arrow.image"; | ||
1616 | scale: 1; | ||
1617 | description { state: "default" 0.0; | ||
1618 | min: 15 15; | ||
1619 | max: 15 15; | ||
1620 | image.normal: "sym_down_light_normal.png"; | ||
1621 | } | ||
1622 | description { state: "pressed" 0.0; | ||
1623 | inherit: "default" 0.0; | ||
1624 | image.normal: "sym_down_glow_normal.png"; | ||
1625 | } | ||
1626 | description { state: "disabled" 0.0; | ||
1627 | inherit: "default" 0.0; | ||
1628 | image.normal: "sym_down_dark_normal.png"; | ||
1629 | } | ||
1630 | } | ||
1631 | } | ||
1632 | } | ||
1633 | /******************* SPINNER BUTTONS STYLES END **********************/ \ No newline at end of file | ||
diff --git a/data/themes/edc/elm/entry.edc b/data/themes/edc/elm/entry.edc index f82b84e20..cf836fcc3 100644 --- a/data/themes/edc/elm/entry.edc +++ b/data/themes/edc/elm/entry.edc | |||
@@ -768,6 +768,11 @@ group { name: "elm/entry/base-single/default"; | |||
768 | } | 768 | } |
769 | } | 769 | } |
770 | 770 | ||
771 | group { name: "elm/entry/base-single/spinner/default"; | ||
772 | alias: "elm/entry/base-single/spinner/vertical"; | ||
773 | inherit: "elm/entry/base-single/default"; | ||
774 | } | ||
775 | |||
771 | group { name: "elm/entry/base-single-noedit/default"; | 776 | group { name: "elm/entry/base-single-noedit/default"; |
772 | inherit: "elm/entry/base/default"; | 777 | inherit: "elm/entry/base/default"; |
773 | parts { | 778 | parts { |
diff --git a/data/themes/edc/elm/spinner.edc b/data/themes/edc/elm/spinner.edc index a631eae0a..ca87047e8 100644 --- a/data/themes/edc/elm/spinner.edc +++ b/data/themes/edc/elm/spinner.edc | |||
@@ -1,136 +1,64 @@ | |||
1 | group { name: "elm/spinner/base/default"; | 1 | group { name: "elm/spinner/base/default"; |
2 | images.image: "vert_bar_inset.png" COMP; | 2 | images.image: "vert_bar_inset.png" COMP; |
3 | images.image: "sym_left_light_normal.png" COMP; | ||
4 | images.image: "sym_left_glow_normal.png" COMP; | ||
5 | images.image: "sym_left_dark_normal.png" COMP; | ||
6 | images.image: "sym_right_light_normal.png" COMP; | ||
7 | images.image: "sym_right_glow_normal.png" COMP; | ||
8 | images.image: "sym_right_dark_normal.png" COMP; | ||
9 | parts { | 3 | parts { |
10 | part { name: "elm.text"; type: TEXT; | 4 | part { name: "bg"; |
11 | effect: SHADOW BOTTOM; | 5 | type: SPACER; |
12 | scale: 1; | 6 | scale: 1; |
13 | description { state: "default" 0.0; | 7 | description { state: "default" 0.0; |
14 | color: FN_COL_DEFAULT; | ||
15 | color_class: "spinner"; | ||
16 | rel1.to_y: "inset"; | ||
17 | rel1.to_x: "left"; | ||
18 | rel1.relative: 1.0 0.0; | ||
19 | rel1.offset: 1 1; | ||
20 | rel2.to_y: "inset"; | ||
21 | rel2.to_x: "right"; | ||
22 | rel2.relative: 0.0 1.0; | ||
23 | rel2.offset: -2 -2; | ||
24 | text { font: FN; size: 10; | ||
25 | min: 1 1; | ||
26 | text_class: "spinner"; | ||
27 | ellipsis: -1; | ||
28 | } | ||
29 | } | ||
30 | description { state: "disabled" 0.0; | ||
31 | inherit: "default" 0.0; | ||
32 | color: FN_COL_DISABLE; | ||
33 | color_class: "spinner_disabled"; | ||
34 | } | ||
35 | description { state: "active" 0.0; | ||
36 | inherit: "default" 0.0; | ||
37 | visible: 0; | ||
38 | } | 8 | } |
39 | } | 9 | } |
40 | part { name: "elm.dragable.slider"; type: RECT; | 10 | part { name: "inset"; mouse_events: 0; |
41 | dragable.x: 1 1 0; | ||
42 | dragable.y: 0 0 0; | ||
43 | description { state: "default" 0.0; | 11 | description { state: "default" 0.0; |
44 | fixed: 1 0; | 12 | rel1.offset: 0 1; |
45 | rel1.to: "inset"; | 13 | rel2.offset: -1 -2; |
46 | rel2.to: "inset"; | 14 | image.normal: "vert_bar_inset.png"; |
47 | color: 0 0 0 0; | 15 | image.border: 1 1 8 6; |
16 | image.middle: 0; | ||
17 | fill.smooth: 0; | ||
48 | } | 18 | } |
49 | } | 19 | } |
50 | part { name: "elm.swallow.entry"; type: SWALLOW; | 20 | part { name: "access"; |
21 | type: RECT; | ||
22 | repeat_events: 1; | ||
51 | description { state: "default" 0.0; | 23 | description { state: "default" 0.0; |
52 | fixed: 1 0; | 24 | fixed: 1 1; |
53 | rel1.to: "elm.text"; | 25 | color: 0 0 0 0; |
54 | rel2.to: "elm.text"; | 26 | rel1.to: "inset"; |
27 | rel2.to: "inset"; | ||
55 | visible: 0; | 28 | visible: 0; |
56 | } | 29 | } |
57 | description { state: "active" 0.0; | 30 | description { state: "active" 0.0; |
58 | inherit: "default" 0.0; | 31 | inherit: "default" 0.0; |
59 | visible: 1; | 32 | visible: 1; |
60 | } | 33 | } |
61 | description { state: "disabled_active" 0.0; | ||
62 | inherit: "default" 0.0; | ||
63 | visible: 0; | ||
64 | } | ||
65 | description { state: "disabled" 0.0; | ||
66 | inherit: "default" 0.0; | ||
67 | visible: 0; | ||
68 | } | ||
69 | } | 34 | } |
70 | part { name: "arrow1"; mouse_events: 0; | 35 | part { name: "elm.dragable.slider"; type: RECT; |
71 | scale: 1; | 36 | dragable.x: 1 1 0; |
37 | dragable.y: 0 0 0; | ||
72 | description { state: "default" 0.0; | 38 | description { state: "default" 0.0; |
73 | rel1.to: "left"; | 39 | fixed: 1 0; |
74 | rel2.to: "left"; | 40 | rel1.to: "inset"; |
75 | image.normal: "sym_left_light_normal.png"; | 41 | rel2.to: "inset"; |
76 | FIXED_SIZE(15, 15) | 42 | color: 0 0 0 0; |
77 | } | ||
78 | description { state: "clicked" 0.0; | ||
79 | inherit: "default" 0.0; | ||
80 | image.normal: "sym_left_glow_normal.png"; | ||
81 | } | ||
82 | description { state: "disabled" 0.0; | ||
83 | inherit: "default" 0.0; | ||
84 | image.normal: "sym_left_dark_normal.png"; | ||
85 | } | 43 | } |
86 | } | 44 | } |
87 | part { name: "arrow2"; mouse_events: 0; | 45 | part { name: "elm.swallow.dec_button"; |
46 | type: SWALLOW; | ||
88 | scale: 1; | 47 | scale: 1; |
89 | description { state: "default" 0.0; | 48 | description { state: "default" 0.0; |
90 | rel1.to: "right"; | ||
91 | rel2.to: "right"; | ||
92 | image.normal: "sym_right_light_normal.png"; | ||
93 | FIXED_SIZE(15, 15) | ||
94 | } | ||
95 | description { state: "clicked" 0.0; | ||
96 | inherit: "default" 0.0; | ||
97 | image.normal: "sym_right_glow_normal.png"; | ||
98 | } | ||
99 | description { state: "disabled" 0.0; | ||
100 | inherit: "default" 0.0; | ||
101 | image.normal: "sym_right_dark_normal.png"; | ||
102 | } | ||
103 | } | ||
104 | part { name: "left"; type: RECT; | ||
105 | description { state: "default" 0.0; | ||
106 | rel1.to: "inset"; | 49 | rel1.to: "inset"; |
107 | rel1.offset: 1 1; | 50 | rel1.offset: 1 1; |
108 | rel2.to: "inset"; | 51 | rel2.to: "inset"; |
109 | rel2.offset: 1 -2; | 52 | rel2.offset: 1 -2; |
110 | rel2.relative: 0.0 1.0; | 53 | rel2.relative: 0.0 1.0; |
111 | align: 0.0 0.5; | 54 | align: 0.0 0.5; |
112 | color: 0 0 0 0; | ||
113 | min: 15 15; | 55 | min: 15 15; |
114 | aspect: 1.0 1.0; aspect_preference: VERTICAL; | 56 | aspect: 1.0 1.0; aspect_preference: VERTICAL; |
115 | } | 57 | } |
116 | } | 58 | } |
117 | program { | 59 | part { name: "elm.swallow.inc_button"; |
118 | signal: "mouse,down,1"; source: "left"; | 60 | type: SWALLOW; |
119 | action: STATE_SET "clicked" 0.0; | 61 | scale: 1; |
120 | target: "arrow1"; | ||
121 | after: "left2"; | ||
122 | } program { name: "left2"; | ||
123 | action: SIGNAL_EMIT "elm,action,decrement,start" "elm"; | ||
124 | } | ||
125 | program { | ||
126 | signal: "mouse,up,1"; source: "left"; | ||
127 | action: STATE_SET "default" 0.0; | ||
128 | target: "arrow1"; | ||
129 | after: "left3"; | ||
130 | } program { name: "left3"; | ||
131 | action: SIGNAL_EMIT "elm,action,decrement,stop" "elm"; | ||
132 | } | ||
133 | part { name: "right"; type: RECT; | ||
134 | description { state: "default" 0.0; | 62 | description { state: "default" 0.0; |
135 | rel1.to: "inset"; | 63 | rel1.to: "inset"; |
136 | rel1.offset: 1 1; | 64 | rel1.offset: 1 1; |
@@ -138,53 +66,46 @@ group { name: "elm/spinner/base/default"; | |||
138 | rel2.to: "inset"; | 66 | rel2.to: "inset"; |
139 | rel2.offset: 1 -2; | 67 | rel2.offset: 1 -2; |
140 | align: 1.0 0.5; | 68 | align: 1.0 0.5; |
141 | color: 0 0 0 0; | ||
142 | min: 15 15; | 69 | min: 15 15; |
143 | aspect: 1.0 1.0; aspect_preference: VERTICAL; | 70 | aspect: 1.0 1.0; aspect_preference: VERTICAL; |
144 | } | 71 | } |
145 | } | 72 | } |
146 | program { | 73 | part { name: "elm.swallow.text_button"; |
147 | signal: "mouse,down,1"; source: "right"; | 74 | type: SWALLOW; |
148 | action: STATE_SET "clicked" 0.0; | 75 | scale: 1; |
149 | target: "arrow2"; | ||
150 | after: "right2"; | ||
151 | } program { name: "right2"; | ||
152 | action: SIGNAL_EMIT "elm,action,increment,start" "elm"; | ||
153 | } | ||
154 | program { | ||
155 | signal: "mouse,up,1"; source: "right"; | ||
156 | action: STATE_SET "default" 0.0; | ||
157 | target: "arrow2"; | ||
158 | after: "right3"; | ||
159 | } program { name: "right3"; | ||
160 | action: SIGNAL_EMIT "elm,action,increment,stop" "elm"; | ||
161 | } | ||
162 | part { name: "inset"; mouse_events: 0; | ||
163 | description { state: "default" 0.0; | 76 | description { state: "default" 0.0; |
164 | rel1.offset: 0 1; | 77 | visible: 1; |
165 | rel2.offset: -1 -2; | 78 | rel1.to_y: "inset"; |
166 | image.normal: "vert_bar_inset.png"; | 79 | rel1.to_x: "elm.swallow.dec_button"; |
167 | image.border: 1 1 8 6; | 80 | rel1.relative: 1.0 0.0; |
168 | image.middle: 0; | 81 | rel1.offset: 1 1; |
169 | fill.smooth: 0; | 82 | rel2.to_y: "inset"; |
83 | rel2.to_x: "elm.swallow.inc_button"; | ||
84 | rel2.relative: 0.0 1.0; | ||
85 | rel2.offset: -2 -2; | ||
86 | } | ||
87 | description { state: "inactive" 0.0; | ||
88 | inherit: "default" 0.0; | ||
89 | visible: 0; | ||
170 | } | 90 | } |
171 | } | 91 | } |
172 | part { name: "access_text"; type: RECT; repeat_events: 1; | 92 | part { name: "elm.swallow.entry"; |
93 | type: SWALLOW; | ||
173 | description { state: "default" 0.0; | 94 | description { state: "default" 0.0; |
174 | color: 0 0 0 0; | 95 | fixed: 1 0; |
175 | rel1.to: "elm.text"; | 96 | rel1.to: "elm.swallow.text_button"; |
176 | rel2.to: "elm.text"; | 97 | rel2.to: "elm.swallow.text_button"; |
98 | visible: 0; | ||
177 | } | 99 | } |
178 | description { state: "disabled" 0.0; | 100 | description { state: "active" 0.0; |
179 | inherit: "default" 0.0; | 101 | inherit: "default" 0.0; |
180 | visible: 0; | 102 | visible: 1; |
181 | } | 103 | } |
182 | } | 104 | } |
183 | program { | 105 | part { name: "disabler"; |
184 | signal: "mouse,clicked,1"; source: "access_text"; | 106 | type: RECT; |
185 | action: SIGNAL_EMIT "elm,action,click" "elm"; | 107 | repeat_events: 0; |
186 | } | 108 | mouse_events: 0; |
187 | part { name: "disabler"; type: RECT; | ||
188 | description { state: "default" 0.0; | 109 | description { state: "default" 0.0; |
189 | color: 0 0 0 0; | 110 | color: 0 0 0 0; |
190 | visible: 0; | 111 | visible: 0; |
@@ -196,107 +117,101 @@ group { name: "elm/spinner/base/default"; | |||
196 | } | 117 | } |
197 | } | 118 | } |
198 | programs { | 119 | programs { |
199 | program { name: "active"; | 120 | program { name: "entry_active"; |
200 | signal: "elm,state,active"; source: "elm"; | 121 | signal: "elm,state,entry,active"; |
122 | source: "elm"; | ||
201 | action: STATE_SET "active" 0.0; | 123 | action: STATE_SET "active" 0.0; |
202 | target: "elm.text"; | ||
203 | target: "elm.swallow.entry"; | 124 | target: "elm.swallow.entry"; |
204 | } | 125 | } |
205 | program { name: "inactive"; | 126 | program { name: "entry_inactive"; |
206 | signal: "elm,state,inactive"; source: "elm"; | 127 | signal: "elm,state,entry,inactive"; |
128 | source: "elm"; | ||
207 | action: STATE_SET "default" 0.0; | 129 | action: STATE_SET "default" 0.0; |
208 | target: "elm.text"; | ||
209 | target: "elm.swallow.entry"; | 130 | target: "elm.swallow.entry"; |
210 | } | 131 | } |
211 | program { name: "toggle_text"; | 132 | program { name: "text_button_active"; |
212 | signal: "mouse,clicked,1"; source: "elm.dragable.slider"; | 133 | signal: "elm,state,button,active"; |
213 | action: SIGNAL_EMIT "elm,action,entry,toggle" "elm"; | 134 | source: "elm"; |
214 | } | ||
215 | program { | ||
216 | signal: "elm,state,enabled"; source: "elm"; | ||
217 | action: STATE_SET "default" 0.0; | 135 | action: STATE_SET "default" 0.0; |
218 | target: "arrow1"; | 136 | target: "elm.swallow.text_button"; |
219 | target: "arrow2"; | 137 | } |
220 | target: "access_text"; | 138 | program { name: "text_button_inactive"; |
139 | signal: "elm,state,button,inactive"; | ||
140 | source: "elm"; | ||
141 | action: STATE_SET "inactive" 0.0; | ||
142 | target: "elm.swallow.text_button"; | ||
143 | } | ||
144 | program { name: "access_activate"; | ||
145 | signal: "elm,state,access,active"; | ||
146 | source: "elm"; | ||
147 | action: STATE_SET "active" 0.0; | ||
148 | target: "access"; | ||
149 | } | ||
150 | program { name: "access_inactivate"; | ||
151 | signal: "elm,state,access,inactive"; | ||
152 | source: "elm"; | ||
153 | action: STATE_SET "default" 0.0; | ||
154 | target: "access"; | ||
155 | } | ||
156 | program { name: "disable"; | ||
157 | signal: "elm,state,disabled"; | ||
158 | source: "elm"; | ||
159 | action: STATE_SET "disabled" 0.0; | ||
221 | target: "disabler"; | 160 | target: "disabler"; |
222 | target: "elm.swallow.entry"; | ||
223 | target: "elm.text"; | ||
224 | } | 161 | } |
225 | program { | 162 | program { name: "enable"; |
226 | signal: "elm,state,disabled"; source: "elm"; | 163 | signal: "elm,state,enabled"; |
227 | action: STATE_SET "disabled" 0.0; | 164 | source: "elm"; |
228 | target: "arrow1"; | 165 | action: STATE_SET "default" 0.0; |
229 | target: "arrow2"; | ||
230 | target: "access_text"; | ||
231 | target: "disabler"; | 166 | target: "disabler"; |
232 | target: "elm.swallow.entry"; | ||
233 | target: "elm.text"; | ||
234 | } | 167 | } |
235 | } | 168 | } |
236 | } | 169 | } |
237 | 170 | ||
238 | group { name: "elm/spinner/base/vertical"; | 171 | group { name: "elm/spinner/base/vertical"; |
239 | inherit: "elm/spinner/base/default"; | 172 | inherit: "elm/spinner/base/default"; |
240 | images.image: "sym_up_light_normal.png" COMP; | ||
241 | images.image: "sym_up_glow_normal.png" COMP; | ||
242 | images.image: "sym_up_dark_normal.png" COMP; | ||
243 | images.image: "sym_down_light_normal.png" COMP; | ||
244 | images.image: "sym_down_glow_normal.png" COMP; | ||
245 | images.image: "sym_down_dark_normal.png" COMP; | ||
246 | parts { | 173 | parts { |
247 | part { name: "elm.text"; | 174 | part { name: "elm.swallow.inc_button"; |
175 | type: SWALLOW; | ||
176 | scale: 1; | ||
248 | description { state: "default" 0.0; | 177 | description { state: "default" 0.0; |
249 | rel1.to_x: "inset"; | 178 | rel1.to: "inset"; |
250 | rel1.relative: 0.0 0.0; | ||
251 | rel1.offset: 1 1; | 179 | rel1.offset: 1 1; |
252 | rel2.to_x: "left"; | 180 | rel1.relative: 1.0 0.0; |
181 | rel2.to: "inset"; | ||
182 | rel2.offset: 1 -2; | ||
183 | align: 1.0 0.5; | ||
184 | } | ||
185 | } | ||
186 | part { name: "elm.swallow.text_button"; | ||
187 | type: SWALLOW; | ||
188 | scale: 1; | ||
189 | description { state: "default" 0.0; | ||
190 | visible: 1; | ||
191 | rel1.to_y: "inset"; | ||
192 | rel1.to_x: "elm.swallow.dec_button"; | ||
193 | rel1.relative: 1.0 0.0; | ||
194 | rel1.offset: 1 1; | ||
195 | rel2.to_y: "inset"; | ||
196 | rel2.to_x: "elm.swallow.inc_button"; | ||
253 | rel2.relative: 0.0 1.0; | 197 | rel2.relative: 0.0 1.0; |
254 | rel2.offset: -2 -2; | 198 | rel2.offset: -2 -2; |
255 | } | 199 | } |
256 | description { state: "disabled" 0.0; | ||
257 | inherit: "default" 0.0; | ||
258 | color: FN_COL_DISABLE; | ||
259 | color_class: "spinner_disabled"; | ||
260 | } | ||
261 | description { state: "active" 0.0; | 200 | description { state: "active" 0.0; |
262 | inherit: "default" 0.0; | 201 | inherit: "default" 0.0; |
263 | visible: 0; | 202 | visible: 0; |
264 | } | 203 | } |
265 | } | 204 | } |
266 | part { name: "arrow1"; mouse_events: 0; | 205 | part { name: "elm.swallow.dec_button"; |
267 | description { state: "default" 0.0; | 206 | type: SWALLOW; |
268 | image.normal: "sym_down_light_normal.png"; | 207 | scale: 1; |
269 | } | ||
270 | description { state: "clicked" 0.0; | ||
271 | inherit: "default" 0.0; | ||
272 | image.normal: "sym_down_glow_normal.png"; | ||
273 | } | ||
274 | description { state: "disabled" 0.0; | ||
275 | inherit: "default" 0.0; | ||
276 | image.normal: "sym_down_dark_normal.png"; | ||
277 | } | ||
278 | } | ||
279 | part { name: "arrow2"; mouse_events: 0; | ||
280 | description { state: "default" 0.0; | ||
281 | image.normal: "sym_up_light_normal.png"; | ||
282 | FIXED_SIZE(15, 15) | ||
283 | } | ||
284 | description { state: "clicked" 0.0; | ||
285 | inherit: "default" 0.0; | ||
286 | image.normal: "sym_up_glow_normal.png"; | ||
287 | } | ||
288 | description { state: "disabled" 0.0; | ||
289 | inherit: "default" 0.0; | ||
290 | image.normal: "sym_up_dark_normal.png"; | ||
291 | } | ||
292 | } | ||
293 | part { name: "left"; | ||
294 | description { state: "default" 0.0; | 208 | description { state: "default" 0.0; |
295 | rel1.to: "right"; | 209 | rel1.to: "inset"; |
296 | rel1.offset: -1 0; | 210 | rel1.offset: 1 1; |
297 | rel2.to: "right"; | 211 | rel2.to: "inset"; |
298 | rel2.offset: -1 -1; | 212 | rel2.offset: 1 -2; |
299 | align: 1.0 0.5; | 213 | rel2.relative: 0.0 1.0; |
214 | align: 0.0 0.5; | ||
300 | } | 215 | } |
301 | } | 216 | } |
302 | } | 217 | } |
diff --git a/src/lib/elm_authors.h b/src/lib/elm_authors.h index 10e91930c..f4cf2f9e8 100644 --- a/src/lib/elm_authors.h +++ b/src/lib/elm_authors.h | |||
@@ -160,6 +160,7 @@ | |||
160 | * @author Jae Yong Hwang <j_yong.hwang@@samsung.com> | 160 | * @author Jae Yong Hwang <j_yong.hwang@@samsung.com> |
161 | * @author Kabeer Khan <kabeer.khan@@samsung.com> | 161 | * @author Kabeer Khan <kabeer.khan@@samsung.com> |
162 | * @author yinsc <shouchen.yin@@samsung.com> | 162 | * @author yinsc <shouchen.yin@@samsung.com> |
163 | * @author Subodh Kumar <s7158.kumar@samsung.com> | ||
163 | * | 164 | * |
164 | * Please contact <enlightenment-devel@lists.sourceforge.net> to get in | 165 | * Please contact <enlightenment-devel@lists.sourceforge.net> to get in |
165 | * contact with the developers and maintainers. | 166 | * contact with the developers and maintainers. |
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 1ae00c71c..51668fb41 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c | |||
@@ -38,14 +38,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { | |||
38 | {NULL, NULL} | 38 | {NULL, NULL} |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static Eina_Bool _key_action_spin(Evas_Object *obj, const char *params); | 41 | static void _access_increment_decrement_info_say(Evas_Object *obj, |
42 | static Eina_Bool _key_action_toggle(Evas_Object *obj, const char *params); | 42 | Eina_Bool is_incremented); |
43 | |||
44 | static const Elm_Action key_actions[] = { | ||
45 | {"spin", _key_action_spin}, | ||
46 | {"toggle", _key_action_toggle}, | ||
47 | {NULL, NULL} | ||
48 | }; | ||
49 | 43 | ||
50 | static void | 44 | static void |
51 | _entry_show(Elm_Spinner_Data *sd) | 45 | _entry_show(Elm_Spinner_Data *sd) |
@@ -108,13 +102,14 @@ _label_write(Evas_Object *obj) | |||
108 | goto apply; | 102 | goto apply; |
109 | } | 103 | } |
110 | } | 104 | } |
105 | |||
111 | if (sd->label) | 106 | if (sd->label) |
112 | snprintf(buf, sizeof(buf), sd->label, sd->val); | 107 | snprintf(buf, sizeof(buf), sd->label, sd->val); |
113 | else | 108 | else |
114 | snprintf(buf, sizeof(buf), "%.0f", sd->val); | 109 | snprintf(buf, sizeof(buf), "%.0f", sd->val); |
115 | 110 | ||
116 | apply: | 111 | apply: |
117 | elm_layout_text_set(obj, "elm.text", buf); | 112 | elm_layout_text_set(sd->text_button, "elm.text", buf); |
118 | elm_interface_atspi_accessible_name_changed_signal_emit(obj); | 113 | elm_interface_atspi_accessible_name_changed_signal_emit(obj); |
119 | if (sd->entry_visible) _entry_show(sd); | 114 | if (sd->entry_visible) _entry_show(sd); |
120 | } | 115 | } |
@@ -197,8 +192,13 @@ _drag_cb(void *data, | |||
197 | ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); | 192 | ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); |
198 | 193 | ||
199 | if (sd->entry_visible) return; | 194 | if (sd->entry_visible) return; |
200 | eo_do((Eo *)wd->resize_obj, | 195 | |
201 | edje_obj_part_drag_value_get("elm.dragable.slider", &pos, NULL)); | 196 | if (!strncmp(elm_widget_style_get(obj), "vertical", 8)) |
197 | eo_do((Eo *)wd->resize_obj, | ||
198 | edje_obj_part_drag_value_get("elm.dragable.slider", NULL, &pos)); | ||
199 | else | ||
200 | eo_do((Eo *)wd->resize_obj, | ||
201 | edje_obj_part_drag_value_get("elm.dragable.slider", &pos, NULL)); | ||
202 | 202 | ||
203 | delta = pos * sd->step * _elm_config->scale; | 203 | delta = pos * sd->step * _elm_config->scale; |
204 | /* If we are on rtl mode, change the delta to be negative on such changes */ | 204 | /* If we are on rtl mode, change the delta to be negative on such changes */ |
@@ -241,7 +241,8 @@ _entry_hide(Evas_Object *obj) | |||
241 | { | 241 | { |
242 | ELM_SPINNER_DATA_GET(obj, sd); | 242 | ELM_SPINNER_DATA_GET(obj, sd); |
243 | 243 | ||
244 | elm_layout_signal_emit(obj, "elm,state,inactive", "elm"); | 244 | elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm"); |
245 | elm_layout_signal_emit(obj, "elm,state,button,active", "elm"); | ||
245 | sd->entry_visible = EINA_FALSE; | 246 | sd->entry_visible = EINA_FALSE; |
246 | } | 247 | } |
247 | 248 | ||
@@ -279,10 +280,21 @@ _entry_activated_cb(void *data, | |||
279 | } | 280 | } |
280 | 281 | ||
281 | static void | 282 | static void |
282 | _entry_toggle_cb(void *data EINA_UNUSED, | 283 | _entry_show_cb(void *data, |
283 | Evas_Object *obj, | 284 | Evas *e EINA_UNUSED, |
284 | const char *emission EINA_UNUSED, | 285 | Evas_Object *obj, |
285 | const char *source EINA_UNUSED) | 286 | void *event_info EINA_UNUSED) |
287 | { | ||
288 | ELM_SPINNER_DATA_GET(data, sd); | ||
289 | _entry_show(sd); | ||
290 | elm_object_focus_set(obj, EINA_TRUE); | ||
291 | elm_entry_select_all(obj); | ||
292 | sd->entry_visible = EINA_TRUE; | ||
293 | elm_layout_signal_emit(data, "elm,state,button,inactive", "elm"); | ||
294 | } | ||
295 | |||
296 | static void | ||
297 | _toggle_entry(Evas_Object *obj) | ||
286 | { | 298 | { |
287 | ELM_SPINNER_DATA_GET(obj, sd); | 299 | ELM_SPINNER_DATA_GET(obj, sd); |
288 | 300 | ||
@@ -299,20 +311,30 @@ _entry_toggle_cb(void *data EINA_UNUSED, | |||
299 | if (!sd->ent) | 311 | if (!sd->ent) |
300 | { | 312 | { |
301 | sd->ent = elm_entry_add(obj); | 313 | sd->ent = elm_entry_add(obj); |
314 | Eina_Strbuf *buf = eina_strbuf_new(); | ||
315 | eina_strbuf_append_printf(buf, "spinner/%s", elm_widget_style_get(obj)); | ||
316 | elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf)); | ||
317 | eina_strbuf_free(buf); | ||
302 | elm_entry_single_line_set(sd->ent, EINA_TRUE); | 318 | elm_entry_single_line_set(sd->ent, EINA_TRUE); |
303 | evas_object_smart_callback_add | 319 | evas_object_smart_callback_add |
304 | (sd->ent, "activated", _entry_activated_cb, obj); | 320 | (sd->ent, "activated", _entry_activated_cb, obj); |
321 | evas_object_event_callback_add | ||
322 | (sd->ent, EVAS_CALLBACK_SHOW, _entry_show_cb, obj); | ||
305 | elm_layout_content_set(obj, "elm.swallow.entry", sd->ent); | 323 | elm_layout_content_set(obj, "elm.swallow.entry", sd->ent); |
306 | } | 324 | } |
307 | 325 | elm_layout_signal_emit(obj, "elm,state,entry,active", "elm"); | |
308 | elm_layout_signal_emit(obj, "elm,state,active", "elm"); | ||
309 | _entry_show(sd); | ||
310 | elm_entry_select_all(sd->ent); | ||
311 | elm_widget_focus_set(sd->ent, EINA_TRUE); | ||
312 | sd->entry_visible = EINA_TRUE; | ||
313 | } | 326 | } |
314 | } | 327 | } |
315 | 328 | ||
329 | static void | ||
330 | _entry_toggle_cb(void *data EINA_UNUSED, | ||
331 | Evas_Object *obj, | ||
332 | const char *emission EINA_UNUSED, | ||
333 | const char *source EINA_UNUSED) | ||
334 | { | ||
335 | _toggle_entry(obj); | ||
336 | } | ||
337 | |||
316 | static Eina_Bool | 338 | static Eina_Bool |
317 | _spin_value(void *data) | 339 | _spin_value(void *data) |
318 | { | 340 | { |
@@ -375,168 +397,118 @@ _spin_stop(Evas_Object *obj) | |||
375 | } | 397 | } |
376 | 398 | ||
377 | static void | 399 | static void |
378 | _button_inc_start_cb(void *data, | 400 | _inc_button_clicked_cb(void *data, |
379 | Evas_Object *obj, | 401 | Evas_Object *obj EINA_UNUSED, |
380 | const char *emission EINA_UNUSED, | 402 | void *event_info EINA_UNUSED) |
381 | const char *source EINA_UNUSED) | ||
382 | { | 403 | { |
383 | ELM_SPINNER_DATA_GET(data, sd); | 404 | ELM_SPINNER_DATA_GET(data, sd); |
384 | 405 | ||
385 | if (sd->entry_visible) | ||
386 | { | ||
387 | _entry_value_apply(obj); | ||
388 | if ((sd->val_updated) && (sd->val == sd->val_min)) return; | ||
389 | } | ||
390 | ecore_timer_del(sd->longpress_timer); | ||
391 | sd->longpress_timer = ecore_timer_add | ||
392 | (_elm_config->longpress_timeout, _val_inc_start, data); | ||
393 | } | ||
394 | |||
395 | static void | ||
396 | _button_inc_stop_cb(void *data, | ||
397 | Evas_Object *obj EINA_UNUSED, | ||
398 | const char *emission EINA_UNUSED, | ||
399 | const char *source EINA_UNUSED) | ||
400 | { | ||
401 | ELM_SPINNER_DATA_GET(data, sd); | ||
402 | if (sd->longpress_timer) | ||
403 | { | ||
404 | ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del); | ||
405 | sd->spin_speed = sd->step; | ||
406 | _spin_value(data); | ||
407 | } | ||
408 | _spin_stop(data); | 406 | _spin_stop(data); |
407 | sd->spin_speed = sd->step; | ||
408 | _spin_value(data); | ||
409 | |||
410 | if (sd->entry_visible) _entry_value_apply(data); | ||
411 | if (_elm_config->access_mode) | ||
412 | _access_increment_decrement_info_say(data, EINA_TRUE); | ||
409 | } | 413 | } |
410 | 414 | ||
411 | static void | 415 | static void |
412 | _button_dec_start_cb(void *data, | 416 | _inc_button_pressed_cb(void *data, |
413 | Evas_Object *obj EINA_UNUSED, | 417 | Evas_Object *obj EINA_UNUSED, |
414 | const char *emission EINA_UNUSED, | 418 | void *event_info EINA_UNUSED) |
415 | const char *source EINA_UNUSED) | ||
416 | { | 419 | { |
417 | ELM_SPINNER_DATA_GET(data, sd); | 420 | ELM_SPINNER_DATA_GET(data, sd); |
418 | 421 | ||
419 | if (sd->entry_visible) | 422 | if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer); |
420 | { | ||
421 | _entry_value_apply(obj); | ||
422 | if ((sd->val_updated) && (sd->val == sd->val_max)) return; | ||
423 | } | ||
424 | ecore_timer_del(sd->longpress_timer); | ||
425 | sd->longpress_timer = ecore_timer_add | 423 | sd->longpress_timer = ecore_timer_add |
426 | (_elm_config->longpress_timeout, _val_dec_start, data); | 424 | (_elm_config->longpress_timeout, |
425 | _val_inc_start, data); | ||
426 | |||
427 | if (sd->entry_visible) _entry_value_apply(data); | ||
427 | } | 428 | } |
428 | 429 | ||
429 | static void | 430 | static void |
430 | _button_dec_stop_cb(void *data, | 431 | _inc_button_unpressed_cb(void *data, |
431 | Evas_Object *obj EINA_UNUSED, | 432 | Evas_Object *obj EINA_UNUSED, |
432 | const char *emission EINA_UNUSED, | 433 | void *event_info EINA_UNUSED) |
433 | const char *source EINA_UNUSED) | ||
434 | { | 434 | { |
435 | ELM_SPINNER_DATA_GET(data, sd); | 435 | ELM_SPINNER_DATA_GET(data, sd); |
436 | |||
436 | if (sd->longpress_timer) | 437 | if (sd->longpress_timer) |
437 | { | 438 | { |
438 | ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del); | 439 | ecore_timer_del(sd->longpress_timer); |
439 | sd->spin_speed = -sd->step; | 440 | sd->longpress_timer = NULL; |
440 | _spin_value(data); | ||
441 | } | 441 | } |
442 | _spin_stop(data); | 442 | _spin_stop(data); |
443 | } | 443 | } |
444 | 444 | ||
445 | EOLIAN static void | 445 | static void |
446 | _elm_spinner_elm_layout_sizing_eval(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED) | 446 | _text_button_clicked_cb(void *data, |
447 | Evas_Object *obj EINA_UNUSED, | ||
448 | void *event_info EINA_UNUSED) | ||
447 | { | 449 | { |
448 | Evas_Coord minw = -1, minh = -1; | 450 | _toggle_entry(data); |
449 | ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); | ||
450 | |||
451 | elm_coords_finger_size_adjust(1, &minw, 1, &minh); | ||
452 | edje_object_size_min_restricted_calc | ||
453 | (wd->resize_obj, &minw, &minh, minw, minh); | ||
454 | evas_object_size_hint_min_set(obj, minw, minh); | ||
455 | evas_object_size_hint_max_set(obj, -1, -1); | ||
456 | } | 451 | } |
457 | 452 | ||
458 | static Eina_Bool | 453 | static void |
459 | _key_action_spin(Evas_Object *obj, const char *params) | 454 | _dec_button_clicked_cb(void *data, |
455 | Evas_Object *obj EINA_UNUSED, | ||
456 | void *event_info EINA_UNUSED) | ||
460 | { | 457 | { |
461 | const char *dir = params; | 458 | ELM_SPINNER_DATA_GET(data, sd); |
462 | Eina_Bool horz = !!strncmp(elm_widget_style_get(obj), "vertical", 8); | ||
463 | 459 | ||
464 | if (((!strcmp(dir, "left")) && horz) || | 460 | _spin_stop(data); |
465 | ((!strcmp(dir, "down")) && !horz)) | 461 | sd->spin_speed = -sd->step; |
466 | { | 462 | _spin_value(data); |
467 | _val_dec_start(obj); | ||
468 | elm_layout_signal_emit(obj, "elm,left,anim,activate", "elm"); | ||
469 | } | ||
470 | else if (((!strcmp(dir, "right")) && horz) || | ||
471 | ((!strcmp(dir, "up")) && !horz)) | ||
472 | { | ||
473 | _val_inc_start(obj); | ||
474 | elm_layout_signal_emit(obj, "elm,right,anim,activate", "elm"); | ||
475 | } | ||
476 | else return EINA_FALSE; | ||
477 | 463 | ||
478 | return EINA_TRUE; | 464 | if (sd->entry_visible) _entry_value_apply(data); |
465 | |||
466 | if (_elm_config->access_mode) | ||
467 | _access_increment_decrement_info_say(data, EINA_FALSE); | ||
479 | } | 468 | } |
480 | 469 | ||
481 | static Eina_Bool | 470 | static void |
482 | _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED) | 471 | _dec_button_pressed_cb(void *data, |
472 | Evas_Object *obj EINA_UNUSED, | ||
473 | void *event_info EINA_UNUSED) | ||
483 | { | 474 | { |
484 | ELM_SPINNER_DATA_GET(obj, sd); | 475 | ELM_SPINNER_DATA_GET(data, sd); |
485 | 476 | ||
486 | if (sd->spin_timer) _spin_stop(obj); | 477 | if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer); |
487 | else _entry_toggle_cb(NULL, obj, NULL, NULL); | 478 | sd->longpress_timer = ecore_timer_add |
479 | (_elm_config->longpress_timeout, | ||
480 | _val_dec_start, data); | ||
488 | 481 | ||
489 | return EINA_FALSE; | 482 | if (sd->entry_visible) _entry_value_apply(data); |
490 | } | 483 | } |
491 | 484 | ||
492 | EOLIAN static Eina_Bool | 485 | static void |
493 | _elm_spinner_elm_widget_event(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info) | 486 | _dec_button_unpressed_cb(void *data, |
487 | Evas_Object *obj EINA_UNUSED, | ||
488 | void *event_info EINA_UNUSED) | ||
494 | { | 489 | { |
495 | Evas_Event_Key_Down *ev = event_info; | 490 | ELM_SPINNER_DATA_GET(data, sd); |
496 | Evas_Event_Mouse_Wheel *mev; | ||
497 | (void) src; | ||
498 | 491 | ||
499 | if (type == EVAS_CALLBACK_KEY_DOWN) | 492 | if (sd->longpress_timer) |
500 | { | ||
501 | Eina_Bool ret; | ||
502 | |||
503 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; | ||
504 | ret = _elm_config_key_binding_call(obj, ev, key_actions); | ||
505 | if (!ret) | ||
506 | { | ||
507 | if (sd->spin_timer) _spin_stop(obj); | ||
508 | else return EINA_FALSE; | ||
509 | } | ||
510 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | ||
511 | } | ||
512 | else if (type == EVAS_CALLBACK_KEY_UP) | ||
513 | { | 493 | { |
514 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; | 494 | ecore_timer_del(sd->longpress_timer); |
515 | if (sd->spin_timer) _spin_stop(obj); | 495 | sd->longpress_timer = NULL; |
516 | else return EINA_FALSE; | ||
517 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | ||
518 | } | 496 | } |
519 | else if (type == EVAS_CALLBACK_MOUSE_WHEEL) | 497 | _spin_stop(data); |
520 | { | 498 | } |
521 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; | ||
522 | mev = event_info; | ||
523 | sd->interval = sd->first_interval; | ||
524 | if (mev->z < 0) | ||
525 | { | ||
526 | sd->spin_speed = sd->step; | ||
527 | elm_layout_signal_emit(obj, "elm,right,anim,activate", "elm"); | ||
528 | } | ||
529 | else | ||
530 | { | ||
531 | sd->spin_speed = -sd->step; | ||
532 | elm_layout_signal_emit(obj, "elm,left,anim,activate", "elm"); | ||
533 | } | ||
534 | _spin_value(obj); | ||
535 | mev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | ||
536 | } | ||
537 | else return EINA_FALSE; | ||
538 | 499 | ||
539 | return EINA_TRUE; | 500 | EOLIAN static void |
501 | _elm_spinner_elm_layout_sizing_eval(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED) | ||
502 | { | ||
503 | Evas_Coord minw = -1, minh = -1; | ||
504 | ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); | ||
505 | |||
506 | elm_coords_finger_size_adjust(1, &minw, 1, &minh); | ||
507 | edje_object_size_min_restricted_calc | ||
508 | (wd->resize_obj, &minw, &minh, minw, minh); | ||
509 | elm_coords_finger_size_adjust(1, &minw, 1, &minh); | ||
510 | evas_object_size_hint_min_set(obj, minw, minh); | ||
511 | evas_object_size_hint_max_set(obj, -1, -1); | ||
540 | } | 512 | } |
541 | 513 | ||
542 | EOLIAN static Eina_Bool | 514 | EOLIAN static Eina_Bool |
@@ -558,13 +530,18 @@ _elm_spinner_elm_widget_on_focus(Eo *obj, Elm_Spinner_Data *sd) | |||
558 | } | 530 | } |
559 | 531 | ||
560 | static char * | 532 | static char * |
561 | _access_info_cb(void *data, Evas_Object *obj) | 533 | _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED) |
562 | { | 534 | { |
563 | Evas_Object *spinner; | 535 | Evas_Object *spinner; |
564 | const char *txt = elm_widget_access_info_get(obj); | 536 | const char *txt = NULL; |
537 | |||
538 | spinner = (Evas_Object *)(data); | ||
539 | ELM_SPINNER_DATA_GET(spinner, sd); | ||
565 | 540 | ||
566 | spinner = data; | 541 | if (sd->entry_visible) |
567 | if (!txt) txt = elm_layout_text_get(spinner, "elm.text"); | 542 | txt = elm_object_text_get(sd->ent); |
543 | else | ||
544 | txt = elm_object_text_get(sd->text_button); | ||
568 | if (txt) return strdup(txt); | 545 | if (txt) return strdup(txt); |
569 | 546 | ||
570 | return NULL; | 547 | return NULL; |
@@ -580,46 +557,45 @@ _access_state_cb(void *data, Evas_Object *obj EINA_UNUSED) | |||
580 | } | 557 | } |
581 | 558 | ||
582 | static void | 559 | static void |
583 | _access_activate_cb(void *data, | 560 | _access_activate_spinner_cb(void *data, |
584 | Evas_Object *part_obj, | 561 | Evas_Object *part_obj EINA_UNUSED, |
585 | Elm_Object_Item *item EINA_UNUSED) | 562 | Elm_Object_Item *item EINA_UNUSED) |
586 | { | 563 | { |
587 | char *text; | 564 | ELM_SPINNER_DATA_GET(data, sd); |
588 | Eina_Strbuf *buf; | ||
589 | Evas_Object *eo, *inc_btn; | ||
590 | const char* increment_part; | ||
591 | 565 | ||
592 | if (!strncmp(elm_widget_style_get(data), "vertical", 8)) | 566 | if (elm_widget_disabled_get(data)) return; |
593 | increment_part = "up_bt"; | 567 | if (!sd->entry_visible) |
594 | else | 568 | _toggle_entry(data); |
595 | increment_part = "right_bt"; | 569 | } |
596 | 570 | ||
597 | eo = elm_layout_edje_get(data); | 571 | static void |
598 | inc_btn = (Evas_Object *)edje_object_part_object_get(eo, increment_part); | 572 | _access_increment_decrement_info_say(Evas_Object *obj, |
573 | Eina_Bool is_incremented) | ||
574 | { | ||
575 | char *text; | ||
576 | Eina_Strbuf *buf; | ||
599 | 577 | ||
600 | if (part_obj != inc_btn) | 578 | ELM_SPINNER_DATA_GET(obj, sd); |
601 | { | ||
602 | _val_dec_start(data); | ||
603 | elm_layout_signal_emit(data, "elm,left,anim,activate", "elm"); | ||
604 | _spin_stop(data); | ||
605 | text = "decremented"; | ||
606 | } | ||
607 | else | ||
608 | { | ||
609 | _val_inc_start(data); | ||
610 | elm_layout_signal_emit(data, "elm,right,anim,activate", "elm"); | ||
611 | _spin_stop(data); | ||
612 | text = "incremented"; | ||
613 | } | ||
614 | 579 | ||
615 | buf = eina_strbuf_new(); | 580 | buf = eina_strbuf_new(); |
581 | if (is_incremented) | ||
582 | { | ||
583 | elm_object_signal_emit | ||
584 | (sd->inc_button, "elm,action,anim,activate", "elm"); | ||
585 | eina_strbuf_append(buf, E_("incremented")); | ||
586 | } | ||
587 | else | ||
588 | { | ||
589 | elm_object_signal_emit | ||
590 | (sd->dec_button, "elm,action,anim,activate", "elm"); | ||
591 | eina_strbuf_append(buf, E_("decremented")); | ||
592 | } | ||
616 | 593 | ||
617 | eina_strbuf_append_printf(buf, "%s, %s", text, | 594 | eina_strbuf_append_printf |
618 | elm_layout_text_get(data, "elm.text")); | 595 | (buf, "%s", elm_object_text_get(sd->text_button)); |
619 | 596 | ||
620 | text = eina_strbuf_string_steal(buf); | 597 | text = eina_strbuf_string_steal(buf); |
621 | eina_strbuf_free(buf); | 598 | eina_strbuf_free(buf); |
622 | |||
623 | _elm_access_say(text); | 599 | _elm_access_say(text); |
624 | } | 600 | } |
625 | 601 | ||
@@ -628,61 +604,41 @@ _access_spinner_register(Evas_Object *obj, Eina_Bool is_access) | |||
628 | { | 604 | { |
629 | Evas_Object *ao; | 605 | Evas_Object *ao; |
630 | Elm_Access_Info *ai; | 606 | Elm_Access_Info *ai; |
631 | const char* increment_part; | ||
632 | const char* decrement_part; | ||
633 | 607 | ||
634 | if (!strncmp(elm_widget_style_get(obj), "vertical", 8)) | 608 | ELM_SPINNER_DATA_GET(obj, sd); |
635 | { | ||
636 | increment_part = "up_bt"; | ||
637 | decrement_part = "down_bt"; | ||
638 | } | ||
639 | else | ||
640 | { | ||
641 | increment_part = "right_bt"; | ||
642 | decrement_part = "left_bt"; | ||
643 | } | ||
644 | 609 | ||
645 | if (!is_access) | 610 | if (!is_access) |
646 | { | 611 | { |
647 | /* unregister increment button, decrement button and spinner label */ | 612 | /* unregister access */ |
648 | _elm_access_edje_object_part_object_unregister | 613 | _elm_access_edje_object_part_object_unregister |
649 | (obj, elm_layout_edje_get(obj), increment_part); | 614 | (obj, elm_layout_edje_get(obj), "access"); |
650 | 615 | elm_layout_signal_emit(obj, "elm,state,access,inactive", "elm"); | |
651 | _elm_access_edje_object_part_object_unregister | ||
652 | (obj, elm_layout_edje_get(obj), decrement_part); | ||
653 | |||
654 | _elm_access_edje_object_part_object_unregister | ||
655 | (obj, elm_layout_edje_get(obj), "access.text"); | ||
656 | |||
657 | return; | 616 | return; |
658 | } | 617 | } |
659 | 618 | elm_layout_signal_emit(obj, "elm,state,access,active", "elm"); | |
660 | /* register increment button */ | ||
661 | ao = _elm_access_edje_object_part_object_register | 619 | ao = _elm_access_edje_object_part_object_register |
662 | (obj, elm_layout_edje_get(obj), increment_part); | 620 | (obj, elm_layout_edje_get(obj), "access"); |
663 | 621 | ||
664 | ai = _elm_access_info_get(ao); | 622 | ai = _elm_access_info_get(ao); |
665 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, | 623 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("spinner")); |
666 | E_("spinner increment button")); | 624 | _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, obj); |
667 | _elm_access_activate_callback_set(ai, _access_activate_cb, obj); | 625 | _elm_access_activate_callback_set(ai, _access_activate_spinner_cb, obj); |
668 | 626 | ||
669 | /* register decrement button */ | 627 | /*Do not register spinner buttons if widget is disabled*/ |
670 | ao = _elm_access_edje_object_part_object_register | 628 | if (!elm_widget_disabled_get(obj)) |
671 | (obj, elm_layout_edje_get(obj), decrement_part); | 629 | { |
630 | ai = _elm_access_info_get(sd->inc_button); | ||
631 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, | ||
632 | E_("spinner increment button")); | ||
672 | 633 | ||
673 | ai = _elm_access_info_get(ao); | 634 | ai = _elm_access_info_get(sd->dec_button); |
674 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, | 635 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, |
675 | E_("spinner decrement button")); | 636 | E_("spinner decrement button")); |
676 | _elm_access_activate_callback_set(ai, _access_activate_cb, obj); | ||
677 | 637 | ||
678 | /* register spinner label */ | 638 | ai = _elm_access_info_get(sd->text_button); |
679 | ao = _elm_access_edje_object_part_object_register | 639 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("spinner text")); |
680 | (obj, elm_layout_edje_get(obj), "access.text"); | 640 | _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, obj); |
681 | 641 | } | |
682 | ai = _elm_access_info_get(ao); | ||
683 | _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("spinner")); | ||
684 | _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, obj); | ||
685 | _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, obj); | ||
686 | } | 642 | } |
687 | 643 | ||
688 | EOLIAN static void | 644 | EOLIAN static void |
@@ -707,14 +663,42 @@ _elm_spinner_evas_object_smart_add(Eo *obj, Elm_Spinner_Data *priv) | |||
707 | elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_stop_cb, obj); | 663 | elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_stop_cb, obj); |
708 | elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop_cb, obj); | 664 | elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop_cb, obj); |
709 | 665 | ||
710 | elm_layout_signal_callback_add | 666 | priv->inc_button = elm_button_add(obj); |
711 | (obj, "elm,action,increment,start", "*", _button_inc_start_cb, obj); | 667 | elm_object_style_set(priv->inc_button, "spinner/increase/default"); |
712 | elm_layout_signal_callback_add | 668 | |
713 | (obj, "elm,action,increment,stop", "*", _button_inc_stop_cb, obj); | 669 | evas_object_smart_callback_add |
714 | elm_layout_signal_callback_add | 670 | (priv->inc_button, "clicked", _inc_button_clicked_cb, obj); |
715 | (obj, "elm,action,decrement,start", "*", _button_dec_start_cb, obj); | 671 | evas_object_smart_callback_add |
716 | elm_layout_signal_callback_add | 672 | (priv->inc_button, "pressed", _inc_button_pressed_cb, obj); |
717 | (obj, "elm,action,decrement,stop", "*", _button_dec_stop_cb, obj); | 673 | evas_object_smart_callback_add |
674 | (priv->inc_button, "unpressed", _inc_button_unpressed_cb, obj); | ||
675 | |||
676 | elm_layout_content_set(obj, "elm.swallow.inc_button", priv->inc_button); | ||
677 | elm_widget_sub_object_add(obj, priv->inc_button); | ||
678 | |||
679 | priv->text_button = elm_button_add(obj); | ||
680 | elm_object_style_set(priv->text_button, "spinner/default"); | ||
681 | |||
682 | evas_object_smart_callback_add | ||
683 | (priv->text_button, "clicked", _text_button_clicked_cb, obj); | ||
684 | |||
685 | elm_layout_content_set(obj, "elm.swallow.text_button", priv->text_button); | ||
686 | elm_widget_sub_object_add(obj, priv->text_button); | ||
687 | |||
688 | |||
689 | priv->dec_button = elm_button_add(obj); | ||
690 | elm_object_style_set(priv->dec_button, "spinner/decrease/default"); | ||
691 | |||
692 | evas_object_smart_callback_add | ||
693 | (priv->dec_button, "clicked", _dec_button_clicked_cb, obj); | ||
694 | evas_object_smart_callback_add | ||
695 | (priv->dec_button, "pressed", _dec_button_pressed_cb, obj); | ||
696 | evas_object_smart_callback_add | ||
697 | (priv->dec_button, "unpressed", _dec_button_unpressed_cb, obj); | ||
698 | |||
699 | elm_layout_content_set(obj, "elm.swallow.dec_button", priv->dec_button); | ||
700 | elm_widget_sub_object_add(obj, priv->dec_button); | ||
701 | |||
718 | 702 | ||
719 | edje_object_part_drag_value_set | 703 | edje_object_part_drag_value_set |
720 | (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0); | 704 | (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0); |
@@ -755,22 +739,53 @@ _elm_spinner_evas_object_smart_del(Eo *obj, Elm_Spinner_Data *sd) | |||
755 | } | 739 | } |
756 | 740 | ||
757 | EOLIAN static Eina_Bool | 741 | EOLIAN static Eina_Bool |
758 | _elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED) | 742 | _elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd) |
759 | { | 743 | { |
760 | Eina_Bool int_ret = elm_layout_theme_set(obj, "spinner", "base", | 744 | Eina_Bool int_ret = elm_layout_theme_set(obj, "spinner", "base", |
761 | elm_widget_style_get(obj)); | 745 | elm_widget_style_get(obj)); |
762 | 746 | ||
763 | if (!int_ret) CRI("Failed to set layout!"); | 747 | if (!int_ret) CRI("Failed to set layout!"); |
764 | 748 | ||
749 | if (sd->ent) | ||
750 | { | ||
751 | Eina_Strbuf *buf = eina_strbuf_new(); | ||
752 | eina_strbuf_append_printf(buf, "spinner/%s", elm_widget_style_get(obj)); | ||
753 | elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf)); | ||
754 | eina_strbuf_free(buf); | ||
755 | } | ||
756 | |||
757 | if (sd->inc_button) | ||
758 | { | ||
759 | Eina_Strbuf *buf = eina_strbuf_new(); | ||
760 | eina_strbuf_append_printf(buf, "spinner/increase/%s", elm_widget_style_get(obj)); | ||
761 | elm_widget_style_set(sd->inc_button, eina_strbuf_string_get(buf)); | ||
762 | eina_strbuf_free(buf); | ||
763 | } | ||
764 | |||
765 | if (sd->text_button) | ||
766 | { | ||
767 | Eina_Strbuf *buf = eina_strbuf_new(); | ||
768 | eina_strbuf_append_printf(buf, "spinner/%s", elm_widget_style_get(obj)); | ||
769 | elm_widget_style_set(sd->text_button, eina_strbuf_string_get(buf)); | ||
770 | eina_strbuf_free(buf); | ||
771 | } | ||
772 | |||
773 | if (sd->dec_button) | ||
774 | { | ||
775 | Eina_Strbuf *buf = eina_strbuf_new(); | ||
776 | eina_strbuf_append_printf(buf, "spinner/decrease/%s", elm_widget_style_get(obj)); | ||
777 | elm_widget_style_set(sd->dec_button, eina_strbuf_string_get(buf)); | ||
778 | eina_strbuf_free(buf); | ||
779 | } | ||
780 | |||
765 | if (_elm_config->access_mode) | 781 | if (_elm_config->access_mode) |
766 | _access_spinner_register(obj, EINA_TRUE); | 782 | _access_spinner_register(obj, EINA_TRUE); |
767 | 783 | ||
768 | elm_layout_sizing_eval(obj); | 784 | elm_layout_sizing_eval(obj); |
769 | |||
770 | return int_ret; | 785 | return int_ret; |
771 | } | 786 | } |
772 | 787 | ||
773 | static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE; | 788 | static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_TRUE; |
774 | 789 | ||
775 | EOLIAN static Eina_Bool | 790 | EOLIAN static Eina_Bool |
776 | _elm_spinner_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_Data *_pd EINA_UNUSED) | 791 | _elm_spinner_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_Data *_pd EINA_UNUSED) |
@@ -781,7 +796,34 @@ _elm_spinner_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_D | |||
781 | EOLIAN static Eina_Bool | 796 | EOLIAN static Eina_Bool |
782 | _elm_spinner_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_Data *_pd EINA_UNUSED) | 797 | _elm_spinner_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Spinner_Data *_pd EINA_UNUSED) |
783 | { | 798 | { |
784 | return EINA_FALSE; | 799 | return EINA_TRUE; |
800 | } | ||
801 | |||
802 | EOLIAN static Eina_Bool | ||
803 | _elm_spinner_elm_widget_focus_direction(Eo *obj, Elm_Spinner_Data *_pd, const Evas_Object *base, double degree, Evas_Object **direction, double *weight) | ||
804 | { | ||
805 | Eina_Bool ret; | ||
806 | Eina_List *items = NULL; | ||
807 | void *(*list_data_get)(const Eina_List *list); | ||
808 | |||
809 | ELM_SPINNER_CHECK(obj) EINA_FALSE; | ||
810 | |||
811 | if (!_pd) | ||
812 | return EINA_FALSE; | ||
813 | |||
814 | list_data_get = eina_list_data_get; | ||
815 | items = eina_list_append(items, _pd->inc_button); | ||
816 | if (_pd->entry_visible) | ||
817 | items = eina_list_append(items, _pd->ent); | ||
818 | else | ||
819 | items = eina_list_append(items, _pd->text_button); | ||
820 | items = eina_list_append(items, _pd->dec_button); | ||
821 | |||
822 | ret = elm_widget_focus_list_direction_get | ||
823 | (obj, base, items, list_data_get, degree, direction, weight); | ||
824 | eina_list_free(items); | ||
825 | |||
826 | return ret; | ||
785 | } | 827 | } |
786 | 828 | ||
787 | static Evas_Object * | 829 | static Evas_Object * |
@@ -798,34 +840,28 @@ _access_object_get(const Evas_Object *obj, const char* part) | |||
798 | } | 840 | } |
799 | 841 | ||
800 | EOLIAN static Eina_Bool | 842 | EOLIAN static Eina_Bool |
801 | _elm_spinner_elm_widget_focus_next(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir, Evas_Object **next) | 843 | _elm_spinner_elm_widget_focus_next(Eo *obj, Elm_Spinner_Data *_pd, Elm_Focus_Direction dir, Evas_Object **next) |
802 | { | 844 | { |
803 | Evas_Object *ao; | 845 | Evas_Object *ao; |
804 | |||
805 | Eina_List *items = NULL; | 846 | Eina_List *items = NULL; |
806 | const char* increment_part; | ||
807 | const char* decrement_part; | ||
808 | 847 | ||
809 | if (!strncmp(elm_widget_style_get(obj), "vertical", 8)) | 848 | ELM_SPINNER_CHECK(obj) EINA_FALSE; |
849 | |||
850 | if (_elm_config->access_mode) | ||
810 | { | 851 | { |
811 | increment_part = "up_bt"; | 852 | ao = _access_object_get(obj, "access"); |
812 | decrement_part = "down_bt"; | 853 | items = eina_list_append(items, ao); |
813 | } | 854 | } |
814 | else | 855 | if (!elm_widget_disabled_get(obj)) |
815 | { | 856 | { |
816 | increment_part = "right_bt"; | 857 | items = eina_list_append(items, _pd->dec_button); |
817 | decrement_part = "left_bt"; | 858 | items = eina_list_append(items, _pd->inc_button); |
818 | } | 859 | if (_pd->entry_visible) |
819 | 860 | items = eina_list_append(items, _pd->ent); | |
820 | ao = _access_object_get(obj, "access.text"); | 861 | else |
821 | items = eina_list_append(items, ao); | 862 | items = eina_list_append(items, _pd->text_button); |
822 | |||
823 | ao = _access_object_get(obj, decrement_part); | ||
824 | items = eina_list_append(items, ao); | ||
825 | |||
826 | ao = _access_object_get(obj, increment_part); | ||
827 | items = eina_list_append(items, ao); | ||
828 | 863 | ||
864 | } | ||
829 | return elm_widget_focus_list_next_get | 865 | return elm_widget_focus_list_next_get |
830 | (obj, items, eina_list_data_get, dir, next); | 866 | (obj, items, eina_list_data_get, dir, next); |
831 | } | 867 | } |
@@ -1103,19 +1139,6 @@ _elm_spinner_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Spinner_Data * | |||
1103 | return elm_layout_text_get(obj, "elm.text"); | 1139 | return elm_layout_text_get(obj, "elm.text"); |
1104 | } | 1140 | } |
1105 | 1141 | ||
1106 | EOLIAN static const Elm_Atspi_Action* | ||
1107 | _elm_spinner_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Spinner_Data *sd EINA_UNUSED) | ||
1108 | { | ||
1109 | static Elm_Atspi_Action atspi_actions[] = { | ||
1110 | { "spin,left", "spin", "left", _key_action_spin}, | ||
1111 | { "spin,right", "spin", "right", _key_action_spin}, | ||
1112 | { "spin,up", "spin", "up", _key_action_spin}, | ||
1113 | { "spin,down", "spin", "down", _key_action_spin}, | ||
1114 | { "toggle", "toggle", NULL, _key_action_toggle}, | ||
1115 | { NULL, NULL, NULL, NULL } | ||
1116 | }; | ||
1117 | return &atspi_actions[0]; | ||
1118 | } | ||
1119 | // A11Y Accessibility - END | 1142 | // A11Y Accessibility - END |
1120 | 1143 | ||
1121 | #include "elm_spinner.eo.c" | 1144 | #include "elm_spinner.eo.c" |
diff --git a/src/lib/elm_spinner.eo b/src/lib/elm_spinner.eo index ed31d4a27..0c02edea6 100644 --- a/src/lib/elm_spinner.eo +++ b/src/lib/elm_spinner.eo | |||
@@ -371,15 +371,14 @@ class Elm_Spinner (Elm_Layout, Elm_Interface_Atspi_Value, Elm_Interface_Atspi_Wi | |||
371 | Elm_Widget.focus_direction_manager_is; | 371 | Elm_Widget.focus_direction_manager_is; |
372 | Elm_Widget.access; | 372 | Elm_Widget.access; |
373 | Elm_Widget.focus_next; | 373 | Elm_Widget.focus_next; |
374 | Elm_Widget.focus_direction; | ||
374 | Elm_Widget.on_focus; | 375 | Elm_Widget.on_focus; |
375 | Elm_Widget.event; | ||
376 | Elm_Layout.sizing_eval; | 376 | Elm_Layout.sizing_eval; |
377 | Elm_Interface_Atspi_Accessible.name.get; | 377 | Elm_Interface_Atspi_Accessible.name.get; |
378 | Elm_Interface_Atspi_Value.value_and_text.get; | 378 | Elm_Interface_Atspi_Value.value_and_text.get; |
379 | Elm_Interface_Atspi_Value.value_and_text.set; | 379 | Elm_Interface_Atspi_Value.value_and_text.set; |
380 | Elm_Interface_Atspi_Value.range.get; | 380 | Elm_Interface_Atspi_Value.range.get; |
381 | Elm_Interface_Atspi_Value.increment.get; | 381 | Elm_Interface_Atspi_Value.increment.get; |
382 | Elm_Interface_Atspi_Widget_Action.elm_actions.get; | ||
383 | } | 382 | } |
384 | events { | 383 | events { |
385 | changed; | 384 | changed; |
diff --git a/src/lib/elm_widget_spinner.h b/src/lib/elm_widget_spinner.h index 838f57135..73e410a30 100644 --- a/src/lib/elm_widget_spinner.h +++ b/src/lib/elm_widget_spinner.h | |||
@@ -28,7 +28,7 @@ | |||
28 | typedef struct _Elm_Spinner_Data Elm_Spinner_Data; | 28 | typedef struct _Elm_Spinner_Data Elm_Spinner_Data; |
29 | struct _Elm_Spinner_Data | 29 | struct _Elm_Spinner_Data |
30 | { | 30 | { |
31 | Evas_Object *ent; | 31 | Evas_Object *ent, *inc_button, *dec_button, *text_button; |
32 | const char *label; | 32 | const char *label; |
33 | double val, val_min, val_max, val_base; | 33 | double val, val_min, val_max, val_base; |
34 | double step; /**< step for the value change. 1 by default. */ | 34 | double step; /**< step for the value change. 1 by default. */ |