[gtksourceview/wip/chergert/gsv-gtk4] tests: add icons to display rows
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/gsv-gtk4] tests: add icons to display rows
- Date: Sun, 30 Aug 2020 21:44:56 +0000 (UTC)
commit f8128cb9169302dd5d463cb68a3df3e1165dc311
Author: Christian Hergert <chergert redhat com>
Date: Sun Aug 30 14:44:50 2020 -0700
tests: add icons to display rows
tests/test-completion.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-completion.c b/tests/test-completion.c
index 7ea2fa674..2cf3c7fc1 100644
--- a/tests/test-completion.c
+++ b/tests/test-completion.c
@@ -197,16 +197,28 @@ test_provider_display (GtkSourceCompletionProvider *provider,
if (TEST_IS_PROPOSAL (proposal))
{
TestProposal *p = TEST_PROPOSAL (proposal);
+ GtkSourceCompletionColumn column;
- if (gtk_source_completion_cell_get_column (cell) == GTK_SOURCE_COMPLETION_COLUMN_TYPED_TEXT)
+ column = gtk_source_completion_cell_get_column (cell);
+
+ if (column == GTK_SOURCE_COMPLETION_COLUMN_TYPED_TEXT)
{
if (p->markup)
gtk_source_completion_cell_set_markup (cell, p->markup);
else if (p->label)
gtk_source_completion_cell_set_text (cell, p->label);
- else if (p->text)
+ else
gtk_source_completion_cell_set_text (cell, p->text);
}
+ else if (column == GTK_SOURCE_COMPLETION_COLUMN_ICON)
+ {
+ if (p->icon_name)
+ gtk_source_completion_cell_set_icon_name (cell, p->icon_name);
+ else if (p->gicon)
+ gtk_source_completion_cell_set_gicon (cell, p->gicon);
+ else
+ gtk_source_completion_cell_set_icon_name (cell, NULL);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]