//#define DEBUG
//#define DEBUG_TEXT
- group {
- name: "quickpanel/minictrl/default";
- data.item: "bgcolor" QP_THEME_BANDED_COLOR;
- parts {
- part {
- name: "base";
- type: SPACER;
- repeat_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 480 QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT;
- fixed: 0 1;
- rel1 {
- relative: 0.0 0.0;
- }
- rel2 {
- relative: 1.0 1.0;
- }
- align: 0.0 0.0;
- }
- }
- part {
- name: "elm.padding.top";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 0 20 + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT;
- fixed: 0 1;
- rel1.to:"base";
- rel2.to:"base";
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 0.0;
- align: 0.0 0.0;
- }
+images {
+ image: "notification_separator_line.png" COMP;
+}
+group { name: "quickpanel/minictrl/container/default";
+ parts {
+ part { name: "base";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 NOTI_VIEW_MINI_CTRL_LAYOUT_HEIGHT;
+ max: -1 NOTI_VIEW_MINI_CTRL_LAYOUT_HEIGHT;
}
- part {
- name: "elm.padding.left.bg";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 0 0;
- fixed: 1 0;
- rel1.to:"base";
- rel2.to:"base";
- rel1.relative: 0.0 0.0;
- rel2.relative: 0.0 1.0;
- align: 0.0 0.0;
- }
- }
- part {
- name: "elm.padding.right.bg";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 0 0;
- fixed: 1 0;
- rel1.to:"base";
- rel2.to:"base";
- rel1.relative: 1.0 0.0;
- rel2.relative: 1.0 1.0;
- align: 1.0 0.0;
- }
- }
- part {
- name: "elm.padding.top.bg";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 0 QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT;
- fixed: 0 1;
- rel1.to:"base";
- rel2.to:"base";
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 0.0;
- align: 0.0 0.0;
- }
- }
- part {
- name: "elm.content.bg";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- rel1 {
- to_x:"elm.padding.left.bg";
- to_y:"elm.padding.top.bg";
- relative: 1.0 1.0;
- }
- rel2 {
- to_x:"elm.padding.right.bg";
- to_y:"elm.padding.bottom";
- relative: 0.0 1.0;
- }
- align: 0.0 0.0;
- visible: 1;
- color: 255 255 255 235;
- color_class: QP_THEME_ITEM_BG_COLOR;
- }
- description {
- state: "show" 0.0;
- inherit: "default" 0.0;
- }
- description {
- state: "hide" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 0;
- }
- }
- part {
- name: "bgcolor";
- type: "RECT";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- rel1.to:"base";
- rel2.to:"base";
- color_class: QP_THEME_BANDED_COLOR;
- visible: 1;
- }
- }
- QUICKPANEL_FOCUS_OBJECT("focus", "elm.content.bg", "elm.content.bg")
- part {
- name: "elm.padding.left";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 18 0;
- fixed: 1 0;
- rel1.to:"base";
- rel2.to:"base";
- rel1.relative: 0.0 0.0;
- rel2.relative: 0.0 1.0;
- align: 0.0 0.0;
- }
- }
- part {
- name: "elm.padding.right";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 12 0;
- fixed: 1 0;
- rel1.to:"base";
- rel2.to:"base";
- rel1.relative: 1.0 0.0;
- rel2.relative: 1.0 1.0;
- align: 1.0 0.0;
- }
- }
- part {
- name: "elm.icon";
- type: SWALLOW;
- mouse_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- align: 0.0 0.0;
- min: 480 QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT;
- rel1 {
- to: "elm.content.bg";
- }
- rel2 {
- to_x: "elm.content.bg";
- to_y: "elm.padding.bottom";
- relative: 1.0 0.0;
- }
+ }
+ part { name: "mini_ctrl.swallow";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 NOTI_VIEW_MINI_CTRL_CONTENT_HEIGHT;
+ max: -1 NOTI_VIEW_MINI_CTRL_CONTENT_HEIGHT;
+ rel1 {
+ to: "base";
+ relative: 0.0 0.0;
}
- }
- part {
- name: "elm.padding.bottom";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 0 0;
- fixed: 1 0;
- rel1.relative: 0.0 1.0;
- rel2.relative: 1.0 1.0;
- align: 0.0 1.0;
+ rel2 {
+ to: "base";
+ relative: 1.0 0.0;
}
+ align: 0.0 0.0;
+ //color: 255 0 0 255;
}
}
- programs {
- program{
- name: "bg.show";
- signal: "bg.show";
- source: "prog";
- action: STATE_SET "show" 0.0;
- target: "elm.content.bg";
+ QUICKPANEL_FOCUS_OBJECT("focus", "mini_ctrl.swallow", "mini_ctrl.swallow")
+ part { name: "seprator.line";
+ type: IMAGE;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 NOTI_VIEW_SEPARATOR_LINE_HEIGHT;
+ fixed: 0 1;
+ rel1 { to: "base"; relative: 0.0 1.0; offset: 40 0;}
+ rel2 { to_x: "base"; to_y: "mini_ctrl.swallow"; relative: 1.0 1.0; offset: -40 0; }
+ align: 0.0 1.0;
+ image.normal: "notification_separator_line.png";
+ visible: 1;
}
- program{
- name: "bg.hide";
- signal: "bg.hide";
- source: "prog";
- action: STATE_SET "hide" 0.0;
- target: "elm.content.bg";
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
}
}
}
+}
#define BUNDLE_BUFFER_LENGTH 100
+#define MINCONTROL_CONTAINER_SWALLOW "mini_ctrl.swallow"
+
+//SLIDER AREA
+#define SLIDER_START_W 790
+#define SLIDER_END_W 1160
+#define SLIDER_START_H 400
+#define SLIDER_END_H 432
+
+//Max Size of Mini-Controller
+#define MINICONTROL_MAX_WIDTH 1200
+#define MINICONTROL_MAX_HEIGHT 112
+
typedef enum _gesture_state_type {
STATE_NORMAL = 0,
STATE_GESTURE_WAIT,
return NULL;
}
- return elm_object_part_content_get(layout, "elm.icon");
+ return elm_object_part_content_get(layout, MINCONTROL_CONTAINER_SWALLOW);
}
static void _viewer_set_size(Evas_Object *layout, void *data, int width, int height)
Evas_Object *viewer;
struct appdata *ad;
int max_width;
- int resized_width;
+ int max_height;
int is_landscape;
if (!layout || !data || width < 0 || height < 0) {
else
is_landscape = 1;
+ INFO("Size Provided by Viewer is %s[ %d X %d ]",
+ ((width > MINICONTROL_MAX_WIDTH || height > MINICONTROL_MAX_HEIGHT) ? "bigger than max size, so resizing to max size[1200X112]": ""),
+ width, height);
- if (width > ad->win_width)
- DBG("MC Size is not valid. it is larger than window size: %dx%d (%dx%d) %d", width, height, ad->win_width, ad->win_height, ad->angle);
-
- max_width = is_landscape ? ad->win_height : ad->win_width;
- resized_width = (width > max_width) ? max_width : width;
+ max_width = ((width > MINICONTROL_MAX_WIDTH) ? MINICONTROL_MAX_WIDTH : width);
+ max_height = ((height > MINICONTROL_MAX_HEIGHT) ? MINICONTROL_MAX_HEIGHT : height);
- DBG("minicontroller view is resized to w:%d/%d(%d) h:%d Landscape[%d]", resized_width, max_width, width, height, is_landscape);
-
- evas_object_size_hint_min_set(viewer, resized_width, height);
- evas_object_size_hint_max_set(viewer, resized_width, height);
+ evas_object_size_hint_min_set(viewer, max_width, max_height);
+ evas_object_size_hint_max_set(viewer, max_width, max_height);
}
static void _viewer_item_free(struct _viewer_item *item)
Evas_Event_Mouse_Down *ev;
struct _viewer_item *vit;
+ struct appdata *ad = data;
if (s_info.mouse_event_blocker == EINA_TRUE)
s_info.mouse_event_blocker = EINA_FALSE;
+ ev = (Evas_Event_Mouse_Down *)event_info;
+
+ /** this is done to stop the flick animation when dragging the slider in mini-controller
+ * as the slider is not created by quickpanel it is part of widget viewer..quickpanel doesn't have access to slider object.
+ * so we have to estimate the slider area, whenever the drag start from slider we freeze the scroller to stop animation.
+ * co-ordinate provided by the mouse event are relative to window/screen.
+ * if position of slider object is changed than we need to update slider area accordingly.
+ */
+
+ if(ev->canvas.x >= SLIDER_START_W && ev->canvas.x <= SLIDER_END_W && ev->canvas.y >= SLIDER_START_H && ev->canvas.y <= SLIDER_END_H)
+ {
+ s_info.mouse_event_blocker = EINA_TRUE;
+ elm_object_scroll_freeze_push(ad->scroller);
+ INFO("mouse click is in slider area..skipping scroll animation");
+ return;
+ }
vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA);
- ev = (Evas_Event_Mouse_Down *)event_info;
if (!ev || !vit) {
ERR("ev %p, vit %p", ev, vit);
if (s_info.mouse_event_blocker == EINA_TRUE)
return;
-
ad = data;
ev = event_info;
vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA);
if (s_info.mouse_event_blocker == EINA_FALSE)
s_info.mouse_event_blocker = EINA_TRUE;
-
ad = data;
vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA);
if (!vit || !ad) {
return NULL;
}
- elm_layout_file_set(layout, util_get_res_file_path(DEFAULT_EDJ), "quickpanel/minictrl/default");
+ elm_layout_file_set(layout, util_get_res_file_path(DEFAULT_EDJ), "quickpanel/minictrl/container/default");
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);
evas_object_show(layout);
return NULL;
}
elm_object_focus_allow_set(viewer, EINA_TRUE);
- elm_object_part_content_set(layout, "elm.icon", viewer);
+ elm_object_part_content_set(layout, MINCONTROL_CONTAINER_SWALLOW, viewer);
evas_object_event_callback_add(viewer, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, ad);
evas_object_event_callback_add(viewer, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, ad);
}
_viewer_set_size(viewer, ad, width, height);
- quickpanel_uic_initial_resize(viewer,
- (height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT)
- ? height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT);
vit = malloc(sizeof(*vit));
if (!vit) {
if (found->viewer) {
_viewer_set_size(found->viewer, ad, width, height);
- quickpanel_uic_initial_resize(found->viewer,
- (height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT)
- ? height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT);
}
}