summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJisung Ahn <jcastle.ahn@samsung.com>2012-09-05 01:45:39 (GMT)
committerJisung Ahn <jcastle.ahn@samsung.com>2012-09-05 01:45:39 (GMT)
commit44e716a2aa828271ab1d1ba367eec3c627b1e36c (patch)
treed379295cda17fff2111fe96a67019fd245602b5b
parent894997ccde6bcbb60c5ccd1da1a5c05d5707d148 (diff)
downloadug-image-viewer-efl-44e716a2aa828271ab1d1ba367eec3c627b1e36c.zip
ug-image-viewer-efl-44e716a2aa828271ab1d1ba367eec3c627b1e36c.tar.gz
ug-image-viewer-efl-44e716a2aa828271ab1d1ba367eec3c627b1e36c.tar.bz2
fix crop view gui
Change-Id: I2db8aae5ff8e585ddfcc2a29009c284a9a0da5df
-rwxr-xr-xmain/layout/crop-view/T06_controlbar_bg.pngbin114793 -> 0 bytes
-rwxr-xr-xmain/layout/ivug-crop-view.edc486
-rwxr-xr-xmain/src/include/ivug-crop-view.h3
-rwxr-xr-xmain/src/view/ivug-crop-view.cpp57
-rwxr-xr-xmain/src/view/ivug-setas-view-callerid.cpp7
5 files changed, 263 insertions, 290 deletions
diff --git a/main/layout/crop-view/T06_controlbar_bg.png b/main/layout/crop-view/T06_controlbar_bg.png
deleted file mode 100755
index 864585c..0000000
--- a/main/layout/crop-view/T06_controlbar_bg.png
+++ /dev/null
Binary files differ
diff --git a/main/layout/ivug-crop-view.edc b/main/layout/ivug-crop-view.edc
index d368067..e77a470 100755
--- a/main/layout/ivug-crop-view.edc
+++ b/main/layout/ivug-crop-view.edc
@@ -13,266 +13,226 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#define CROP_VIEW_CONTROLBAR_BG "T06_controlbar_bg.png"
-
-
-#define PADDING_VISIBILITY 0
-
-#define MENU_VISIBLE 1
-#define MENU_INVISIBLE 0
-
-collections {
- group {
- name: "crop_view";
- images {
- image: CROP_VIEW_CONTROLBAR_BG COMP;
- }
-
- /*script {
- public menu_state = MENU_VISIBLE;
- }*/
- parts{
- part {
- name: "bg";
- type: RECT;
- scale:1;
- description {
- state: "default" 0.0;
- visible: 1;
- color: 0 0 0 255;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
-
- part{
- name: "photocam";
- type: SWALLOW;
- mouse_events: 1;
- repeat_events: 0;
- scale: 1; //allow scaling
- description {
- state: "default" 0.0;
- rel1 { relative: 0 0; to:bg; }
- rel2 { relative: 1 1; to:bg; }
- }
- }
-#if 0
- part{
- name: "thumbnail";
- type: SWALLOW;
- scale: 1; //allow scaling
- description {
- state: "default" 0.0;
- align: 0.5 0.5;
- rel1 { relative: 0 0; to:bg; }
- rel2 { relative: 1 1; to:bg; }
- }
- }
-#endif
- part{
- name: "scissorbox";
- type: SWALLOW;
- mouse_events: 1;
- repeat_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- rel1 { relative: 0 0; to:bg; }
- rel2 { relative: 1 1; to:bg; }
- }
- }
-
- part {
- name: "event";
- type: RECT;
- repeat_events: 1;
- mouse_events: 1;
- scale:1;
- description {
- state: "default" 0.0;
- color: 0 0 0 0;
- visible: 1;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
-
- part {
- name: "clipper";
- type: RECT;
- scale:1;
- description {
- state: "default" 0.0;
- visible:1;
- color: 255 255 255 255;
- }
- description {
- state: "hide" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 0;
- };
-
- }
-
- part {
- name: "controlbar.bg";
- type: IMAGE;
- mouse_events: 0;
- scale: 1;
- clip_to: "clipper";
- description {
- state: "default" 0.0;
- visible: 1;
- rel1 { relative: 0.0 1.0; }
- rel2 { relative: 1.0 1.0; }
- align: 0.5 1.0;
- min: 0 126;
-
- image {
- normal: CROP_VIEW_CONTROLBAR_BG;
- }
-
- }
-
- }
-
- part {
- name: "padding.left.13";
- type: RECT;
- scale:1;
- description {
- state: "default" 0.0;
- color: 128 0 0 255;
- visible: PADDING_VISIBILITY;
- min: 13 0;
- fixed: 1 0;
- align: 0.0 0.5;
- rel1.relative: 0.0 0.0;
- rel2.relative: 0.0 1.0;
- }
- }
-
- part {
- name: "padding.right.13";
- type: RECT;
- scale:1;
- description {
- state: "default" 0.0;
- color: 0 255 0 255;
- visible: PADDING_VISIBILITY;
- min: 13 0;
- fixed: 1 0;
- align: 1.0 0.5;
- rel1.relative: 1.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
-
- part {
- name: "padding.bottom.20";
- type: RECT;
- scale:1;
- description {
- state: "default" 0.0;
- color: 0 255 255 255;
- visible: PADDING_VISIBILITY;
- min: 0 20;
- fixed: 0 1;
- align: 0.5 1.0;
- rel1.relative: 0.0 1.0;
- rel2.relative: 1.0 1.0;
- }
- }
-
- part {
- name: "btn.save";
- type: SWALLOW;
- scale:1;
- clip_to: "clipper";
- description {
- state: "default" 0.0;
- color: 0 0 255 255;
- visible: 1;
- align: 0.0 1.0;
- min: 118 74;
- fixed: 1 1;
- rel1 {
- relative: 1.0 0.0;
- to_x: "padding.left.13";
- to_y: "padding.bottom.20";
- }
- rel2 {
- relative: 1.0 0.0;
- to_x: "padding.left.13";
- to_y: "padding.bottom.20";
- }
- }
- }
-
- part {
- name: "btn.cancel";
- type: SWALLOW;
- scale:1;
- clip_to: "clipper";
- description {
- state: "default" 0.0;
- color: 0 0 255 255;
- visible: 1;
- align: 1.0 1.0;
- min: 118 74;
- fixed: 1 1;
- rel1 {
- relative: 0.0 0.0;
- to_x: "padding.right.13";
- to_y: "padding.bottom.20";
- }
- rel2 {
- relative: 0.0 0.0;
- to_x: "padding.right.13";
- to_y: "padding.bottom.20";
- }
- }
- }
- }
-
- programs {
- /*program {
- name: "menu.show";
- source: "event";
- signal: "mouse,clicked,1";
- script {
- if (get_int(menu_state) == MENU_VISIBLE)
- {
- set_state(PART:"clipper", "hide", 0.0);
- set_int(menu_state, MENU_INVISIBLE );
- }
- else
- {
- set_state(PART:"clipper", "default", 0.0);
- set_int(menu_state, MENU_VISIBLE );
- }
- }
- }*/
-
- program {
- name: "hide_menu";
- signal: "elm,state,hide";
- source: "event";
- action: STATE_SET "hide" 0.0;
- target: "clipper";
- }
-
- program {
- name: "show_menu";
- signal: "elm,state,show";
- source: "event";
- action: STATE_SET "default" 0.0;
- target: "clipper";
- }
- }
-
- }
-}
+
+#include "ivug-theme.edc"
+
+#define MENU_VISIBLE 1
+#define MENU_INVISIBLE 0
+
+#define PROGRESSBAR_WIDTH 100
+#define PROGRESSBAR_HEIGHT 100
+
+collections {
+ group {
+ name: "crop_view";
+
+ /*script {
+ public menu_state = MENU_VISIBLE;
+ }*/
+ parts{
+ part {
+ name: "bg";
+ type: RECT;
+ scale:1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 255;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+
+ part{
+ name: "photocam";
+ type: SWALLOW;
+ mouse_events: 1;
+ repeat_events: 0;
+ scale: 1; //allow scaling
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1 { relative: 0 0; to:bg; }
+ rel2 { relative: 1 1; to:bg; }
+ }
+ }
+
+ part{
+ name: "thumbnail";
+ type: SWALLOW;
+ scale: 1; //allow scaling
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ visible: 1;
+ rel1 { relative: 0 0; to:bg; }
+ rel2 { relative: 1 1; to:bg; }
+ }
+ }
+
+ part{
+ name: "progressbar";
+ type: SWALLOW;
+ scale: 1; //allow scaling
+ description {
+ state: "default" 0.0;
+ min: PROGRESSBAR_WIDTH PROGRESSBAR_WIDTH;
+ max: PROGRESSBAR_WIDTH PROGRESSBAR_WIDTH;
+ fixed: 1 1;
+ visible: 1;
+ align: 0.5 0.5;
+ rel1 { relative: 0 0; to:photocam; }
+ rel2 { relative: 1 1; to:photocam; }
+ }
+ }
+
+ part {
+ name: "event";
+ type: RECT;
+ repeat_events: 1;
+ mouse_events: 1;
+ scale:1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 1;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+
+ part{
+ name: "scissorbox";
+ type: SWALLOW;
+ mouse_events: 1;
+ repeat_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1 { relative: 0 0; to:bg; }
+ rel2 { relative: 1 1; to:bg; }
+ }
+ }
+ }
+ }
+}
+
+collections {
+#define BTN_SET_CALLER_IMAGE_WIDTH 86
+#define BTN_SET_CALLER_IMAGE_HEIGHT 86
+#if 1
+ group {
+ name: "crop_view_btn";
+
+ images {
+ image: "00_winset_control_toolbar_bg.png" COMP;
+ }
+
+ parts{
+ part {
+ name: "base";
+ type: RECT;
+ scale:1;
+ mouse_events: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ part { name: "controlbar_bg";
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 CONTROLBAR_SMALL_HEIGHT_INC;
+ max: 999999 CONTROLBAR_SMALL_HEIGHT_INC;
+ fixed: 0 1;
+ align: 0.0 1.0;
+ visible: 1;
+ rel1 { to: "base"; }
+ rel2 { to: "base"; }
+ //image.normal: "00_winset_control_toolbar_bg.png";
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "controlbar_clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "controlbar_bg";
+ rel2.to: "controlbar_bg";
+ visible: 1;
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "elm.prev_btn_bg";
+ type: RECT;
+ scale: 1;
+ clip_to: "controlbar_clip";
+ description { state: "default" 0.0;
+ min: 0 0;
+ fixed: 1 0;
+ align: 1.0 0.0;
+ rel1 { relative: 1.0 0.0; to: "controlbar_bg"; }
+ rel2.to: "controlbar_bg";
+ visible: 0;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0;
+ }
+ }
+ part { name: "elm.swallow.prev_btn";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "controlbar_clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ rel1.to: "elm.prev_btn_bg";
+ rel2.to: "elm.prev_btn_bg";
+ }
+ }
+ part { name: "controlbar";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "controlbar_clip";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "controlbar_bg";
+ rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; }
+ visible: 1;
+ }
+ }
+ }
+
+ programs {
+
+ program {
+ name: "hide_menu";
+ signal: "elm,state,hide";
+ source: "event";
+ action: STATE_SET "hide" 0.0;
+ target: "controlbar_clip";
+ target: "controlbar_bg";
+ }
+
+ program {
+ name: "show_menu";
+ signal: "elm,state,show";
+ source: "event";
+ action: STATE_SET "default" 0.0;
+ target: "controlbar_clip";
+ target: "controlbar_bg";
+ }
+ }
+ }
+}
+
diff --git a/main/src/include/ivug-crop-view.h b/main/src/include/ivug-crop-view.h
index 40b278a..3e11f87 100755
--- a/main/src/include/ivug-crop-view.h
+++ b/main/src/include/ivug-crop-view.h
@@ -32,7 +32,8 @@ typedef struct {
Ecore_Timer *timer;
- Evas_Object *btn_ok;
+ Evas_Object *btn_layout;
+ Elm_Object_Item *btn_ok;
int w;
int h;
diff --git a/main/src/view/ivug-crop-view.cpp b/main/src/view/ivug-crop-view.cpp
index 49411d0..7e18817 100755
--- a/main/src/view/ivug-crop-view.cpp
+++ b/main/src/view/ivug-crop-view.cpp
@@ -32,7 +32,13 @@
#undef LOG_CAT
#define LOG_CAT "IV-CROP"
-#define EDJ_PATH PREFIX"/res/edje/"PACKAGE
+#define EDJ_PATH PREFIX"/res/edje/"PACKAGE
+
+#define CROP_EDJ_FILE EDJ_PATH"/ivug-crop-view.edj"
+
+#define CONTROL_ICON_DIRECTORY_PATH IMAGE_PATH"/01_Control icon"
+#define ICON_PATH_SAVE CONTROL_ICON_DIRECTORY_PATH"/T01_controlbar_icon_save.png"
+#define ICON_PATH_PREV CONTROL_ICON_DIRECTORY_PATH"/00_winset_btn_prev.png"
static void _on_layout_resized(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
@@ -123,7 +129,7 @@ static Eina_Bool _on_crop_timer_expired(void *data)
pCropView->timer = NULL;
- elm_object_disabled_set(pCropView->btn_ok, EINA_FALSE);
+ elm_object_item_disabled_set(pCropView->btn_ok, EINA_FALSE);
MSG_HIGH("Image preloaded");
@@ -362,13 +368,12 @@ IvugCropView *ivug_crop_view_create(Evas_Object *parent)
Evas_Object *layout;
- layout = EFL::create_layout(parent, EDJ_PATH"/ivug-crop-view.edj", "crop_view");
+ layout = EFL::create_layout(parent, CROP_EDJ_FILE, "crop_view");
if ( layout == NULL )
{
MSG_ERROR("Cannot create crop view");
- delete pCropView;
-
+ free(pCropView);
return NULL;
}
@@ -391,24 +396,35 @@ IvugCropView *ivug_crop_view_create(Evas_Object *parent)
elm_object_part_content_set(layout, "scissorbox", pCropView->cropbox);
-// Create button
- Evas_Object *btn = NULL;
-
- btn = EFL::create_button(layout, "btn_style1", NULL, IDS_SAVE);
- evas_object_smart_callback_add(btn, "clicked", _on_btn_save, (void *)pCropView);
- elm_object_part_content_set(layout, "btn.save", btn);
+ Evas_Object *controlbar = ivug_controlbar_add(pCropView->layout, "default");
+ Elm_Object_Item *item[4];
- pCropView->btn_ok = btn;
-
- btn = EFL::create_button(layout, "btn_style1", NULL, IDS_CANCEL);
- evas_object_smart_callback_add(btn, "clicked", _on_btn_cancel, (void *)pCropView);
- elm_object_part_content_set(layout, "btn.cancel", btn);
+ item[0] = elm_toolbar_item_append(controlbar, ICON_PATH_SAVE, NULL, _on_btn_save, (void *)pCropView);
+ item[1] = elm_toolbar_item_append(controlbar, NULL, NULL, NULL, NULL);
+ item[2] = elm_toolbar_item_append(controlbar, NULL, NULL, NULL, NULL);
+ item[3] = elm_toolbar_item_append(controlbar, ICON_PATH_PREV, NULL, _on_btn_cancel, (void *)pCropView);
+
+ pCropView->btn_layout = ivug_layout_add(pCropView->layout , CROP_EDJ_FILE, "crop_view_btn");
+ if ( pCropView->btn_layout == NULL )
+ {
+ MSG_SETAS_ERROR("Cannot create btn_layout.");
+ evas_object_del(pCropView->layout);
+ free(pCropView);
+ return NULL;
+ }
+
+ pCropView->btn_ok = item[0];
+ elm_object_item_disabled_set(pCropView->btn_ok, EINA_TRUE);
+
+ elm_object_part_content_set(pCropView->btn_layout, "controlbar", controlbar);
+
+ evas_object_smart_member_add(pCropView->btn_layout, pCropView->layout);
+
+ evas_object_show(pCropView->btn_layout);
MSG_HIGH("Create CropView");
evas_object_smart_callback_add(layout, "test", _on_test, NULL);
-
- elm_object_disabled_set(pCropView->btn_ok, EINA_TRUE);
elm_win_resize_object_add(gGetCurrentWindow(), layout);
@@ -475,7 +491,10 @@ void ivug_crop_view_destroy(IvugCropView *pCropView)
free(pCropView->file_path);
if ( pCropView->result_path)
- free(pCropView->result_path);
+ free(pCropView->result_path);
+
+ if ( pCropView->btn_layout )
+ evas_object_del(pCropView->btn_layout);
if ( pCropView->layout )
evas_object_del(pCropView->layout);
diff --git a/main/src/view/ivug-setas-view-callerid.cpp b/main/src/view/ivug-setas-view-callerid.cpp
index f3f22c9..bd26d86 100755
--- a/main/src/view/ivug-setas-view-callerid.cpp
+++ b/main/src/view/ivug-setas-view-callerid.cpp
@@ -527,13 +527,6 @@ Evas_Object *_ivug_setas_callerid_create_layout(Evas_Object *parent)
elm_object_item_disabled_set(item[1], EINA_TRUE);
elm_object_item_disabled_set(item[2], EINA_TRUE);
- pSetAsData->btn_layout = ivug_layout_add(pSetAsData->layout , SETAS_EDJ_FILE, "setas_view_btn");
- if ( pSetAsData->btn_layout == NULL )
- {
- MSG_SETAS_ERROR("Cannot create btn_layout.");
- goto error;
- }
-
elm_object_part_content_set(pSetAsData->btn_layout, "controlbar", controlbar);
//Evas_Object *back_btn = ivug_button_add(controlbar, "naviframe/end_btn/default", IDS_BACK, NULL, _on_btn_cancel_clicked, pSetAsData->layout);