Fix frame borders

pull/224/head
Satyajit Sahoo 2014-12-14 17:17:14 +05:30
parent da340ddb79
commit 63b89ba1f0
5 changed files with 71 additions and 68 deletions

View File

@ -43,8 +43,8 @@
outline-color: alpha($selected_bg_color, 0.5); outline-color: alpha($selected_bg_color, 0.5);
outline-style: dashed; outline-style: dashed;
outline-width: 1px; outline-width: 1px;
outline-offset: -2px; outline-offset: -1px;
outline-radius: 2px; outline-radius: $roundness;
} }

View File

@ -6,56 +6,59 @@
! Buttons ! Buttons
**********/ **********/
%button { @include exports("button_extends") {
padding: ($spacing - 1px) ($spacing + 1px); %button {
border-width: 1px; padding: ($spacing - 1px) ($spacing + 1px);
border-style: solid;
border-radius: $roundness;
transition: 100ms ease;
-GtkWidget-focus-padding: 1;
-GtkWidget-focus-line-width: 0;
}
%linked_button {
border-width: 1px;
border-style: solid;
border-radius: 0;
border-right-style: none;
border-left-style: none;
&:first-child {
border-width: 1px;
border-radius: $roundness;
border-left-style: solid;
border-right-style: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
&:dir(rtl) {
border-left-style: none;
border-right-style: solid;
}
}
&:last-child {
border-width: 1px;
border-radius: $roundness;
border-left-style: none;
border-right-style: solid;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&:dir(rtl) {
border-left-style: solid;
border-right-style: none;
}
}
&:only-child, &:first-child:only-child {
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
border-radius: $roundness; border-radius: $roundness;
transition: 100ms ease;
outline-color: transparent;
-GtkWidget-focus-padding: 1;
-GtkWidget-focus-line-width: 0;
}
%linked_button {
border-width: 1px;
border-style: solid;
border-radius: 0;
border-right-style: none;
border-left-style: none;
&:first-child {
border-width: 1px;
border-radius: $roundness;
border-left-style: solid;
border-right-style: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
&:dir(rtl) {
border-left-style: none;
border-right-style: solid;
}
}
&:last-child {
border-width: 1px;
border-radius: $roundness;
border-left-style: none;
border-right-style: solid;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&:dir(rtl) {
border-left-style: solid;
border-right-style: none;
}
}
&:only-child, &:first-child:only-child {
border-width: 1px;
border-style: solid;
border-radius: $roundness;
}
} }
} }
@ -184,7 +187,7 @@
&.default { @include button($selected_bg_color, $selected_fg_color); } &.default { @include button($selected_bg_color, $selected_fg_color); }
.linked & { @include linked_button($bg_color); } &.linked, .linked & { @include linked_button($bg_color); }
.spinbutton & { .spinbutton & {
color: mix($text_color, $base_color, 0.4); color: mix($text_color, $base_color, 0.4);
@ -198,7 +201,7 @@
&:insensitive { &:insensitive {
color: mix($text_color, $base_color, 0.7); color: mix($text_color, $base_color, 0.7);
box-shadow: inset 1px 0 shade($base_color, 0.95); box-shadow: inset 1px 0 shade($base_color, 0.85);
} }
&:active, &:checked, &:hover { color: $text_color; } &:active, &:checked, &:hover { color: $text_color; }
@ -214,12 +217,12 @@
} }
.spinbutton.vertical & { .spinbutton.vertical & {
border: 1px solid shade($bg_color, 0.8); border: 1px solid shade($bg_color, 0.8);
border-radius: $roundness; border-radius: $roundness;
background-color: shade($bg_color, 1.08); background-color: shade($bg_color, 1.08);
background-image: none; background-image: none;
color: $fg_color; color: $fg_color;
box-shadow: none; box-shadow: none;
&:hover { &:hover {
border-color: shade($bg_color, 0.7); border-color: shade($bg_color, 0.7);
@ -248,7 +251,6 @@
&:first-child { &:first-child {
border-width: 1px; border-width: 1px;
border-bottom-width: 0; border-bottom-width: 0;
border-radius: $roundness;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
@ -256,7 +258,6 @@
&:last-child { &:last-child {
border-width: 1px; border-width: 1px;
border-top-width: 0; border-top-width: 0;
border-radius: $roundness;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
} }

View File

@ -65,9 +65,11 @@ $modules: () !default;
&:focus, &:hover { border-color: border_focus($color); } &:focus, &:hover { border-color: border_focus($color); }
&:active, &:active:hover, &:active, &:active:hover,
&:active:focus, &:active:hover:focus { border-color: border_active($color); } &:active:focus, &:active:hover:focus,
&:checked, &:checked:hover,
&:checked:focus, &:checked:hover:focus { border-color: border_active($color); }
&:insensitive { border-color: border_insensitive($color); } &:insensitive { border-color: border_insensitive($color); }
&:active *:insensitive { border-color: border_normal($color); } &:active:insensitive, &:checked:insensitive { border-color: border_normal($color); }
} }

View File

@ -31,7 +31,7 @@
.button { @include button($bg, $fg); } .button { @include button($bg, $fg); }
.linked .button { @include linked_button($bg); } .button.linked, .linked .button { @include linked_button($bg); }
GtkComboBox, .button { GtkComboBox, .button {
padding: $spacing - 1px; padding: $spacing - 1px;

View File

@ -181,13 +181,13 @@
***********/ ***********/
@include exports("frame") { @include exports("frame") {
.frame { border: none; } .frame {
border: 1px solid border_normal($bg_color);
GtkScrolledWindow { &.flat { border: none; }
&.frame { border: 1px solid border_normal($bg_color); }
/* avoid double borders when a viewport is packed into a GtkScrolledWindow */
GtkViewport.frame { border: none; }
} }
/* avoid double borders when a viewport is packed into a GtkScrolledWindow */
GtkScrolledWindow GtkViewport.frame { border: none; }
} }