From 2039e75e90beb680b19479f0980b4b1ba715d215 Mon Sep 17 00:00:00 2001 From: Christoph Schmidt <cschmidt.fs@gmail.com> Date: Thu, 9 Nov 2023 17:08:07 +0100 Subject: [PATCH] Updated pushbutton. Added option to change the image path --- build/lib/fswidgets/PlayPushButton.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/lib/fswidgets/PlayPushButton.py b/build/lib/fswidgets/PlayPushButton.py index 7279ba1..43f9707 100644 --- a/build/lib/fswidgets/PlayPushButton.py +++ b/build/lib/fswidgets/PlayPushButton.py @@ -19,7 +19,7 @@ class PlayPushButton(QPushButton): self.setText(text) - def _style_play(self): + def _style_play(self, img_path='/icons/icons/cil-media-play.png'): return """ QPushButton { background-color: rgb(36, 209, 21); @@ -30,7 +30,7 @@ class PlayPushButton(QPushButton): border-left: 22px solid transparent; text-align: left; padding-left: 44px; - background-image: url(:/icons/images/icons/cil-media-play.png); + background-image: url(:""" + img_path + """); } QPushButton:hover { @@ -49,7 +49,7 @@ class PlayPushButton(QPushButton): """ - def _style_pause(self): + def _style_pause(selfm, img_path = "/icons/icons/cil-media-pause.png"): return """ QPushButton { background-color: rgb(255, 200,11); @@ -60,7 +60,7 @@ class PlayPushButton(QPushButton): border-left: 22px solid transparent; text-align: left; padding-left: 44px; - background-image: url(:/icons/images/icons/cil-media-pause.png) + background-image: url(:""" + img_path + """) } QPushButton:hover { @@ -78,7 +78,7 @@ class PlayPushButton(QPushButton): } """ - def _style_stop(self): + def _style_stop(self, img_path = "/icons/icons/cil-media-stop.png"): return """ QPushButton { background-color: rgb(242, 41, 41); @@ -89,7 +89,7 @@ class PlayPushButton(QPushButton): border-left: 22px solid transparent; text-align: left; padding-left: 44px; - background-image: url(:/icons/images/icons/cil-media-stop.png) + background-image: url(:""" + img_path + """) } QPushButton:hover { -- GitLab