Skip to content

Commit

Permalink
Remove song index label from playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
abegert committed Nov 6, 2021
1 parent 22bea58 commit 6d5210f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
14 changes: 3 additions & 11 deletions src/app/components/playlist/song.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
.song__index {
transition: opacity 150ms ease;
font-size: 12px;
margin: 4px 12px;
padding: 0;
opacity: 1;
}

.song__icon, .song__checkbox {
transition: opacity 150ms ease;
opacity: 0;
}

.song--playing .song__index {
.song--playing .song__cover {
opacity: 0;
}

.song--playing .song__icon {
opacity: 1;
}

.playlist--selectable .song__index, .playlist--selectable .song__icon {
.playlist--selectable .playlist--selectable .song__icon {
opacity: 0;
}

Expand All @@ -37,7 +29,7 @@ row {
margin: 1px 0;
}

.song--playing label.song__title, .song--playing label.song__index {
.song--playing label.song__title, .song--playing {
font-weight: bold;
}

Expand Down
4 changes: 0 additions & 4 deletions src/app/components/playlist/song.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ mod imp {
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/alextren/Spot/components/song.ui")]
pub struct SongWidget {
#[template_child]
pub song_index: TemplateChild<gtk::Label>,

#[template_child]
pub song_icon: TemplateChild<gtk::Image>,

Expand Down Expand Up @@ -141,7 +138,6 @@ impl SongWidget {
pub fn bind(&self, model: &SongModel, worker: Worker) {
let widget = imp::SongWidget::from_instance(self);

model.bind_index(&*widget.song_index, "label");
model.bind_title(&*widget.song_title, "label");
model.bind_artist(&*widget.song_artist, "label");
model.bind_duration(&*widget.song_length, "label");
Expand Down
8 changes: 0 additions & 8 deletions src/app/components/playlist/song.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
<property name="row">0</property>
</layout>
<child>
<object class="GtkLabel" id="song_index">
<property name="label">1</property>
<style>
<class name="song__index"/>
</style>
</object>
</child>
<child type="overlay">
<object class="GtkImage" id="song_cover">
<property name="pixel-size">30</property>
<style>
Expand Down
8 changes: 0 additions & 8 deletions src/app/models/gtypes/song_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ impl SongModel {
.to_string()
}

pub fn bind_index<O: ObjectType>(&self, o: &O, property: &str) {
imp::SongModel::from_instance(self).push_binding(
self.bind_property("index", o, property)
.flags(glib::BindingFlags::DEFAULT | glib::BindingFlags::SYNC_CREATE)
.build(),
);
}

pub fn bind_artist<O: ObjectType>(&self, o: &O, property: &str) {
imp::SongModel::from_instance(self).push_binding(
self.bind_property("artist", o, property)
Expand Down

0 comments on commit 6d5210f

Please sign in to comment.