mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
icon
This commit is contained in:
parent
a2e0040e5e
commit
acc88fa123
@ -413,7 +413,11 @@ def getcachedimage(src, small):
|
|||||||
return _pix
|
return _pix
|
||||||
|
|
||||||
|
|
||||||
def getpixfunction(kk, small=False):
|
def getpixfunction(kk, small=False, iconfirst=False):
|
||||||
|
if iconfirst:
|
||||||
|
_pix = getExeIcon(uid2gamepath[kk], False, cache=True)
|
||||||
|
if not _pix.toImage().allGray():
|
||||||
|
return _pix
|
||||||
if (
|
if (
|
||||||
savehook_new_data[kk]["currentmainimage"]
|
savehook_new_data[kk]["currentmainimage"]
|
||||||
in savehook_new_data[kk]["imagepath_all"]
|
in savehook_new_data[kk]["imagepath_all"]
|
||||||
|
@ -92,7 +92,9 @@ class clickitem(QWidget):
|
|||||||
self.uid = uid
|
self.uid = uid
|
||||||
self.lay = QHBoxLayout()
|
self.lay = QHBoxLayout()
|
||||||
self.lay.setSpacing(0)
|
self.lay.setSpacing(0)
|
||||||
self.lay.setContentsMargins(0, 0, 0, 0)
|
size = globalconfig["dialog_savegame_layout"]["listitemheight"]
|
||||||
|
margin = min(3, int(size / 15))
|
||||||
|
self.lay.setContentsMargins(margin, margin, margin, margin)
|
||||||
|
|
||||||
self.maskshowfileexists = QLabel(self)
|
self.maskshowfileexists = QLabel(self)
|
||||||
exists = os.path.exists(get_launchpath(uid))
|
exists = os.path.exists(get_launchpath(uid))
|
||||||
@ -101,22 +103,20 @@ class clickitem(QWidget):
|
|||||||
self.bottommask.hide()
|
self.bottommask.hide()
|
||||||
self.bottommask.setObjectName("savegame_onselectcolor1")
|
self.bottommask.setObjectName("savegame_onselectcolor1")
|
||||||
_ = QLabel(self)
|
_ = QLabel(self)
|
||||||
_.setStyleSheet(
|
_.setStyleSheet("""background-color: rgba(255,255,255, 0);""")
|
||||||
"""background-color: rgba(255,255,255, 0);border-bottom: 1px solid gray;"""
|
|
||||||
)
|
|
||||||
self.bottomline = _
|
self.bottomline = _
|
||||||
size = globalconfig["dialog_savegame_layout"]["listitemheight"]
|
|
||||||
_ = QLabel()
|
_ = QLabel()
|
||||||
_.setFixedSize(QSize(size, size))
|
_.setFixedSize(QSize(size - 2 * margin, size - 2 * margin))
|
||||||
_.setScaledContents(True)
|
_.setScaledContents(True)
|
||||||
_.setStyleSheet("background-color: rgba(255,255,255, 0);")
|
_.setStyleSheet("background-color: rgba(255,255,255, 0);")
|
||||||
icon = getpixfunction(uid, small=True)
|
icon = getpixfunction(uid, small=True, iconfirst=True)
|
||||||
icon.setDevicePixelRatio(self.devicePixelRatioF())
|
icon.setDevicePixelRatio(self.devicePixelRatioF())
|
||||||
_.setPixmap(icon)
|
_.setPixmap(icon)
|
||||||
self.lay.addWidget(_)
|
self.lay.addWidget(_)
|
||||||
_ = QLabel(savehook_new_data[uid]["title"])
|
_ = QLabel(savehook_new_data[uid]["title"])
|
||||||
_.setWordWrap(True)
|
_.setWordWrap(True)
|
||||||
_.setFixedHeight(size + 1)
|
_.setFixedHeight(size)
|
||||||
_.setObjectName("savegame_textfont2")
|
_.setObjectName("savegame_textfont2")
|
||||||
self.lay.addWidget(_)
|
self.lay.addWidget(_)
|
||||||
self.setLayout(self.lay)
|
self.setLayout(self.lay)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user