Commit 51dda34e authored by Ngọc Trịnh's avatar Ngọc Trịnh Committed by Vadim Rutkovsky

Tweak sidebar ui

Fix sidebar border is cut off
https://bugzilla.gnome.org/show_bug.cgi?id=744658

Update sidebar background color follow the mockup
https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/music/music-artists.png
parent fb9c6640
......@@ -30,19 +30,29 @@ GtkTreeView{
.title{
padding-left:24px;
}
.artist-panel-white{
border-right: 1px solid #a1a1a1;
background-color: #d7dad7;
.side-panel:dir(ltr) {
border-width: 0 1px 0 0;
}
.artist-panel-white:selected{
background-color: #888A85;
.side-panel:dir(rtl) {
border-width: 0 0 0 1px;
}
.artist-panel-dark{
border-right: 1px solid #a1a1a1;
background-color: #282528;
.side-panel .view {
background-color: mix(@theme_fg_color, @theme_bg_color, 0.9);
}
.artist-panel-dark:selected{
background-color: #77757A;
.side-panel .view:dir(ltr) {
box-shadow: inset -10px 0 5px -10px @borders;
}
.side-panel .view:dir(rtl) {
box-shadow: inset 10px 0 5px -10px @borders;
}
.side-panel .view:selected {
background-color: mix(@theme_fg_color, @theme_bg_color, 0.5);
}
.playlist-controls-white{
......@@ -149,4 +159,4 @@ GtkTreeView{
color: mix (@theme_fg_color, @theme_bg_color, 0.50);
}
.content-view { background-color: @theme_bg; }
\ No newline at end of file
.content-view { background-color: @theme_bg; }
......@@ -624,19 +624,14 @@ class Artists (ViewContainer):
)
self.artistAlbumsStack.add_named(self._artistAlbumsWidget, "sidebar")
self.artistAlbumsStack.set_visible_child_name("sidebar")
self.view.set_shadow_type(Gtk.ShadowType.IN)
self.view.get_style_context().add_class('side-panel')
self.view.set_hexpand(False)
self.view.get_generic_view().get_selection().set_mode(
Gtk.SelectionMode.SINGLE)
self._grid.attach(self.artistAlbumsStack, 2, 0, 2, 2)
self._add_list_renderers()
self.view.get_generic_view().get_style_context().remove_class('content-view')
if (Gtk.Settings.get_default().get_property(
'gtk_application_prefer_dark_theme')):
self.view.get_generic_view().get_style_context().\
add_class('artist-panel-dark')
else:
self.view.get_generic_view().get_style_context().\
add_class('artist-panel-white')
self.show_all()
self.view.hide()
......@@ -813,9 +808,7 @@ class Playlist(ViewContainer):
@log
def __init__(self, window, player):
self.playlists_sidebar = Gd.MainView(
shadow_type=Gtk.ShadowType.NONE
)
self.playlists_sidebar = Gd.MainView()
ViewContainer.__init__(self, 'playlists', _("Playlists"), window,
Gd.MainViewType.LIST, True, self.playlists_sidebar)
......@@ -857,7 +850,7 @@ class Playlist(ViewContainer):
self.playlists_sidebar.set_view_type(Gd.MainViewType.LIST)
self.playlists_sidebar.set_model(self.playlists_model)
self.playlists_sidebar.set_hexpand(False)
#self.playlists_sidebar.get_style_context().add_class('artist-panel')
self.playlists_sidebar.get_style_context().add_class('side-panel')
self.playlists_sidebar.get_generic_view().get_selection().set_mode(
Gtk.SelectionMode.SINGLE)
self.playlists_sidebar.connect('item-activated', self._on_playlist_activated)
......@@ -866,13 +859,6 @@ class Playlist(ViewContainer):
self._grid.child_set_property(self.stack, 'height', 2)
self._add_sidebar_renderers()
self.playlists_sidebar.get_generic_view().get_style_context().remove_class('content-view')
if (Gtk.Settings.get_default().get_property(
'gtk_application_prefer_dark_theme')):
self.playlists_sidebar.get_generic_view().get_style_context().\
add_class("artist-panel-dark")
else:
self.playlists_sidebar.get_generic_view().get_style_context().\
add_class("artist-panel-white")
self.iter_to_clean = None
self.iter_to_clean_model = None
......
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