[gnome-music/wip/mschraal/gtk4-v2: 19/60] Adapt PlayerToolbar to GtkButton changes
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/gtk4-v2: 19/60] Adapt PlayerToolbar to GtkButton changes
- Date: Sun, 2 May 2021 11:44:20 +0000 (UTC)
commit 2107fe6952af0cf1df917273318fca20534d0469
Author: Marinus Schraal <mschraal gnome org>
Date: Sun Apr 11 21:10:39 2021 +0200
Adapt PlayerToolbar to GtkButton changes
data/ui/PlayerToolbar.ui | 37 +++----------------------------------
gnomemusic/widgets/playertoolbar.py | 10 ++++------
2 files changed, 7 insertions(+), 40 deletions(-)
---
diff --git a/data/ui/PlayerToolbar.ui b/data/ui/PlayerToolbar.ui
index 782f829c5..b8ac7fae2 100644
--- a/data/ui/PlayerToolbar.ui
+++ b/data/ui/PlayerToolbar.ui
@@ -23,34 +23,6 @@
<attribute name="target">none</attribute>
</item>
</menu>
- <object class="GtkImage" id="next_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-top">1</property>
- <property name="icon_name">media-skip-forward-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- <object class="GtkImage" id="_pause_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-top">1</property>
- <property name="icon_name">media-playback-pause-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- <object class="GtkImage" id="_play_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-top">1</property>
- <property name="icon_name">media-playback-start-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- <object class="GtkImage" id="previous_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-top">1</property>
- <property name="icon_name">media-skip-backward-symbolic</property>
- <property name="icon_size">1</property>
- </object>
<template class="PlayerToolbar" parent="GtkActionBar">
<property name="can_focus">False</property>
<child>
@@ -64,8 +36,7 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="image">previous_image</property>
- <property name="always_show_image">True</property>
+ <property name="icon_name">media-skip-backward-symbolic</property>
<property name="tooltip_text" translatable="yes">Previous</property>
<signal name="clicked" handler="_on_prev_button_clicked" swapped="no"/>
</object>
@@ -77,8 +48,7 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="image">_play_image</property>
- <property name="always_show_image">True</property>
+ <property name="icon_name">media-playback-start-symbolic</property>
<property name="tooltip_text" translatable="yes">Play</property>
<signal name="clicked" handler="_on_play_button_clicked" swapped="no"/>
</object>
@@ -90,8 +60,7 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="image">next_image</property>
- <property name="always_show_image">True</property>
+ <property name="icon_name">media-skip-forward-symbolic</property>
<property name="tooltip_text" translatable="yes">Next</property>
<signal name="clicked" handler="_on_next_button_clicked" swapped="no"/>
</object>
diff --git a/gnomemusic/widgets/playertoolbar.py b/gnomemusic/widgets/playertoolbar.py
index 87d7106a4..46bc03201 100644
--- a/gnomemusic/widgets/playertoolbar.py
+++ b/gnomemusic/widgets/playertoolbar.py
@@ -46,9 +46,7 @@ class PlayerToolbar(Gtk.ActionBar):
_art_stack = Gtk.Template.Child()
_duration_label = Gtk.Template.Child()
_next_button = Gtk.Template.Child()
- _pause_image = Gtk.Template.Child()
_play_button = Gtk.Template.Child()
- _play_image = Gtk.Template.Child()
_prev_button = Gtk.Template.Child()
_progress_scale = Gtk.Template.Child()
_progress_time_label = Gtk.Template.Child()
@@ -139,14 +137,14 @@ class PlayerToolbar(Gtk.ActionBar):
self.show()
if self._player.props.state == Playback.PLAYING:
- image = self._pause_image
+ icon_name = "media-playback-pause-symbolic"
tooltip = _("Pause")
else:
- image = self._play_image
+ icon_name = "media-playback-start-symbolic"
tooltip = _("Play")
- if self._play_button.get_image() != image:
- self._play_button.set_image(image)
+ if self._play_button.props.icon_name != icon_name:
+ self._play_button.props.icon_name = icon_name
self._play_button.set_tooltip_text(tooltip)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]