diff --git a/TODO b/TODO index 1de040ab..c37e2d97 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,6 @@ make it a first-class terminal: [ ] splits need to size only by steps in font size (elm feature) [ ] split handles need to become invisible (elm theme) -[ ] new term/split/close buttons need proper icons [ ] better info in tyls -m [ ] tyls -b needs doing [ ] blink and blink2 attributes need to be supported diff --git a/data/themes/default.edc b/data/themes/default.edc index f6e8c278..2f84b8f4 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -2262,6 +2262,7 @@ target: "4.bottom" image: "pm_overlay.png" COMP; image: "pm_fill.png" COMP; image: "bg_shadow.png" COMP; + image: "inset_shadow.png" COMP; } parts { part { name: "shadow"; @@ -2318,17 +2319,32 @@ target: "4.bottom" color: 255 255 255 255; } } + part { name: "overlay_shadow"; mouse_events: 0; + description { state: "default" 0.0; + image.normal: "inset_shadow.png"; + image.border: 5 5 7 3; + image.middle: 0; + fill.smooth: 0; + color: 255 255 255 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } program { signal: "begin"; source: "terminology"; action: STATE_SET "visible" 0.0; transition: DECELERATE 0.3; target: "overlay"; + target: "overlay_shadow"; } program { signal: "end"; source: "terminology"; action: STATE_SET "default" 0.0; transition: DECELERATE 0.3 CURRENT; target: "overlay"; + target: "overlay_shadow"; } } } @@ -2979,6 +2995,22 @@ target: "4.bottom" } } +#define ICON(Grp, Img) \ + group { name: "elm/icon/"##Grp##"/default"; min: 10 10; max: 80 80; \ + images.image: Img COMP; \ + parts { part { name: "base"; description { state: "default" 0.0; \ + aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: Img; \ + } } } } + ICON("new", "icon_new.png"); + ICON("split-h", "icon_split_h.png"); + ICON("split-v", "icon_split_v.png"); + ICON("close", "icon_close.png"); + ICON("copy", "icon_copy.png"); + ICON("paste", "icon_paste.png"); + ICON("settings", "icon_settings.png"); + ICON("about", "icon_about.png"); +#undef ICON + ////////////////////////////////////////////////////////////////////////////// //// the about box content image group { name: "terminology/about"; diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am index f4b9910f..c655a94f 100644 --- a/data/themes/images/Makefile.am +++ b/data/themes/images/Makefile.am @@ -16,6 +16,15 @@ cr_key.png \ cr_out.png \ cr_pulse.png \ fn_shadow.png \ +icon_about.png \ +icon_close.png \ +icon_copy.png \ +icon_new.png \ +icon_paste.png \ +icon_settings.png \ +icon_split_h.png \ +icon_split_v.png \ +inset_shadow.png \ media_bg.png \ media_line.png \ media_pause.png \ diff --git a/data/themes/images/icon_about.png b/data/themes/images/icon_about.png new file mode 100644 index 00000000..1c3423e3 Binary files /dev/null and b/data/themes/images/icon_about.png differ diff --git a/data/themes/images/icon_about.svg b/data/themes/images/icon_about.svg new file mode 100644 index 00000000..d456b028 --- /dev/null +++ b/data/themes/images/icon_about.svg @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + ? + ? + + + + + + diff --git a/data/themes/images/icon_close.png b/data/themes/images/icon_close.png new file mode 100644 index 00000000..440e306b Binary files /dev/null and b/data/themes/images/icon_close.png differ diff --git a/data/themes/images/icon_close.svg b/data/themes/images/icon_close.svg new file mode 100644 index 00000000..937a47ec --- /dev/null +++ b/data/themes/images/icon_close.svg @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/data/themes/images/icon_copy.png b/data/themes/images/icon_copy.png new file mode 100644 index 00000000..bf7ec28b Binary files /dev/null and b/data/themes/images/icon_copy.png differ diff --git a/data/themes/images/icon_copy.svg b/data/themes/images/icon_copy.svg new file mode 100644 index 00000000..5cb3f497 --- /dev/null +++ b/data/themes/images/icon_copy.svg @@ -0,0 +1,541 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/themes/images/icon_new.png b/data/themes/images/icon_new.png new file mode 100644 index 00000000..845f4006 Binary files /dev/null and b/data/themes/images/icon_new.png differ diff --git a/data/themes/images/icon_new.svg b/data/themes/images/icon_new.svg new file mode 100644 index 00000000..cc97d974 --- /dev/null +++ b/data/themes/images/icon_new.svg @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/data/themes/images/icon_paste.png b/data/themes/images/icon_paste.png new file mode 100644 index 00000000..d0a338bb Binary files /dev/null and b/data/themes/images/icon_paste.png differ diff --git a/data/themes/images/icon_paste.svg b/data/themes/images/icon_paste.svg new file mode 100644 index 00000000..6fa8b60f --- /dev/null +++ b/data/themes/images/icon_paste.svg @@ -0,0 +1,569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/themes/images/icon_settings.png b/data/themes/images/icon_settings.png new file mode 100644 index 00000000..0f1b2143 Binary files /dev/null and b/data/themes/images/icon_settings.png differ diff --git a/data/themes/images/icon_settings.svg b/data/themes/images/icon_settings.svg new file mode 100644 index 00000000..933097af --- /dev/null +++ b/data/themes/images/icon_settings.svg @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/data/themes/images/icon_split_h.png b/data/themes/images/icon_split_h.png new file mode 100644 index 00000000..6f96eb27 Binary files /dev/null and b/data/themes/images/icon_split_h.png differ diff --git a/data/themes/images/icon_split_h.svg b/data/themes/images/icon_split_h.svg new file mode 100644 index 00000000..745a221f --- /dev/null +++ b/data/themes/images/icon_split_h.svg @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/data/themes/images/icon_split_v.png b/data/themes/images/icon_split_v.png new file mode 100644 index 00000000..c72a8ea7 Binary files /dev/null and b/data/themes/images/icon_split_v.png differ diff --git a/data/themes/images/icon_split_v.svg b/data/themes/images/icon_split_v.svg new file mode 100644 index 00000000..b0087a74 --- /dev/null +++ b/data/themes/images/icon_split_v.svg @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/data/themes/images/inset_shadow.png b/data/themes/images/inset_shadow.png new file mode 100644 index 00000000..dad255c6 Binary files /dev/null and b/data/themes/images/inset_shadow.png differ diff --git a/src/bin/controls.c b/src/bin/controls.c index 567cd1da..0e4ff867 100644 --- a/src/bin/controls.c +++ b/src/bin/controls.c @@ -121,6 +121,30 @@ _cb_saved_del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUS } } +static Evas_Object * +_button_add(Evas_Object *win, const char *label, const char *icon, Evas_Smart_Cb cb, void *cbdata) +{ + Evas_Object *o, *bt, *ic; + + bt = o = elm_button_add(win); + evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + if (label) elm_object_text_set(o, label); + evas_object_smart_callback_add(o, "clicked", cb, cbdata); + + if (icon) + { + ic = o = elm_icon_add(win); + evas_object_size_hint_aspect_set(o, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_icon_standard_set(o, icon); + elm_object_part_content_set(bt, "icon", o); + evas_object_show(o); + } + + evas_object_show(bt); + return bt; +} + void controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) { @@ -150,41 +174,14 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) elm_box_pack_end(ct_boxh, o); evas_object_show(o); - // XXX: need real icon - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "*"); + o = _button_add(win, "New", "new", _cb_ct_new, term); elm_box_pack_end(ct_box2, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_new, NULL); - - // XXX: need real icon - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "|"); + o = _button_add(win, "Split V", "split-h", _cb_ct_split_v, term); elm_box_pack_end(ct_box2, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_split_v, NULL); - - // XXX: need real icon - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "-"); + o = _button_add(win, "Split H", "split-v", _cb_ct_split_h, term); elm_box_pack_end(ct_box2, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_split_h, NULL); - - // XXX: need real icon - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "X"); + o = _button_add(win, "Close", "close", _cb_ct_close, term); elm_box_pack_end(ct_box2, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_close, NULL); o = elm_separator_add(win); evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND); @@ -197,21 +194,10 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) elm_box_pack_end(ct_boxh, o); evas_object_show(o); - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "Copy"); + o = _button_add(win, "Copy", "copy", _cb_ct_copy, term); elm_box_pack_end(ct_box, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_copy, term); - - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "Paste"); + o = _button_add(win, "Paste", "paste", _cb_ct_paste, term); elm_box_pack_end(ct_box, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_paste, term); o = elm_separator_add(win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); @@ -220,13 +206,8 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) elm_box_pack_end(ct_box, o); evas_object_show(o); - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "Options"); + o = _button_add(win, "Settings", "settings", _cb_ct_options, term); elm_box_pack_end(ct_box, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_options, NULL); o = elm_separator_add(win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); @@ -235,14 +216,8 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) elm_box_pack_end(ct_box, o); evas_object_show(o); - o = elm_button_add(win); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_text_set(o, "About"); + o = _button_add(win, "About", "about", _cb_ct_about, term); elm_box_pack_end(ct_box, o); - evas_object_show(o); - evas_object_smart_callback_add(o, "clicked", _cb_ct_about, NULL); - } if (!ct_out) { diff --git a/src/bin/main.c b/src/bin/main.c index 441c46c1..6d1537b3 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -2328,16 +2328,22 @@ elm_main(int argc, char **argv) return EXIT_FAILURE; } - config_init(); - - main_config = config_load("config"); - config = config_fork(main_config); - elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); elm_app_info_set(elm_main, "terminology", "themes/default.edj"); + config_init(); + + main_config = config_load("config"); + +// elm_theme_extension_add(NULL, config_theme_path_get(main_config)); +// elm_theme_extension_add(NULL, config_theme_path_default_get(main_config)); + elm_theme_overlay_add(NULL, config_theme_path_get(main_config)); + elm_theme_overlay_add(NULL, config_theme_path_default_get(main_config)); + + config = config_fork(main_config); + args = ecore_getopt_parse(&options, values, argc, argv); if (args < 0) {