From 7f91380c249b8cfa9342ff8a1e4a830f5896c868 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sat, 10 Oct 2020 18:01:14 +0900 Subject: [PATCH] Add margin in common profile Change-Id: Ie87fe69eb3850dbe681153d2e35ccdf0db808547 Signed-off-by: Jihoon Kim --- CMakeLists.txt | 1 + .../input_method_setting_list_ui.cpp | 18 ++++- packaging/org.tizen.inputmethod-setting.spec | 2 + res/CMakeLists.txt | 1 + res/edje/CMakeLists.txt | 12 ++++ res/edje/main_layout.edc | 69 +++++++++++++++++++ 6 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 res/CMakeLists.txt create mode 100644 res/edje/CMakeLists.txt create mode 100644 res/edje/main_layout.edc diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ad14bc..98635b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,3 +54,4 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/${PKGNAME}-selector.png DESTINATION ${ICO ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/im_setting_list) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/im_setting_selector) ADD_SUBDIRECTORY(po) +ADD_SUBDIRECTORY(res) diff --git a/im_setting_list/input_method_setting_list_ui.cpp b/im_setting_list/input_method_setting_list_ui.cpp index 9fba5cc..144670b 100644 --- a/im_setting_list/input_method_setting_list_ui.cpp +++ b/im_setting_list/input_method_setting_list_ui.cpp @@ -45,6 +45,8 @@ "_CREDIT_CARD_NUMBERS_MSG") +#define MAIN_LAYOUT_EDJ RESDIR"/edje/main_layout.edj" + typedef struct list_item_text_s { char main_text[256]; @@ -934,6 +936,8 @@ Evas_Object *im_setting_list_list_create(void *data) Evas_Object *back_btn = NULL; const char *title = NULL; const char *item_style = NULL; + Elm_Object_Item *nf_main_item = NULL; + #ifdef _WEARABLE item_style = "empty"; #else @@ -944,11 +948,21 @@ Evas_Object *im_setting_list_list_create(void *data) evas_object_smart_callback_add(back_btn, "clicked", im_setting_list_navi_back_btn_call_cb, NULL); #endif - Elm_Object_Item *nf_main_item = elm_naviframe_item_push(ad->naviframe, + Evas_Object *layout = elm_layout_add(ad->naviframe); +#if defined(_WEARABLE) || defined(_MOBILE) + elm_layout_theme_set(layout, "layout", "application", "default"); +#else + elm_layout_file_set(layout, MAIN_LAYOUT_EDJ, "main_layout"); +#endif + + elm_object_content_set(layout, ad->genlist); + evas_object_show(layout); + + nf_main_item = elm_naviframe_item_push(ad->naviframe, title, back_btn, NULL, - ad->genlist, + layout, item_style); #ifdef _WEARABLE diff --git a/packaging/org.tizen.inputmethod-setting.spec b/packaging/org.tizen.inputmethod-setting.spec index 15db944..edf1666 100644 --- a/packaging/org.tizen.inputmethod-setting.spec +++ b/packaging/org.tizen.inputmethod-setting.spec @@ -7,6 +7,7 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: gettext-tools +BuildRequires: edje-bin BuildRequires: cmake BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(isf) @@ -206,6 +207,7 @@ mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector \ %manifest %{name}.manifest %defattr(-,root,root,-) %{TZ_SYS_RO_ICONS}/default/small/* +%{TZ_SYS_RO_APP}/%{name}/res/* %{TZ_SYS_RO_PACKAGES}/%{name}.xml %license LICENSE diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt new file mode 100644 index 0000000..2ab7c7b --- /dev/null +++ b/res/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(edje) diff --git a/res/edje/CMakeLists.txt b/res/edje/CMakeLists.txt new file mode 100644 index 0000000..aac4c96 --- /dev/null +++ b/res/edje/CMakeLists.txt @@ -0,0 +1,12 @@ +ADD_CUSTOM_TARGET( + main_layout.edj + COMMAND edje_cc -no-save + ${CMAKE_CURRENT_SOURCE_DIR}/main_layout.edc + ${CMAKE_BINARY_DIR}/main_layout.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main_layout.edc +) + +# install edc files +INSTALL(FILES ${CMAKE_BINARY_DIR}/main_layout.edj DESTINATION ${RESDIR}/edje) + +ADD_CUSTOM_TARGET(edje ALL DEPENDS main_layout.edj) diff --git a/res/edje/main_layout.edc b/res/edje/main_layout.edc new file mode 100644 index 0000000..050b119 --- /dev/null +++ b/res/edje/main_layout.edc @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define PADDING_SIZE 40 +#define PADDING_BOTTOM_SIZE 30 + +collections +{ + base_scale: 1.8; + + group { "main_layout"; + parts { + rect { "base"; + desc { "default"; + color: 238 239 241 255; + } + } + spacer { "padding.left"; scale; + desc { "default"; + min: PADDING_SIZE 0; + max: PADDING_SIZE -1; + fixed: 1 0; + align: 0.0 0.0; + rel.to: "base"; + } + } + spacer { "padding.right"; scale; + desc { "default"; + min: PADDING_SIZE 0; + max: PADDING_SIZE -1; + fixed: 1 0; + align: 1.0 0.0; + rel.to: "base"; + } + } + swallow { "elm.swallow.content"; + desc { "default"; + rel1 { relative: 1.0 0.0; to: "padding.left"; } + rel2 { relative: 0.0 0.0; + to_x: "padding.right"; + to_y: "padding.bottom"; + } + } + } + spacer { "padding.bottom"; scale; + desc { "default"; + min: 0 PADDING_BOTTOM_SIZE; + max: -1 PADDING_BOTTOM_SIZE; + fixed: 0 1; + align: 0.0 1.0; + rel.to: "base"; + } + } + } + } +} -- 2.34.1