forked from Rowland/EG
ui更新
This commit is contained in:
parent
a4e5d834db
commit
34ce05121a
@ -1,4 +1,5 @@
|
||||
from PIL.ImageChops import lighter
|
||||
from PyQt5.QtGui import QFont
|
||||
from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QMenu, QStyle
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.sip import delete
|
||||
@ -292,6 +293,8 @@ class InterfaceManager:
|
||||
sceneRoot = QTreeWidgetItem(self.treeWidget, ['场景'])
|
||||
sceneRoot.setData(0, Qt.UserRole, self.world.render)
|
||||
sceneRoot.setData(0, Qt.UserRole + 1, "SCENE_ROOT")
|
||||
font = QFont("Microsoft YaHei", 10, QFont.Light) # 假设您希望字体大小为10
|
||||
sceneRoot.setFont(0, font)
|
||||
# 添加相机节点
|
||||
cameraItem = QTreeWidgetItem(sceneRoot, ['相机'])
|
||||
cameraItem.setData(0, Qt.UserRole, self.world.cam)
|
||||
|
||||
@ -64,7 +64,7 @@ class StyledTerrainDialog(QDialog):
|
||||
}
|
||||
QLabel#titleLabel {
|
||||
color: #FFFFFF;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.7px;
|
||||
@ -103,14 +103,14 @@ class StyledTerrainDialog(QDialog):
|
||||
}
|
||||
QLabel[role="fieldLabel"] {
|
||||
color: #EBEBEB;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.6px;
|
||||
}
|
||||
QLabel[role="hint"] {
|
||||
color: rgba(235, 235, 235, 0.6);
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 11px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.55px;
|
||||
@ -122,7 +122,7 @@ class StyledTerrainDialog(QDialog):
|
||||
border: 1px solid rgba(76, 92, 110, 0.6);
|
||||
border-radius: 2px;
|
||||
padding: 0px 10px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 11px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.55px;
|
||||
@ -148,7 +148,7 @@ class StyledTerrainDialog(QDialog):
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
padding: 0px 12px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.5px;
|
||||
@ -396,6 +396,8 @@ class MainWindow(QMainWindow):
|
||||
background-color: transparent;
|
||||
padding: 6px 12px;
|
||||
color: #D4D4D4;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
QMenuBar::item:selected {
|
||||
background-color: rgba(48, 103, 192, 0.4);
|
||||
@ -1504,7 +1506,7 @@ class MainWindow(QMainWindow):
|
||||
padding: 8px 10px;
|
||||
border-bottom: none;
|
||||
text-align: left;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
@ -1544,7 +1546,7 @@ class MainWindow(QMainWindow):
|
||||
alternate-background-color: #19191b;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
font-weight: 400;
|
||||
outline: none;
|
||||
}
|
||||
QTreeView::item {
|
||||
@ -1879,6 +1881,7 @@ class MainWindow(QMainWindow):
|
||||
QGroupBox[groupRole="first"] {
|
||||
padding-top: 16px;
|
||||
margin-top: 0px;
|
||||
border-top: none; /* 明确移除顶部边框 */
|
||||
}
|
||||
QGroupBox[groupRole="first"]::title {
|
||||
padding: 6px 3px 8px 0px;
|
||||
@ -2057,6 +2060,7 @@ class MainWindow(QMainWindow):
|
||||
QGroupBox[groupRole="first"] {
|
||||
padding-top: 16px;
|
||||
margin-top: 0px;
|
||||
border-top: none; /* 明确移除顶部边框 */
|
||||
}
|
||||
QGroupBox[groupRole="first"]::title {
|
||||
padding: 6px 3px 8px 0px;
|
||||
@ -2196,7 +2200,7 @@ class MainWindow(QMainWindow):
|
||||
alternate-background-color: #19191b;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
font-weight: 400;
|
||||
outline: none;
|
||||
}
|
||||
QTreeWidget::item {
|
||||
@ -2559,7 +2563,7 @@ class MainWindow(QMainWindow):
|
||||
scriptSystemLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #ebebeb;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2575,7 +2579,7 @@ class MainWindow(QMainWindow):
|
||||
color: #2dffc4;
|
||||
border-radius: 2px;
|
||||
padding: 2px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2591,7 +2595,7 @@ class MainWindow(QMainWindow):
|
||||
hotReloadLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #ebebeb;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2607,7 +2611,7 @@ class MainWindow(QMainWindow):
|
||||
color: #289eff;
|
||||
border-radius: 2px;
|
||||
padding: 2px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2630,7 +2634,7 @@ class MainWindow(QMainWindow):
|
||||
nameLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #ebebeb;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2648,7 +2652,7 @@ class MainWindow(QMainWindow):
|
||||
border: 1px solid rgba(76, 92, 110, 0.6);
|
||||
border-radius: 2px;
|
||||
padding: 4px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2670,7 +2674,7 @@ class MainWindow(QMainWindow):
|
||||
templateLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #ebebeb;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2688,7 +2692,7 @@ class MainWindow(QMainWindow):
|
||||
border: 1px solid rgba(76, 92, 110, 0.6);
|
||||
border-radius: 2px;
|
||||
padding: 4px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2725,7 +2729,7 @@ class MainWindow(QMainWindow):
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 2px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2763,7 +2767,7 @@ class MainWindow(QMainWindow):
|
||||
alternate-background-color: rgba(89, 100, 113, 0.15);
|
||||
selection-background-color: rgba(48, 103, 192, 0.4);
|
||||
selection-color: #ffffff;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2802,7 +2806,7 @@ class MainWindow(QMainWindow):
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 2px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2827,7 +2831,7 @@ class MainWindow(QMainWindow):
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 2px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2856,7 +2860,7 @@ class MainWindow(QMainWindow):
|
||||
self.selectedObjectLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #2dffc4;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2877,7 +2881,7 @@ class MainWindow(QMainWindow):
|
||||
border: 1px solid rgba(76, 92, 110, 0.6);
|
||||
border-radius: 2px;
|
||||
padding: 4px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2917,7 +2921,7 @@ class MainWindow(QMainWindow):
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 2px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2950,7 +2954,7 @@ class MainWindow(QMainWindow):
|
||||
alternate-background-color: rgba(89, 100, 113, 0.15);
|
||||
selection-background-color: rgba(48, 103, 192, 0.4);
|
||||
selection-color: #ffffff;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -2980,7 +2984,7 @@ class MainWindow(QMainWindow):
|
||||
mountedLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #ebebeb;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -3000,7 +3004,7 @@ class MainWindow(QMainWindow):
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 2px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.5px;
|
||||
@ -4453,7 +4457,7 @@ class MainWindow(QMainWindow):
|
||||
color: #f39d78 ;
|
||||
border-radius: 2px;
|
||||
padding: 2px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -4468,7 +4472,7 @@ class MainWindow(QMainWindow):
|
||||
color: #289eff ;
|
||||
border-radius: 2px;
|
||||
padding: 2px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -4487,7 +4491,7 @@ class MainWindow(QMainWindow):
|
||||
color: #2dffc4;
|
||||
border-radius: 2px;
|
||||
padding: 2px 8px;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -4501,7 +4505,7 @@ class MainWindow(QMainWindow):
|
||||
self.selectedObjectLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: #2dffc4;
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
@ -4518,7 +4522,7 @@ class MainWindow(QMainWindow):
|
||||
self.selectedObjectLabel.setStyleSheet("""
|
||||
QLabel {
|
||||
color: rgba(235, 235, 235, 0.5);
|
||||
font-family: 'Inter', 'Microsoft YaHei', sans-serif;
|
||||
font-family: 'Microsoft YaHei', 'Inter', sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.5px;
|
||||
|
||||
@ -53,6 +53,7 @@ class PropertyPanelManager:
|
||||
border-radius: 4px;
|
||||
padding: 4px 6px;
|
||||
font-size: 10px;
|
||||
|
||||
}
|
||||
QDoubleSpinBox:focus, QSpinBox:focus {
|
||||
border: 1px solid #4d74bd;
|
||||
@ -667,6 +668,7 @@ class PropertyPanelManager:
|
||||
model.setPythonTag("user_visible", True)
|
||||
|
||||
self.name_group = QGroupBox("物体名称")
|
||||
self.name_group.setProperty("groupRole", "first")
|
||||
name_layout = QGridLayout()
|
||||
self.active_check = QCheckBox()
|
||||
# 根据模型的实际可见性状态设置复选框
|
||||
@ -5646,6 +5648,7 @@ class PropertyPanelManager:
|
||||
# material_group = QGroupBox(display_name)
|
||||
material_group = QGroupBox("材质属性")
|
||||
material_layout = QGridLayout()
|
||||
material_layout.setColumnMinimumWidth(0, self.column_minimum_width)
|
||||
|
||||
material_layout.addWidget(QLabel("名称:"), 0, 0)
|
||||
limited_length = 25
|
||||
@ -5661,7 +5664,7 @@ class PropertyPanelManager:
|
||||
material_layout.addWidget(QLabel("状态:"), 1, 0)
|
||||
status_label = QLabel(material_status)
|
||||
# status_label.setStyleSheet("color:#FFA500;font-style:italic;font-size:10px;")
|
||||
material_layout.addWidget(status_label, 1, 1, 1, 2)
|
||||
material_layout.addWidget(status_label, 1, 1, 1, 3)
|
||||
|
||||
# 基础颜色编辑
|
||||
base_color = self._getOrCreateMaterialBaseColor(material)
|
||||
@ -5706,7 +5709,7 @@ class PropertyPanelManager:
|
||||
|
||||
# base_color_layout.addStretch(1)
|
||||
|
||||
material_layout.addLayout(base_color_layout, color_row, 1, 1, 4)
|
||||
material_layout.addLayout(base_color_layout, color_row, 1, 1, 3)
|
||||
else:
|
||||
no_base_color_label = QLabel("无法获取材质基础颜色")
|
||||
no_base_color_label.setStyleSheet("color:#888;font-style:italic;font-size:10px;")
|
||||
|
||||
@ -1068,6 +1068,8 @@ class CustomAssetsTreeWidget(QTreeWidget):
|
||||
root_item = QTreeWidgetItem([f"📁 {root_name}"])
|
||||
root_item.setData(0, Qt.UserRole, self.current_path)
|
||||
root_item.setData(0, Qt.UserRole + 1, True)
|
||||
font = QFont("Microsoft YaHei", 10, QFont.Light) # 假设您希望字体大小为10
|
||||
root_item.setFont(0, font)
|
||||
self.addTopLevelItem(root_item)
|
||||
|
||||
# 加载当前目录内容
|
||||
@ -3550,11 +3552,11 @@ class CustomTreeWidget(QTreeWidget):
|
||||
font = QFont(self.font())
|
||||
marker = item.data(0, Qt.UserRole + 1)
|
||||
if item.parent() is None and (marker == "SCENE_ROOT" or item.text(0) == '场景'):
|
||||
font.setPointSize(12)
|
||||
font.setWeight(QFont.Medium)
|
||||
font = QFont("Microsoft YaHei", 12)
|
||||
font.setWeight(QFont.Light)
|
||||
else:
|
||||
font.setPointSize(10)
|
||||
font.setWeight(QFont.Normal)
|
||||
font = QFont("Microsoft YaHei", 10)
|
||||
font.setWeight(QFont.Light)
|
||||
item.setFont(0, font)
|
||||
|
||||
def _apply_font_recursively(self, item):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user