Distinguish removed files more prettily
It's still somewhat bad, but at least no longer ridiculous.
This commit is contained in:
parent
200485246b
commit
4c8df56193
|
@ -402,7 +402,7 @@ draw_row(FivBrowser *self, cairo_t *cr, const Row *row)
|
||||||
|
|
||||||
// Performance optimization--specifically targeting the checkerboard.
|
// Performance optimization--specifically targeting the checkerboard.
|
||||||
if (cairo_image_surface_get_format(item->entry->thumbnail) !=
|
if (cairo_image_surface_get_format(item->entry->thumbnail) !=
|
||||||
CAIRO_FORMAT_RGB24) {
|
CAIRO_FORMAT_RGB24 || item->entry->removed) {
|
||||||
gtk_render_background(style, cr, border.left, border.top,
|
gtk_render_background(style, cr, border.left, border.top,
|
||||||
extents.width, extents.height);
|
extents.width, extents.height);
|
||||||
}
|
}
|
||||||
|
@ -418,21 +418,39 @@ draw_row(FivBrowser *self, cairo_t *cr, const Row *row)
|
||||||
cairo_mask_surface(
|
cairo_mask_surface(
|
||||||
cr, item->entry->thumbnail, border.left, border.top);
|
cr, item->entry->thumbnail, border.left, border.top);
|
||||||
} else {
|
} else {
|
||||||
|
// Distinguish removed items by rendering them only faintly.
|
||||||
|
if (item->entry->removed)
|
||||||
|
cairo_push_group(cr);
|
||||||
|
|
||||||
cairo_set_source_surface(
|
cairo_set_source_surface(
|
||||||
cr, item->entry->thumbnail, border.left, border.top);
|
cr, item->entry->thumbnail, border.left, border.top);
|
||||||
cairo_paint(cr);
|
cairo_paint(cr);
|
||||||
|
|
||||||
// Here, we could consider multiplying
|
// Here, we could also consider multiplying
|
||||||
// the whole rectangle with the selection color.
|
// the whole rectangle with the selection color.
|
||||||
|
if (item->entry->removed) {
|
||||||
|
cairo_pop_group_to_source(cr);
|
||||||
|
cairo_paint_with_alpha(cr, 0.25);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(p): Come up with a better rendition.
|
// This rendition is about the best I could come up with.
|
||||||
|
// It might be possible to use more such emblems with entries,
|
||||||
|
// though they would deserve some kind of a blur-glow.
|
||||||
if (item->entry->removed) {
|
if (item->entry->removed) {
|
||||||
cairo_move_to(cr, 0, border.top + extents.height + border.bottom);
|
int size = 32;
|
||||||
cairo_line_to(cr, border.left + extents.width + border.right, 0);
|
cairo_surface_t *cross = gtk_icon_theme_load_surface(
|
||||||
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
|
gtk_icon_theme_get_default(), "cross-large-symbolic",
|
||||||
cairo_set_line_width(cr, 5);
|
size, gtk_widget_get_scale_factor(GTK_WIDGET(self)),
|
||||||
cairo_stroke(cr);
|
gtk_widget_get_window(GTK_WIDGET(self)),
|
||||||
|
GTK_ICON_LOOKUP_FORCE_SYMBOLIC, NULL);
|
||||||
|
if (cross) {
|
||||||
|
cairo_set_source_rgb(cr, 1, 0, 0);
|
||||||
|
cairo_mask_surface(cr, cross,
|
||||||
|
border.left + extents.width - size - size / 4,
|
||||||
|
border.top + extents.height - size - size / 4);
|
||||||
|
cairo_surface_destroy(cross);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->show_labels) {
|
if (self->show_labels) {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m 1.980469 2 h 1 h 0.03125 c 0.253906 0.011719 0.511719 0.128906 0.6875 0.3125 l 4.28125 4.28125 l 4.3125 -4.28125 c 0.265625 -0.230469 0.445312 -0.304688 0.6875 -0.3125 h 1 v 1 c 0 0.285156 -0.035157 0.550781 -0.25 0.75 l -4.28125 4.28125 l 4.25 4.25 c 0.1875 0.1875 0.28125 0.453125 0.28125 0.71875 v 1 h -1 c -0.265625 0 -0.53125 -0.09375 -0.71875 -0.28125 l -4.28125 -4.28125 l -4.28125 4.28125 c -0.1875 0.1875 -0.453125 0.28125 -0.71875 0.28125 h -1 v -1 c 0 -0.265625 0.09375 -0.53125 0.28125 -0.71875 l 4.28125 -4.25 l -4.28125 -4.28125 c -0.210938 -0.195312 -0.304688 -0.46875 -0.28125 -0.75 z m 0 0" fill="#222222"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 774 B |
|
@ -6,6 +6,7 @@
|
||||||
<gresource prefix="/org/gnome/design/IconLibrary/scalable/actions/">
|
<gresource prefix="/org/gnome/design/IconLibrary/scalable/actions/">
|
||||||
<file preprocess="xml-stripblanks">text-symbolic.svg</file>
|
<file preprocess="xml-stripblanks">text-symbolic.svg</file>
|
||||||
<file preprocess="xml-stripblanks">circle-filled-symbolic.svg</file>
|
<file preprocess="xml-stripblanks">circle-filled-symbolic.svg</file>
|
||||||
|
<file preprocess="xml-stripblanks">cross-large-symbolic.svg</file>
|
||||||
<file preprocess="xml-stripblanks">funnel-symbolic.svg</file>
|
<file preprocess="xml-stripblanks">funnel-symbolic.svg</file>
|
||||||
<file preprocess="xml-stripblanks">blend-tool-symbolic.svg</file>
|
<file preprocess="xml-stripblanks">blend-tool-symbolic.svg</file>
|
||||||
<file preprocess="xml-stripblanks">checkerboard-symbolic.svg</file>
|
<file preprocess="xml-stripblanks">checkerboard-symbolic.svg</file>
|
||||||
|
|
Loading…
Reference in New Issue