Skip to content

Commit

Permalink
improved big picture view
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Dec 11, 2023
1 parent 4281c41 commit cc3c1f6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 21 deletions.
14 changes: 6 additions & 8 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TidalWindow(Adw.ApplicationWindow):
artist_label = Gtk.Template.Child()
sidebar_collection = Gtk.Template.Child()
right_sidebar_split_view = Gtk.Template.Child()
lyrics_box = Gtk.Template.Child()
lyrics_label = Gtk.Template.Child()
sidebar_playlists = Gtk.Template.Child()
volume_button = Gtk.Template.Child()
in_my_collection_button = Gtk.Template.Child()
Expand Down Expand Up @@ -210,10 +210,10 @@ def on_song_changed(self, *args):
else:
self.play_button.set_icon_name("media-playback-start-symbolic")

if self.right_sidebar_split_view.get_show_sidebar():
th = threading.Thread(target=self.add_lyrics_to_page, args=())
th.deamon = True
th.start()
# if self.right_sidebar_split_view.get_show_sidebar() or :
th = threading.Thread(target=self.add_lyrics_to_page, args=())
th.deamon = True
th.start()

self.control_bar_artist = track.artist
self.update_slider()
Expand Down Expand Up @@ -380,9 +380,7 @@ def on_lyrics_button_clicked_func(self, widget):

def add_lyrics_to_page(self):
lyrics = self.player_object.playing_track.lyrics()
label = Gtk.Label(label=lyrics.text, wrap=True, justify=2, opacity=0.6,
margin_start=12, margin_end=12, css_classes=["lyrics"])
self.lyrics_box.set_child(label)
self.lyrics_label.set_label(lyrics.text)

def download_song(self):
"""Added to check the streamed song quality, triggered with ctrl+d"""
Expand Down
57 changes: 44 additions & 13 deletions src/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@
<child>
<object class="GtkScrolledWindow">
<property name="vexpand">true</property>
<property name="css-classes">undershoot-bottom
undershoot-top</property>
<style>
<class name="undershoot-top"/>
<class name="undershoot-bottom"/>
</style>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
Expand Down Expand Up @@ -253,12 +255,23 @@ undershoot-top</property>
<object class="GtkStackPage">
<property name="title" translatable="true">Lyrics</property>
<property name="child">
<object class="GtkScrolledWindow" id="lyrics_box">
<object class="GtkScrolledWindow">
<property name="hexpand">true</property>
<property name="vexpand">true</property>
<style>
<class name="undershoot-top"/>
<class name="undershoot-bottom"/>
</style>
<child>
<object class="GtkLabel" id="lyrics_label">
<property name="wrap">True</property>
<property name="justify">2</property>
<property name="opacity">0.6</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="css-classes">lyrics</property>
</object>
</child>
</object>
</property>
</object>
Expand All @@ -272,6 +285,7 @@ undershoot-top</property>
<property name="vexpand">true</property>
<style>
<class name="undershoot-top"/>
<class name="undershoot-bottom"/>
</style>
</object>
</property>
Expand Down Expand Up @@ -625,8 +639,6 @@ flat</property>
</child>
<child>
<object class="GtkBox">
<property name="margin-end">12</property>
<property name="margin-start">12</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
Expand All @@ -638,14 +650,18 @@ flat</property>

<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<style>
<class name="undershoot-top"/>
<class name="undershoot-bottom"/>
</style>
<child>

<object class="AdwClamp">
<property name="margin-end">12</property>
<property name="margin-start">12</property>
<property name="maximum-size">600</property>
<property name="tightening-threshold">400</property>
<property name="unit">px</property>
<child>

<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">12</property>
Expand Down Expand Up @@ -673,7 +689,8 @@ flat</property>
<property name="halign">center</property>
<property name="height-request">330</property>
<property name="pixel-size">200</property>
<property name="valign">start</property>
<property name="valign">center</property>
<property name="vexpand">true</property>
<property name="width-request">330</property>
<property name="overflow">hidden</property>
<property name="file" bind-source="playing_track_image" bind-property="file"/>
Expand All @@ -687,6 +704,8 @@ flat</property>
<object class="GtkBox">
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<child>
<object class="GtkLabel">
<property name="css-classes">title-2</property>
Expand Down Expand Up @@ -724,6 +743,8 @@ flat</property>
</child>
<child>
<object class="GtkScale">
<property name="valign">center</property>
<property name="vexpand">True</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper" bind-source="progress_bar_adjustment" bind-property="upper"/>
Expand Down Expand Up @@ -802,12 +823,22 @@ circular</property>
<child>
<object class="AdwViewStackPage">
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkTextView">
<object class="GtkScrolledWindow">
<property name="hexpand">true</property>
<property name="vexpand">true</property>
<style>
<class name="undershoot-top"/>
<class name="undershoot-bottom"/>
</style>
<child>
<object class="GtkLabel">
<property name="wrap">True</property>
<property name="justify">2</property>
<property name="opacity">0.6</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="css-classes">lyrics</property>
<property name="vexpand">True</property>
<property name="label" bind-source="lyrics_label" bind-property="label"/>
</object>
</child>
</object>
Expand Down

0 comments on commit cc3c1f6

Please sign in to comment.