summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-07-28 02:22:37 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-07-28 02:22:37 +0000
commitfd1a3be560bd4cac06cde9e4b257d049f784d201 (patch)
tree6873cbfe81d427b057007b15d29c9180c86713af
parentb5de44b9fe696f209edfe7fe5aa474919f7ecd52 (diff)
properly set tooltip freesizing when object has not been realized in genlist/gengrid
SVN revision: 61834
-rw-r--r--src/lib/elm_gengrid.c10
-rw-r--r--src/lib/elm_genlist.c10
2 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index d80585b45..a8dcd7e56 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -40,6 +40,7 @@
40 Elm_Tooltip_Item_Content_Cb content_cb; 40 Elm_Tooltip_Item_Content_Cb content_cb;
41 Evas_Smart_Cb del_cb; 41 Evas_Smart_Cb del_cb;
42 const char *style; 42 const char *style;
43 Eina_Bool free_size : 1;
43 } tooltip; 44 } tooltip;
44 45
45 const char *mouse_cursor; 46 const char *mouse_cursor;
@@ -1003,6 +1004,7 @@ _item_realize(Elm_Gengrid_Item *item)
1003 item->tooltip.content_cb, 1004 item->tooltip.content_cb,
1004 item->tooltip.data, NULL); 1005 item->tooltip.data, NULL);
1005 elm_widget_item_tooltip_style_set(item, item->tooltip.style); 1006 elm_widget_item_tooltip_style_set(item, item->tooltip.style);
1007 elm_widget_item_tooltip_size_restrict_disable(item, item->tooltip.free_size);
1006 } 1008 }
1007 1009
1008 if (item->mouse_cursor) 1010 if (item->mouse_cursor)
@@ -2196,6 +2198,7 @@ elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *item,
2196 item->tooltip.content_cb, 2198 item->tooltip.content_cb,
2197 item->tooltip.data, NULL); 2199 item->tooltip.data, NULL);
2198 elm_widget_item_tooltip_style_set(item, item->tooltip.style); 2200 elm_widget_item_tooltip_style_set(item, item->tooltip.style);
2201 elm_widget_item_tooltip_size_restrict_disable(item, item->tooltip.free_size);
2199 } 2202 }
2200 2203
2201 return; 2204 return;
@@ -2216,6 +2219,7 @@ elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *item)
2216 item->tooltip.del_cb = NULL; 2219 item->tooltip.del_cb = NULL;
2217 item->tooltip.content_cb = NULL; 2220 item->tooltip.content_cb = NULL;
2218 item->tooltip.data = NULL; 2221 item->tooltip.data = NULL;
2222 item->tooltip.free_size = EINA_FALSE;
2219 if (item->tooltip.style) 2223 if (item->tooltip.style)
2220 elm_gengrid_item_tooltip_style_set(item, NULL); 2224 elm_gengrid_item_tooltip_style_set(item, NULL);
2221} 2225}
@@ -2240,14 +2244,16 @@ EAPI Eina_Bool
2240elm_gengrid_item_tooltip_size_restrict_disable(Elm_Gengrid_Item *item, Eina_Bool disable) 2244elm_gengrid_item_tooltip_size_restrict_disable(Elm_Gengrid_Item *item, Eina_Bool disable)
2241{ 2245{
2242 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); 2246 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
2243 return elm_widget_item_tooltip_size_restrict_disable(item, disable); 2247 item->tooltip.free_size = disable;
2248 if (item->base.view) return elm_widget_item_tooltip_size_restrict_disable(item, disable);
2249 return EINA_TRUE;
2244} 2250}
2245 2251
2246EAPI Eina_Bool 2252EAPI Eina_Bool
2247elm_gengrid_item_tooltip_size_restrict_disabled_get(const Elm_Gengrid_Item *item) 2253elm_gengrid_item_tooltip_size_restrict_disabled_get(const Elm_Gengrid_Item *item)
2248{ 2254{
2249 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); 2255 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
2250 return elm_widget_item_tooltip_size_restrict_disabled_get(item); 2256 return item->tooltip.free_size;
2251} 2257}
2252 2258
2253EAPI void 2259EAPI void
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index e06f046a3..3b8ef4d89 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -122,6 +122,7 @@ struct _Elm_Genlist_Item
122 Elm_Tooltip_Item_Content_Cb content_cb; 122 Elm_Tooltip_Item_Content_Cb content_cb;
123 Evas_Smart_Cb del_cb; 123 Evas_Smart_Cb del_cb;
124 const char *style; 124 const char *style;
125 Eina_Bool free_size : 1;
125 } tooltip; 126 } tooltip;
126 127
127 const char *mouse_cursor; 128 const char *mouse_cursor;
@@ -1927,6 +1928,7 @@ _item_realize(Elm_Genlist_Item *it,
1927 it->tooltip.content_cb, 1928 it->tooltip.content_cb,
1928 it->tooltip.data, NULL); 1929 it->tooltip.data, NULL);
1929 elm_widget_item_tooltip_style_set(it, it->tooltip.style); 1930 elm_widget_item_tooltip_style_set(it, it->tooltip.style);
1931 elm_widget_item_tooltip_size_restrict_disable(it, it->tooltip.free_size);
1930 } 1932 }
1931 1933
1932 if (it->mouse_cursor) 1934 if (it->mouse_cursor)
@@ -4722,6 +4724,7 @@ elm_genlist_item_tooltip_content_cb_set(Elm_Genlist_Item *item,
4722 item->tooltip.content_cb, 4724 item->tooltip.content_cb,
4723 item->tooltip.data, NULL); 4725 item->tooltip.data, NULL);
4724 elm_widget_item_tooltip_style_set(item, item->tooltip.style); 4726 elm_widget_item_tooltip_style_set(item, item->tooltip.style);
4727 elm_widget_item_tooltip_size_restrict_disable(item, item->tooltip.free_size);
4725 } 4728 }
4726 4729
4727 return; 4730 return;
@@ -4755,6 +4758,7 @@ elm_genlist_item_tooltip_unset(Elm_Genlist_Item *item)
4755 item->tooltip.del_cb = NULL; 4758 item->tooltip.del_cb = NULL;
4756 item->tooltip.content_cb = NULL; 4759 item->tooltip.content_cb = NULL;
4757 item->tooltip.data = NULL; 4760 item->tooltip.data = NULL;
4761 item->tooltip.free_size = EINA_FALSE;
4758 if (item->tooltip.style) 4762 if (item->tooltip.style)
4759 elm_genlist_item_tooltip_style_set(item, NULL); 4763 elm_genlist_item_tooltip_style_set(item, NULL);
4760} 4764}
@@ -4800,14 +4804,16 @@ EAPI Eina_Bool
4800elm_genlist_item_tooltip_size_restrict_disable(Elm_Genlist_Item *item, Eina_Bool disable) 4804elm_genlist_item_tooltip_size_restrict_disable(Elm_Genlist_Item *item, Eina_Bool disable)
4801{ 4805{
4802 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); 4806 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
4803 return elm_widget_item_tooltip_size_restrict_disable(item, disable); 4807 item->tooltip.free_size = disable;
4808 if (item->base.view) return elm_widget_item_tooltip_size_restrict_disable(item, disable);
4809 return EINA_TRUE;
4804} 4810}
4805 4811
4806EAPI Eina_Bool 4812EAPI Eina_Bool
4807elm_genlist_item_tooltip_size_restrict_disabled_get(const Elm_Genlist_Item *item) 4813elm_genlist_item_tooltip_size_restrict_disabled_get(const Elm_Genlist_Item *item)
4808{ 4814{
4809 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); 4815 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
4810 return elm_widget_item_tooltip_size_restrict_disabled_get(item); 4816 return item->tooltip.free_size;
4811} 4817}
4812 4818
4813/** 4819/**