优化UI
This commit is contained in:
473
v1/main.py
473
v1/main.py
@@ -1,335 +1,157 @@
|
|||||||
import sys
|
import sys
|
||||||
from PyQt5.QtWidgets import QApplication, QMainWindow, QStackedWidget, QHBoxLayout, QWidget, QMessageBox
|
from PyQt5.QtWidgets import QApplication, QMainWindow, QStackedWidget, QHBoxLayout, QWidget, QMessageBox, QPushButton, \
|
||||||
from PyQt5.QtCore import Qt
|
QLabel, QVBoxLayout, QFrame, QSizePolicy
|
||||||
|
from PyQt5.QtCore import Qt, QPoint
|
||||||
from views.login import LoginPage
|
from views.login import LoginPage
|
||||||
from views.nav import NavBar
|
from views.nav import NavBar
|
||||||
from views.home import Home
|
from views.home import Home
|
||||||
from views.word_to_pdf import WordToPDFPage
|
from views.word_to_pdf import WordToPDFPage
|
||||||
|
from views.pdf_tools_page import PDFToolsPage
|
||||||
from views.app_center import AppCenter
|
from views.app_center import AppCenter
|
||||||
from views.history import HistoryPage
|
from views.history import HistoryPage
|
||||||
from PyQt5.QtGui import QPalette, QColor
|
from PyQt5.QtGui import QPalette, QColor, QFont
|
||||||
|
|
||||||
# 优化的暗色主题样式表
|
from styles.styles import STYLES_TXT
|
||||||
STYLES_TXT = """
|
|
||||||
/* ===== 全局样式 ===== */
|
|
||||||
QWidget {
|
|
||||||
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #e2e8f0;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 输入框 */
|
|
||||||
QLineEdit {
|
|
||||||
background-color: #2d3748;
|
|
||||||
border: 1px solid #4a5568;
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 10px;
|
|
||||||
color: #e2e8f0;
|
|
||||||
min-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QLineEdit:focus {
|
class CustomTitleBar(QWidget):
|
||||||
border-color: #818cf8;
|
"""自定义标题栏控件"""
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===== 按钮全局样式 ===== */
|
def __init__(self, parent=None):
|
||||||
QPushButton {
|
super().__init__(parent)
|
||||||
background-color: #4f46e5;
|
self.parent = parent
|
||||||
color: white;
|
self.setMouseTracking(True)
|
||||||
border-radius: 8px; /* 增加圆角程度 */
|
self.drag_position = QPoint()
|
||||||
padding: 10px 16px;
|
self.setObjectName("customTitleBar")
|
||||||
min-height: 40px; /* 增加高度 */
|
self.init_ui()
|
||||||
font-weight: 500;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
border: none;
|
|
||||||
outline: none; /* 防止点击时出现虚线边框 */
|
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton:hover {
|
def init_ui(self):
|
||||||
background-color: #4338ca;
|
"""初始化标题栏UI"""
|
||||||
transform: translateY(-2px);
|
layout = QHBoxLayout(self)
|
||||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
layout.setContentsMargins(15, 8, 15, 8)
|
||||||
}
|
layout.setSpacing(12)
|
||||||
|
|
||||||
QPushButton:pressed {
|
# 添加应用图标和标题
|
||||||
background-color: #3730a3;
|
self.title_label = QLabel("奶酪云工具箱")
|
||||||
transform: translateY(0);
|
self.title_label.setObjectName("titleLabel")
|
||||||
box-shadow: none;
|
self.title_label.setFont(QFont("Microsoft YaHei UI", 12, QFont.Bold))
|
||||||
}
|
self.title_label.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
QPushButton:disabled {
|
# 添加拖拽区域(占位区域)
|
||||||
background-color: #4a5568;
|
self.drag_area = QWidget()
|
||||||
color: #a0aec0;
|
self.drag_area.setObjectName("dragArea")
|
||||||
}
|
self.drag_area.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
||||||
|
|
||||||
/* 特殊按钮样式 */
|
# 添加窗口控制按钮
|
||||||
QPushButton#navBtn {
|
self.minimize_btn = QPushButton("—")
|
||||||
text-align: left;
|
self.minimize_btn.setObjectName("minimizeBtn")
|
||||||
padding: 12px 25px;
|
self.minimize_btn.setFixedSize(30, 30)
|
||||||
color: #a0aec0;
|
self.minimize_btn.clicked.connect(lambda: self.parent.showMinimized())
|
||||||
border-radius: 8px;
|
|
||||||
margin: 5px 15px;
|
|
||||||
font-size: 14px;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#navBtn:hover {
|
self.maximize_btn = QPushButton("□")
|
||||||
background-color: rgba(79, 70, 229, 0.1);
|
self.maximize_btn.setObjectName("maximizeBtn")
|
||||||
color: #cbd5e0;
|
self.maximize_btn.setFixedSize(30, 30)
|
||||||
}
|
self.maximize_btn.clicked.connect(self.toggle_maximize)
|
||||||
|
|
||||||
QPushButton#navBtn.active {
|
self.close_btn = QPushButton("×")
|
||||||
background-color: rgba(79, 70, 229, 0.15);
|
self.close_btn.setObjectName("closeBtn")
|
||||||
color: #818cf8;
|
self.close_btn.setFixedSize(30, 30)
|
||||||
font-weight: 500;
|
self.close_btn.clicked.connect(self.parent.close)
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#logoutBtn {
|
# 将控件添加到布局中
|
||||||
text-align: left;
|
layout.addWidget(self.title_label)
|
||||||
padding: 12px 25px;
|
layout.addWidget(self.drag_area)
|
||||||
border-radius: 8px;
|
layout.addWidget(self.minimize_btn)
|
||||||
margin: 5px 15px;
|
layout.addWidget(self.maximize_btn)
|
||||||
font-size: 14px;
|
layout.addWidget(self.close_btn)
|
||||||
color: #feb2b2;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#logoutBtn:hover {
|
def toggle_maximize(self):
|
||||||
color: #f56565;
|
"""切换窗口最大化/正常状态"""
|
||||||
}
|
if self.parent.isMaximized():
|
||||||
|
self.parent.showNormal()
|
||||||
|
self.maximize_btn.setText("□")
|
||||||
|
else:
|
||||||
|
self.parent.showMaximized()
|
||||||
|
self.maximize_btn.setText("⬜")
|
||||||
|
|
||||||
/* 操作按钮样式 */
|
def mousePressEvent(self, event):
|
||||||
QPushButton#actionBtn {
|
"""鼠标按下事件处理"""
|
||||||
background-color: rgba(129, 140, 248, 0.1);
|
if event.button() == Qt.LeftButton:
|
||||||
color: #818cf8;
|
self.drag_position = event.globalPos() - self.parent.frameGeometry().topLeft()
|
||||||
border: 1px solid rgba(129, 140, 248, 0.2);
|
event.accept()
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#actionBtn:hover {
|
def mouseMoveEvent(self, event):
|
||||||
background-color: rgba(129, 140, 248, 0.2);
|
"""鼠标移动事件处理"""
|
||||||
}
|
if event.buttons() == Qt.LeftButton:
|
||||||
|
self.parent.move(event.globalPos() - self.drag_position)
|
||||||
|
event.accept()
|
||||||
|
|
||||||
QPushButton#retryBtn {
|
def mouseDoubleClickEvent(self, event):
|
||||||
background-color: rgba(251, 113, 133, 0.1);
|
"""鼠标双击事件处理"""
|
||||||
color: #fb7185;
|
if event.button() == Qt.LeftButton:
|
||||||
border: 1px solid rgba(251, 113, 133, 0.2);
|
self.toggle_maximize()
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
event.accept()
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#retryBtn:hover {
|
|
||||||
background-color: rgba(251, 113, 133, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#deleteBtn {
|
|
||||||
background-color: rgba(120, 113, 108, 0.1);
|
|
||||||
color: #a8a29e;
|
|
||||||
border: 1px solid rgba(120, 113, 108, 0.2);
|
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
QPushButton#deleteBtn:hover {
|
|
||||||
background-color: rgba(120, 113, 108, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 卡片按钮样式 */
|
|
||||||
QPushButton#appCardBtn {
|
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
|
||||||
min-width: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 登录页面按钮 */
|
|
||||||
QPushButton#loginBtn {
|
|
||||||
min-height: auto; /* 覆盖全局最小高度 */
|
|
||||||
min-width: 240px;
|
|
||||||
padding: 14px 30px;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 列表控件 */
|
|
||||||
QListWidget {
|
|
||||||
background-color: #2d3748;
|
|
||||||
border: 1px solid #4a5568;
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 4px;
|
|
||||||
color: #e2e8f0;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
QListWidget::item {
|
|
||||||
padding: 8px 12px;
|
|
||||||
border-bottom: 1px solid #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
QListWidget::item:selected {
|
|
||||||
background-color: rgba(129, 140, 248, 0.15);
|
|
||||||
color: #e2e8f0;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 滚动条 */
|
|
||||||
QScrollBar:vertical {
|
|
||||||
background: #2d3748;
|
|
||||||
width: 10px;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
QScrollBar::handle:vertical {
|
|
||||||
background: #4a5568;
|
|
||||||
min-height: 20px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QScrollBar::handle:vertical:hover {
|
|
||||||
background: #718096;
|
|
||||||
}
|
|
||||||
|
|
||||||
QScrollBar::add-line:vertical,
|
|
||||||
QScrollBar::sub-line:vertical {
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QScrollBar::add-page:vertical,
|
|
||||||
QScrollBar::sub-page:vertical {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 标签 */
|
|
||||||
QLabel {
|
|
||||||
color: #e2e8f0;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 菜单栏 */
|
|
||||||
/* 导航栏 */
|
|
||||||
#navBar {
|
|
||||||
background-color: #1a202c;
|
|
||||||
border-right: 1px solid #2d3748;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 用户卡片 */
|
|
||||||
#userCard {
|
|
||||||
background-color: #2d3748;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: 15px;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 导航按钮 */
|
|
||||||
#navBtn {
|
|
||||||
text-align: left;
|
|
||||||
padding: 12px 25px;
|
|
||||||
color: #a0aec0;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: 5px 15px;
|
|
||||||
font-size: 14px;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navBtn:hover {
|
|
||||||
background-color: rgba(79, 70, 229, 0.1);
|
|
||||||
color: #cbd5e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navBtn.active {
|
|
||||||
background-color: rgba(79, 70, 229, 0.15);
|
|
||||||
color: #818cf8;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 退出按钮 */
|
|
||||||
#logoutBtn {
|
|
||||||
text-align: left;
|
|
||||||
padding: 12px 25px;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: 5px 15px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #feb2b2;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logoutBtn:hover {
|
|
||||||
color: #f56565;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 分割线 */
|
|
||||||
QFrame[frameShape="4"] { /* HLine */
|
|
||||||
background-color: #2d3748;
|
|
||||||
margin: 10px 15px;
|
|
||||||
max-height: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 进度条 */
|
|
||||||
QProgressBar {
|
|
||||||
border-radius: 4px;
|
|
||||||
height: 8px;
|
|
||||||
background-color: #2d3748;
|
|
||||||
border: 1px solid #4a5568;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #4f46e5;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 复选框 */
|
|
||||||
QCheckBox {
|
|
||||||
color: #e2e8f0;
|
|
||||||
spacing: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QCheckBox::indicator {
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
border: 1px solid #4a5568;
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: #2d3748;
|
|
||||||
}
|
|
||||||
|
|
||||||
QCheckBox::indicator:checked {
|
|
||||||
background-color: #4f46e5;
|
|
||||||
border: 1px solid #4f46e5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 分组框 */
|
|
||||||
QGroupBox {
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: #2d3748;
|
|
||||||
border: 1px solid #4a5568;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin-top: 1.5ex;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QGroupBox::title {
|
|
||||||
subcontrol-origin: margin;
|
|
||||||
subcontrol-position: top left;
|
|
||||||
background-color: transparent;
|
|
||||||
padding: 0 3px;
|
|
||||||
left: 9px;
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.username = None
|
self.username = None
|
||||||
|
self.setWindowFlag(Qt.FramelessWindowHint) # 设置为无边框窗口
|
||||||
self.init_ui()
|
self.init_ui()
|
||||||
|
|
||||||
def init_ui(self):
|
def init_ui(self):
|
||||||
self.setWindowTitle("文档处理工具")
|
self.setWindowTitle("文档处理工具")
|
||||||
self.setGeometry(100, 100, 1200, 800)
|
self.setGeometry(100, 100, 1200, 800)
|
||||||
self.setStyleSheet(STYLES_TXT)
|
|
||||||
|
# 添加自定义标题栏样式
|
||||||
|
titlebar_styles = """
|
||||||
|
/* 自定义标题栏样式 */
|
||||||
|
#customTitleBar {
|
||||||
|
background-color: #1a202c;
|
||||||
|
border-bottom: 1px solid #2d3748;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#titleLabel {
|
||||||
|
color: #cbd5e0;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#dragArea {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#minimizeBtn,
|
||||||
|
QPushButton#maximizeBtn,
|
||||||
|
QPushButton#closeBtn {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #a0aec0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#minimizeBtn:hover,
|
||||||
|
QPushButton#maximizeBtn:hover {
|
||||||
|
background-color: rgba(74, 85, 104, 0.3);
|
||||||
|
color: #e2e8f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#closeBtn:hover {
|
||||||
|
background-color: rgba(254, 178, 178, 0.3);
|
||||||
|
color: #f56565;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 窗口边框效果 */
|
||||||
|
#mainWidget {
|
||||||
|
border: 1px solid #2d3748;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
# 合并样式表
|
||||||
|
self.setStyleSheet(STYLES_TXT + titlebar_styles)
|
||||||
|
|
||||||
# 设置暗色主题调色板
|
# 设置暗色主题调色板
|
||||||
palette = QPalette()
|
palette = QPalette()
|
||||||
@@ -351,10 +173,29 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
# 主窗口部件
|
# 主窗口部件
|
||||||
self.main_widget = QWidget()
|
self.main_widget = QWidget()
|
||||||
self.main_layout = QHBoxLayout(self.main_widget)
|
self.main_widget.setObjectName("mainWidget")
|
||||||
|
self.main_layout = QVBoxLayout(self.main_widget)
|
||||||
self.main_layout.setContentsMargins(0, 0, 0, 0)
|
self.main_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.main_layout.setSpacing(0)
|
self.main_layout.setSpacing(0)
|
||||||
|
|
||||||
|
# 添加自定义标题栏
|
||||||
|
self.title_bar = CustomTitleBar(self)
|
||||||
|
self.main_layout.addWidget(self.title_bar)
|
||||||
|
|
||||||
|
# 添加分隔线
|
||||||
|
separator = QFrame()
|
||||||
|
separator.setFrameShape(QFrame.HLine)
|
||||||
|
separator.setFrameShadow(QFrame.Sunken)
|
||||||
|
separator.setMaximumHeight(1)
|
||||||
|
separator.setStyleSheet("background-color: #2d3748;")
|
||||||
|
self.main_layout.addWidget(separator)
|
||||||
|
|
||||||
|
# 主内容区域
|
||||||
|
content_widget = QWidget()
|
||||||
|
content_layout = QHBoxLayout(content_widget)
|
||||||
|
content_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
content_layout.setSpacing(0)
|
||||||
|
|
||||||
# 导航栏 (初始隐藏)
|
# 导航栏 (初始隐藏)
|
||||||
self.nav_bar = NavBar("")
|
self.nav_bar = NavBar("")
|
||||||
self.nav_bar.setObjectName("navBar")
|
self.nav_bar.setObjectName("navBar")
|
||||||
@@ -381,10 +222,13 @@ class MainWindow(QMainWindow):
|
|||||||
# Word转PDF页
|
# Word转PDF页
|
||||||
self.word_to_pdf = WordToPDFPage()
|
self.word_to_pdf = WordToPDFPage()
|
||||||
|
|
||||||
|
# Word转PDF页
|
||||||
|
self.pdf_tools_page = PDFToolsPage()
|
||||||
|
|
||||||
# 使用记录页
|
# 使用记录页
|
||||||
self.history_page = HistoryPage()
|
self.history_page = HistoryPage()
|
||||||
|
|
||||||
# 设置页(待实现)
|
# 设置页(占位)
|
||||||
self.settings_page = QWidget()
|
self.settings_page = QWidget()
|
||||||
self.settings_page.setObjectName("settingsPage")
|
self.settings_page.setObjectName("settingsPage")
|
||||||
|
|
||||||
@@ -393,17 +237,26 @@ class MainWindow(QMainWindow):
|
|||||||
self.stacked_pages.addWidget(self.app_center)
|
self.stacked_pages.addWidget(self.app_center)
|
||||||
self.stacked_pages.addWidget(self.home)
|
self.stacked_pages.addWidget(self.home)
|
||||||
self.stacked_pages.addWidget(self.word_to_pdf)
|
self.stacked_pages.addWidget(self.word_to_pdf)
|
||||||
|
self.stacked_pages.addWidget(self.pdf_tools_page)
|
||||||
self.stacked_pages.addWidget(self.history_page)
|
self.stacked_pages.addWidget(self.history_page)
|
||||||
self.stacked_pages.addWidget(self.settings_page)
|
self.stacked_pages.addWidget(self.settings_page)
|
||||||
|
|
||||||
# 主布局
|
# 主内容布局
|
||||||
self.main_layout.addWidget(self.nav_bar)
|
content_layout.addWidget(self.nav_bar)
|
||||||
self.main_layout.addWidget(self.stacked_pages, 1) # 设置弹性因子为1
|
content_layout.addWidget(self.stacked_pages, 1)
|
||||||
|
|
||||||
|
# 添加到主布局
|
||||||
|
self.main_layout.addWidget(content_widget, 1)
|
||||||
|
|
||||||
self.setCentralWidget(self.main_widget)
|
self.setCentralWidget(self.main_widget)
|
||||||
|
|
||||||
|
# 鼠标悬停在边缘时的调整光标
|
||||||
|
self.setMouseTracking(True)
|
||||||
|
|
||||||
def handle_login_success(self, username):
|
def handle_login_success(self, username):
|
||||||
self.username = username
|
self.username = username
|
||||||
|
# 更新标题栏显示
|
||||||
|
self.title_bar.title_label.setText(f"文档处理工具 - 欢迎 {username}")
|
||||||
# 更新导航栏用户信息
|
# 更新导航栏用户信息
|
||||||
self.nav_bar.username = username
|
self.nav_bar.username = username
|
||||||
self.nav_bar.show()
|
self.nav_bar.show()
|
||||||
@@ -415,6 +268,8 @@ class MainWindow(QMainWindow):
|
|||||||
self.username = None
|
self.username = None
|
||||||
self.nav_bar.hide()
|
self.nav_bar.hide()
|
||||||
self.stacked_pages.setCurrentWidget(self.login_page)
|
self.stacked_pages.setCurrentWidget(self.login_page)
|
||||||
|
# 重置标题栏
|
||||||
|
self.title_bar.title_label.setText("文档处理工具")
|
||||||
|
|
||||||
def handle_nav_click(self, nav_id):
|
def handle_nav_click(self, nav_id):
|
||||||
# 确保导航栏状态更新
|
# 确保导航栏状态更新
|
||||||
@@ -434,17 +289,15 @@ class MainWindow(QMainWindow):
|
|||||||
try:
|
try:
|
||||||
if app_id == "word_to_pdf":
|
if app_id == "word_to_pdf":
|
||||||
self.stacked_pages.setCurrentWidget(self.word_to_pdf)
|
self.stacked_pages.setCurrentWidget(self.word_to_pdf)
|
||||||
|
elif app_id == "pdf_tools_page":
|
||||||
|
print('1')
|
||||||
|
self.stacked_pages.setCurrentWidget(self.pdf_tools_page)
|
||||||
elif app_id == "history":
|
elif app_id == "history":
|
||||||
# 注意:这里假设历史记录页面尚未开发,暂时显示word_to_pdf页面
|
|
||||||
# 实际开发中应替换为正确的历史记录页面
|
|
||||||
self.stacked_pages.setCurrentWidget(self.word_to_pdf)
|
self.stacked_pages.setCurrentWidget(self.word_to_pdf)
|
||||||
else:
|
else:
|
||||||
# 未开发的应用:弹出提示弹窗
|
|
||||||
self.show_development_popup(app_id)
|
self.show_development_popup(app_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# 捕获并打印异常信息,避免程序闪退
|
|
||||||
print(f"处理应用选择时发生错误: {e}")
|
print(f"处理应用选择时发生错误: {e}")
|
||||||
# 可以选择显示错误弹窗
|
|
||||||
QMessageBox.critical(self, "错误", f"发生错误: {str(e)}", QMessageBox.Button.Ok)
|
QMessageBox.critical(self, "错误", f"发生错误: {str(e)}", QMessageBox.Button.Ok)
|
||||||
|
|
||||||
def show_development_popup(self, app_id):
|
def show_development_popup(self, app_id):
|
||||||
@@ -476,4 +329,4 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@@ -1,223 +1,172 @@
|
|||||||
styles_txt = """
|
# 优化的暗色主题样式表
|
||||||
/* 全局样式 */
|
STYLES_TXT = """
|
||||||
|
/* ===== 全局样式 ===== */
|
||||||
QWidget {
|
QWidget {
|
||||||
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #e2e8f0;
|
color: #e2e8f0;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 登录页面 */
|
/* 输入框 */
|
||||||
#loginPage {
|
QLineEdit {
|
||||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #667eea, stop:1 #764ba2);
|
background-color: #2d3748;
|
||||||
}
|
border: 1px solid #4a5568;
|
||||||
|
|
||||||
#loginCard {
|
|
||||||
background-color: rgba(255, 255, 255, 0.9);
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#loginTitle {
|
|
||||||
font-size: 28px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #2d3748;
|
|
||||||
}
|
|
||||||
|
|
||||||
#formLabel {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
#formInput {
|
|
||||||
background-color: #edf2f7;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
color: #2d3748;
|
color: #e2e8f0;
|
||||||
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#formInput:focus {
|
QLineEdit:focus {
|
||||||
border-color: #667eea;
|
border-color: #818cf8;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#loginBtn {
|
/* ===== 按钮全局样式 ===== */
|
||||||
|
QPushButton {
|
||||||
background-color: #4f46e5;
|
background-color: #4f46e5;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 6px;
|
border-radius: 8px; /* 增加圆角程度 */
|
||||||
padding: 12px;
|
padding: 10px 16px;
|
||||||
font-weight: bold;
|
min-height: 40px; /* 增加高度 */
|
||||||
|
font-weight: 500;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
border: none;
|
||||||
|
outline: none; /* 防止点击时出现虚线边框 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#loginBtn:hover {
|
QPushButton:hover {
|
||||||
background-color: #4338ca;
|
background-color: #4338ca;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 导航栏 */
|
QPushButton:pressed {
|
||||||
#navBar {
|
background-color: #3730a3;
|
||||||
background-color: #1a202c;
|
transform: translateY(0);
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#userFrame {
|
QPushButton:disabled {
|
||||||
background-color: #2d3748;
|
background-color: #4a5568;
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#userName {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navBtn {
|
|
||||||
text-align: left;
|
|
||||||
padding: 12px 20px;
|
|
||||||
border-radius: 6px;
|
|
||||||
color: #a0aec0;
|
color: #a0aec0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navBtn:hover {
|
/* 特殊按钮样式 */
|
||||||
background-color: #2d3748;
|
QPushButton#navBtn {
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logoutBtn {
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 12px 20px;
|
padding: 12px 25px;
|
||||||
border-radius: 6px;
|
color: #a0aec0;
|
||||||
color: #e53e3e;
|
border-radius: 8px;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#logoutBtn:hover {
|
QPushButton#navBtn:hover {
|
||||||
background-color: #2d3748;
|
background-color: rgba(79, 70, 229, 0.1);
|
||||||
|
color: #cbd5e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#navBtn.active {
|
||||||
|
background-color: rgba(79, 70, 229, 0.15);
|
||||||
|
color: #818cf8;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#logoutBtn {
|
||||||
|
text-align: left;
|
||||||
|
padding: 12px 25px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #feb2b2;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#logoutBtn:hover {
|
||||||
color: #f56565;
|
color: #f56565;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 应用中心 */
|
/* 操作按钮样式 */
|
||||||
#appCenter {
|
QPushButton#actionBtn {
|
||||||
background-color: #1a202c;
|
background-color: rgba(129, 140, 248, 0.1);
|
||||||
|
color: #818cf8;
|
||||||
|
border: 1px solid rgba(129, 140, 248, 0.2);
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#pageTitle {
|
QPushButton#actionBtn:hover {
|
||||||
font-size: 24px;
|
background-color: rgba(129, 140, 248, 0.2);
|
||||||
font-weight: bold;
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#appCard {
|
QPushButton#retryBtn {
|
||||||
border-radius: 12px;
|
background-color: rgba(251, 113, 133, 0.1);
|
||||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
color: #fb7185;
|
||||||
transition: transform 0.2s;
|
border: 1px solid rgba(251, 113, 133, 0.2);
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#appCard:hover {
|
QPushButton#retryBtn:hover {
|
||||||
transform: translateY(-5px);
|
background-color: rgba(251, 113, 133, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Word转PDF页面 */
|
QPushButton#deleteBtn {
|
||||||
#wordToPdfPage {
|
background-color: rgba(120, 113, 108, 0.1);
|
||||||
background-color: #1a202c;
|
color: #a8a29e;
|
||||||
|
border: 1px solid rgba(120, 113, 108, 0.2);
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#leftPanel, #rightPanel {
|
QPushButton#deleteBtn:hover {
|
||||||
|
background-color: rgba(120, 113, 108, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片按钮样式 */
|
||||||
|
QPushButton#appCardBtn {
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
|
min-width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 登录页面按钮 */
|
||||||
|
QPushButton#loginBtn {
|
||||||
|
min-height: auto; /* 覆盖全局最小高度 */
|
||||||
|
min-width: 240px;
|
||||||
|
padding: 14px 30px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 列表控件 */
|
||||||
|
QListWidget {
|
||||||
background-color: #2d3748;
|
background-color: #2d3748;
|
||||||
border-radius: 12px;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#uploadArea {
|
|
||||||
border: 2px dashed #4a5568;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: rgba(74, 85, 104, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#uploadArea:hover {
|
|
||||||
border-color: #667eea;
|
|
||||||
background-color: rgba(102, 126, 234, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#uploadBtn {
|
|
||||||
background-color: #4f46e5;
|
|
||||||
color: white;
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#uploadBtn:hover {
|
|
||||||
background-color: #4338ca;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fileList, #resultList, #logContent {
|
|
||||||
background-color: #1a202c;
|
|
||||||
border: 1px solid #4a5568;
|
border: 1px solid #4a5568;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 8px;
|
padding: 4px;
|
||||||
|
color: #e2e8f0;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#convertBtn {
|
QListWidget::item {
|
||||||
background-color: #4CAF50;
|
padding: 8px 12px;
|
||||||
color: white;
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#convertBtn:hover {
|
|
||||||
background-color: #3d8b40;
|
|
||||||
}
|
|
||||||
|
|
||||||
#deleteBtn {
|
|
||||||
background-color: #f44336;
|
|
||||||
color: white;
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#deleteBtn:hover {
|
|
||||||
background-color: #d32f2f;
|
|
||||||
}
|
|
||||||
|
|
||||||
#downloadBtn {
|
|
||||||
background-color: #2196F3;
|
|
||||||
color: white;
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#downloadBtn:hover {
|
|
||||||
background-color: #1976d2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logArea {
|
|
||||||
background-color: #1a202c;
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logTitle {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: white;
|
|
||||||
padding-bottom: 8px;
|
|
||||||
border-bottom: 1px solid #4a5568;
|
border-bottom: 1px solid #4a5568;
|
||||||
}
|
}
|
||||||
|
|
||||||
QProgressBar {
|
QListWidget::item:selected {
|
||||||
border-radius: 4px;
|
background-color: rgba(129, 140, 248, 0.15);
|
||||||
height: 8px;
|
color: #e2e8f0;
|
||||||
background-color: #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: #4f46e5;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 滚动条 */
|
/* 滚动条 */
|
||||||
QScrollBar:vertical {
|
QScrollBar:vertical {
|
||||||
border: none;
|
|
||||||
background: #2d3748;
|
background: #2d3748;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
margin: 0;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical {
|
QScrollBar::handle:vertical {
|
||||||
@@ -230,11 +179,131 @@ QScrollBar::handle:vertical:hover {
|
|||||||
background: #718096;
|
background: #718096;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
|
QScrollBar::add-line:vertical,
|
||||||
|
QScrollBar::sub-line:vertical {
|
||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
QScrollBar::add-page:vertical,
|
||||||
|
QScrollBar::sub-page:vertical {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 标签 */
|
||||||
|
QLabel {
|
||||||
|
color: #e2e8f0;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 菜单栏 */
|
||||||
|
/* 导航栏 */
|
||||||
|
#navBar {
|
||||||
|
background-color: #1a202c;
|
||||||
|
border-right: 1px solid #2d3748;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 用户卡片 */
|
||||||
|
#userCard {
|
||||||
|
background-color: #2d3748;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 15px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 导航按钮 */
|
||||||
|
#navBtn {
|
||||||
|
text-align: left;
|
||||||
|
padding: 12px 25px;
|
||||||
|
color: #a0aec0;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#navBtn:hover {
|
||||||
|
background-color: rgba(79, 70, 229, 0.1);
|
||||||
|
color: #cbd5e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#navBtn.active {
|
||||||
|
background-color: rgba(79, 70, 229, 0.15);
|
||||||
|
color: #818cf8;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 退出按钮 */
|
||||||
|
#logoutBtn {
|
||||||
|
text-align: left;
|
||||||
|
padding: 12px 25px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #feb2b2;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logoutBtn:hover {
|
||||||
|
color: #f56565;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 分割线 */
|
||||||
|
QFrame[frameShape="4"] { /* HLine */
|
||||||
|
background-color: #2d3748;
|
||||||
|
margin: 10px 15px;
|
||||||
|
max-height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 进度条 */
|
||||||
|
QProgressBar {
|
||||||
|
border-radius: 4px;
|
||||||
|
height: 8px;
|
||||||
|
background-color: #2d3748;
|
||||||
|
border: 1px solid #4a5568;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #4f46e5;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 复选框 */
|
||||||
|
QCheckBox {
|
||||||
|
color: #e2e8f0;
|
||||||
|
spacing: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox::indicator {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
border: 1px solid #4a5568;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: #2d3748;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
background-color: #4f46e5;
|
||||||
|
border: 1px solid #4f46e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 分组框 */
|
||||||
|
QGroupBox {
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: #2d3748;
|
||||||
|
border: 1px solid #4a5568;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-top: 1.5ex;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QGroupBox::title {
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
subcontrol-position: top left;
|
||||||
|
background-color: transparent;
|
||||||
|
padding: 0 3px;
|
||||||
|
left: 9px;
|
||||||
|
}
|
||||||
"""
|
"""
|
||||||
@@ -853,7 +853,7 @@ class AppCenter(QWidget):
|
|||||||
"desc": "批量将Word文档转换为PDF格式",
|
"desc": "批量将Word文档转换为PDF格式",
|
||||||
"color": ("#6366F1", "#4F46E5"),
|
"color": ("#6366F1", "#4F46E5"),
|
||||||
"icon": "word_to_pdf",
|
"icon": "word_to_pdf",
|
||||||
"author": "李明",
|
"author": "年糕崽崽",
|
||||||
"upload_time": "2023-06-15",
|
"upload_time": "2023-06-15",
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"category": "文档处理",
|
"category": "文档处理",
|
||||||
@@ -865,46 +865,12 @@ class AppCenter(QWidget):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ocr",
|
"id": "pdf_tools_page",
|
||||||
"title": "OCR文字识别",
|
"title": "PDF合并/拆分工具",
|
||||||
"desc": "从图片中提取文字内容",
|
|
||||||
"color": ("#4ADE80", "#22C55E"),
|
|
||||||
"icon": "ocr",
|
|
||||||
"author": "张伟",
|
|
||||||
"upload_time": "2023-07-22",
|
|
||||||
"version": "2.0.1",
|
|
||||||
"category": "图像处理",
|
|
||||||
"features": [
|
|
||||||
"支持多种图片格式",
|
|
||||||
"识别准确率高",
|
|
||||||
"支持多语言识别",
|
|
||||||
"导出为可编辑文本"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "image_convert",
|
|
||||||
"title": "图片格式转换",
|
|
||||||
"desc": "转换图像文件格式并优化",
|
|
||||||
"color": ("#F97316", "#EA580C"),
|
|
||||||
"icon": "image_convert",
|
|
||||||
"author": "王芳",
|
|
||||||
"upload_time": "2023-08-10",
|
|
||||||
"version": "1.5.3",
|
|
||||||
"category": "图像处理",
|
|
||||||
"features": [
|
|
||||||
"支持JPEG、PNG、WEBP等格式",
|
|
||||||
"批量转换功能",
|
|
||||||
"图片压缩优化",
|
|
||||||
"保持图片质量"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "pdf_merge",
|
|
||||||
"title": "PDF合并工具",
|
|
||||||
"desc": "合并多个PDF文件为一个",
|
"desc": "合并多个PDF文件为一个",
|
||||||
"color": ("#8B5CF6", "#7C3AED"),
|
"color": ("#8B5CF6", "#7C3AED"),
|
||||||
"icon": "pdf_merge",
|
"icon": "pdf_merge",
|
||||||
"author": "刘强",
|
"author": "年糕崽崽",
|
||||||
"upload_time": "2023-09-05",
|
"upload_time": "2023-09-05",
|
||||||
"version": "极速版1.1.0",
|
"version": "极速版1.1.0",
|
||||||
"category": "文档处理",
|
"category": "文档处理",
|
||||||
@@ -915,91 +881,108 @@ class AppCenter(QWidget):
|
|||||||
"支持大文件处理"
|
"支持大文件处理"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
# {
|
||||||
"id": "pdf_split",
|
# "id": "ocr",
|
||||||
"title": "PDF拆分工具",
|
# "title": "OCR文字识别",
|
||||||
"desc": "拆分PDF文件为多个文档",
|
# "desc": "从图片中提取文字内容",
|
||||||
"color": ("#EC4899", "#DB2777"),
|
# "color": ("#4ADE80", "#22C55E"),
|
||||||
"icon": "pdf_split",
|
# "icon": "ocr",
|
||||||
"author": "陈晓",
|
# "author": "张伟",
|
||||||
"upload_time": "2023-09-18",
|
# "upload_time": "2023-07-22",
|
||||||
"version": "1.0.5",
|
# "version": "2.0.1",
|
||||||
"category": "文档处理",
|
# "category": "图像处理",
|
||||||
"features": [
|
# "features": [
|
||||||
"按页码拆分PDF",
|
# "支持多种图片格式",
|
||||||
"按书签拆分PDF",
|
# "识别准确率高",
|
||||||
"自定义拆分范围",
|
# "支持多语言识别",
|
||||||
"批量处理多个文件"
|
# "导出为可编辑文本"
|
||||||
]
|
# ]
|
||||||
},
|
# },
|
||||||
{
|
# {
|
||||||
"id": "video_compress",
|
# "id": "image_convert",
|
||||||
"title": "视频压缩",
|
# "title": "图片格式转换",
|
||||||
"desc": "减小视频文件大小",
|
# "desc": "转换图像文件格式并优化",
|
||||||
"color": ("#3B82F6", "#2563EB"),
|
# "color": ("#F97316", "#EA580C"),
|
||||||
"icon": "video_compress",
|
# "icon": "image_convert",
|
||||||
"author": "赵雷",
|
# "author": "王芳",
|
||||||
"upload_time": "2023-10-02",
|
# "upload_time": "2023-08-10",
|
||||||
"version": "1.3.2",
|
# "version": "1.5.3",
|
||||||
"category": "媒体工具",
|
# "category": "图像处理",
|
||||||
"features": [
|
# "features": [
|
||||||
"支持多种视频格式",
|
# "支持JPEG、PNG、WEBP等格式",
|
||||||
"自定义压缩参数",
|
# "批量转换功能",
|
||||||
"保持视频质量",
|
# "图片压缩优化",
|
||||||
"批量处理功能"
|
# "保持图片质量"
|
||||||
]
|
# ]
|
||||||
},
|
# },
|
||||||
{
|
# {
|
||||||
"id": "audio_extract",
|
# "id": "video_compress",
|
||||||
"title": "音频提取",
|
# "title": "视频压缩",
|
||||||
"desc": "从视频中提取音频",
|
# "desc": "减小视频文件大小",
|
||||||
"color": ("#06B6D4", "#0891B2"),
|
# "color": ("#3B82F6", "#2563EB"),
|
||||||
"icon": "audio_extract",
|
# "icon": "video_compress",
|
||||||
"author": "杨帆",
|
# "author": "赵雷",
|
||||||
"upload_time": "2023-10-15",
|
# "upload_time": "2023-10-02",
|
||||||
"version": "1.0.2",
|
# "version": "1.3.2",
|
||||||
"category": "媒体工具",
|
# "category": "媒体工具",
|
||||||
"features": [
|
# "features": [
|
||||||
"支持常见视频格式",
|
# "支持多种视频格式",
|
||||||
"无损音频提取",
|
# "自定义压缩参数",
|
||||||
"批量处理功能",
|
# "保持视频质量",
|
||||||
"转换速度快"
|
# "批量处理功能"
|
||||||
]
|
# ]
|
||||||
},
|
# },
|
||||||
{
|
# {
|
||||||
"id": "text_summary",
|
# "id": "audio_extract",
|
||||||
"title": "文本摘要",
|
# "title": "音频提取",
|
||||||
"desc": "自动提取文章关键信息",
|
# "desc": "从视频中提取音频",
|
||||||
"color": ("#F59E0B", "#D97706"),
|
# "color": ("#06B6D4", "#0891B2"),
|
||||||
"icon": "text_summary",
|
# "icon": "audio_extract",
|
||||||
"author": "周华",
|
# "author": "杨帆",
|
||||||
"upload_time": "2023-10-28",
|
# "upload_time": "2023-10-15",
|
||||||
"version": "2.1.0",
|
# "version": "1.0.2",
|
||||||
"category": "文档处理",
|
# "category": "媒体工具",
|
||||||
"features": [
|
# "features": [
|
||||||
"多种摘要算法可选",
|
# "支持常见视频格式",
|
||||||
"自定义摘要长度",
|
# "无损音频提取",
|
||||||
"支持多语言处理",
|
# "批量处理功能",
|
||||||
"处理结果可导出"
|
# "转换速度快"
|
||||||
]
|
# ]
|
||||||
},
|
# },
|
||||||
{
|
# {
|
||||||
"id": "color_picker",
|
# "id": "text_summary",
|
||||||
"title": "颜色提取器",
|
# "title": "文本摘要",
|
||||||
"desc": "从图像中提取配色方案",
|
# "desc": "自动提取文章关键信息",
|
||||||
"color": ("#EC4899", "#DB2777"),
|
# "color": ("#F59E0B", "#D97706"),
|
||||||
"icon": "color_picker",
|
# "icon": "text_summary",
|
||||||
"author": "吴敏",
|
# "author": "周华",
|
||||||
"upload_time": "2023-11-05",
|
# "upload_time": "2023-10-28",
|
||||||
"version": "1.0.0",
|
# "version": "2.1.0",
|
||||||
"category": "图像处理",
|
# "category": "文档处理",
|
||||||
"features": [
|
# "features": [
|
||||||
"自动分析主色调",
|
# "多种摘要算法可选",
|
||||||
"提取多种配色方案",
|
# "自定义摘要长度",
|
||||||
"支持导出配色代码",
|
# "支持多语言处理",
|
||||||
"直观的颜色展示"
|
# "处理结果可导出"
|
||||||
]
|
# ]
|
||||||
}
|
# },
|
||||||
|
# {
|
||||||
|
# "id": "color_picker",
|
||||||
|
# "title": "颜色提取器",
|
||||||
|
# "desc": "从图像中提取配色方案",
|
||||||
|
# "color": ("#EC4899", "#DB2777"),
|
||||||
|
# "icon": "color_picker",
|
||||||
|
# "author": "吴敏",
|
||||||
|
# "upload_time": "2023-11-05",
|
||||||
|
# "version": "1.0.0",
|
||||||
|
# "category": "图像处理",
|
||||||
|
# "features": [
|
||||||
|
# "自动分析主色调",
|
||||||
|
# "提取多种配色方案",
|
||||||
|
# "支持导出配色代码",
|
||||||
|
# "直观的颜色展示"
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class LoginPage(QWidget):
|
|||||||
logo_label.setPixmap(logo_pixmap)
|
logo_label.setPixmap(logo_pixmap)
|
||||||
logo_label.setAlignment(Qt.AlignCenter)
|
logo_label.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
title_label = QLabel("文档处理中心")
|
title_label = QLabel("奶酪云工具箱")
|
||||||
title_label.setObjectName("titleLabel")
|
title_label.setObjectName("titleLabel")
|
||||||
title_label.setAlignment(Qt.AlignCenter)
|
title_label.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import os
|
|
||||||
import comtypes.client
|
|
||||||
import random
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
|
||||||
|
import comtypes.client
|
||||||
|
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QTimer
|
||||||
|
from PyQt5.QtGui import QPixmap, QDragEnterEvent, QDropEvent, QDragLeaveEvent
|
||||||
from PyQt5.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QLabel,
|
from PyQt5.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QLabel,
|
||||||
QPushButton, QFrame, QListWidget, QListWidgetItem,
|
QPushButton, QFrame, QListWidget, QListWidgetItem,
|
||||||
QFileDialog, QProgressBar, QMessageBox, QSpacerItem)
|
QFileDialog, QProgressBar)
|
||||||
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QSize, QTimer
|
|
||||||
from PyQt5.QtGui import QPixmap, QIcon, QDragEnterEvent, QDropEvent, QDragLeaveEvent
|
|
||||||
|
|
||||||
|
|
||||||
def generate_unique_filename(original_path):
|
def generate_unique_filename(original_path):
|
||||||
@@ -653,4 +654,4 @@ class WordToPDFPage(QWidget):
|
|||||||
else:
|
else:
|
||||||
self.findChild(QFrame, "uploadArea").setProperty("hover", False)
|
self.findChild(QFrame, "uploadArea").setProperty("hover", False)
|
||||||
self.findChild(QFrame, "uploadArea").style().polish(self.findChild(QFrame, "uploadArea"))
|
self.findChild(QFrame, "uploadArea").style().polish(self.findChild(QFrame, "uploadArea"))
|
||||||
super().paintEvent(event)
|
super().paintEvent(event)
|
||||||
|
|||||||
Reference in New Issue
Block a user