[gnome-themes-standard] pane-separator: render the pane separator grip with an SVG asset



commit de6fae75b3047866e835b0ada84373e44c32adc1
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 15 22:08:18 2012 -0400

    pane-separator: render the pane separator grip with an SVG asset
    
    Use a background layer instead of C code for it.

 src/adwaita_engine.c                               |   58 -----------
 themes/Adwaita/gtk-3.0/assets/Makefile.am          |    2 +
 .../assets/pane-separator-grip-vertical.svg        |  107 ++++++++++++++++++++
 .../Adwaita/gtk-3.0/assets/pane-separator-grip.svg |  107 ++++++++++++++++++++
 themes/Adwaita/gtk-3.0/gtk-widgets.css             |   10 ++-
 themes/Adwaita/gtk-3.0/gtk.gresource.xml           |    2 +
 6 files changed, 226 insertions(+), 60 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index 0149a5a..2b5dabe 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -459,63 +459,6 @@ adwaita_engine_render_activity (GtkThemingEngine *engine,
 }
 
 static void
-adwaita_engine_render_handle (GtkThemingEngine *engine,
-                              cairo_t          *cr,
-                              gdouble           x,
-                              gdouble           y,
-                              gdouble           width,
-                              gdouble           height)
-{
-  if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PANE_SEPARATOR))
-    {
-      GdkRGBA fg;
-      GtkStateFlags state;
-      gdouble xx, yy;
-
-      state = gtk_theming_engine_get_state (engine);
-      gtk_theming_engine_get_color (engine, state, &fg);
-
-      GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_background
-        (engine, cr, x, y, width, height);
-      GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_frame
-        (engine, cr, x, y, width, height);
-
-      cairo_save (cr);
-      cairo_set_line_width (cr, 2.0);
-      gdk_cairo_set_source_rgba (cr, &fg);
-
-      if (width > height)
-        {
-          for (xx = x + width / 2 - 12; xx <= x + width / 2 + 12; xx += 6)
-            {
-              cairo_arc (cr, xx, y + height / 2.0,
-                         1.0,
-                         0, G_PI * 2.0);
-              cairo_fill (cr);
-            }
-        }
-      else
-        {
-          for (yy = y + height / 2 - 12; yy <= y + height / 2 + 12; yy += 6)
-            {
-              cairo_arc (cr, x + width / 2.0, yy,
-                         1.0,
-                         0, G_PI * 2.0);
-              cairo_fill (cr);
-            }
-        }
-
-      cairo_restore (cr);
-    }
-  else
-    {
-      GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_handle
-        (engine, cr,
-         x, y, width, height);
-    }
-}
-
-static void
 adwaita_engine_class_init (AdwaitaEngineClass *klass)
 {
   GtkThemingEngineClass *engine_class = GTK_THEMING_ENGINE_CLASS (klass);
@@ -527,7 +470,6 @@ adwaita_engine_class_init (AdwaitaEngineClass *klass)
   engine_class->render_background = adwaita_engine_render_background;
   engine_class->render_expander = adwaita_engine_render_expander;
   engine_class->render_activity = adwaita_engine_render_activity;
-  engine_class->render_handle = adwaita_engine_render_handle;
 
   gtk_theming_engine_register_property (ADWAITA_NAMESPACE, NULL,
                                         g_param_spec_boxed ("focus-border-color",
diff --git a/themes/Adwaita/gtk-3.0/assets/Makefile.am b/themes/Adwaita/gtk-3.0/assets/Makefile.am
index 6f2a76e..6ada3e5 100644
--- a/themes/Adwaita/gtk-3.0/assets/Makefile.am
+++ b/themes/Adwaita/gtk-3.0/assets/Makefile.am
@@ -47,6 +47,8 @@ EXTRA_DIST = 		\
 	menuitem-radio-checked.png \
 	menuitem-radio-checked-insensitive.png \
 	menuitem-radio-checked-selected.png \
+	pane-separator-grip.svg \
+	pane-separator-grip-vertical.svg \
 	radio-checked.png \
 	radio-checked-alt.png \
 	radio-checked-alt-dark.png \
diff --git a/themes/Adwaita/gtk-3.0/assets/pane-separator-grip-vertical.svg b/themes/Adwaita/gtk-3.0/assets/pane-separator-grip-vertical.svg
new file mode 100644
index 0000000..9d1190c
--- /dev/null
+++ b/themes/Adwaita/gtk-3.0/assets/pane-separator-grip-vertical.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="24"
+   height="2"
+   id="svg32934"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="pane-separator-grip-vertical.svg">
+  <defs
+     id="defs32936" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="8"
+     inkscape:cx="-24.023431"
+     inkscape:cy="12.438041"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1280"
+     inkscape:window-height="741"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata32939">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     transform="translate(0,-14)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       id="path5824"
+       sodipodi:cx="868.63647"
+       sodipodi:cy="617.14966"
+       sodipodi:rx="1.9003495"
+       sodipodi:ry="1.9003495"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       transform="matrix(-0.52621972,0,0,-0.52621861,469.09367,339.75564)" />
+    <path
+       transform="matrix(-0.52621972,0,0,-0.52621861,474.59365,339.75564)"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       sodipodi:ry="1.9003495"
+       sodipodi:rx="1.9003495"
+       sodipodi:cy="617.14966"
+       sodipodi:cx="868.63647"
+       id="path5828"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       id="path5830"
+       sodipodi:cx="868.63647"
+       sodipodi:cy="617.14966"
+       sodipodi:rx="1.9003495"
+       sodipodi:ry="1.9003495"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       transform="matrix(-0.52621972,0,0,-0.52621861,480.09364,339.75564)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       id="path5824-3"
+       sodipodi:cx="868.63647"
+       sodipodi:cy="617.14966"
+       sodipodi:rx="1.9003495"
+       sodipodi:ry="1.9003495"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       transform="matrix(-0.52621972,0,0,-0.52621861,458.09369,339.75564)" />
+    <path
+       transform="matrix(-0.52621972,0,0,-0.52621861,463.59368,339.75564)"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       sodipodi:ry="1.9003495"
+       sodipodi:rx="1.9003495"
+       sodipodi:cy="617.14966"
+       sodipodi:cx="868.63647"
+       id="path5828-7"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       sodipodi:type="arc" />
+  </g>
+</svg>
diff --git a/themes/Adwaita/gtk-3.0/assets/pane-separator-grip.svg b/themes/Adwaita/gtk-3.0/assets/pane-separator-grip.svg
new file mode 100644
index 0000000..e2fa9be
--- /dev/null
+++ b/themes/Adwaita/gtk-3.0/assets/pane-separator-grip.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="2"
+   height="24"
+   id="svg32934"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="pane-separator-grip.svg">
+  <defs
+     id="defs32936" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.313708"
+     inkscape:cx="-31.057447"
+     inkscape:cy="11.379732"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1280"
+     inkscape:window-height="741"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata32939">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     transform="translate(0,8)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       id="path5824"
+       sodipodi:cx="868.63647"
+       sodipodi:cy="617.14966"
+       sodipodi:rx="1.9003495"
+       sodipodi:ry="1.9003495"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       transform="matrix(0.52621899,0,0,0.52621789,-456.09301,-320.75518)" />
+    <path
+       transform="matrix(0.52621899,0,0,0.52621789,-456.09301,-326.25519)"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       sodipodi:ry="1.9003495"
+       sodipodi:rx="1.9003495"
+       sodipodi:cy="617.14966"
+       sodipodi:cx="868.63647"
+       id="path5828"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       sodipodi:type="arc" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       id="path5830"
+       sodipodi:cx="868.63647"
+       sodipodi:cy="617.14966"
+       sodipodi:rx="1.9003495"
+       sodipodi:ry="1.9003495"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       transform="matrix(0.52621899,0,0,0.52621789,-456.09301,-331.75519)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       id="path5824-3"
+       sodipodi:cx="868.63647"
+       sodipodi:cy="617.14966"
+       sodipodi:rx="1.9003495"
+       sodipodi:ry="1.9003495"
+       d="m 870.53682,617.14966 c 0,1.04953 -0.85081,1.90035 -1.90035,1.90035 -1.04953,0 -1.90034,-0.85082 -1.90034,-1.90035 0,-1.04954 0.85081,-1.90035 1.90034,-1.90035 1.04954,0 1.90035,0.85081 1.90035,1.90035 z"
+       transform="matrix(0.52621899,0,0,0.52621789,-456.09301,-309.75517)" />
+    <path
+       transform="matrix(0.52621899,0,0,0.52621789,-456.09301,-315.25518)"
+       d="m 870.53682,617.14966 a 1.9003495,1.9003495 0 1 1 -3.80069,0 1.9003495,1.9003495 0 1 1 3.80069,0 z"
+       sodipodi:ry="1.9003495"
+       sodipodi:rx="1.9003495"
+       sodipodi:cy="617.14966"
+       sodipodi:cx="868.63647"
+       id="path5828-7"
+       style="fill:#babdb6;fill-opacity:1;stroke:none;display:inline;enable-background:new"
+       sodipodi:type="arc" />
+  </g>
+</svg>
diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets.css b/themes/Adwaita/gtk-3.0/gtk-widgets.css
index db24862..a9d8cbd 100644
--- a/themes/Adwaita/gtk-3.0/gtk-widgets.css
+++ b/themes/Adwaita/gtk-3.0/gtk-widgets.css
@@ -224,9 +224,15 @@ GtkTreeView.separator:backdrop,
     color: @theme_text_color;
 }
 
-.pane-separator,
-.pane-separator:hover {
+.pane-separator {
     background-color: @theme_bg_color;
+    background-repeat: no-repeat;
+    background-position: center;
+    background-image: url("assets/pane-separator-grip.svg");
+}
+
+.pane-separator.vertical {
+    background-image: url("assets/pane-separator-grip-vertical.svg");
 }
 
 .pane-separator:backdrop,
diff --git a/themes/Adwaita/gtk-3.0/gtk.gresource.xml b/themes/Adwaita/gtk-3.0/gtk.gresource.xml
index 6d7b1bc..121a62e 100644
--- a/themes/Adwaita/gtk-3.0/gtk.gresource.xml
+++ b/themes/Adwaita/gtk-3.0/gtk.gresource.xml
@@ -49,6 +49,8 @@
     <file preprocess="to-pixdata">assets/menuitem-radio-checked-insensitive.png</file>
     <file preprocess="to-pixdata">assets/menuitem-radio-checked.png</file>
     <file preprocess="to-pixdata">assets/menuitem-radio-checked-selected.png</file>
+    <file preprocess="to-pixdata">assets/pane-separator-grip.svg</file>
+    <file preprocess="to-pixdata">assets/pane-separator-grip-vertical.svg</file>
     <file preprocess="to-pixdata">assets/radio-checked-alt-dark.png</file>
     <file preprocess="to-pixdata">assets/radio-checked-alt.png</file>
     <file preprocess="to-pixdata">assets/radio-checked-backdrop-dark.png</file>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]