From 11432d42a717280f2f25cfd52942b0df59b0e35f Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 12 Jan 2017 18:02:18 +0900 Subject: [PATCH] elm theme/test - add start of nviframe window style and test it --- data/elementary/themes/edc/elm/border.edc | 93 +++++++++++++++++++++++++++++++ src/bin/elementary/test_win_stack.c | 14 +++-- src/lib/elementary/efl_ui_win.c | 12 +++- src/lib/elementary/efl_ui_win.eo | 6 +- src/lib/elementary/elm_win_legacy.h | 37 ++++++------ 5 files changed, 137 insertions(+), 25 deletions(-) diff --git a/data/elementary/themes/edc/elm/border.edc b/data/elementary/themes/edc/elm/border.edc index 18cc44b..1c0d2d8 100644 --- a/data/elementary/themes/edc/elm/border.edc +++ b/data/elementary/themes/edc/elm/border.edc @@ -994,6 +994,99 @@ group { name: "elm/border/base/default"; } } +group { name: "elm/border/base/dialog"; + inherit: "elm/border/base/default"; + parts { + text { "elm.text.title"; + clip: "top_clip"; + desc { "default"; + rel2.to_x: "elm.event.close"; + } + desc { "focused"; + inherit: "default"; + visible: 0; + } + } + text { "title2"; + desc { "default"; + rel2.to_x: "elm.event.close"; + } + desc { "focused"; + inherit: "default"; + visible: 1; + } + } + image { "max1"; + desc { "default"; + visible: 0; + } + desc { "selected"; + visible: 0; + } + } + image { "min1"; + desc { "default"; + visible: 0; + } + desc { "selected"; + visible: 0; + } + } + image { "max2"; + desc { "default"; + visible: 0; + } + desc { "selected"; + visible: 0; + } + } + image { "min2"; + desc { "default"; + visible: 0; + } + desc { "selected"; + visible: 0; + } + } + rect { "elm.event.maximize"; + desc { "default"; + visible: 0; + } + } + rect { "elm.event.minimize"; + desc { "default"; + visible: 0; + } + } + } +} + +group { name: "elm/border/base/naviframe"; + images.image: "sym_left_dark_normal.png" COMP; + images.image: "sym_left_glow_normal.png" COMP; + images.image: "sym_left_light_normal.png" COMP; + inherit: "elm/border/base/dialog"; + parts { + image { "close1"; + desc { "default"; + image.normal: "sym_left_dark_normal.png"; + } + desc { "selected"; + image.normal: "sym_left_glow_normal.png"; + } + } + image { "close2"; nomouse; + clip: "clip2"; + desc { "default"; + image.normal: "sym_left_light_normal.png"; + } + desc { "selected"; + image.normal: "sym_left_glow_normal.png"; + } + } + } +} + #undef UNRESIZABLE #undef BORDERLESS #undef MAXIMIZED diff --git a/src/bin/elementary/test_win_stack.c b/src/bin/elementary/test_win_stack.c index c228a89..128a805 100644 --- a/src/bin/elementary/test_win_stack.c +++ b/src/bin/elementary/test_win_stack.c @@ -15,11 +15,17 @@ _win_new(Evas_Object *stack_top, const char *title) Evas_Object *bg, *bx, *bt, *lb, *win; if (level >= 3) - win = elm_win_add(NULL, "window-stack", ELM_WIN_DIALOG_BASIC); + win = efl_add(EFL_UI_WIN_CLASS, NULL, + efl_ui_win_name_set(efl_added, "window-stack"), + efl_ui_win_type_set(efl_added, ELM_WIN_NAVIFRAME_BASIC), + efl_text_set(efl_added, title), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); else - win = elm_win_add(NULL, "window-stack", ELM_WIN_BASIC); - elm_win_title_set(win, title); - elm_win_autodel_set(win, EINA_TRUE); + win = efl_add(EFL_UI_WIN_CLASS, NULL, + efl_ui_win_name_set(efl_added, "window-stack"), + efl_ui_win_type_set(efl_added, ELM_WIN_DIALOG_BASIC), + efl_text_set(efl_added, title), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); if (level == 3) popto_win = win; diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 0c14e7b..38a58e1 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -4165,7 +4165,7 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *style) if (v < FRAME_OBJ_THEME_MIN_VERSION) { // Theme compatibility - const char *key = "elm/border/base/default"; // FIXME? + const char *key = "elm/border/base/default"; // FIXME? char *sys_theme; WRN("Selected theme does not support the required border theme API " @@ -5103,6 +5103,8 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W /* do not append to list; all windows render as black rects */ if (type != ELM_WIN_FAKE) { + const char *style = "default"; + _elm_win_list = eina_list_append(_elm_win_list, obj); _elm_win_count++; @@ -5111,7 +5113,13 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W { TRAP(sd, fullscreen_set, 1); } - _elm_win_frame_add(sd, "default"); + switch (type) + { + case EFL_UI_WIN_DIALOG_BASIC: style = "dialog"; break; + case EFL_UI_WIN_NAVIFRAME_BASIC: style = "naviframe"; break; + default: break; + } + _elm_win_frame_add(sd, style); if (_elm_config->focus_highlight_enable) elm_win_focus_highlight_enabled_set(obj, EINA_TRUE); diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 3787ace..20f835d 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -53,11 +53,15 @@ enum Efl.Ui.Win.Type contents will be rendered to an image buffer and can be shown other process's plug image object. ]] - fake [[This window was created using a pre-existing canvas. The window + fake, [[This window was created using a pre-existing canvas. The window widget can be deleted, but the canvas must be managed externally. @since 1.13 ]] + naviframe_basic [[Used for naviframe style replacement with a back + button instead of a close button. + @since 1.19 + ]] } enum Efl.Ui.Win.Keyboard_Mode diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index c98e667..a4c45ab 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -52,24 +52,25 @@ typedef enum typedef Efl_Ui_Win_Type Elm_Win_Type; -#define ELM_WIN_UNKNOWN EFL_UI_WIN_UNKNOWN -#define ELM_WIN_BASIC EFL_UI_WIN_BASIC -#define ELM_WIN_DIALOG_BASIC EFL_UI_WIN_DIALOG_BASIC -#define ELM_WIN_DESKTOP EFL_UI_WIN_DESKTOP -#define ELM_WIN_DOCK EFL_UI_WIN_DOCK -#define ELM_WIN_TOOLBAR EFL_UI_WIN_TOOLBAR -#define ELM_WIN_MENU EFL_UI_WIN_MENU -#define ELM_WIN_UTILITY EFL_UI_WIN_UTILITY -#define ELM_WIN_SPLASH EFL_UI_WIN_SPLASH -#define ELM_WIN_DROPDOWN_MENU EFL_UI_WIN_DROPDOWN_MENU -#define ELM_WIN_POPUP_MENU EFL_UI_WIN_POPUP_MENU -#define ELM_WIN_TOOLTIP EFL_UI_WIN_TOOLTIP -#define ELM_WIN_NOTIFICATION EFL_UI_WIN_NOTIFICATION -#define ELM_WIN_COMBO EFL_UI_WIN_COMBO -#define ELM_WIN_DND EFL_UI_WIN_DND -#define ELM_WIN_INLINED_IMAGE EFL_UI_WIN_INLINED_IMAGE -#define ELM_WIN_SOCKET_IMAGE EFL_UI_WIN_SOCKET_IMAGE -#define ELM_WIN_FAKE EFL_UI_WIN_FAKE +#define ELM_WIN_UNKNOWN EFL_UI_WIN_UNKNOWN +#define ELM_WIN_BASIC EFL_UI_WIN_BASIC +#define ELM_WIN_DIALOG_BASIC EFL_UI_WIN_DIALOG_BASIC +#define ELM_WIN_DESKTOP EFL_UI_WIN_DESKTOP +#define ELM_WIN_DOCK EFL_UI_WIN_DOCK +#define ELM_WIN_TOOLBAR EFL_UI_WIN_TOOLBAR +#define ELM_WIN_MENU EFL_UI_WIN_MENU +#define ELM_WIN_UTILITY EFL_UI_WIN_UTILITY +#define ELM_WIN_SPLASH EFL_UI_WIN_SPLASH +#define ELM_WIN_DROPDOWN_MENU EFL_UI_WIN_DROPDOWN_MENU +#define ELM_WIN_POPUP_MENU EFL_UI_WIN_POPUP_MENU +#define ELM_WIN_TOOLTIP EFL_UI_WIN_TOOLTIP +#define ELM_WIN_NOTIFICATION EFL_UI_WIN_NOTIFICATION +#define ELM_WIN_COMBO EFL_UI_WIN_COMBO +#define ELM_WIN_DND EFL_UI_WIN_DND +#define ELM_WIN_INLINED_IMAGE EFL_UI_WIN_INLINED_IMAGE +#define ELM_WIN_SOCKET_IMAGE EFL_UI_WIN_SOCKET_IMAGE +#define ELM_WIN_FAKE EFL_UI_WIN_FAKE +#define ELM_WIN_NAVIFRAME_BASIC EFL_UI_WIN_NAVIFRAME_BASIC typedef Efl_Ui_Win_Keyboard_Mode Elm_Win_Keyboard_Mode; -- 2.7.4