Commit 19b4833c authored by Ludovic Fauvet's avatar Ludovic Fauvet

Extend the naviframe theme (with ejde) to add the 'more' icon

For an unknown reason the button needs to be pressed twice to
reopen the 'more' menu.
parent 16ecb0ab
......@@ -70,6 +70,7 @@
#define AUDIOPLAYERMINIEDJ get_resource_path( EDJPATH "/audio_player_mini.edj")
#define AUDIOPLAYEREDJ get_resource_path( EDJPATH "/audio_player.edj")
#define ABOUTEDJ get_resource_path( EDJPATH "/about.edj")
#define THEMEEDJ get_resource_path( EDJPATH "/theme.edj")
#define RES_DIR "/opt/usr/apps/" PACKAGE "/res/"
#define ICON_DIR RES_DIR "/images/"
......
/*****************************************************************************
* Copyright © 2015 VideoLAN, VideoLabs SAS
*****************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*
* By committing to this project, you allow VideoLAN and VideoLabs to relicense
* the code to a different OSI approved license, in case it is required for
* compatibility with the Store
*****************************************************************************/
#define BUTTON_NAVIFRAME_DRAWERS_WIDTH_INC 24
#define BUTTON_NAVIFRAME_DRAWERS_IMAGE_SIZE_INC 24 24
collections {
group { name: "elm/button/base/naviframe/custom_more";
images {
set {
name: "ic_more_normal";
image {
image: "ic_more_normal.png" COMP;
}
}
}
script {
public mouse_down = 0;
public multi_down = 0;
}
parts {
part { name: "button_bg";
type: RECT;
scale: 1;
mouse_events: 0;
clip_to: "button_bg_clipper";
description { state: "default" 0.0;
min: BUTTON_NAVIFRAME_DRAWERS_WIDTH_INC 0;
max: BUTTON_NAVIFRAME_DRAWERS_WIDTH_INC -1;
fixed: 1 0;
}
}
part { name: "button_bg_clipper";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "button_bg";
rel2.to: "button_bg";
visible: 0;
}
description { state: "pressed" 0.0;
inherit: "default" 0.0;
color_class: "F043P";
visible: 1;
}
}
part { name: "button_icon";
type: IMAGE;
scale: 1;
mouse_events: 0;
clip_to: "button_icon_clipper";
description { state: "default" 0.0;
fixed: 1 1;
align: 0.0 0.5;
rel1 { to: "button_bg"; relative: 0.0 0.0; }
rel2 { to: "button_bg"; relative: 0.0 1.0; }
image.normal: "ic_more_normal";
max: BUTTON_NAVIFRAME_DRAWERS_IMAGE_SIZE_INC;
min: BUTTON_NAVIFRAME_DRAWERS_IMAGE_SIZE_INC;
}
}
part { name: "button_icon_clipper";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "button_icon";
rel2.to: "button_icon";
color_class: "F043L1i";
}
description { state: "disabled" 0.0;
inherit: "default" 0.0;
color_class: "F043L1iD";
}
}
part { name: "over2";
type: RECT;
ignore_flags: ON_HOLD;
description { state: "default" 0.0;
rel1.to: "button_bg";
rel2.to: "button_bg";
color: 0 0 0 0;
}
}
part { name: "over3";
type: RECT;
repeat_events: 1;
description { state: "default" 0.0;
rel1.to: "button_bg";
rel2.to: "button_bg";
color: 0 0 0 0;
}
}
part { name: "disabler";
type: RECT;
description { state: "default" 0.0;
rel1.to: "button_bg";
rel2.to: "button_bg";
color: 0 0 0 0;
visible: 0;
}
description { state: "disabled" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
}
programs {
program { name: "button_press";
signal: "mouse,down,1*";
source: "over2";
script {
if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
{
set_int(mouse_down, 1);
set_state(PART:"button_bg_clipper", "pressed", 0.0);
emit("elm,action,press", "");
}
}
}
program { name: "button_unpress";
signal: "mouse,up,1*";
source: "over3";
script {
if (get_int(mouse_down) == 1)
{
set_int(mouse_down, 0);
set_state(PART:"button_bg_clipper", "default", 0.0);
emit("elm,action,unpress", "");
}
}
}
program { name: "button_click";
signal: "mouse,clicked,1";
source: "over2";
script {
if (get_int(multi_down) == 0) {
run_program(PROGRAM:"touch_sound");
emit("elm,action,click", "");
}
}
}
program { name: "touch_sound";
action: RUN_PLUGIN "touch_sound";
}
program { name: "key_press";
signal: "elm,action,pressed";
source: "elm";
action: STATE_SET "pressed" 0.0;
target: "button_bg_clipper";
}
program { name: "key_unpress";
signal: "elm,action,unpressed";
source: "elm";
action: STATE_SET "default" 0.0;
target: "button_bg_clipper";
}
program { name: "enable";
signal: "elm,state,enabled";
source: "elm";
action: STATE_SET "default" 0.0;
target: "button_icon_clipper";
}
program { name: "disable";
signal: "elm,state,disabled";
source: "elm";
action: STATE_SET "disabled" 0.0;
target: "button_icon_clipper";
}
program {
name: "multi_down";
signal: "elm,action,multi,down";
source: "elm";
script {
set_int(multi_down, 1);
}
}
program {
name: "multi_up";
signal: "elm,action,multi,up";
source: "elm";
script {
set_int(multi_down, 0);
}
}
}
}
}
\ No newline at end of file
res/images/ic_more_normal.png

296 Bytes | W: | H:

res/images/ic_more_normal.png

321 Bytes | W: | H:

res/images/ic_more_normal.png
res/images/ic_more_normal.png
res/images/ic_more_normal.png
res/images/ic_more_normal.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -164,7 +164,7 @@ intf_push_view(interface *intf, interface_view *view, const char *title)
{
if(intf->popup_toggle_btn == NULL)
{
intf->popup_toggle_btn = create_button(intf->nf_content, "naviframe/drawers");
intf->popup_toggle_btn = create_button(intf->nf_content, "naviframe/custom_more");
evas_object_smart_callback_add(intf->popup_toggle_btn, "clicked", right_panel_button_clicked_cb, intf);
}
elm_object_part_content_set(intf->nf_content, "title_right_btn", intf->popup_toggle_btn);
......@@ -494,6 +494,9 @@ intf_create(application *app)
EDJE_COLOR_CLASS_SET_VLC_COLOR("W0641D", VLC_ORANGE_500_TRANSPARENT); // slider thumb disabled
EDJE_COLOR_CLASS_SET_VLC_ORANGE("W0641"); // slider thumb
// Extend theme
elm_theme_extension_add(NULL, THEMEEDJ);
/* Handle rotations */
if (elm_win_wm_rotation_supported_get(intf->win)) {
int rots[4] = { 0, 90, 180, 270 };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment