Commit ce0b55e4 authored by Nikita Churaev's avatar Nikita Churaev
Browse files

Add custom CSS for the path bar and the sidebar

parent 597e585f
Pipeline #6183 passed with stage
in 3 minutes
......@@ -1207,6 +1207,41 @@ lay_down_one_line (NautilusCanvasContainer *container,
}
}
static void
distribute_line (NautilusCanvasContainer *container,
GArray *positions,
double icon_width,
int num_columns)
{
GtkAllocation allocation;
double available_width;
double used_width;
double unused_width;
double spacing;
double padding;
int i;
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
num_columns = MAX (positions->len, num_columns);
available_width = CANVAS_WIDTH (container, allocation);
available_width -= ICON_PAD_LEFT;
available_width -= ICON_PAD_RIGHT;
used_width = icon_width * num_columns;
unused_width = MAX (0.0, available_width - used_width);
spacing = floor(unused_width / (double)num_columns);
padding = floor(spacing / 2);
for (i = 0; i < positions->len; i++)
{
IconPositions *position = &g_array_index (positions, IconPositions, i);
position->width += spacing;
position->x_offset += padding;
}
}
static void
lay_down_icons_horizontal (NautilusCanvasContainer *container,
GList *icons,
......@@ -1225,6 +1260,7 @@ lay_down_icons_horizontal (NautilusCanvasContainer *container,
double grid_width;
int icon_width, icon_size;
int i;
int num_columns;
GtkAllocation allocation;
g_assert (NAUTILUS_IS_CANVAS_CONTAINER (container));
......@@ -1250,6 +1286,7 @@ lay_down_icons_horizontal (NautilusCanvasContainer *container,
line_start = icons;
y = start_y + CONTAINER_PAD_TOP;
i = 0;
num_columns = 0;
max_height_above = 0;
max_height_below = 0;
......@@ -1280,6 +1317,9 @@ lay_down_icons_horizontal (NautilusCanvasContainer *container,
/* Advance to the baseline. */
y += ICON_PAD_TOP + max_height_above;
num_columns = MAX (num_columns, i);
distribute_line (container, positions, icon_width, num_columns);
lay_down_one_line (container, line_start, p, y, max_height_above, positions, FALSE);
/* Advance to next line. */
......@@ -1322,6 +1362,7 @@ lay_down_icons_horizontal (NautilusCanvasContainer *container,
/* Advance to the baseline. */
y += ICON_PAD_TOP + max_height_above;
distribute_line (container, positions, icon_width, num_columns);
lay_down_one_line (container, line_start, NULL, y, max_height_above, positions, TRUE);
}
......
......@@ -18,6 +18,76 @@
color: mix (@theme_selected_fg_color, @theme_selected_bg_color, 0.20);
}
/* Path bar */
.path-bar button {
background: none;
border: 1px solid transparent;
box-shadow: none;
padding: 0;
}
.path-bar button:not(:first-child) {
border-left: 5px solid transparent;
}
.path-bar button:not(:last-child) {
border-right: 4px solid transparent;
}
.path-bar button:not(:first-child) {
background-image: image(mix(@theme_bg_color, @borders, 1.0));
background-size: 1px 12px;
background-repeat: no-repeat;
background-position: -5px 50%
}
.path-bar button:not(:first-child):backdrop {
background-image: image(mix(@theme_bg_color, @borders, 0.5));
}
.path-bar button:checked,
.path-bar button:active {
box-shadow: inset 0 -2px 0 @theme_selected_bg_color;
}
.path-bar button:not(:checked):hover,
.path-bar button:checked:backdrop {
box-shadow: inset 0 -2px 0 mix(@theme_bg_color, @borders, 0.5);
}
.path-bar button.slider-button:disabled {
color: mix(@theme_bg_color, @theme_fg_color, 0.2);
}
/* Sidebar */
.sidebar-row:selected {
background: linear-gradient(
to bottom,
shade(@theme_bg_color, 0.85),
shade(@theme_bg_color, 0.93) 3px,
shade(@theme_bg_color, 0.93));
}
.sidebar-row:selected,
.sidebar-row:selected label {
color: shade(@theme_fg_color, 0.4);
}
.sidebar-row:selected:backdrop {
background: linear-gradient(
to bottom,
shade(@theme_bg_color, 0.95),
shade(@theme_bg_color, 0.95) 3px,
shade(@theme_bg_color, 0.95));
}
.sidebar-row:selected:backdrop,
.sidebar-row:selected:backdrop label {
color: shade(@theme_unfocused_fg_color, 0.85);
}
/* Toolbar */
/* Here we use the .button background-image colors from Adwaita, but ligthen them,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment