Hide "v" button when only one line candidates
authorHaifeng Deng <haifeng.deng@samsung.com>
Wed, 12 Sep 2012 07:31:10 +0000 (15:31 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 10 Oct 2012 11:32:46 +0000 (20:32 +0900)
Change-Id: Ie14b0da8761343ac52348b3655dc19e237d4e2a9

configure.ac
debian/changelog
ism/extras/efl_panel/isf_panel_efl.cpp
packaging/isf.spec
releasenote.txt

index 10132e9..699bdd9 100755 (executable)
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script
 #AC_INIT(scim, 1.4.7, suzhe@tsinghua.org.cn)
-AC_INIT(isf, 2.3.5710, isf@samsung.com)
+AC_INIT(isf, 2.3.5712, isf@samsung.com)
 AC_CONFIG_SRCDIR([ism/src/scim.h])
 m4_pattern_allow([^AS_])
 
@@ -11,7 +11,7 @@ m4_pattern_allow([^AS_])
 # ISF version
 ISF_MAJOR_VERSION=2
 ISF_MINOR_VERSION=3
-ISF_MICRO_VERSION=5710
+ISF_MICRO_VERSION=5712
 
 ISF_VERSION=$ISF_MAJOR_VERSION.$ISF_MINOR_VERSION.$ISF_MICRO_VERSION
 
index 86c0fb3..e12ea40 100755 (executable)
@@ -1,3 +1,12 @@
+isf (2.3.5712-1slp2+1) unstable; urgency=low
+
+  * [isf-panel-efl] Hide "v" button when only one line candidates
+  * [isf-setting-efl] Add padding at bottom
+  * Git: framework/uifw/isf
+  * Tag: isf_2.3.5712-1slp2+1
+
+ -- Haifeng Deng <haifeng.deng@samsung.com>  Wed, 12 Sep 2012 16:18:00 +0900
+
 isf (2.3.5710-1slp2+2) unstable; urgency=low
 
   * Upload again.
index 4b7c449..216608d 100644 (file)
@@ -175,6 +175,7 @@ static Evas_Object       *_line_items [SCIM_LOOKUP_TABLE_MAX_PAGESIZE];
 static Evas_Object       *_more_btn                         = 0;
 static Evas_Object       *_close_btn                        = 0;
 static bool               _candidate_window_show            = false;
+static bool               _candidate_window_always_show     = false;
 
 static int                _candidate_x                      = 0;
 static int                _candidate_y                      = 0;
@@ -258,6 +259,7 @@ static clock_t            _clock_start;
 
 static Ecore_Timer       *_check_size_timer                 = NULL;
 static Ecore_Timer       *_longpress_timer                  = NULL;
+static Ecore_Timer       *_destroy_timer                    = NULL;
 
 
 /////////////////////////////////////////////////////////////////////////////
@@ -683,7 +685,7 @@ static void ui_candidate_window_adjust (void)
                 evas_object_move (_candidate_area_2, 0, _candidate_port_height_min);
                 evas_object_move (_scroller_bg, 0, _candidate_port_height_min);
             }
-        } else if (evas_object_visible_get (_candidate_area_1)) {
+        } else {
             evas_object_hide (_aux_line);
             evas_object_move (_candidate_area_1, _candidate_area_1_pos[0], _candidate_area_1_pos[1]);
             if (_candidate_angle == 90 || _candidate_angle == 270) {
@@ -759,6 +761,8 @@ static bool ui_candidate_can_be_hide (void)
         evas_object_visible_get (_candidate_area_1) ||
         evas_object_visible_get (_candidate_area_2))
         return false;
+    else if (_candidate_window_always_show && _ise_show)
+        return false;
     else
         return true;
 }
@@ -829,6 +833,37 @@ static Eina_Bool ui_candidate_longpress_timeout (void *data)
 }
 
 /**
+ * @brief Delete destroy timer.
+ *
+ * @return void
+ */
+static void ui_candidate_delete_destroy_timer (void)
+{
+    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
+
+    if (_destroy_timer != NULL) {
+        ecore_timer_del (_destroy_timer);
+        _destroy_timer = NULL;
+    }
+}
+
+/**
+ * @brief Callback function for destroy timer.
+ *
+ * @param data Data to pass when it is called.
+ *
+ * @return ECORE_CALLBACK_CANCEL
+ */
+static Eina_Bool ui_candidate_destroy_timeout (void *data)
+{
+    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
+
+    ui_candidate_delete_destroy_timer ();
+    ui_destroy_candidate_window ();
+    return ECORE_CALLBACK_CANCEL;
+}
+
+/**
  * @brief Show candidate window.
  */
 static void ui_candidate_show (void)
@@ -874,11 +909,22 @@ static void ui_candidate_hide (bool bForce)
         return;
 
     if (bForce) {
-        evas_object_hide (_aux_area);
-        elm_scroller_region_show (_aux_area, 0, 0, 10, 10);
-        evas_object_hide (_candidate_area_1);
-        evas_object_hide (_candidate_area_2);
-        evas_object_hide (_scroller_bg);
+        if ((_aux_area && evas_object_visible_get (_aux_area)) ||
+            (_candidate_area_1 && evas_object_visible_get (_candidate_area_1)) ||
+            (_candidate_area_2 && evas_object_visible_get (_candidate_area_2))) {
+            evas_object_hide (_aux_area);
+            elm_scroller_region_show (_aux_area, 0, 0, 10, 10);
+            evas_object_hide (_candidate_area_1);
+            evas_object_hide (_more_btn);
+
+            if (_candidate_area_2 && evas_object_visible_get (_candidate_area_2)) {
+                evas_object_hide (_candidate_area_2);
+                evas_object_hide (_scroller_bg);
+                evas_object_hide (_close_btn);
+                _panel_agent->candidate_more_window_hide ();
+            }
+            ui_candidate_window_adjust ();
+        }
     }
 
     if (ui_candidate_can_be_hide () || bForce) {
@@ -937,12 +983,14 @@ static void ui_candidate_window_close_button_cb (void *data, Evas *e, Evas_Objec
 {
     SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
 
-    if (evas_object_visible_get (_candidate_area_2)) {
-        evas_object_hide (_candidate_area_2);
-        evas_object_hide (_scroller_bg);
-        evas_object_hide (_close_btn);
-        _panel_agent->candidate_more_window_hide ();
-    }
+    if (_candidate_area_2 == NULL || !evas_object_visible_get (_candidate_area_2))
+        return;
+
+    evas_object_hide (_candidate_area_2);
+    evas_object_hide (_scroller_bg);
+    evas_object_hide (_close_btn);
+    _panel_agent->candidate_more_window_hide ();
+
     evas_object_show (_candidate_area_1);
     evas_object_show (_more_btn);
     ui_candidate_window_adjust ();
@@ -1696,6 +1744,7 @@ static void slot_focus_in (void)
 {
     SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
 
+    ui_candidate_delete_destroy_timer ();
     if (!_candidate_window) {
         ui_create_candidate_window ();
     }
@@ -1707,7 +1756,8 @@ static void slot_focus_in (void)
 static void slot_focus_out (void)
 {
     SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
-    ui_destroy_candidate_window ();
+    ui_candidate_delete_destroy_timer ();
+    _destroy_timer = ecore_timer_add (1.0, ui_candidate_destroy_timeout, NULL);
 }
 
 /**
@@ -1728,8 +1778,7 @@ static void slot_contract_candidate (void)
 {
     SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
 
-    if (_candidate_area_2 && evas_object_visible_get (_candidate_area_2))
-        ui_candidate_window_close_button_cb (NULL, NULL, NULL, NULL);
+    ui_candidate_window_close_button_cb (NULL, NULL, NULL, NULL);
 }
 
 /**
@@ -1803,9 +1852,12 @@ static void slot_update_input_context (int type, int value)
     if (type == ECORE_IMF_INPUT_PANEL_STATE_EVENT) {
         if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
             _ise_show = false;
+            ui_candidate_hide (true);
             set_keyboard_geometry_atom_info (KEYBOARD_STATE_OFF);
         } else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
             _ise_show = true;
+            if (_candidate_window_always_show)
+                ui_candidate_show ();
             set_keyboard_geometry_atom_info (KEYBOARD_STATE_ON);
         }
     }
@@ -2161,12 +2213,25 @@ static void update_table (const int table_type, const LookupTable &table)
 
                 // Add first item
                 if (i == 0) {
+                    if (item_num == 1) {
+                        if (_candidate_angle == 90 || _candidate_angle == 270)
+                            scroll_0_width = _candidate_land_width;
+                        else
+                            scroll_0_width = _candidate_port_width;
+                    }
                     item_0_width = item_0_width > scroll_0_width ? scroll_0_width : item_0_width;
                     evas_object_size_hint_min_set (_candidate_0 [i], item_0_width, _item_min_height);
                     elm_table_pack (_candidate_0_table, _candidate_0 [i], 0, 0, item_0_width, _item_min_height);
                     total_width += item_0_width;
                     continue;
                 } else {
+                    if (i == item_num - 1) {
+                        if (_candidate_angle == 90 || _candidate_angle == 270)
+                            scroll_0_width = _candidate_land_width;
+                        else
+                            scroll_0_width = _candidate_port_width;
+                    }
+
                     total_width += (item_0_width + seperate_width);
                     if (total_width <= scroll_0_width) {
                         _seperate_0 [i] = edje_object_add (evas);
@@ -2273,8 +2338,12 @@ static void update_table (const int table_type, const LookupTable &table)
     }
 
     _panel_agent->update_displayed_candidate_number (item_num - more_item_count);
-    if (more_item_count == 0 && evas_object_visible_get (_candidate_area_2))
+    if (more_item_count == 0) {
         ui_candidate_window_close_button_cb (NULL, NULL, NULL, NULL);
+        evas_object_hide (_more_btn);
+    } else if (!evas_object_visible_get (_candidate_area_2)) {
+        evas_object_show (_more_btn);
+    }
     elm_scroller_region_show (_candidate_area_1, 0, 0, _candidate_scroll_width, _item_min_height);
     elm_scroller_region_show (_candidate_area_2, 0, 0, _candidate_scroll_width, _item_min_height);
     flush_memory ();
@@ -2923,6 +2992,7 @@ static void change_hw_and_sw_keyboard (void)
                 _ise_height = -1;
             }
             _ise_show = false;
+            _candidate_port_line = 1;
 
             _config->write (ISF_CONFIG_HARDWARE_KEYBOARD_DETECT, 1);
         } else {
@@ -3279,6 +3349,7 @@ int main (int argc, char *argv [])
 cleanup:
     ui_candidate_delete_check_size_timer ();
     ui_candidate_delete_longpress_timer ();
+    ui_candidate_delete_destroy_timer ();
 
     if (!_config.null ())
         _config.reset ();
index e83f15b..ffffccb 100755 (executable)
@@ -1,10 +1,10 @@
-#sbs-git:framework/uifw/isf isf 2.3.5710 07f2b65224e6cef5cd6799065bb01fa656bc115e
+#sbs-git:framework/uifw/isf isf 2.3.5712 07f2b65224e6cef5cd6799065bb01fa656bc115e
 %define _usrdir        /usr
 %define _ugdir %{_usrdir}/ug
 
 Name:       isf
 Summary:    Input Service Framework
-Version:    2.3.5710
+Version:    2.3.5712
 Release:    2
 Group:      TO_BE/FILLED_IN
 License:    LGPL
index af32904..f188db3 100644 (file)
@@ -1,7 +1,13 @@
+ISF 2.3.5712 :
+  1. [isf-panel-efl] Hide "v" button when only one line candidates
+  2. [isf-setting-efl] Add padding at bottom
+
+
 ISF 2.3.5707 :
   1. [isf-panel-efl] Fix input panel geometry defect when target is rotating
   2. Add notification of which keyboard ISE is selected by hotkey
 
+
 ISF 2.3.5706 :
   1. [immodule] add cursor position in Ise_Context structure
   2. [immodule] disable prediction in TERMINAL layout