일단 정리..
This commit is contained in:
45
UI.py
45
UI.py
@@ -8,7 +8,7 @@ import GetArc_Hitomi as hitomi
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from PyQt5.QtCore import Qt, QUrl, QSettings, QSize, QPoint, QByteArray
|
||||
from PyQt5.QtCore import Qt, QUrl, QSettings, QSize, QPoint, QByteArray, QRect
|
||||
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton, QVBoxLayout, QLineEdit, QHBoxLayout, QListWidget, QListWidgetItem, QLabel, QFileDialog
|
||||
from PyQt5.QtGui import QPixmap, QKeyEvent
|
||||
|
||||
@@ -21,16 +21,28 @@ class MyApp(QMainWindow):
|
||||
self.initUI()
|
||||
self.loadINI()
|
||||
|
||||
|
||||
#
|
||||
def closeEvent(self, event):
|
||||
self.saveINI()
|
||||
event.accept()
|
||||
|
||||
|
||||
#
|
||||
def resizeEvent(self, event):
|
||||
super().resizeEvent(event)
|
||||
|
||||
rcDesktop = QApplication.primaryScreen().availableGeometry()
|
||||
rcWnd = self.geometry()
|
||||
|
||||
if False == rcDesktop.contains(rcWnd):
|
||||
self.setGeometry(rcDesktop)
|
||||
|
||||
pixmap = self.label_Image.pixmap()
|
||||
if None != pixmap:
|
||||
pixmapScaled = pixmap.scaled(self.label_Image.size())
|
||||
self.label_Image.setPixmap(pixmapScaled)
|
||||
|
||||
self.update()
|
||||
|
||||
#
|
||||
def initUI(self):
|
||||
layout = self.MakeUI()
|
||||
|
||||
@@ -108,10 +120,6 @@ class MyApp(QMainWindow):
|
||||
# show Image in middle Layout
|
||||
self.label_Image = QLabel(self)
|
||||
|
||||
# Load Default Image
|
||||
pixmap = QPixmap("layoutImg.jpeg")
|
||||
self.label_Image.setMaximumWidth(self.screen().size().width()-(self.list_ArcList.width()+400))
|
||||
|
||||
layout_R = self.MakeUI_Right()
|
||||
|
||||
# 레이아웃 설정
|
||||
@@ -121,16 +129,8 @@ class MyApp(QMainWindow):
|
||||
layout.addLayout(layout_R, stretch = 1)
|
||||
|
||||
return layout
|
||||
|
||||
|
||||
def GetFitSize(self, szTarget):
|
||||
szDesktop = self.screen().size()
|
||||
szWindow = self.size()
|
||||
|
||||
nTrgHeight = self.list_Items.height()
|
||||
nTrgWidth = szWindow.width() - ( self.list_ArcList.width() + self.list_Items.width() )
|
||||
|
||||
|
||||
#
|
||||
def on_click_SrcAdd(self):
|
||||
folder_path = QFileDialog.getExistingDirectory(self, '폴더 선택', '')
|
||||
|
||||
@@ -272,6 +272,7 @@ class MyApp(QMainWindow):
|
||||
|
||||
elif fileExt.lower() == ".rar":
|
||||
listContents = []
|
||||
|
||||
elif True == os.path.isdir(pathTarget):
|
||||
listContents = util.ListFileExtRcr(pathTarget, [".jpg", ".jpeg", ".png", ".webp"])
|
||||
|
||||
@@ -301,8 +302,14 @@ class MyApp(QMainWindow):
|
||||
pixmap.load(selItemText)
|
||||
|
||||
self.label_Image.setPixmap(pixmap)
|
||||
scaled_pixmap = pixmap.scaled(self.label_Image.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
self.label_Image.setPixmap(scaled_pixmap)
|
||||
|
||||
#
|
||||
def GetFitSize(self, szTarget):
|
||||
szDesktop = self.screen().size()
|
||||
szWindow = self.size()
|
||||
|
||||
nTrgHeight = self.list_Items.height()
|
||||
nTrgWidth = szWindow.width() - ( self.list_ArcList.width() + self.list_Items.width() )
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user