// import button theme
elm_theme_overlay_add(NULL, THEME_EDJ_PATH);
- m_conformant = createConformant(m_win);
- evas_object_show(m_conformant);
- m_platform_layout = createPlatformLayout(m_conformant);
+ m_platform_layout = createPlatformLayout(m_win);
evas_object_show(m_platform_layout);
m_navigation = createNavigationBar(m_platform_layout);
evas_object_show(m_navigation);
m_user_layout = createUserLayout(m_navigation);
evas_object_show(m_user_layout);
-
+ m_conformant = createConformant(m_user_layout);
+ evas_object_show(m_conformant);
}
void WindowData::setEvasObjectForLayout(Evas_Object* evas_object)
elm_object_content_unset(m_conformant);
}
-void WindowData::toggleIndicator(bool indicator)
+void WindowData::toggleIndicator(bool fullscreen)
{
- LogDebug(__PRETTY_FUNCTION__);
- if (indicator)
+ LogDebug("fullscreen=" << (fullscreen?"true":"false"));
+
+ if (!fullscreen) {
elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);
- else
+ elm_layout_theme_set(m_platform_layout,
+ LAYOUT,
+ APPLICATION,
+ INDICATOR);
+ } else {
elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_HIDE);
-
+ elm_layout_theme_set(m_platform_layout,
+ LAYOUT,
+ APPLICATION,
+ NOINDICATOR);
+ }
}
void WindowData::setViewMode(
- const char *title,
bool fullscreen,
- bool indicator,
bool backbutton,
CtxMenuItems ctxMenuItems)
{
LogDebug("setViewMode " <<m_debugMode);
- LogDebug("fullscreen: " << fullscreen << ", indicator: " << indicator);
+ LogDebug("fullscreen: " << fullscreen);
+ LogDebug("backbutton: " << backbutton);
- m_indicator = indicator;
m_fullscreen = fullscreen;
- toggleIndicator(indicator);
+ toggleIndicator(m_fullscreen);
if (backbutton) {
createFloatBackButton();
}
- m_title = title;
m_ctxMenuItems = ctxMenuItems;
if(m_debugMode) {
- if(fullscreen)
- showHiddenOption(m_user_layout);
- else
- createTitle(m_title.c_str(), m_ctxMenuItems);
-
+ showHiddenOption(m_user_layout);
createToolbar(m_ctxMenuItems);
}
- else
- if(!fullscreen)
- createTitle(m_title.c_str(), m_ctxMenuItems);
-}
-
-void WindowData::createTitle(const char *data, CtxMenuItems ctxMenuItems)
-{
- LogDebug("createTitle");
- showTitle(data);
- if(m_debugMode) {
- createMoreButton();
- createTitleToolbar(ctxMenuItems);
- }
-}
-
-void WindowData::showTitle(const char *data)
-{
- LogInfo("showTitle");
-
- Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation);
- elm_naviframe_item_title_visible_set(naviIt, EINA_TRUE);
- elm_object_item_text_set(naviIt, data);
-}
-
-void WindowData::hideTitle()
-{
- LogInfo("hideTitle");
-
- Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation);
- elm_object_item_signal_emit(naviIt, "elm,state,optionheader,instant_close", "");
- optionheaderClose = FALSE;
-
- elm_naviframe_item_title_visible_set(naviIt, EINA_FALSE);
-}
-
-void WindowData::createMoreButton()
-{
- Evas_Object *btn = elm_button_add(m_navigation);
- if (!btn)
- return;
- Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation);
- elm_object_style_set(btn, "naviframe/more/default");
- evas_object_smart_callback_add(btn, "clicked", moreButtonCallback, this);
- elm_object_item_part_content_set(naviIt, "title_more_btn", btn);
- evas_object_show(btn);
-
-}
-
-void WindowData::createTitleToolbar(CtxMenuItems ctxMenuItems)
-{
- Elm_Object_Item *toolbarIt;
- Evas_Object *toolbarButton;
- Elm_Object_Item *naviIt = elm_naviframe_top_item_get(m_navigation);
-
- Evas_Object *toolbar = elm_toolbar_add(m_navigation);
- if (!toolbar)
- return;
- elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
-
- elm_object_style_set(toolbar, "naviframe");
-
- toolbarButton = elm_button_add(m_navigation);
- if (!toolbarButton)
- return;
-
- std::list<CtxMenuItem>::iterator itor;
- for (itor = ctxMenuItems.begin(); itor != ctxMenuItems.end(); ++itor) {
- toolbarButton = elm_button_add(toolbar);
- elm_object_style_set(toolbarButton, "naviframe_contrl/default");
- evas_object_size_hint_align_set(toolbarButton,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- elm_object_text_set(toolbarButton, ((*itor).label).c_str());
- evas_object_smart_callback_add(toolbarButton,
- "clicked",
- (*itor).callback,
- (*itor).data);
- toolbarIt = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(toolbarIt, "object", toolbarButton);
- }
-
- toolbarButton = elm_button_add(toolbar);
- elm_object_style_set(toolbarButton, "naviframe_contrl/default");
- evas_object_size_hint_align_set(toolbarButton,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- elm_object_text_set(toolbarButton, WRT_OPTION_LABEL_FULLVIEW);
- evas_object_smart_callback_add(toolbarButton,
- "clicked",
- changeViewModeCallback,
- this);
- toolbarIt = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(toolbarIt, "object", toolbarButton);
-
- elm_object_item_part_content_set(naviIt, "optionheader", toolbar);
- elm_object_item_signal_emit(naviIt,
- "elm,state,optionheader,instant_close",
- "");
- optionheaderClose = TRUE;
}
void WindowData::createToolbar(CtxMenuItems ctxMenuItems)
}
}
-void WindowData::createTitleButton()
-{
- // Add left button for back action
- m_naviBackButton = elm_button_add(m_navigation);
- elm_object_style_set(m_naviBackButton, "navigationbar_backbutton/default");
-
- Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation);
- elm_object_item_part_content_set(naviIt, "prev_btn", m_naviBackButton);
-}
-
void WindowData::createFloatBackButton()
{
// Add float backbutton on the left coner
evas_object_show(m_floatBackButton);
}
-void WindowData::updateTitleButton(const bool display)
-{
- if (display) {
- evas_object_show(m_naviBackButton);
- } else {
- evas_object_hide(m_naviBackButton);
- }
-}
-
Evas_Object* WindowData::createWindow(unsigned long pid)
{
Evas_Object* window = elm_win_add(NULL, "wrt-widget", ELM_WIN_BASIC);
return window;
}
-Evas_Object* WindowData::createConformant(Evas_Object* parent)
-{
- Assert(parent != NULL && "Parent is null");
- Evas_Object* conformant = elm_conformant_add(parent);
-
- evas_object_size_hint_weight_set(
- conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_win_resize_object_add(parent, conformant);
- return conformant;
-}
-
Evas_Object* WindowData::createPlatformLayout(Evas_Object* parent)
{
Evas_Object* platform_layout = elm_layout_add(parent);
- elm_layout_file_set(platform_layout, PLATFORM_EDJ_PATH, "platformlayout");
+ if (!elm_layout_file_set(platform_layout, PLATFORM_EDJ_PATH, "platformlayout"))
+ elm_layout_theme_set(platform_layout, LAYOUT, APPLICATION, NOINDICATOR);
- evas_object_size_hint_align_set(platform_layout,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(platform_layout,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ evas_object_size_hint_expand_set(platform_layout,
+ EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ elm_win_resize_object_add(parent, platform_layout);
- elm_object_content_set(parent, platform_layout);
edje_object_signal_emit(
elm_layout_edje_get(platform_layout), ELM_STATE_SHOW_CONTENT, ELM);
return platform_layout;
}
-Evas_Object* WindowData::createNavigationBar(Evas_Object* parent)
-{
- Assert(parent != NULL && "Parent for naviframe is null");
- Evas_Object* navigation = elm_naviframe_add(parent);
-
- evas_object_size_hint_align_set(navigation,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(navigation,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, navigation);
- //elm_object_content_set(parent, navigation);
- return navigation;
-}
-
Evas_Object* WindowData::createUserLayout(Evas_Object* parent)
{
Assert(parent != NULL && "Parent for User Layout is null");
evas_object_size_hint_weight_set(
layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_win_resize_object_add(parent, layout);
Elm_Object_Item* naviIt = elm_naviframe_item_push(
/* Evas_Object *obj */
return layout;
}
+Evas_Object* WindowData::createConformant(Evas_Object* parent)
+{
+ Assert(parent != NULL && "Parent is null");
+ Evas_Object* conformant = elm_conformant_add(parent);
+ elm_object_style_set(conformant, INTERNAL_LAYOUT);
+ evas_object_size_hint_weight_set(
+ conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, conformant);
+ evas_object_show(conformant);
+ return conformant;
+}
+
+Evas_Object* WindowData::createNavigationBar(Evas_Object* parent)
+{
+ Assert(parent != NULL && "Parent for naviframe is null");
+ Evas_Object* navigation = elm_naviframe_add(parent);
+ elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, navigation);
+ return navigation;
+}
+
void WindowData::showHiddenOption(Evas_Object* parent)
{
Assert(parent != NULL && "Parent for Hiden Option");
Elm_Object_Item *naviIt = elm_naviframe_top_item_get(This->m_navigation);
if(elm_naviframe_item_title_visible_get(naviIt)) {
- This->hideTitle();
This->showHiddenOption(This->m_user_layout);
} else {
- This->createTitle(This->m_title.c_str(), This->m_ctxMenuItems);
This ->hideToolbar();
}
}
return;
}
- if (!m_fullscreen) //If ViewMode is not fullscreen, toggle the title bar.
- fullscreen ? hideTitle() : showTitle(m_title.c_str());
-
- if (m_indicator) //If indicator is shown by default, toggle it.
- toggleIndicator(!fullscreen);
-
+ if (!m_fullscreen) {
+ //If ViewMode is not fullscreen, toggle the title bar and indicator
+ toggleIndicator(fullscreen);
+ }
alreadyFullscreen = !alreadyFullscreen;
}