[gnome-builder/wip/chergert/completion] html: add some icons to completion
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/completion] html: add some icons to completion
- Date: Wed, 6 Jun 2018 04:49:33 +0000 (UTC)
commit d4ea015a43fc40d049684a2f8ab946ce97f9eedd
Author: Christian Hergert <chergert redhat com>
Date: Tue Jun 5 21:48:59 2018 -0700
html: add some icons to completion
.../html-completion/ide-html-completion-provider.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/html-completion/ide-html-completion-provider.c
b/src/plugins/html-completion/ide-html-completion-provider.c
index d3bc98b81..c8a229308 100644
--- a/src/plugins/html-completion/ide-html-completion-provider.c
+++ b/src/plugins/html-completion/ide-html-completion-provider.c
@@ -414,6 +414,7 @@ ide_html_completion_provider_display_proposal (IdeCompletionProvider *provider
{
g_autofree gchar *markup = NULL;
const gchar *word;
+ IdeHtmlProposalKind kind;
g_assert (IDE_IS_HTML_COMPLETION_PROVIDER (provider));
g_assert (IDE_IS_COMPLETION_LIST_BOX_ROW (row));
@@ -422,8 +423,25 @@ ide_html_completion_provider_display_proposal (IdeCompletionProvider *provider
word = ide_html_proposal_get_word (IDE_HTML_PROPOSAL (proposal));
markup = ide_completion_item_fuzzy_highlight (word, typed_text);
+ kind = ide_html_proposal_get_kind (IDE_HTML_PROPOSAL (proposal));
+
+ switch (kind)
+ {
+ case IDE_HTML_PROPOSAL_CSS_PROPERTY:
+ /* probably could use something css specific */
+ ide_completion_list_box_row_set_icon_name (row, "ui-property-symbolic");
+ break;
+
+ case IDE_HTML_PROPOSAL_ELEMENT_START:
+ case IDE_HTML_PROPOSAL_ELEMENT_END:
+ case IDE_HTML_PROPOSAL_ATTRIBUTE_NAME:
+ case IDE_HTML_PROPOSAL_ATTRIBUTE_VALUE:
+ case IDE_HTML_PROPOSAL_NONE:
+ default:
+ ide_completion_list_box_row_set_icon_name (row, NULL);
+ break;
+ }
- ide_completion_list_box_row_set_icon_name (row, NULL);
ide_completion_list_box_row_set_left (row, NULL);
ide_completion_list_box_row_set_right (row, NULL);
ide_completion_list_box_row_set_center_markup (row, markup);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]