From 4acbb13f8ca9ab4f6851f3602725783220d6b690 Mon Sep 17 00:00:00 2001
From: Daniel Boles <dboles@src.gnome.org>
Date: Sat, 7 Oct 2017 01:27:05 +0100
Subject: [PATCH] HV: Avoid accidental huge separator in GEdit, etc.

It was selecting paned separator, which means any separator at any level
of descent within a paned, including the toplevel container in GEdit.

We need to be more specific and only select the relevant separator that
is the direct child of the paned. This is what Adwaita does.

https://bugzilla.gnome.org/show_bug.cgi?id=788573
---
 gtk/theme/HighContrast/_common.scss              | 17 +++++++++++------
 gtk/theme/HighContrast/gtk-contained-inverse.css | 14 +++++++-------
 gtk/theme/HighContrast/gtk-contained.css         | 14 +++++++-------
 3 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/gtk/theme/HighContrast/_common.scss b/gtk/theme/HighContrast/_common.scss
index 50b082afe6..8d22b73ed9 100644
--- a/gtk/theme/HighContrast/_common.scss
+++ b/gtk/theme/HighContrast/_common.scss
@@ -3088,30 +3088,35 @@ placesview {
 
 
 paned {
-  separator {
+  > separator {
     min-width: 1px;
     min-height: 1px;
     background-image: _solid($borders_color);
+
     &:backdrop {
       background-image: _solid($backdrop_borders_color);
     }
   }
-   &:dir(ltr).horizontal separator {
+
+  &:dir(ltr).horizontal > separator {
     margin: 0 -8px 0 0;
     padding: 0 8px 0 0;
   }
-  &:dir(rtl).horizontal separator {
+  &:dir(rtl).horizontal > separator {
     margin: 0 0 0 -8px;
     padding: 0 0 0 8px;
   }
-  &.vertical separator {
+
+  &.vertical > separator {
     margin: 0 0 -8px 0;
     padding: 0 0 8px 0;
   }
-  separator:selected {
+
+  > separator:selected {
     background-color: $selected_bg_color;
   }
-  separator.wide {
+
+  > separator.wide {
     min-width: 5px;
     min-height: 5px;
     background-color: transparent;
diff --git a/gtk/theme/HighContrast/gtk-contained-inverse.css b/gtk/theme/HighContrast/gtk-contained-inverse.css
index 66e196c492..3bb3b92abc 100644
--- a/gtk/theme/HighContrast/gtk-contained-inverse.css
+++ b/gtk/theme/HighContrast/gtk-contained-inverse.css
@@ -1371,19 +1371,19 @@ placesview .server-list-button:checked > image { transition: 200ms cubic-bezier(
 placesview row.activatable:hover { background-color: transparent; }
 
 /********* Paned * */
-paned separator { min-width: 1px; min-height: 1px; background-image: linear-gradient(to bottom, gray, gray); }
+paned > separator { min-width: 1px; min-height: 1px; background-image: linear-gradient(to bottom, gray, gray); }
 
-paned separator:backdrop { background-image: linear-gradient(to bottom, #737373, #737373); }
+paned > separator:backdrop { background-image: linear-gradient(to bottom, #737373, #737373); }
 
-paned:dir(ltr).horizontal separator { margin: 0 -8px 0 0; padding: 0 8px 0 0; }
+paned:dir(ltr).horizontal > separator { margin: 0 -8px 0 0; padding: 0 8px 0 0; }
 
-paned:dir(rtl).horizontal separator { margin: 0 0 0 -8px; padding: 0 0 0 8px; }
+paned:dir(rtl).horizontal > separator { margin: 0 0 0 -8px; padding: 0 0 0 8px; }
 
-paned.vertical separator { margin: 0 0 -8px 0; padding: 0 0 8px 0; }
+paned.vertical > separator { margin: 0 0 -8px 0; padding: 0 0 8px 0; }
 
-paned separator:selected { background-color: #ddd; }
+paned > separator:selected { background-color: #ddd; }
 
-paned separator.wide { min-width: 5px; min-height: 5px; background-color: transparent; border-style: none solid; border-color: gray; border-width: 1px; }
+paned > separator.wide { min-width: 5px; min-height: 5px; background-color: transparent; border-style: none solid; border-color: gray; border-width: 1px; }
 
 /************** GtkInfoBar * */
 infobar { border-width: 0; border-style: none; }
diff --git a/gtk/theme/HighContrast/gtk-contained.css b/gtk/theme/HighContrast/gtk-contained.css
index e818e27632..0b5b24a2bb 100644
--- a/gtk/theme/HighContrast/gtk-contained.css
+++ b/gtk/theme/HighContrast/gtk-contained.css
@@ -1377,19 +1377,19 @@ placesview .server-list-button:checked > image { transition: 200ms cubic-bezier(
 placesview row.activatable:hover { background-color: transparent; }
 
 /********* Paned * */
-paned separator { min-width: 1px; min-height: 1px; background-image: linear-gradient(to bottom, gray, gray); }
+paned > separator { min-width: 1px; min-height: 1px; background-image: linear-gradient(to bottom, gray, gray); }
 
-paned separator:backdrop { background-image: linear-gradient(to bottom, #8d8d8d, #8d8d8d); }
+paned > separator:backdrop { background-image: linear-gradient(to bottom, #8d8d8d, #8d8d8d); }
 
-paned:dir(ltr).horizontal separator { margin: 0 -8px 0 0; padding: 0 8px 0 0; }
+paned:dir(ltr).horizontal > separator { margin: 0 -8px 0 0; padding: 0 8px 0 0; }
 
-paned:dir(rtl).horizontal separator { margin: 0 0 0 -8px; padding: 0 0 0 8px; }
+paned:dir(rtl).horizontal > separator { margin: 0 0 0 -8px; padding: 0 0 0 8px; }
 
-paned.vertical separator { margin: 0 0 -8px 0; padding: 0 0 8px 0; }
+paned.vertical > separator { margin: 0 0 -8px 0; padding: 0 0 8px 0; }
 
-paned separator:selected { background-color: #000; }
+paned > separator:selected { background-color: #000; }
 
-paned separator.wide { min-width: 5px; min-height: 5px; background-color: transparent; border-style: none solid; border-color: gray; border-width: 1px; }
+paned > separator.wide { min-width: 5px; min-height: 5px; background-color: transparent; border-style: none solid; border-color: gray; border-width: 1px; }
 
 /************** GtkInfoBar * */
 infobar { border-width: 0; border-style: none; }
-- 
2.14.2