[gtksourceview] css: avoid drawing background on "textview text" selector
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] css: avoid drawing background on "textview text" selector
- Date: Fri, 11 Feb 2022 23:35:16 +0000 (UTC)
commit a2aee5aee857c93642df91cd2670f6797c6212a7
Author: Christian Hergert <chergert redhat com>
Date: Fri Feb 11 15:35:11 2022 -0800
css: avoid drawing background on "textview text" selector
This can cause extra large drawing to occur in situations that we can
avoid. There are still others we need to improve on, but this is
definitely a start.
gtksourceview/GtkSourceView.css | 5 +++++
gtksourceview/gtksourceview.c | 2 ++
2 files changed, 7 insertions(+)
---
diff --git a/gtksourceview/GtkSourceView.css b/gtksourceview/GtkSourceView.css
index e049364c..f0094e93 100644
--- a/gtksourceview/GtkSourceView.css
+++ b/gtksourceview/GtkSourceView.css
@@ -167,6 +167,11 @@ GtkSourceStyleSchemePreview.selected image {
margin: 6px;
}
+/* Ensure we don't double draw backgrounds */
+textview.GtkSourceView text {
+ background: transparent;
+}
+
textview.GtkSourceMap {
font-size: 1.75pt;
line-height: 4px;
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index ed55e1ef..4789a016 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -1410,6 +1410,8 @@ gtk_source_view_init (GtkSourceView *view)
GtkEventController *key;
GtkDropTarget *dest;
+ gtk_widget_add_css_class (GTK_WIDGET (view), "GtkSourceView");
+
priv->tab_width = DEFAULT_TAB_WIDTH;
priv->tabs_set = FALSE;
priv->indent_width = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]