summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Houston <stephen@localhost.localdomain>2017-10-17 20:10:08 -0500
committerStephen Houston <stephen@localhost.localdomain>2017-10-17 20:10:08 -0500
commitbda1fd5e2a02325bc9acd1a6b035840d4f5fce80 (patch)
treee062b36f2a1992bd5a32404d16f48efacc701634
parenteda0c933588d7d8c3d119d8cd5eafb43f1ce2387 (diff)
Fix sizing throughout.
-rw-r--r--src/wireless.c125
1 files changed, 60 insertions, 65 deletions
diff --git a/src/wireless.c b/src/wireless.c
index 811acd3..c0825e4 100644
--- a/src/wireless.c
+++ b/src/wireless.c
@@ -212,8 +212,8 @@ _wireless_popup_table_entry_row(Evas_Object *tb, const char *name, Evas_Smart_Cb
212 212
213 fr = elm_frame_add(tb); 213 fr = elm_frame_add(tb);
214 evas_object_show(fr); 214 evas_object_show(fr);
215 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 215 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0);
216 evas_object_size_hint_fill_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 216 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
217 elm_object_text_set(fr, name); 217 elm_object_text_set(fr, name);
218 elm_table_pack(tb, fr, 0, *row, 2, 2); 218 elm_table_pack(tb, fr, 0, *row, 2, 2);
219 *row += 2; 219 *row += 2;
@@ -222,6 +222,8 @@ _wireless_popup_table_entry_row(Evas_Object *tb, const char *name, Evas_Smart_Cb
222 evas_object_show(entry); 222 evas_object_show(entry);
223 elm_entry_single_line_set(entry, 1); 223 elm_entry_single_line_set(entry, 1);
224 elm_entry_scrollable_set(entry, 1); 224 elm_entry_scrollable_set(entry, 1);
225 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
226 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
225 evas_object_data_set(entry, "table", tb); 227 evas_object_data_set(entry, "table", tb);
226 evas_object_smart_callback_add(entry, "activated", cb, data); 228 evas_object_smart_callback_add(entry, "activated", cb, data);
227 elm_object_content_set(fr, entry); 229 elm_object_content_set(fr, entry);
@@ -501,7 +503,6 @@ _wireless_edit_send()
501static void 503static void
502_wireless_edit_send_button() 504_wireless_edit_send_button()
503{ 505{
504 evas_object_hide(wireless_edit_popup);
505 evas_object_del(wireless_edit_popup); 506 evas_object_del(wireless_edit_popup);
506 _wireless_edit_send(); 507 _wireless_edit_send();
507} 508}
@@ -510,7 +511,6 @@ static void
510_wireless_edit_remove() 511_wireless_edit_remove()
511{ 512{
512 void connman_service_remove(const char *path); 513 void connman_service_remove(const char *path);
513 evas_object_hide(wireless_edit_popup);
514 evas_object_del(wireless_edit_popup); 514 evas_object_del(wireless_edit_popup);
515 connman_service_remove(wireless_edit[1]->wn->path); 515 connman_service_remove(wireless_edit[1]->wn->path);
516} 516}
@@ -518,17 +518,15 @@ _wireless_edit_remove()
518static void 518static void
519_wireless_edit_key(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_data) 519_wireless_edit_key(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_data)
520{ 520{
521 Evas_Event_Key_Up *ev = event_data; 521 Evas_Event_Key_Down *ev = event_data;
522 522
523 if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) 523 if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
524 { 524 {
525 _wireless_edit_send(); 525 _wireless_edit_send();
526 evas_object_hide(obj);
527 evas_object_del(obj); 526 evas_object_del(obj);
528 } 527 }
529 if (!strcmp(ev->key, "Escape")) 528 if (!strcmp(ev->key, "Escape"))
530 { 529 {
531 evas_object_hide(obj);
532 evas_object_del(obj); 530 evas_object_del(obj);
533 } 531 }
534} 532}
@@ -554,14 +552,14 @@ _wireless_gadget_edit_proxy(void)
554 Wireless_Connection *wc = wireless_edit[1]; 552 Wireless_Connection *wc = wireless_edit[1];
555 553
556 wireless_popup.content = tb = elm_table_add(wireless_popup.popup); 554 wireless_popup.content = tb = elm_table_add(wireless_popup.popup);
557 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 555 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0);
558 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 556 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
559 evas_object_show(tb); 557 evas_object_show(tb);
560 elm_box_pack_end(wireless_popup.box, tb); 558 elm_box_pack_end(wireless_popup.box, tb);
561 559
562 fr = elm_frame_add(tb); 560 fr = elm_frame_add(tb);
563 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 561 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0);
564 evas_object_size_hint_fill_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 562 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
565 evas_object_show(fr); 563 evas_object_show(fr);
566 elm_object_text_set(fr, _("Proxy Type")); 564 elm_object_text_set(fr, _("Proxy Type"));
567 elm_table_pack(tb, fr, 0, row++, 2, 1); 565 elm_table_pack(tb, fr, 0, row++, 2, 1);
@@ -569,6 +567,8 @@ _wireless_gadget_edit_proxy(void)
569 hoversel = elm_hoversel_add(tb); 567 hoversel = elm_hoversel_add(tb);
570 elm_hoversel_hover_parent_set(hoversel, wireless_popup.popup); 568 elm_hoversel_hover_parent_set(hoversel, wireless_popup.popup);
571 elm_hoversel_auto_update_set(hoversel, 1); 569 elm_hoversel_auto_update_set(hoversel, 1);
570 evas_object_size_hint_weight_set(hoversel, EVAS_HINT_EXPAND, 0);
571 evas_object_size_hint_align_set(hoversel, EVAS_HINT_FILL, EVAS_HINT_FILL);
572 evas_object_show(hoversel); 572 evas_object_show(hoversel);
573 elm_object_content_set(fr, hoversel); 573 elm_object_content_set(fr, hoversel);
574 evas_object_smart_callback_add(hoversel, "selected", _wireless_gadget_edit_proxy_method, NULL); 574 evas_object_smart_callback_add(hoversel, "selected", _wireless_gadget_edit_proxy_method, NULL);
@@ -584,8 +584,8 @@ _wireless_gadget_edit_dnstime(void)
584 int row = 0; 584 int row = 0;
585 585
586 wireless_popup.content = tb = elm_table_add(wireless_popup.popup); 586 wireless_popup.content = tb = elm_table_add(wireless_popup.popup);
587 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 587 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0);
588 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 588 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
589 evas_object_show(tb); 589 evas_object_show(tb);
590 elm_box_pack_end(wireless_popup.box, tb); 590 elm_box_pack_end(wireless_popup.box, tb);
591 591
@@ -645,27 +645,27 @@ _wireless_gadget_edit_services(void)
645 645
646 wireless_popup.content = tb = elm_table_add(wireless_popup.popup); 646 wireless_popup.content = tb = elm_table_add(wireless_popup.popup);
647 elm_table_homogeneous_set(tb, 1); 647 elm_table_homogeneous_set(tb, 1);
648 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 648 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0);
649 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 649 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
650 evas_object_show(tb); 650 evas_object_show(tb);
651 elm_box_pack_end(wireless_popup.box, tb); 651 elm_box_pack_end(wireless_popup.box, tb);
652 652
653 fr = elm_frame_add(tb); 653 fr = elm_frame_add(tb);
654 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 654 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0);
655 evas_object_size_hint_fill_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 655 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
656 evas_object_show(fr); 656 evas_object_show(fr);
657 elm_object_text_set(fr, _("Hide Service Types")); 657 elm_object_text_set(fr, _("Hide Service Types"));
658 elm_table_pack(tb, fr, 0, row++, 2, 1); 658 elm_table_pack(tb, fr, 0, row++, 2, 1);
659 659
660 bx = elm_box_add(fr); 660 bx = elm_box_add(fr);
661 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 661 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0);
662 evas_object_size_hint_fill_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); 662 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
663 evas_object_show(bx); 663 evas_object_show(bx);
664 elm_object_content_set(fr, bx); 664 elm_object_content_set(fr, bx);
665 665
666 ck = elm_check_add(tb); 666 ck = elm_check_add(tb);
667 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 667 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0);
668 evas_object_size_hint_fill_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL); 668 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
669 elm_object_text_set(ck, _("Hide Wifi")); 669 elm_object_text_set(ck, _("Hide Wifi"));
670 elm_check_state_set(ck, (wireless_config->disabled_types & 670 elm_check_state_set(ck, (wireless_config->disabled_types &
671 (1 << WIRELESS_SERVICE_TYPE_WIFI)) == (1 << WIRELESS_SERVICE_TYPE_WIFI)); 671 (1 << WIRELESS_SERVICE_TYPE_WIFI)) == (1 << WIRELESS_SERVICE_TYPE_WIFI));
@@ -676,8 +676,8 @@ _wireless_gadget_edit_services(void)
676 elm_box_pack_end(bx, ck); 676 elm_box_pack_end(bx, ck);
677 677
678 ck = elm_check_add(tb); 678 ck = elm_check_add(tb);
679 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 679 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0);
680 evas_object_size_hint_fill_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL); 680 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
681 elm_object_text_set(ck, _("Hide Bluetooth")); 681 elm_object_text_set(ck, _("Hide Bluetooth"));
682 elm_check_state_set(ck, (wireless_config->disabled_types & 682 elm_check_state_set(ck, (wireless_config->disabled_types &
683 (1 << WIRELESS_SERVICE_TYPE_BLUETOOTH)) == (1 << WIRELESS_SERVICE_TYPE_BLUETOOTH)); 683 (1 << WIRELESS_SERVICE_TYPE_BLUETOOTH)) == (1 << WIRELESS_SERVICE_TYPE_BLUETOOTH));
@@ -688,8 +688,8 @@ _wireless_gadget_edit_services(void)
688 elm_box_pack_end(bx, ck); 688 elm_box_pack_end(bx, ck);
689 689
690 ck = elm_check_add(tb); 690 ck = elm_check_add(tb);
691 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 691 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0);
692 evas_object_size_hint_fill_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL); 692 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
693 elm_object_text_set(ck, _("Hide Cellular")); 693 elm_object_text_set(ck, _("Hide Cellular"));
694 elm_check_state_set(ck, (wireless_config->disabled_types & 694 elm_check_state_set(ck, (wireless_config->disabled_types &
695 (1 << WIRELESS_SERVICE_TYPE_CELLULAR)) == (1 << WIRELESS_SERVICE_TYPE_CELLULAR)); 695 (1 << WIRELESS_SERVICE_TYPE_CELLULAR)) == (1 << WIRELESS_SERVICE_TYPE_CELLULAR));
@@ -713,14 +713,14 @@ _wireless_gadget_edit_basic(void)
713 Wireless_Connection *wc = wireless_edit[1]; 713 Wireless_Connection *wc = wireless_edit[1];
714 714
715 wireless_popup.content = tb = elm_table_add(wireless_popup.box); 715 wireless_popup.content = tb = elm_table_add(wireless_popup.box);
716 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 716 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0);
717 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 717 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
718 evas_object_show(tb); 718 evas_object_show(tb);
719 elm_box_pack_end(wireless_popup.box, tb); 719 elm_box_pack_end(wireless_popup.box, tb);
720 720
721 fr = elm_frame_add(tb); 721 fr = elm_frame_add(tb);
722 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 722 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0);
723 evas_object_size_hint_fill_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 723 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
724 evas_object_show(fr); 724 evas_object_show(fr);
725 elm_object_text_set(fr, _("Method")); 725 elm_object_text_set(fr, _("Method"));
726 elm_table_pack(tb, fr, 0, row++, 2, 1); 726 elm_table_pack(tb, fr, 0, row++, 2, 1);
@@ -728,6 +728,8 @@ _wireless_gadget_edit_basic(void)
728 hoversel = elm_hoversel_add(tb); 728 hoversel = elm_hoversel_add(tb);
729 elm_hoversel_hover_parent_set(hoversel, wireless_popup.popup); 729 elm_hoversel_hover_parent_set(hoversel, wireless_popup.popup);
730 elm_hoversel_auto_update_set(hoversel, 1); 730 elm_hoversel_auto_update_set(hoversel, 1);
731 evas_object_size_hint_weight_set(hoversel, EVAS_HINT_EXPAND, 0);
732 evas_object_size_hint_align_set(hoversel, EVAS_HINT_FILL, EVAS_HINT_FILL);
731 evas_object_show(hoversel); 733 evas_object_show(hoversel);
732 elm_object_content_set(fr, hoversel); 734 elm_object_content_set(fr, hoversel);
733 evas_object_smart_callback_add(hoversel, "selected", _wireless_gadget_edit_method, NULL); 735 evas_object_smart_callback_add(hoversel, "selected", _wireless_gadget_edit_method, NULL);
@@ -830,7 +832,6 @@ _wireless_gadget_edit(int type)
830 if (!wc) return; 832 if (!wc) return;
831 if (wireless_popup.popup) 833 if (wireless_popup.popup)
832 { 834 {
833 evas_object_hide(wireless_popup.popup);
834 evas_object_del(wireless_popup.popup); 835 evas_object_del(wireless_popup.popup);
835 } 836 }
836 wireless_edit[0] = calloc(1, sizeof(Wireless_Connection)); 837 wireless_edit[0] = calloc(1, sizeof(Wireless_Connection));
@@ -885,8 +886,8 @@ _wireless_gadget_edit(int type)
885 elm_win_alpha_set(popup, 1); 886 elm_win_alpha_set(popup, 1);
886 887
887 box = elm_box_add(popup); 888 box = elm_box_add(popup);
888 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 889 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
889 evas_object_size_hint_fill_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); 890 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
890 evas_object_show(box); 891 evas_object_show(box);
891 elm_win_resize_object_add(popup, box); 892 elm_win_resize_object_add(popup, box);
892 893
@@ -901,15 +902,15 @@ _wireless_gadget_edit(int type)
901 elm_box_pack_end(box, lbl); 902 elm_box_pack_end(box, lbl);
902 903
903 wireless_popup.box = box1 = elm_box_add(popup); 904 wireless_popup.box = box1 = elm_box_add(popup);
904 evas_object_size_hint_weight_set(box1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 905 evas_object_size_hint_weight_set(box1, EVAS_HINT_EXPAND, 0);
905 evas_object_size_hint_fill_set(box1, EVAS_HINT_FILL, EVAS_HINT_FILL); 906 evas_object_size_hint_align_set(box1, EVAS_HINT_FILL, EVAS_HINT_FILL);
906 elm_box_horizontal_set(box1, 1); 907 elm_box_horizontal_set(box1, 1);
907 evas_object_show(box1); 908 evas_object_show(box1);
908 elm_box_pack_end(box, box1); 909 elm_box_pack_end(box, box1);
909 910
910 list = elm_list_add(box1); 911 list = elm_list_add(box1);
911 evas_object_size_hint_weight_set(list, 0, EVAS_HINT_EXPAND); 912 evas_object_size_hint_weight_set(list, 0, 0);
912 evas_object_size_hint_fill_set(list, 0, EVAS_HINT_FILL); 913 evas_object_size_hint_align_set(list, 0, EVAS_HINT_FILL);
913 elm_box_pack_end(box1, list); 914 elm_box_pack_end(box1, list);
914 elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS); 915 elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
915 elm_scroller_content_min_limit(list, 1, 1); 916 elm_scroller_content_min_limit(list, 1, 1);
@@ -930,16 +931,16 @@ _wireless_gadget_edit(int type)
930 if (!disabled) 931 if (!disabled)
931 { 932 {
932 bt = elm_button_add(box); 933 bt = elm_button_add(box);
933 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 934 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
934 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 935 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
935 evas_object_show(bt); 936 evas_object_show(bt);
936 elm_object_text_set(bt, _("Deal with it")); 937 elm_object_text_set(bt, _("Deal with it"));
937 evas_object_smart_callback_add(bt, "clicked", _wireless_edit_send_button, NULL); 938 evas_object_smart_callback_add(bt, "clicked", _wireless_edit_send_button, NULL);
938 elm_box_pack_end(box, bt); 939 elm_box_pack_end(box, bt);
939 940
940 bt = elm_button_add(box); 941 bt = elm_button_add(box);
941 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 942 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
942 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 943 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
943 evas_object_show(bt); 944 evas_object_show(bt);
944 elm_object_text_set(bt, _("Forget Network")); 945 elm_object_text_set(bt, _("Forget Network"));
945 evas_object_smart_callback_add(bt, "clicked", _wireless_edit_remove, NULL); 946 evas_object_smart_callback_add(bt, "clicked", _wireless_edit_remove, NULL);
@@ -948,7 +949,7 @@ _wireless_gadget_edit(int type)
948 wireless_edit_popup = popup; 949 wireless_edit_popup = popup;
949 evas_object_size_hint_fill_set(box, 0.5, 0.5); 950 evas_object_size_hint_fill_set(box, 0.5, 0.5);
950 evas_object_show(wireless_edit_popup); 951 evas_object_show(wireless_edit_popup);
951 evas_object_event_callback_add(wireless_edit_popup, EVAS_CALLBACK_KEY_UP, _wireless_edit_key, NULL); 952 evas_object_event_callback_add(wireless_edit_popup, EVAS_CALLBACK_KEY_DOWN, _wireless_edit_key, NULL);
952 evas_object_event_callback_add(wireless_edit_popup, EVAS_CALLBACK_DEL, _wireless_edit_del, NULL); 953 evas_object_event_callback_add(wireless_edit_popup, EVAS_CALLBACK_DEL, _wireless_edit_del, NULL);
953 elm_object_focus_set(entry, 1); 954 elm_object_focus_set(entry, 1);
954} 955}
@@ -962,7 +963,6 @@ _wireless_popup_network_click(void *data, Evas_Object *obj EINA_UNUSED, void *ev
962 { 963 {
963 int type = wireless_popup.type; 964 int type = wireless_popup.type;
964 965
965 evas_object_hide(wireless_popup.popup);
966 evas_object_del(wireless_popup.popup); 966 evas_object_del(wireless_popup.popup);
967 _wireless_gadget_edit(type); 967 _wireless_gadget_edit(type);
968 } 968 }
@@ -1032,7 +1032,6 @@ _wireless_gadget_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Ob
1032 if (ev->button != 1) return; 1032 if (ev->button != 1) return;
1033 if (wireless_popup.popup) 1033 if (wireless_popup.popup)
1034 { 1034 {
1035 evas_object_hide(wireless_popup.popup);
1036 evas_object_del(wireless_popup.popup); 1035 evas_object_del(wireless_popup.popup);
1037 wireless_popup.popup = NULL; 1036 wireless_popup.popup = NULL;
1038 return; 1037 return;
@@ -1045,12 +1044,12 @@ _wireless_gadget_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Ob
1045 1044
1046 tb = elm_table_add(ctx); 1045 tb = elm_table_add(ctx);
1047 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1046 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1048 evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 1047 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1049 1048
1050 wireless_popup.content = list = elm_list_add(ctx); 1049 wireless_popup.content = list = elm_list_add(ctx);
1051 elm_list_mode_set(list, ELM_LIST_EXPAND); 1050 elm_list_mode_set(list, ELM_LIST_EXPAND);
1052 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1051 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1053 evas_object_size_hint_fill_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); 1052 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
1054 _wireless_popup_list_populate(); 1053 _wireless_popup_list_populate();
1055 elm_list_go(list); 1054 elm_list_go(list);
1056 evas_object_show(list); 1055 evas_object_show(list);
@@ -1162,11 +1161,9 @@ wireless_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
1162{ 1161{
1163 if (inst->popup) 1162 if (inst->popup)
1164 { 1163 {
1165 evas_object_hide(wireless_popup.popup);
1166 evas_object_del(wireless_popup.popup); 1164 evas_object_del(wireless_popup.popup);
1167 } 1165 }
1168 1166
1169 evas_object_hide(wireless_popup.popup);
1170 evas_object_del(wireless_popup.popup); 1167 evas_object_del(wireless_popup.popup);
1171 free(inst); 1168 free(inst);
1172 free(wireless_config); 1169 free(wireless_config);
@@ -1187,7 +1184,7 @@ _wireless_gadget_icon_add(int type)
1187 1184
1188 inst->icon[type] = g = elm_layout_add(inst->box); 1185 inst->icon[type] = g = elm_layout_add(inst->box);
1189 evas_object_size_hint_weight_set(g, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1186 evas_object_size_hint_weight_set(g, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1190 evas_object_size_hint_fill_set(g, EVAS_HINT_FILL, EVAS_HINT_FILL); 1187 evas_object_size_hint_align_set(g, EVAS_HINT_FILL, EVAS_HINT_FILL);
1191 elm_layout_file_set(g, elm_theme_group_path_find(NULL, wireless_theme_groups[type]), 1188 elm_layout_file_set(g, elm_theme_group_path_find(NULL, wireless_theme_groups[type]),
1192 wireless_theme_groups[type]); 1189 wireless_theme_groups[type]);
1193 elm_object_tooltip_content_cb_set(g, _wireless_tooltip, inst, NULL); 1190 elm_object_tooltip_content_cb_set(g, _wireless_tooltip, inst, NULL);
@@ -1215,7 +1212,6 @@ _wireless_gadget_refresh()
1215 elm_object_tooltip_hide(inst->icon[type]); 1212 elm_object_tooltip_hide(inst->icon[type]);
1216 if (wireless_popup.type == type) 1213 if (wireless_popup.type == type)
1217 { 1214 {
1218 evas_object_hide(wireless_popup.popup);
1219 evas_object_del(wireless_popup.popup); 1215 evas_object_del(wireless_popup.popup);
1220 } 1216 }
1221 evas_object_del(inst->icon[type]); 1217 evas_object_del(inst->icon[type]);
@@ -1304,7 +1300,7 @@ main(int argc, char *argv[])
1304 elm_box_horizontal_set(inst->box, inst->orient != E_GADGET_SITE_ORIENT_VERTICAL); 1300 elm_box_horizontal_set(inst->box, inst->orient != E_GADGET_SITE_ORIENT_VERTICAL);
1305 elm_box_homogeneous_set(inst->box, 1); 1301 elm_box_homogeneous_set(inst->box, 1);
1306 evas_object_size_hint_weight_set(inst->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1302 evas_object_size_hint_weight_set(inst->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1307 evas_object_size_hint_fill_set(inst->box, EVAS_HINT_FILL, EVAS_HINT_FILL); 1303 evas_object_size_hint_align_set(inst->box, EVAS_HINT_FILL, EVAS_HINT_FILL);
1308 evas_object_event_callback_add(inst->box, EVAS_CALLBACK_DEL, wireless_del, inst); 1304 evas_object_event_callback_add(inst->box, EVAS_CALLBACK_DEL, wireless_del, inst);
1309 evas_object_show(inst->box); 1305 evas_object_show(inst->box);
1310 1306
@@ -1312,7 +1308,7 @@ main(int argc, char *argv[])
1312 { 1308 {
1313 inst->icon[WIRELESS_SERVICE_TYPE_WIFI] = g = elm_layout_add(inst->box); 1309 inst->icon[WIRELESS_SERVICE_TYPE_WIFI] = g = elm_layout_add(inst->box);
1314 evas_object_size_hint_weight_set(g, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1310 evas_object_size_hint_weight_set(g, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1315 evas_object_size_hint_fill_set(g, EVAS_HINT_FILL, EVAS_HINT_FILL); 1311 evas_object_size_hint_align_set(g, EVAS_HINT_FILL, EVAS_HINT_FILL);
1316 elm_layout_file_set(g, elm_theme_group_path_find(NULL, "wireless/wifi"), 1312 elm_layout_file_set(g, elm_theme_group_path_find(NULL, "wireless/wifi"),
1317 "wireless/wifi"); 1313 "wireless/wifi");
1318 elm_object_signal_emit(g, "wireless,state,default", "wireless"); 1314 elm_object_signal_emit(g, "wireless,state,default", "wireless");
@@ -1390,7 +1386,6 @@ wireless_wifi_current_networks_set(Wireless_Connection **current)
1390 } 1386 }
1391 else if ((type > -1) && wireless_popup.popup && (!wireless_current[type])) 1387 else if ((type > -1) && wireless_popup.popup && (!wireless_current[type]))
1392 { 1388 {
1393 evas_object_hide(wireless_popup.popup);
1394 evas_object_del(wireless_popup.popup); 1389 evas_object_del(wireless_popup.popup);
1395 } 1390 }
1396 _wireless_gadget_refresh(); 1391 _wireless_gadget_refresh();
@@ -1446,7 +1441,7 @@ void
1446wireless_airplane_mode_set(Eina_Bool enabled) 1441wireless_airplane_mode_set(Eina_Bool enabled)
1447{ 1442{
1448 wireless_offline = enabled; 1443 wireless_offline = enabled;
1449 //Currently not used due to E internals 1444 //Currently not used due to e internals
1450 /*if (enabled == e_config->mode.offline) return; 1445 /*if (enabled == e_config->mode.offline) return;
1451 e_config->mode.offline = !!enabled; 1446 e_config->mode.offline = !!enabled;
1452 e_config_mode_changed(); 1447 e_config_mode_changed();
@@ -1463,7 +1458,6 @@ _wireless_auth_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED
1463 p->cb(p->data, NULL); 1458 p->cb(p->data, NULL);
1464 free(p); 1459 free(p);
1465 wireless_auth_popup = NULL; 1460 wireless_auth_popup = NULL;
1466 evas_object_hide(popup);
1467 evas_object_del(popup); 1461 evas_object_del(popup);
1468 if (!wireless_auth_pending) return; 1462 if (!wireless_auth_pending) return;
1469 wireless_auth_popup = eina_list_data_get(wireless_auth_pending); 1463 wireless_auth_popup = eina_list_data_get(wireless_auth_pending);
@@ -1500,18 +1494,16 @@ _wireless_auth_send(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1500 p->cb(p->data, arr); 1494 p->cb(p->data, arr);
1501 p->sent = 1; 1495 p->sent = 1;
1502 eina_array_free(arr); 1496 eina_array_free(arr);
1503 evas_object_hide(p->popup);
1504 evas_object_del(p->popup); 1497 evas_object_del(p->popup);
1505} 1498}
1506 1499
1507static void 1500static void
1508_wireless_auth_key(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_data) 1501_wireless_auth_key(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_data)
1509{ 1502{
1510 Evas_Event_Key_Up *ev = event_data; 1503 Evas_Event_Key_Down *ev = event_data;
1511 1504
1512 if (!strcmp(ev->key, "Escape")) 1505 if (!strcmp(ev->key, "Escape"))
1513 { 1506 {
1514 evas_object_hide(obj);
1515 evas_object_del(obj); 1507 evas_object_del(obj);
1516 } 1508 }
1517} 1509}
@@ -1536,20 +1528,24 @@ wireless_authenticate(const Eina_Array *fields, Wireless_Auth_Cb cb, void *data)
1536 p->data = data; 1528 p->data = data;
1537 if (wireless_popup.popup) 1529 if (wireless_popup.popup)
1538 { 1530 {
1539 evas_object_hide(wireless_popup.popup);
1540 evas_object_del(wireless_popup.popup); 1531 evas_object_del(wireless_popup.popup);
1541 } 1532 }
1542 1533
1543 popup = elm_win_add(inst->win, "win", ELM_WIN_BASIC); 1534 popup = elm_win_add(inst->win, "win", ELM_WIN_BASIC);
1544 elm_win_alpha_set(popup, 1); 1535 elm_win_alpha_set(popup, 1);
1545 evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_UP, _wireless_auth_key, NULL); 1536 evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN, _wireless_auth_key, NULL);
1546 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, _wireless_auth_del, NULL); 1537 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, _wireless_auth_del, NULL);
1538 p->popup = popup;
1547 1539
1548 tb = elm_table_add(popup); 1540 tb = elm_table_add(popup);
1541 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0);
1542 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1549 evas_object_show(tb); 1543 evas_object_show(tb);
1550 elm_win_resize_object_add(popup, tb); 1544 elm_win_resize_object_add(popup, tb);
1551 1545
1552 lbl = elm_label_add(popup); 1546 lbl = elm_label_add(popup);
1547 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0);
1548 evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1553 evas_object_show(lbl); 1549 evas_object_show(lbl);
1554 elm_object_text_set(lbl, _("Authentication Required")); 1550 elm_object_text_set(lbl, _("Authentication Required"));
1555 elm_table_pack(tb, lbl, 0, row++, 2, 1); 1551 elm_table_pack(tb, lbl, 0, row++, 2, 1);
@@ -1567,6 +1563,8 @@ wireless_authenticate(const Eina_Array *fields, Wireless_Auth_Cb cb, void *data)
1567 elm_entry_password_set(o, 1); 1563 elm_entry_password_set(o, 1);
1568 1564
1569 ck = elm_check_add(tb); 1565 ck = elm_check_add(tb);
1566 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0);
1567 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
1570 evas_object_show(ck); 1568 evas_object_show(ck);
1571 evas_object_size_hint_align_set(ck, 0, -1); 1569 evas_object_size_hint_align_set(ck, 0, -1);
1572 snprintf(buf, sizeof(buf), _("Show %s"), f); 1570 snprintf(buf, sizeof(buf), _("Show %s"), f);
@@ -1574,7 +1572,6 @@ wireless_authenticate(const Eina_Array *fields, Wireless_Auth_Cb cb, void *data)
1574 elm_object_text_set(ck, buf); 1572 elm_object_text_set(ck, buf);
1575 elm_table_pack(tb, ck, 0, row++, 2, 1); 1573 elm_table_pack(tb, ck, 0, row++, 2, 1);
1576 } 1574 }
1577 p->popup = popup;
1578 evas_object_size_hint_fill_set(tb, 0.5, 0.5); 1575 evas_object_size_hint_fill_set(tb, 0.5, 0.5);
1579 if (wireless_auth_popup) 1576 if (wireless_auth_popup)
1580 wireless_auth_pending = eina_list_append(wireless_auth_pending, p); 1577 wireless_auth_pending = eina_list_append(wireless_auth_pending, p);
@@ -1590,7 +1587,6 @@ void
1590wireless_authenticate_cancel(void) 1587wireless_authenticate_cancel(void)
1591{ 1588{
1592 if (!wireless_auth_popup) return; 1589 if (!wireless_auth_popup) return;
1593 evas_object_hide(wireless_auth_popup->popup);
1594 evas_object_del(wireless_auth_popup->popup); 1590 evas_object_del(wireless_auth_popup->popup);
1595} 1591}
1596 1592
@@ -1629,7 +1625,6 @@ wireless_authenticate_external(Wireless_Network *wn, const char *url)
1629 1625
1630 if (wireless_popup.popup) 1626 if (wireless_popup.popup)
1631 { 1627 {
1632 evas_object_hide(wireless_popup.popup);
1633 evas_object_del(wireless_popup.popup); 1628 evas_object_del(wireless_popup.popup);
1634 } 1629 }
1635 if (wn->type == WIRELESS_SERVICE_TYPE_ETHERNET) 1630 if (wn->type == WIRELESS_SERVICE_TYPE_ETHERNET)
@@ -1641,7 +1636,7 @@ wireless_authenticate_external(Wireless_Network *wn, const char *url)
1641 ctx = elm_win_add(inst->win, "win", ELM_WIN_POPUP_MENU); 1636 ctx = elm_win_add(inst->win, "win", ELM_WIN_POPUP_MENU);
1642 1637
1643 tb = elm_table_add(ctx); 1638 tb = elm_table_add(ctx);
1644 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1639 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0);
1645 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 1640 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1646 elm_win_resize_object_add(ctx, tb); 1641 elm_win_resize_object_add(ctx, tb);
1647 evas_object_show(tb); 1642 evas_object_show(tb);
@@ -1654,7 +1649,7 @@ wireless_authenticate_external(Wireless_Network *wn, const char *url)
1654 1649
1655 bt = elm_button_add(ctx); 1650 bt = elm_button_add(ctx);
1656 evas_object_show(bt); 1651 evas_object_show(bt);
1657 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1652 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
1658 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 1653 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1659 elm_object_text_set(bt, _("Deny")); 1654 elm_object_text_set(bt, _("Deny"));
1660 evas_object_smart_callback_add(bt, "clicked", _wireless_auth_external_deny, url); 1655 evas_object_smart_callback_add(bt, "clicked", _wireless_auth_external_deny, url);
@@ -1662,7 +1657,7 @@ wireless_authenticate_external(Wireless_Network *wn, const char *url)
1662 1657
1663 bt = elm_button_add(ctx); 1658 bt = elm_button_add(ctx);
1664 evas_object_show(bt); 1659 evas_object_show(bt);
1665 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1660 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
1666 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 1661 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1667 elm_object_text_set(bt, _("Allow")); 1662 elm_object_text_set(bt, _("Allow"));
1668 evas_object_smart_callback_add(bt, "clicked", _wireless_auth_external_allow, url); 1663 evas_object_smart_callback_add(bt, "clicked", _wireless_auth_external_allow, url);