Skip to content

Commit

Permalink
Prevent tab borders from colliding with containing widget if show_bor…
Browse files Browse the repository at this point in the history
…der = 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.
  • Loading branch information
soc committed Sep 12, 2018
1 parent 8e74c38 commit 479582f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gtk-3.0/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions gtk-3.0/gtk-contained-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions gtk-3.0/gtk-contained.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 479582f

Please sign in to comment.