调整设置按钮到右上角,增加按钮样式
This commit is contained in:
@@ -9,9 +9,9 @@ from loguru import logger
|
|||||||
from PySide6.QtWidgets import (QApplication, QMainWindow, QPushButton, QMessageBox,
|
from PySide6.QtWidgets import (QApplication, QMainWindow, QPushButton, QMessageBox,
|
||||||
QVBoxLayout, QWidget, QLabel, QGroupBox, QGridLayout,
|
QVBoxLayout, QWidget, QLabel, QGroupBox, QGridLayout,
|
||||||
QStatusBar, QFrame, QDialog, QLineEdit, QFormLayout,
|
QStatusBar, QFrame, QDialog, QLineEdit, QFormLayout,
|
||||||
QDialogButtonBox, QFileDialog)
|
QDialogButtonBox, QFileDialog, QHBoxLayout)
|
||||||
from PySide6.QtCore import Qt, QThread, Signal
|
from PySide6.QtCore import Qt, QThread, Signal
|
||||||
from PySide6.QtGui import QFont, QAction
|
from PySide6.QtGui import QFont
|
||||||
|
|
||||||
logger.add(sys.stderr, format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}", level="INFO")
|
logger.add(sys.stderr, format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}", level="INFO")
|
||||||
|
|
||||||
@@ -137,8 +137,6 @@ class MainWindow(QMainWindow):
|
|||||||
self.setWindowTitle("投屏源控制")
|
self.setWindowTitle("投屏源控制")
|
||||||
self.setFixedSize(520, 420)
|
self.setFixedSize(520, 420)
|
||||||
|
|
||||||
self.create_menu()
|
|
||||||
|
|
||||||
self.status_bar = QStatusBar()
|
self.status_bar = QStatusBar()
|
||||||
self.setStatusBar(self.status_bar)
|
self.setStatusBar(self.status_bar)
|
||||||
|
|
||||||
@@ -146,11 +144,22 @@ class MainWindow(QMainWindow):
|
|||||||
self.setCentralWidget(central_widget)
|
self.setCentralWidget(central_widget)
|
||||||
main_layout = QVBoxLayout(central_widget)
|
main_layout = QVBoxLayout(central_widget)
|
||||||
|
|
||||||
|
title_layout = QHBoxLayout()
|
||||||
|
title_layout.addStretch()
|
||||||
|
self.btn_settings = QPushButton("⚙ 设置")
|
||||||
|
self.btn_settings.setFixedSize(70, 30)
|
||||||
|
self.btn_settings.clicked.connect(self.open_settings)
|
||||||
|
title_layout.addWidget(self.btn_settings)
|
||||||
|
|
||||||
title_label = QLabel("会议投屏系统 - 主播端")
|
title_label = QLabel("会议投屏系统 - 主播端")
|
||||||
title_font = QFont("Microsoft YaHei", 14, QFont.Bold)
|
title_font = QFont("Microsoft YaHei", 14, QFont.Bold)
|
||||||
title_label.setFont(title_font)
|
title_label.setFont(title_font)
|
||||||
title_label.setAlignment(Qt.AlignCenter)
|
title_label.setAlignment(Qt.AlignCenter)
|
||||||
main_layout.addWidget(title_label)
|
|
||||||
|
title_main_layout = QVBoxLayout()
|
||||||
|
title_main_layout.addLayout(title_layout)
|
||||||
|
title_main_layout.addWidget(title_label)
|
||||||
|
main_layout.addLayout(title_main_layout)
|
||||||
|
|
||||||
config_group = QGroupBox("本地配置")
|
config_group = QGroupBox("本地配置")
|
||||||
config_layout = QGridLayout()
|
config_layout = QGridLayout()
|
||||||
@@ -188,6 +197,21 @@ class MainWindow(QMainWindow):
|
|||||||
self.btn_push = QPushButton("🎬 开始全屏投屏")
|
self.btn_push = QPushButton("🎬 开始全屏投屏")
|
||||||
self.btn_push.setFixedHeight(50)
|
self.btn_push.setFixedHeight(50)
|
||||||
self.btn_push.setFont(QFont("Microsoft YaHei", 11))
|
self.btn_push.setFont(QFont("Microsoft YaHei", 11))
|
||||||
|
self.btn_push.setStyleSheet("""
|
||||||
|
QPushButton {
|
||||||
|
background-color: #2E7D32;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: #388E3C;
|
||||||
|
}
|
||||||
|
QPushButton:pressed {
|
||||||
|
background-color: #1B5E20;
|
||||||
|
}
|
||||||
|
""")
|
||||||
self.btn_push.clicked.connect(self.push_full_screen)
|
self.btn_push.clicked.connect(self.push_full_screen)
|
||||||
main_layout.addWidget(self.btn_push)
|
main_layout.addWidget(self.btn_push)
|
||||||
|
|
||||||
@@ -204,11 +228,6 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
logger.info("投屏源控制界面已初始化")
|
logger.info("投屏源控制界面已初始化")
|
||||||
|
|
||||||
def create_menu(self):
|
|
||||||
settings_action = QAction("⚙ 设置", self)
|
|
||||||
settings_action.triggered.connect(self.open_settings)
|
|
||||||
self.menuBar().addAction(settings_action)
|
|
||||||
|
|
||||||
def update_info_group(self):
|
def update_info_group(self):
|
||||||
cfg = self.config
|
cfg = self.config
|
||||||
if self.info_group.layout():
|
if self.info_group.layout():
|
||||||
|
|||||||
Reference in New Issue
Block a user