summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-03-17 19:59:06 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-05 12:56:26 +0200
commit72b62461d5002c3473e31fd689ce1a27b627c6dd (patch)
tree362aba20d9252ee8f92bb67e19c5354228f6cd5b
parente1cd36cb953976a3f0546c7b81efaa2f68366b46 (diff)
elmementary_config: Ported config window to the settingspanel widget
-rw-r--r--src/bin/config.c270
1 files changed, 69 insertions, 201 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index 6733be68a..246c189e4 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -984,97 +984,6 @@ _status_config(Evas_Object *win,
984 evas_object_show(bx); 984 evas_object_show(bx);
985} 985}
986 986
987static void
988_flip_to(Evas_Object *win,
989 const char *name)
990{
991 Evas_Object *wid, *naviframe;
992 wid = evas_object_data_get(win, name);
993 naviframe = evas_object_data_get(win, "naviframe");
994 if (!naviframe) return;
995 elm_naviframe_item_simple_promote(naviframe, wid);
996}
997
998static void
999_cf_sizing(void *data,
1000 Evas_Object *obj EINA_UNUSED,
1001 void *event_info EINA_UNUSED)
1002{
1003 _flip_to(data, "sizing");
1004}
1005
1006static void
1007_cf_themes(void *data,
1008 Evas_Object *obj EINA_UNUSED,
1009 void *event_info EINA_UNUSED)
1010{
1011 _flip_to(data, "themes");
1012}
1013
1014static void
1015_cf_fonts(void *data,
1016 Evas_Object *obj EINA_UNUSED,
1017 void *event_info EINA_UNUSED)
1018{
1019 _flip_to(data, "fonts");
1020}
1021
1022static void
1023_cf_profiles(void *data,
1024 Evas_Object *obj EINA_UNUSED,
1025 void *event_info EINA_UNUSED)
1026{
1027 _flip_to(data, "profiles");
1028}
1029
1030static void
1031_cf_scrolling(void *data,
1032 Evas_Object *obj EINA_UNUSED,
1033 void *event_info EINA_UNUSED)
1034{
1035 _flip_to(data, "scrolling");
1036}
1037
1038static void
1039_cf_rendering(void *data,
1040 Evas_Object *obj EINA_UNUSED,
1041 void *event_info EINA_UNUSED)
1042{
1043 _flip_to(data, "rendering");
1044}
1045
1046static void
1047_cf_caches(void *data,
1048 Evas_Object *obj EINA_UNUSED,
1049 void *event_info EINA_UNUSED)
1050{
1051 _flip_to(data, "caches");
1052}
1053
1054static void
1055_cf_audio(void *data,
1056 Evas_Object *obj EINA_UNUSED,
1057 void *event_info EINA_UNUSED)
1058{
1059 _flip_to(data,"audio");
1060}
1061
1062static void
1063_cf_focus(void *data,
1064 Evas_Object *obj EINA_UNUSED,
1065 void *event_info EINA_UNUSED)
1066{
1067 _flip_to(data, "focus");
1068}
1069
1070static void
1071_cf_etc(void *data,
1072 Evas_Object *obj EINA_UNUSED,
1073 void *event_info EINA_UNUSED)
1074{
1075 _flip_to(data,"etc");
1076}
1077
1078const char * 987const char *
1079_elm_theme_current_get(const char *theme_search_order) 988_elm_theme_current_get(const char *theme_search_order)
1080{ 989{
@@ -1513,9 +1422,8 @@ _theme_sel(void *data EINA_UNUSED,
1513 printf("not implemented\n"); 1422 printf("not implemented\n");
1514 }*/ 1423 }*/
1515 1424
1516static void 1425static Evas_Object*
1517_status_config_sizing(Evas_Object *win, 1426_status_config_sizing(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
1518 Evas_Object *naviframe)
1519{ 1427{
1520 Evas_Object *lb, *pd, *bx, *sl, *sp; 1428 Evas_Object *lb, *pd, *bx, *sl, *sp;
1521 1429
@@ -1564,9 +1472,7 @@ _status_config_sizing(Evas_Object *win,
1564 evas_object_smart_callback_add(sl, "changed", fs_round, NULL); 1472 evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
1565 evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL); 1473 evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
1566 1474
1567 evas_object_data_set(win, "sizing", bx); 1475 return bx;
1568
1569 elm_naviframe_item_simple_push(naviframe, bx);
1570} 1476}
1571 1477
1572#define MUTE_CB(_cb, _chan) \ 1478#define MUTE_CB(_cb, _chan) \
@@ -1591,9 +1497,8 @@ MUTE_CB(mute_input_change, EDJE_CHANNEL_INPUT)
1591MUTE_CB(mute_alert_change, EDJE_CHANNEL_ALERT) 1497MUTE_CB(mute_alert_change, EDJE_CHANNEL_ALERT)
1592MUTE_CB(mute_all_change, EDJE_CHANNEL_ALL) 1498MUTE_CB(mute_all_change, EDJE_CHANNEL_ALL)
1593 1499
1594static void 1500static Evas_Object*
1595_status_config_audio(Evas_Object *win, 1501_status_config_audio(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
1596 Evas_Object *naviframe)
1597{ 1502{
1598 Evas_Object *bx, *ck; 1503 Evas_Object *bx, *ck;
1599 1504
@@ -1614,9 +1519,7 @@ _status_config_audio(Evas_Object *win,
1614 MUTE_CHECK("Mute Alert", EDJE_CHANNEL_ALERT, mute_alert_change); 1519 MUTE_CHECK("Mute Alert", EDJE_CHANNEL_ALERT, mute_alert_change);
1615 MUTE_CHECK("Mute Everything", EDJE_CHANNEL_ALL, mute_all_change); 1520 MUTE_CHECK("Mute Everything", EDJE_CHANNEL_ALL, mute_all_change);
1616 1521
1617 evas_object_data_set(win, "audio", bx); 1522 return bx;
1618
1619 elm_naviframe_item_simple_push(naviframe, bx);
1620} 1523}
1621 1524
1622static void 1525static void
@@ -1700,9 +1603,8 @@ _config_focus_auto_animate_cb(void *data EINA_UNUSED, Evas_Object *obj,
1700 elm_config_all_flush(); 1603 elm_config_all_flush();
1701} 1604}
1702 1605
1703static void 1606static Evas_Object*
1704_status_config_focus(Evas_Object *win, 1607_status_config_focus(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
1705 Evas_Object *naviframe)
1706{ 1608{
1707 Evas_Object *bx, *ck, *fr; 1609 Evas_Object *bx, *ck, *fr;
1708 1610
@@ -1801,14 +1703,11 @@ _status_config_focus(Evas_Object *win,
1801 elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get()); 1703 elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get());
1802 } 1704 }
1803 1705
1804 evas_object_data_set(win, "focus", bx); 1706 return bx;
1805
1806 elm_naviframe_item_simple_push(naviframe, bx);
1807} 1707}
1808 1708
1809static void 1709static Evas_Object*
1810_status_config_etc(Evas_Object *win, 1710_status_config_etc(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
1811 Evas_Object *naviframe)
1812{ 1711{
1813 Evas_Object *bx, *ck, *sl, *fr, *bx2; 1712 Evas_Object *bx, *ck, *sl, *fr, *bx2;
1814 1713
@@ -1858,9 +1757,7 @@ _status_config_etc(Evas_Object *win,
1858 evas_object_smart_callback_add(sl, "changed", sc_round, NULL); 1757 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
1859 evas_object_smart_callback_add(sl, "delay,changed", transition_duration_change, NULL); 1758 evas_object_smart_callback_add(sl, "delay,changed", transition_duration_change, NULL);
1860 1759
1861 evas_object_data_set(win, "etc", bx); 1760 return bx;
1862
1863 elm_naviframe_item_simple_push(naviframe, bx);
1864} 1761}
1865 1762
1866static Evas_Object * 1763static Evas_Object *
@@ -1949,9 +1846,8 @@ _sample_theme_new(Evas_Object *win)
1949 return base; 1846 return base;
1950} 1847}
1951 1848
1952static void 1849static Evas_Object*
1953_status_config_themes(Evas_Object *win, 1850_status_config_themes(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
1954 Evas_Object *naviframe)
1955{ 1851{
1956 Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample; 1852 Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample;
1957 Eina_List *list, *l; 1853 Eina_List *list, *l;
@@ -2125,8 +2021,7 @@ _status_config_themes(Evas_Object *win,
2125 elm_object_content_set(pd, bt); 2021 elm_object_content_set(pd, bt);
2126 evas_object_show(bt); 2022 evas_object_show(bt);
2127 2023
2128 evas_object_data_set(win, "themes", tb); 2024 return tb;
2129 elm_naviframe_item_simple_push(naviframe, tb);
2130} 2025}
2131 2026
2132static void 2027static void
@@ -2587,9 +2482,8 @@ _font_names_list_load(Evas_Object *flist)
2587 evas_event_thaw(evas); 2482 evas_event_thaw(evas);
2588} 2483}
2589 2484
2590static void 2485static Evas_Object*
2591_status_config_fonts(Evas_Object *win, 2486_status_config_fonts(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
2592 Evas_Object *naviframe)
2593{ 2487{
2594 Evas_Object *base, *fr, *li, *rc, *preview, *sp, *pd, *bt, *bx; 2488 Evas_Object *base, *fr, *li, *rc, *preview, *sp, *pd, *bt, *bx;
2595 char buf[PATH_MAX]; 2489 char buf[PATH_MAX];
@@ -2756,9 +2650,7 @@ _status_config_fonts(Evas_Object *win,
2756 2650
2757 elm_object_content_set(pd, bx); 2651 elm_object_content_set(pd, bx);
2758 2652
2759 evas_object_data_set(win, "fonts", base); 2653 return base;
2760
2761 elm_naviframe_item_simple_push(naviframe, base);
2762} 2654}
2763 2655
2764static void 2656static void
@@ -2934,9 +2826,8 @@ _profiles_list_unselect_cb(void *data EINA_UNUSED,
2934 EINA_TRUE); 2826 EINA_TRUE);
2935} 2827}
2936 2828
2937static void 2829static Evas_Object*
2938_status_config_profiles(Evas_Object *win, 2830_status_config_profiles(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
2939 Evas_Object *naviframe)
2940{ 2831{
2941 Evas_Object *li, *bx, *fr_bx1, *fr_bx2, *btn_bx, *fr, *lb, *en, *sp, *pd, 2832 Evas_Object *li, *bx, *fr_bx1, *fr_bx2, *btn_bx, *fr, *lb, *en, *sp, *pd,
2942 *bt; 2833 *bt;
@@ -3072,8 +2963,7 @@ _status_config_profiles(Evas_Object *win,
3072 edje_thaw(); 2963 edje_thaw();
3073 evas_event_thaw(evas); 2964 evas_event_thaw(evas);
3074 2965
3075 evas_object_data_set(win, "profiles", bx); 2966 return bx;
3076 elm_naviframe_item_simple_push(naviframe, bx);
3077} 2967}
3078 2968
3079static void 2969static void
@@ -3427,9 +3317,8 @@ _status_config_scrolling_acceleration(Evas_Object *win, Evas_Object *box)
3427 evas_object_smart_callback_add(sl, "delay,changed", tsaw_change, NULL); 3317 evas_object_smart_callback_add(sl, "delay,changed", tsaw_change, NULL);
3428} 3318}
3429 3319
3430static void 3320static Evas_Object*
3431_status_config_scrolling(Evas_Object *win, 3321_status_config_scrolling(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
3432 Evas_Object *naviframe)
3433{ 3322{
3434 Evas_Object *lb, *pd, *bx, *sl, *sc, *ck; 3323 Evas_Object *lb, *pd, *bx, *sl, *sc, *ck;
3435 3324
@@ -3567,7 +3456,7 @@ _status_config_scrolling(Evas_Object *win,
3567 3456
3568 evas_object_data_set(win, "scrolling", sc); 3457 evas_object_data_set(win, "scrolling", sc);
3569 3458
3570 elm_naviframe_item_simple_push(naviframe, sc); 3459 return sc;
3571} 3460}
3572 3461
3573static void 3462static void
@@ -3612,9 +3501,8 @@ _cb_vsync(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
3612 } 3501 }
3613} 3502}
3614 3503
3615static void 3504static Evas_Object*
3616_status_config_rendering(Evas_Object *win, 3505_status_config_rendering(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
3617 Evas_Object *naviframe)
3618{ 3506{
3619 Evas_Object *li, *bx, *ck, *sp; 3507 Evas_Object *li, *bx, *ck, *sp;
3620 Elm_Object_Item *it; 3508 Elm_Object_Item *it;
@@ -3680,13 +3568,11 @@ _status_config_rendering(Evas_Object *win,
3680 _cb_vsync, NULL); 3568 _cb_vsync, NULL);
3681 elm_check_state_set(ck, elm_config_vsync_get()); 3569 elm_check_state_set(ck, elm_config_vsync_get());
3682 3570
3683 evas_object_data_set(win, "rendering", bx); 3571 return bx;
3684 elm_naviframe_item_simple_push(naviframe, bx);
3685} 3572}
3686 3573
3687static void 3574static Evas_Object*
3688_status_config_caches(Evas_Object *win, 3575_status_config_caches(Evas_Object *win, Eo *item EINA_UNUSED, void *data EINA_UNUSED)
3689 Evas_Object *naviframe)
3690{ 3576{
3691 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck; 3577 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck;
3692 3578
@@ -3812,72 +3698,54 @@ _status_config_caches(Evas_Object *win,
3812 evas_object_smart_callback_add(sl, "changed", ecc_round, NULL); 3698 evas_object_smart_callback_add(sl, "changed", ecc_round, NULL);
3813 evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL); 3699 evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL);
3814 3700
3815 evas_object_data_set(win, "caches", bx); 3701 return bx;
3816
3817 elm_naviframe_item_simple_push(naviframe, bx);
3818} 3702}
3819 3703
3820static void 3704static void
3821_status_config_full(Evas_Object *win, 3705_status_config_full(Evas_Object *win,
3822 Evas_Object *bx0) 3706 Evas_Object *bx0)
3823{ 3707{
3824 Evas_Object *tb, *naviframe; 3708 Evas_Object *settings;
3825 Elm_Object_Item *tb_sizing, *tb_it; 3709 Elm_Settingspane_Item *it;
3826 3710
3827 tb = elm_toolbar_add(win); 3711 settings = elm_settingspane_add(win);
3828 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS); 3712 evas_object_size_hint_weight_set(settings, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3829 elm_toolbar_menu_parent_set(tb, win); 3713 evas_object_size_hint_align_set(settings, EVAS_HINT_FILL, EVAS_HINT_FILL);
3830 elm_toolbar_homogeneous_set(tb, EINA_FALSE); 3714
3831 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0); 3715 it = elm_settingspane_item_append(settings, NULL, "Sizing", "Set the scale of elementary widgets", NULL, "zoom-fit-best", NULL);
3832 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); 3716 elm_settingspane_item_attach_panel(it, _status_config_sizing, NULL, NULL);
3717 elm_settingspane_item_keywords_set(it, "size, scale");
3718
3719 it = elm_settingspane_item_append(settings, NULL, "Theme", "Choose from your installed themes", NULL, "preferences-desktop-theme", NULL);
3720 elm_settingspane_item_attach_panel(it, _status_config_themes, NULL, NULL);
3721
3722 it = elm_settingspane_item_append(settings, NULL, "Fonts", "Fonts to use for elm widgets", NULL, "preferences-desktop-font", NULL);
3723 elm_settingspane_item_attach_panel(it, _status_config_fonts, NULL, NULL);
3724
3725 it = elm_settingspane_item_append(settings, NULL, "Profiles", "The config profile to use", NULL, "system-users", NULL);
3726 elm_settingspane_item_attach_panel(it, _status_config_profiles, NULL, NULL);
3727
3728 it = elm_settingspane_item_append(settings, NULL, "Scrolling", "Scrollings", NULL, "system-run", NULL);
3729 elm_settingspane_item_attach_panel(it, _status_config_scrolling, NULL, NULL);
3730
3731 it = elm_settingspane_item_append(settings, NULL, "Rendering", "The engine to use to render", NULL, "video-display", NULL);
3732 elm_settingspane_item_attach_panel(it, _status_config_rendering, NULL, NULL);
3733 elm_settingspane_item_keywords_set(it, "3D, gl, vsync");
3734
3735 it = elm_settingspane_item_append(settings, NULL, "Caches", "Sizes and flushing of the caches", NULL, "appointment-new", NULL);
3736 elm_settingspane_item_attach_panel(it, _status_config_caches, NULL, NULL);
3737
3738 it = elm_settingspane_item_append(settings, NULL, "Audio", "Configure which sounds should be played", NULL, "sound", NULL);
3739 elm_settingspane_item_attach_panel(it, _status_config_audio, NULL, NULL);
3740 elm_settingspane_item_keywords_set(it, "sound, volume");
3741
3742 it = elm_settingspane_item_append(settings, NULL, "Focus", "Settings for the widget focus", NULL, NULL, NULL);
3743 elm_settingspane_item_attach_panel(it, _status_config_focus, NULL, NULL);
3833 3744
3834 tb_sizing = elm_toolbar_item_append(tb, "zoom-fit-best", "Sizing", 3745 it = elm_settingspane_item_append(settings, NULL, "Etc", "Miscellaneous", NULL, NULL, NULL);
3835 _cf_sizing, win); 3746 elm_settingspane_item_attach_panel(it, _status_config_etc, NULL, NULL);
3836 elm_toolbar_item_priority_set(tb_sizing, 100); 3747 elm_box_pack_end(bx0, settings);
3837 3748 evas_object_show(settings);
3838 tb_it = elm_toolbar_item_append(tb, "preferences-desktop-theme", "Theme",
3839 _cf_themes, win);
3840 elm_toolbar_item_priority_set(tb_it, 90);
3841
3842 elm_toolbar_item_append(tb, "preferences-desktop-font", "Fonts",
3843 _cf_fonts, win);
3844
3845 tb_it = elm_toolbar_item_append(tb, "system-users", "Profiles",
3846 _cf_profiles, win);
3847 elm_toolbar_item_priority_set(tb_it, 90);
3848
3849 elm_toolbar_item_append(tb, "system-run", "Scrolling", _cf_scrolling, win);
3850 elm_toolbar_item_append(tb, "video-display", "Rendering",
3851 _cf_rendering, win);
3852 elm_toolbar_item_append(tb, "appointment-new", "Caches", _cf_caches, win);
3853 elm_toolbar_item_append(tb, "sound", "Audio", _cf_audio, win);
3854 elm_toolbar_item_append(tb, NULL, "Focus", _cf_focus, win);
3855 elm_toolbar_item_append(tb, NULL, "Etc", _cf_etc, win);
3856
3857 elm_box_pack_end(bx0, tb);
3858 evas_object_show(tb);
3859
3860 naviframe = elm_naviframe_add(win);
3861 evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
3862 evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3863 evas_object_data_set(win, "naviframe", naviframe);
3864
3865 _status_config_themes(win, naviframe);
3866 _status_config_fonts(win, naviframe);
3867 _status_config_profiles(win, naviframe);
3868 _status_config_rendering(win, naviframe);
3869 _status_config_scrolling(win, naviframe);
3870 _status_config_caches(win, naviframe);
3871 _status_config_audio(win, naviframe);
3872 _status_config_focus(win, naviframe);
3873 _status_config_etc(win, naviframe);
3874 _status_config_sizing(win, naviframe); // Note: call this at the end.
3875
3876 // FIXME uncomment after flip style fix, please
3877 //elm_object_style_set(naviframe, "flip");
3878 elm_toolbar_item_selected_set(tb_sizing, EINA_TRUE);
3879 elm_box_pack_end(bx0, naviframe);
3880 evas_object_show(naviframe);
3881} 3749}
3882 3750
3883static void 3751static void