Implement strike-through support for wxDataViewCtrl in wxGTK too

Previously it was supported in the generic version only, see #18180 and
the changes of 09124932eb

Closes https://github.com/wxWidgets/wxWidgets/pull/892
This commit is contained in:
Igor Korot
2018-08-19 12:04:04 +02:00
committed by Vadim Zeitlin
parent 617a15d418
commit 36d21ce6c8
3 changed files with 19 additions and 2 deletions

View File

@@ -110,7 +110,7 @@ All (GUI):
- Fix possible infinite loop in wxHtmlWindow layout (trivia21). - Fix possible infinite loop in wxHtmlWindow layout (trivia21).
- Add "hint" property support to XRC for wxComboBox and wxSearchCtrl. - Add "hint" property support to XRC for wxComboBox and wxSearchCtrl.
- Add support for style="page-break-inside:avoid" to <div> in wxHTML. - Add support for style="page-break-inside:avoid" to <div> in wxHTML.
- Add strike-through support to wxDataViewItem attributes (approach). - Support strike-through in wxDataViewItem attributes (approach, Igor Korot).
wxGTK: wxGTK:

View File

@@ -718,7 +718,7 @@ public:
text. text.
Currently this attribute is only supported in the generic version of Currently this attribute is only supported in the generic version of
wxDataViewCtrl and ignored by the native GTK+ and OS X implementations. wxDataViewCtrl and GTK and ignored by the native OS X implementations.
@since 3.1.2 @since 3.1.2
*/ */

View File

@@ -2275,6 +2275,23 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr)
g_value_unset( &gvalue ); g_value_unset( &gvalue );
} }
if (attr.GetStrikethrough())
{
GValue gvalue = G_VALUE_INIT;
g_value_init( &gvalue, G_TYPE_BOOLEAN );
g_value_set_boolean( &gvalue, TRUE );
g_object_set_property( G_OBJECT(renderer), "strikethrough", &gvalue );
g_value_unset( &gvalue );
}
else
{
GValue gvalue = G_VALUE_INIT;
g_value_init( &gvalue, G_TYPE_BOOLEAN );
g_value_set_boolean( &gvalue, FALSE );
g_object_set_property( G_OBJECT(renderer), "strikethrough-set", &gvalue );
g_value_unset( &gvalue );
}
if (attr.HasBackgroundColour()) if (attr.HasBackgroundColour())
{ {
GValue gvalue = G_VALUE_INIT; GValue gvalue = G_VALUE_INIT;