[gtksourceview/wip/minimap] map: add FIXME comments
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/minimap] map: add FIXME comments
- Date: Wed, 6 May 2015 16:29:39 +0000 (UTC)
commit b261aa2e31b78c557ca2f5059c6bb86da4b221ed
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed May 6 18:28:43 2015 +0200
map: add FIXME comments
And changed a bit the code at one place.
gtksourceview/gtksourcemap.c | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index 10d39c4..8e97f49 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -71,6 +71,7 @@ gtk_source_map_rebuild_css (GtkSourceMap *map)
gchar *tmp;
tmp = _gtk_source_pango_font_description_to_css (priv->font_desc);
+ /* FIXME strange ternary */
css = g_strdup_printf ("GtkSourceView { %s }\n", tmp ?: "");
gtk_css_provider_load_from_data (priv->view_css_provider, css, -1, NULL);
g_free (css);
@@ -90,6 +91,11 @@ gtk_source_map_rebuild_css (GtkSourceMap *map)
gchar *background = NULL;
GtkSourceStyle *style;
+ /* FIXME hard to understand what the condition does with
+ * a quick glance. It's better to assign variables
+ * outside a condition, and replace "!style" with
+ * "style == NULL", it's clearer IMO.
+ */
if (!(style = gtk_source_style_scheme_get_style (style_scheme, "map-overlay")) &&
!(style = gtk_source_style_scheme_get_style (style_scheme, "selection")))
{
@@ -118,15 +124,19 @@ gtk_source_map_rebuild_css (GtkSourceMap *map)
gchar *css;
css = g_strdup_printf ("GtkSourceMap GtkEventBox {"
- "background-color: %s;"
- "opacity: 0.75;"
- "border-top: 1px solid shade(%s,0.9);"
- "border-bottom: 1px solid shade(%s,0.9);"
+ " background-color: %s;"
+ " opacity: 0.75;"
+ " border-top: 1px solid shade(%s,0.9);"
+ " border-bottom: 1px solid shade(%s,0.9);"
"}\n",
- background, background, background);
+ background,
+ background,
+ background);
+
gtk_css_provider_load_from_data (priv->box_css_provider, css, -1, NULL);
g_free (css);
}
+
g_free (background);
}
}
@@ -807,6 +817,9 @@ gtk_source_map_set_view (GtkSourceMap *map,
priv = gtk_source_map_get_instance_private (map);
+ /* FIXME with early returns it's possible to avoid the two indentation
+ * levels.
+ */
if (gtk_source_set_weak_pointer (&priv->view, view))
{
if (view != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]