[gnome-builder] libide/sourceview: remove redundant enable-search-bubbles css code
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/sourceview: remove redundant enable-search-bubbles css code
- Date: Fri, 14 Oct 2022 17:38:14 +0000 (UTC)
commit 7350f41ebab221ad02d20accf4b870a1360482da
Author: Colin Kinloch <colin kinloch collabora com>
Date: Thu Oct 13 23:14:20 2022 +0100
libide/sourceview: remove redundant enable-search-bubbles css code
Signed-off-by: Colin Kinloch <colin kinloch collabora com>
src/libide/sourceview/ide-source-view-private.h | 3 +--
src/libide/sourceview/ide-source-view.c | 11 ++++-------
src/plugins/editorui/gbp-editorui-preview.c | 4 +---
3 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view-private.h b/src/libide/sourceview/ide-source-view-private.h
index 91711bfbb..5d1903cfb 100644
--- a/src/libide/sourceview/ide-source-view-private.h
+++ b/src/libide/sourceview/ide-source-view-private.h
@@ -94,8 +94,7 @@ void _ide_source_view_addins_set_language (IdeSourceView *self,
char *_ide_source_view_generate_css (GtkSourceView *view,
const PangoFontDescription *font_desc,
int font_scale,
- double line_height,
- gboolean enable_search_bubbles);
+ double line_height);
void _ide_source_view_set_search_context (IdeSourceView *self,
GtkSourceSearchContext *search_context);
diff --git a/src/libide/sourceview/ide-source-view.c b/src/libide/sourceview/ide-source-view.c
index 5728a515e..920e7a70e 100644
--- a/src/libide/sourceview/ide-source-view.c
+++ b/src/libide/sourceview/ide-source-view.c
@@ -74,8 +74,7 @@ char *
_ide_source_view_generate_css (GtkSourceView *view,
const PangoFontDescription *font_desc,
int font_scale,
- double line_height,
- gboolean enable_search_bubbles)
+ double line_height)
{
g_autofree char *font_css = NULL;
PangoFontDescription *scaled = NULL;
@@ -93,8 +92,7 @@ _ide_source_view_generate_css (GtkSourceView *view,
/* Get information for search bubbles */
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
- if (enable_search_bubbles &&
- (scheme = gtk_source_buffer_get_style_scheme (GTK_SOURCE_BUFFER (buffer))) &&
+ if ((scheme = gtk_source_buffer_get_style_scheme (GTK_SOURCE_BUFFER (buffer))) &&
(style = gtk_source_style_scheme_get_style (scheme, "search-match")))
{
g_autofree char *background = NULL;
@@ -170,8 +168,7 @@ ide_source_view_update_css (IdeSourceView *self)
g_assert (IDE_IS_SOURCE_VIEW (self));
- if ((css = _ide_source_view_generate_css (GTK_SOURCE_VIEW (self), self->font_desc, self->font_scale,
- self->line_height, self->enable_search_bubbles)))
+ if ((css = _ide_source_view_generate_css (GTK_SOURCE_VIEW (self), self->font_desc, self->font_scale,
self->line_height)))
gtk_css_provider_load_from_data (self->css_provider, css, -1);
}
@@ -1941,7 +1938,7 @@ ide_source_view_set_enable_search_bubbles (IdeSourceView *self,
{
self->enable_search_bubbles = enable_search_bubbles;
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ENABLE_SEARCH_BUBBLES]);
- ide_source_view_update_css (self);
+ gtk_widget_queue_resize (GTK_WIDGET (self));
}
}
diff --git a/src/plugins/editorui/gbp-editorui-preview.c b/src/plugins/editorui/gbp-editorui-preview.c
index bcb88bc3a..9d20af06a 100644
--- a/src/plugins/editorui/gbp-editorui-preview.c
+++ b/src/plugins/editorui/gbp-editorui-preview.c
@@ -131,14 +131,12 @@ gbp_editorui_preview_settings_changed_cb (GbpEditoruiPreview *self,
g_autofree char *font_name = NULL;
PangoFontDescription *font_desc;
double line_height;
- gboolean enable_search_bubbles;
line_height = g_settings_get_double (settings, "line-height");
font_name = g_settings_get_string (settings, "font-name");
font_desc = pango_font_description_from_string (font_name);
- enable_search_bubbles = g_settings_get_boolean (settings, "enable-search-bubbles");
- if ((css = _ide_source_view_generate_css (GTK_SOURCE_VIEW (self), font_desc, 1, line_height,
enable_search_bubbles)))
+ if ((css = _ide_source_view_generate_css (GTK_SOURCE_VIEW (self), font_desc, 1, line_height)))
gtk_css_provider_load_from_data (self->css_provider, css, -1);
g_clear_pointer (&font_desc, pango_font_description_free);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]