From beb181c175e78045152adf9dad71ef30c2f44a3a Mon Sep 17 00:00:00 2001 From: Dummerle Date: Fri, 18 Jun 2021 12:24:56 +0200 Subject: [PATCH] Some fixes --- rare/components/tabs/shop/game_widgets.py | 1 - rare/components/tabs/shop/shop_info.py | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rare/components/tabs/shop/game_widgets.py b/rare/components/tabs/shop/game_widgets.py index e9919cbd..7bc3ae32 100644 --- a/rare/components/tabs/shop/game_widgets.py +++ b/rare/components/tabs/shop/game_widgets.py @@ -1,5 +1,4 @@ import json -import json import logging from PyQt5 import QtGui diff --git a/rare/components/tabs/shop/shop_info.py b/rare/components/tabs/shop/shop_info.py index 84b4b57e..f1aa22dd 100644 --- a/rare/components/tabs/shop/shop_info.py +++ b/rare/components/tabs/shop/shop_info.py @@ -62,7 +62,6 @@ class ShopGameInfo(QWidget, Ui_shop_info): self.request.finished.connect(self.data_received) def data_received(self): - logging.info(f"Data of game {self.data['title']} received") if self.request: if self.request.error() == QNetworkReply.NoError: error = QJsonParseError() @@ -80,12 +79,18 @@ class ShopGameInfo(QWidget, Ui_shop_info): return self.game = ShopGame.from_json(game, self.data) self.title.setText(self.game.title) + self.price.setFont(QFont()) if self.game.price != "0": self.price.setText(self.game.price) else: self.price.setText(self.tr("Free")) + if self.game.price != self.game.discount_price: - self.discount_price.setText(self.game.discount_price) + font = QFont() + font.setStrikeOut(True) + self.price.setFont(font) + self.discount_price.setText( + self.game.discount_price if self.game.discount_price != "0" else self.tr("Free")) self.discount_price.setVisible(True) else: self.discount_price.setVisible(False) @@ -126,7 +131,6 @@ class ShopGameInfo(QWidget, Ui_shop_info): pass self.tags.setText(", ".join(self.game.tags)) # self.price.setText(self.game.price) - self.request.deleteLater() def button_clicked(self):