From 479582fea38e77e6b39a9f04e5eccfc37c15162e Mon Sep 17 00:00:00 2001 From: Simon Ochsenreither Date: Wed, 12 Sep 2018 23:56:49 +0200 Subject: [PATCH 1/2] Prevent tab borders from colliding with containing widget if show_border = false (Fixes #228) The core idea of show_border = false is to get rid of the border around the widget and set the margins to zero to visually embed the widget directly inside the containing widget, without introducing additional borders. To facilitate such design choices by applications, Greybird's tabs need to be slightly moved to the right to prevent them from colliding with the containing widget's borders. A screenshot of how this looks in Greybird and other themes is supplied in #228. --- gtk-3.0/_common.scss | 9 +++++++++ gtk-3.0/gtk-contained-dark.css | 6 ++++++ gtk-3.0/gtk-contained.css | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/gtk-3.0/_common.scss b/gtk-3.0/_common.scss index 36ade907..ca27fd7e 100644 --- a/gtk-3.0/_common.scss +++ b/gtk-3.0/_common.scss @@ -2039,6 +2039,8 @@ notebook { &.frame { border-style: none; + > header { margin-left: 0; } + > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks border: 1px solid shade($bg_color, 0.9); } @@ -2304,6 +2306,13 @@ notebook { } } + // if the notebook property show_border is set to false, the frame directly inside the notebook + // doesn't exist, so we define the tab margins, the background and backdrop colors here: + + > header { + margin-left: 6px; + } + > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks background-color: shade($bg_color, 1.05); border-width: 1px; diff --git a/gtk-3.0/gtk-contained-dark.css b/gtk-3.0/gtk-contained-dark.css index 93744434..d1b3f76e 100644 --- a/gtk-3.0/gtk-contained-dark.css +++ b/gtk-3.0/gtk-contained-dark.css @@ -2360,6 +2360,9 @@ notebook.frame { notebook.frame > stack:not(:only-child) { border: 1px solid shade(#393f3f, 0.9); } +notebook.frame > header { + margin-left: 0; } + notebook > header { padding: 1px; background-color: #393f3f; } @@ -2532,6 +2535,9 @@ notebook > header { notebook > header.right > tabs { margin-left: -2px; } +notebook > header { + margin-left: 6px; } + notebook > stack:not(:only-child) { background-color: shade(#393f3f, 1.05); border-width: 1px; diff --git a/gtk-3.0/gtk-contained.css b/gtk-3.0/gtk-contained.css index 19991a9c..8337f0d0 100644 --- a/gtk-3.0/gtk-contained.css +++ b/gtk-3.0/gtk-contained.css @@ -2374,6 +2374,9 @@ notebook.frame { notebook.frame > stack:not(:only-child) { border: 1px solid shade(#cecece, 0.9); } +notebook.frame > header { + margin-left: 0; } + notebook > header { padding: 1px; background-color: #cecece; } @@ -2546,6 +2549,9 @@ notebook > header { notebook > header.right > tabs { margin-left: -2px; } +notebook > header { + margin-left: 6px; } + notebook > stack:not(:only-child) { background-color: shade(#cecece, 1.05); border-width: 1px; From 7c7f54109dcdae7ba8999acbd399e658ea949f1b Mon Sep 17 00:00:00 2001 From: Simon Ochsenreither Date: Thu, 13 Sep 2018 23:15:53 +0200 Subject: [PATCH 2/2] Set GtkNotebook's left/right/bottom borders to 0 if show_border=false --- gtk-3.0/_common.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk-3.0/_common.scss b/gtk-3.0/_common.scss index ca27fd7e..99963742 100644 --- a/gtk-3.0/_common.scss +++ b/gtk-3.0/_common.scss @@ -2315,7 +2315,7 @@ notebook { > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks background-color: shade($bg_color, 1.05); - border-width: 1px; + border-width: 1px 0 0; border-color: shade($bg_color, 0.9); border-style: solid; &:backdrop { background-color: $backdrop_bg_color; }