Skip to content

Commit 43299d4

Browse files
ochi123v1n0
authored andcommitted
Yaru Gnome Shell Theme: Added Visual Changes to Ubuntu Dock
Changes includes Dropping the translucent background, fixing inconsistent padding and better background radius handling. * Dropping translucent background: dropping the translucent background and replacing it with background color as dark as the gnome shell popover elements helps with achieving better contrast. Once crucial feature of the dock that is affected by the translucent background is the separator. Some wallpaper practically makes the separator nearly invisible. A much darker border is also applied to panel mode but only on the side opposite to the current dock position. This helps achieve separation with full screen windows. * Fixing inconsistent padding: In panel mode, there is a behavior where the top and bottom padding (when dock is vertically oriented) is larger. The original shrunk padding is still kept. With the consistencies applied, calculating the dock radius when not in panel becomes more consistent. * Better background radius handling: The icon radius is changed and matched to popover item radius. With this change, dock radius is better handled and is calculated by the sum of the icon radius and the current dock padding. closes github.com//issues/4322
1 parent 47cee33 commit 43299d4

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

gnome-shell/src/gnome-shell-sass/_dock.scss

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
$dash_padding: $base_padding + 4px; // 10px
88
$dash_border_radius: $modal_radius * 3;
99

10+
// Custom Yaru definition
11+
$dock_item_border_radius: $base_border_radius * 1.5; // same as $menuitem_border_radius: $base_border_radius * 1.5;
12+
1013
$dock_spacing: round($base_padding / 4);
1114
$dock_bottom_margin: $base_margin * 4;
1215
$dock_start_margin: $dock_bottom_margin;
@@ -78,12 +81,23 @@ $dock_remark_color: rgba(238, 238, 238, 0.2);
7881
}
7982
}
8083

84+
85+
/* Yaru change */
86+
// a border is applied for panel mode
87+
// we need to add a 1px offset padding
88+
// to compensate with 1px border since
89+
// the border is rendered on top of the last column
90+
// of the dock (assuming it is positioned to the left)
91+
// -------------------------------------------------------
92+
// NOTE: yaru changes are the one commented with 'Yaru change'
8193
@mixin padded-edge-child($chid, $side, $padding) {
8294
@if $chid == first {
8395
@if is_horizontal($side) {
8496
padding-left: $padding;
97+
padding-#{opposite($side)}: 1px; // Yaru Change
8598
} @else {
8699
padding-top: $padding;
100+
padding-#{opposite($side)}: 1px; // Yaru Change
87101
}
88102
} @else if $chid == last {
89103
@if is_horizontal($side) {
@@ -95,6 +109,7 @@ $dock_remark_color: rgba(238, 238, 238, 0.2);
95109
@error "Invalid rule";
96110
}
97111
}
112+
/**/
98113

99114
// In extended mode we need to use the first and last .dash-item-container's
100115
// to apply the padding on the dock, to ensure that the actual first or last
@@ -274,7 +289,11 @@ $dock_style_modes: [null, shrink, extended, extended-shrink];
274289
side_margin: /* not shrunk */ $dock_side_margin,
275290
padding: shrink($dash_padding),
276291
margin: shrink($base_margin),
277-
edge_items_padding: shrink_light($dock_edge_items_padding),
292+
/* Yaru Change */
293+
// $edge items_padding is changed to make padding consistent across extended
294+
// and not extended.
295+
edge_items_padding: shrink($dash_padding), // shrink_light($dock_edge_items_padding),
296+
/**/
278297
fixed_inner_margin: shrink($dock_fixed_inner_margin),
279298
));
280299
}
@@ -487,7 +506,7 @@ $dock_style_modes: [null, shrink, extended, extended-shrink];
487506

488507
/* Yaru Dock styling */
489508

490-
$dock_color: $panel_bg_color;
509+
$dock_color: $bg_color_dark;
491510

492511
@each $side in bottom, top, left, right {
493512
#dashtodockContainer.#{$side} {
@@ -498,15 +517,34 @@ $dock_color: $panel_bg_color;
498517
padding: 0px;
499518

500519
.dash-background {
501-
background: transparentize($dock_color, 0.25);
502-
transition-duration: $panel_transition_duration;
520+
background: $dock_color; // Yaru: Drop translucent background
503521
}
504522

505523
.dash-separator {
506524
background: transparentize($osd_fg_color, 0.7);
507525
}
508526
}
509527

528+
#dash {
529+
.dash-background {
530+
// when not shrunk the padding used it $dash_padding;
531+
// border radius will be the icon radius increased by dash padding;
532+
// this is the correct way of making a consistent look instead of
533+
// hard coding
534+
border-radius: $dock_item_border_radius + $dash_padding;
535+
}
536+
}
537+
538+
&.shrink #dash {
539+
.dash-background {
540+
// when shrunk the padding used it shrink($dash_padding);
541+
// border radius will be the icon radius increased by shrink($dash padding)
542+
// this is the correct way of making a consistent look instead of
543+
// hard coding
544+
border-radius: $dock_item_border_radius + shrink($dash_padding);
545+
}
546+
}
547+
510548
&.overview {
511549
#dash,
512550
&.dashtodock #dash,
@@ -524,13 +562,17 @@ $dock_color: $panel_bg_color;
524562
.dash-background {
525563
// Yaru: remove the border we apply to the upstream dock
526564
border: none;
565+
// Yaru: then apply the border color to the side opposite to dock position,
566+
border-#{opposite($side)}: 1px;
567+
// Yaru: set a darker border;
568+
border-color: lighten($dock_color, 5%);
527569
}
528570
}
529571
}
530572

531573
.dash-item-container {
532574
.show-apps, .app-well-app {
533-
border-radius: $dash_border_radius;
575+
border-radius: $dock_item_border_radius; //Yaru: sync with pop-over
534576
&:active, &:checked {
535577
.overview-icon {
536578
background-color: $base_active_color; box-shadow: none;
@@ -559,6 +601,7 @@ $dock_color: $panel_bg_color;
559601
.overview-icon {
560602
@extend %tile;
561603
@include button(normal, $tc:$fg, $c:$normal_bg, $style: flat, $always_dark: true);
604+
border-radius: $dock_item_border_radius;
562605
}
563606

564607
&:focus .overview-icon { @include button(focus, $tc:$fg, $c:$bg, $style: flat, $always_dark: true);}

0 commit comments

Comments
 (0)