win: Remove menu from EDC group (fixes compatibility)

This fixes compatibility with legacy themes (ie. every single
theme in existence beyond the default one, for now), by checking
where to swallow the menu widget. If a legacy theme is used,
the legacy swallow should be used, and it will all look correct.

Moving forward I hope to get rid of the internal edje object
entirely, except for compatibility reasons.
This commit is contained in:
Jean-Philippe Andre 2016-11-22 17:09:48 +09:00
parent fc4c07e735
commit 8c505e3191
2 changed files with 10 additions and 48 deletions

View File

@ -1,66 +1,28 @@
group { name: "elm/win/base/default";
parts {
part { name: "menu_bg"; type: RECT;
description { state: "default" 0.0;
color: 64 64 64 255;
align: 0.5 0;
rel2.to: "elm.swallow.menu";
}
}
part { name: "elm.swallow.menu"; type: SWALLOW;
description { state: "default" 0.0;
rel2.relative: 1.0 0.0;
visible: 0;
align: 0.5 0;
fixed: 1 1;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
fixed: 0 1;
}
}
part { name: "client_clip"; type: RECT; mouse_events: 0;
description { state: "default" 0.0;
rect { "client_clip"; nomouse;
desc { "default";
rel1.to_y: "elm.swallow.contents";
rel2.to_y: "elm.swallow.contents";
}
}
part { name: "elm.swallow.contents"; type: SWALLOW;
swallow { "elm.swallow.contents";
clip_to: "client_clip";
description { state: "default" 0.0;
rel1 {
to_y: "elm.swallow.menu";
relative: 0.0 1.0;
}
}
}
part { name: "blocker"; type: RECT;
description { state: "default" 0.0;
rect { "blocker";
desc { "default";
rel1.relative : 0.0 0.0;
rel2.relative : 1.0 1.0;
color: 64 64 64 150;
visible: 0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
desc { "visible";
inherit: "default";
visible: 1;
}
}
}
programs {
program { name: "show_menu";
signal: "elm,action,show_menu";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.menu";
}
program { name: "hide_menu";
signal: "elm,action,hide";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.menu";
}
program { name: "hide_blocker";
signal: "elm,action,hide_blocker";
source: "elm";

View File

@ -5320,10 +5320,10 @@ _efl_ui_win_fullscreen_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
static inline Eo *
_main_menu_swallow_get(Efl_Ui_Win_Data *sd)
{
if (sd->frame_obj)
if (edje_object_part_exists(sd->legacy.edje, "elm.swallow.menu"))
{
if (edje_object_part_exists(sd->frame_obj, "elm.swallow.menu"))
return sd->frame_obj;
DBG("Detected legacy theme, using legacy swallows.");
return sd->legacy.edje;
}
return sd->legacy.edje;
}