diff --git a/data/gtk.css b/data/gtk.css index 13d4fa8..7588f26 100644 --- a/data/gtk.css +++ b/data/gtk.css @@ -18,17 +18,28 @@ font-weight:bold; } -iconview.view:selected, -iconview.view:selected:focus, -GtkIconView.cell:selected, -GtkIconView.cell:selected:focus { - background-color:@theme_selected_bg_color; +actionbar { + background-color:@theme_unfocused_bg_color; } +/* Icon View in regular mode */ +iconview.view:selected, +iconview.view:selected:focus { + background-color:@theme_selected_bg_color; +} iconview.view:hover { -gtk-icon-effect:highlight; } -actionbar { - background-color:@theme_unfocused_bg_color; +/* Icon View in selection mode */ +iconview.view.selection { + -gtk-icon-effect:dim; +} +iconview.view.selection:selected, +iconview.view.selection:selected:focus { + background-color:@theme_selected_bg_color; + -gtk-icon-effect:highlight; +} +iconview.view.selection:hover { + -gtk-icon-effect:none; } diff --git a/mcg/widgets.py b/mcg/widgets.py index 21f7040..021fe1d 100644 --- a/mcg/widgets.py +++ b/mcg/widgets.py @@ -92,6 +92,7 @@ class Window(): _PANEL_INDEX_COVER = 1 _PANEL_INDEX_PLAYLIST = 2 _PANEL_INDEX_LIBRARY = 3 + _CSS_SELECTION = 'selection' def __init__(self, app, builder, title, settings): @@ -1183,9 +1184,11 @@ class PlaylistPanel(GObject.GObject): if widget.get_active(): self._actionbar_revealer.set_reveal_child(True) self._playlist_grid.set_selection_mode(Gtk.SelectionMode.MULTIPLE) + self._playlist_grid.get_style_context().add_class(Window._CSS_SELECTION) else: self._actionbar_revealer.set_reveal_child(False) self._playlist_grid.set_selection_mode(Gtk.SelectionMode.SINGLE) + self._playlist_grid.get_style_context().remove_class(Window._CSS_SELECTION) def clear_clicked(self, widget): @@ -1501,9 +1504,11 @@ class LibraryPanel(GObject.GObject): if widget.get_active(): self._actionbar_revealer.set_reveal_child(True) self._library_grid.set_selection_mode(Gtk.SelectionMode.MULTIPLE) + self._library_grid.get_style_context().add_class(Window._CSS_SELECTION) else: self._actionbar_revealer.set_reveal_child(False) self._library_grid.set_selection_mode(Gtk.SelectionMode.SINGLE) + self._library_grid.get_style_context().remove_class(Window._CSS_SELECTION) def on_grid_scale_change(self, widget, scroll, value):