From 57f66dc7b33ea8da75fa6b384ebe38e21541a4e8 Mon Sep 17 00:00:00 2001
From: Megax <megax@yeahunter.hu>
Date: Wed, 11 May 2016 10:26:58 +0200
Subject: [PATCH] * Implement vertical linked button code.

---
 gtk-3.20/scss/widgets/_button.scss | 113 +++++++++++++++++++++++++++--
 1 file changed, 108 insertions(+), 5 deletions(-)

diff --git a/gtk-3.20/scss/widgets/_button.scss b/gtk-3.20/scss/widgets/_button.scss
index 6afc675..e6e65ab 100755
--- a/gtk-3.20/scss/widgets/_button.scss
+++ b/gtk-3.20/scss/widgets/_button.scss
@@ -27,8 +27,7 @@
 
         @if $variant == 'light' {
             background-position: right 3px, right 4px;
-        }
-        @else {
+        } @else {
             background-position: right 3px, right 2px;
         }
 
@@ -37,8 +36,7 @@
         &:dir(rtl) {
             @if $variant == 'light' {
                 background-position: left 3px, left 4px;
-            }
-            @else {
+            } @else {
                 background-position: left 3px, left 2px;
             }
         }
@@ -72,6 +70,18 @@
         }
     }
 
+    %linked_vertical_middle {
+        border-radius: 0;
+        border-top-style: none;
+        border-bottom-style: solid;
+
+        &:dir(rtl) {
+            border-radius: 0; // needed when including %linked_vertical_middle:dir(rtl)
+            border-top-style: none;
+            border-bottom-style: solid;
+        }
+    }
+
     %linked_button {
         border-width: 1px;
         border-style: solid;
@@ -116,6 +126,51 @@
             border-radius: $roundness;
         }
     }
+
+    %linked_vertical_button {
+        border-width: 1px;
+        border-style: solid;
+        border-radius: 0;
+        border-top-style: none;
+        border-bottom-style: none;
+
+        &:first-child {
+            border-width: 1px;
+            border-radius: $roundness;
+            border-top-style: solid;
+            border-bottom-style: none;
+            border-bottom-left-radius: 0;
+            border-bottom-right-radius: 0;
+
+            &:dir(rtl) {
+                border-top-style: none;
+                border-bottom-style: solid;
+            }
+        }
+
+        &:last-child {
+            border-width: 1px;
+            border-radius: $roundness;
+            border-top-style: none;
+            border-bottom-style: solid;
+            border-top-left-radius: 0;
+            border-top-right-radius: 0;
+
+            &:dir(rtl) {
+                border-top-style: solid;
+                border-bottom-style: none;
+            }
+        }
+
+        &:only-child, &:first-child:only-child {
+            border-width: 1px;
+            border-style: solid;
+        }
+
+        &:only-child {
+            border-radius: $roundness;
+        }
+    }
 }
 
 @mixin linked_button($bg) {
@@ -165,6 +220,53 @@
     }
 }
 
+@mixin linked_vertical_button($bg) {
+    $border_strength: if(lightness($bg) > 50, 0, .1);
+    $shadow_strength: if(lightness($bg) > 50, 0, .1);
+
+    @extend %linked_vertical_button;
+
+    box-shadow: inset 0 -1px border_normal(rgba(0, 0, 0, .12 + $border_strength)),
+    0 1px 2px -1px alpha($dark_shadow, .12 + $shadow_strength);
+
+    &:focus, &:hover {
+        box-shadow: inset 0 -1px border_focus(rgba(0, 0, 0, .12 + $border_strength)),
+        0 1px 2px -1px alpha($dark_shadow, .32 + $shadow_strength);
+    }
+
+    &:active, &:active:hover,
+    &:active:focus, &:active:hover:focus,
+    &:checked, &:checked:hover,
+    &:checked:focus, &:checked:hover:focus {
+        box-shadow: inset 0 -1px border_active(rgba(0, 0, 0, .12 + $border_strength)),
+        inset 1px 0 alpha($dark_shadow, .07),
+        inset -1px 0 alpha($dark_shadow, .05);
+    }
+
+    &:disabled { box-shadow: inset 0 -1px shade($bg, .8); }
+
+    &:last-child, &:only-child { box-shadow: 0 1px 2px -1px alpha($dark_shadow, .12 + $shadow_strength); }
+
+    &:last-child:hover, &:only-child:hover { box-shadow: 0 1px 2px -1px alpha($dark_shadow, .32 + $shadow_strength); }
+
+    &:disabled:last-child, &:disabled:only-child,
+    &:active:disabled:last-child, &:active:disabled:only-child,
+    &:checked:disabled:last-child, &:checked:disabled:only-child { box-shadow: none; }
+
+    &:active:last-child, &:active:last-child:focus, &:active:last-child:hover, &:active:last-child:hover:focus,
+    &:checked:last-child, &:checked:last-child:focus, &:checked:last-child:hover, &:checked:last-child:hover:focus {
+        box-shadow: inset 0 1px alpha($dark_shadow, .07),
+        inset -1px 0 alpha($dark_shadow, .06);
+    }
+
+    &:active:only-child, &:active:only-child:focus, &:active:only-child:hover, &:active:only-child:hover:focus,
+    &:checked:only-child, &:checked:only-child:focus, &:checked:only-child:hover, &:checked:only-child:hover:focus {
+        box-shadow: inset 1px 0 alpha($dark_shadow, .06),
+        inset 0 1px alpha($dark_shadow, .07),
+        inset -1px 0 alpha($dark_shadow, .06);
+    }
+}
+
 @mixin button($bg, $fg) {
     $border_strength: if(lightness($bg) > 50, 0, .1);
     $shadow_strength: if(lightness($bg) > 50, 0, .1);
@@ -239,7 +341,6 @@
 }
 
 @include exports("button") {
-
     %close_button {
         border: 1px solid transparent;
         background-color: transparent;
@@ -268,6 +369,8 @@
 
         &.linked, .linked & { @include linked_button(shade($bg_color, 1.2)); }
 
+        &.linked.vertical, .linked.vertical & { @include linked_vertical_button(shade($bg_color, 1.2)); }
+
         spinbutton & {
             color: mix($text_color, $base_color, .4);
             padding: $spacing ($spacing * 2);