Fix Space bug in Icon layout; Remove config sections on uninstall; Remove unused Widget
This commit is contained in:
parent
c2ae188745
commit
b799241357
|
@ -8,7 +8,6 @@ from qtawesome import icon
|
|||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame
|
||||
from rare.components.tabs.games.game_widgets.base_installed_widget import BaseInstalledWidget
|
||||
from rare.utils.extra_widgets import ClickableLabel
|
||||
|
||||
logger = getLogger("GameWidgetInstalled")
|
||||
|
||||
|
@ -36,7 +35,7 @@ class GameWidgetInstalled(BaseInstalledWidget):
|
|||
if self.pixmap:
|
||||
w = 200
|
||||
self.pixmap = self.pixmap.scaled(w, int(w * 4 / 3), transformMode=Qt.SmoothTransformation)
|
||||
self.image = ClickableLabel()
|
||||
self.image = QLabel()
|
||||
self.image.setObjectName("game_widget")
|
||||
self.image.setPixmap(self.pixmap)
|
||||
self.layout.addWidget(self.image)
|
||||
|
|
|
@ -5,7 +5,6 @@ from PyQt5.QtWidgets import QVBoxLayout, QLabel
|
|||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import Game
|
||||
from rare.components.tabs.games.game_widgets.base_uninstalled_widget import BaseUninstalledWidget
|
||||
from rare.utils.extra_widgets import ClickableLabel
|
||||
|
||||
logger = getLogger("Uninstalled")
|
||||
|
||||
|
@ -19,7 +18,7 @@ class IconWidgetUninstalled(BaseUninstalledWidget):
|
|||
if self.pixmap:
|
||||
w = 200
|
||||
self.pixmap = self.pixmap.scaled(w, int(w * 4 / 3))
|
||||
self.image = ClickableLabel()
|
||||
self.image = QLabel()
|
||||
self.image.setPixmap(self.pixmap)
|
||||
self.layout.addWidget(self.image)
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ class FlowLayout(QLayout):
|
|||
lineheight = 0
|
||||
for item in self._items:
|
||||
widget = item.widget()
|
||||
if not widget.isVisible():
|
||||
continue
|
||||
hspace = self.horizontalSpacing()
|
||||
if hspace == -1:
|
||||
hspace = widget.style().layoutSpacing(
|
||||
|
@ -114,13 +116,6 @@ class FlowLayout(QLayout):
|
|||
return parent.spacing()
|
||||
|
||||
|
||||
class ClickableLabel(QLabel):
|
||||
clicked = pyqtSignal()
|
||||
|
||||
def __init__(self):
|
||||
super(ClickableLabel, self).__init__()
|
||||
|
||||
|
||||
class PathEdit(QWidget, Ui_PathEdit):
|
||||
def __init__(self,
|
||||
text: str = "",
|
||||
|
|
|
@ -87,6 +87,13 @@ def uninstall(app_name: str, core: LegendaryCore, options=None):
|
|||
except Exception as e:
|
||||
logger.warning(f'Removing game failed: {e!r}, please remove {igame.install_path} manually.')
|
||||
|
||||
logger.info("Removing sections in config file")
|
||||
if core.lgd.config.has_section(app_name):
|
||||
core.lgd.config.remove_section(app_name)
|
||||
if core.lgd.config.has_section(app_name + ".env"):
|
||||
core.lgd.config.remove_section(app_name + ".env")
|
||||
core.lgd.save_config()
|
||||
|
||||
|
||||
class VerifyThread(QThread):
|
||||
status = pyqtSignal(tuple)
|
||||
|
|
Loading…
Reference in a new issue