move labels on cover panel to the right and use CSS for styling

This commit is contained in:
coderkun 2016-06-11 13:15:20 +02:00
parent 898f59bd42
commit c031630379
3 changed files with 98 additions and 97 deletions

View file

@ -406,11 +406,6 @@
</child>
<child>
<object class="GtkBox" id="cover-panel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
@ -463,37 +458,14 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScale" id="cover-songs">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="round_digits">1</property>
<property name="draw_value">False</property>
<signal name="button-press-event" handler="on_cover-songs_button_press_event" swapped="no"/>
<signal name="button-release-event" handler="on_cover-songs_button_release_event" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
@ -507,7 +479,7 @@
<object class="GtkLabel" id="cover-album">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Album</property>
<property name="label">Album</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -518,7 +490,7 @@
<object class="GtkLabel" id="cover-date">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Date</property>
<property name="label">Date</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -529,18 +501,46 @@
<object class="GtkLabel" id="cover-artist">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Artist</property>
<property name="label">Artist</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<style>
<class name="cover-labels"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScale" id="cover-songs">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="orientation">vertical</property>
<property name="draw_value">False</property>
<signal name="button-press-event" handler="on_cover-songs_button_press_event" swapped="no"/>
<signal name="button-release-event" handler="on_cover-songs_button_release_event" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>

View file

@ -11,6 +11,13 @@
border:none;
}
.cover-labels label {
font-size:larger;
}
.cover-labels label:first-child {
font-weight:bold;
}
iconview.view:selected,
iconview.view:selected:focus,
GtkIconView.cell:selected,

View file

@ -816,27 +816,21 @@ class CoverPanel(mcg.Base):
def set_album(self, album):
# Set labels
self._album_title_label.set_markup(
"<b><big>{}</big></b>".format(
self._album_title_label.set_label(
GObject.markup_escape_text(
album.get_title()
)
)
)
self._album_date_label.set_markup(
"<big>{}</big>".format(
GObject.markup_escape_text(
', '.join(album.get_dates())
)
)
)
self._album_artist_label.set_markup(
"<big>{}</big>".format(
GObject.markup_escape_text(
', '.join(album.get_artists())
)
)
)
# Set tracks
self._set_tracks(album)