Merge branch 'openkylin/nile' of gitee.com:openkylin/kylin-theme-builder into openkylin/nile

Signed-off-by: KevinDuan <duankaiwen@ubuntukylin.com>
This commit is contained in:
KevinDuan 2023-11-21 06:20:19 +00:00 committed by Gitee
commit 8824ccc0ba
19 changed files with 1618 additions and 209 deletions

View File

@ -7,6 +7,15 @@ ConfigFileManager::ConfigFileManager(QObject *parent) : QObject(parent)
}
/**
* @brief JSON
*
* JSON
*
* @param cachedir
*
* @return JSON true false
*/
bool ConfigFileManager::createJson(QDir cachedir)
{
QString m_themePath = cachedir.absolutePath();
@ -26,6 +35,15 @@ bool ConfigFileManager::createJson(QDir cachedir)
}
}
/**
* @brief
*
*
*
* @param cachedir
*
* @return true false
*/
bool ConfigFileManager::createConf(QDir cachedir)
{
QString m_themePath = cachedir.absolutePath();
@ -45,6 +63,16 @@ bool ConfigFileManager::createConf(QDir cachedir)
}
}
/**
* @brief radius的json配置文件
*
* radius值json配置文件中的"Radius"
*
* @param radius Radius值
* @param jsonFilePath
*
* @return truefalse
*/
bool ConfigFileManager::modifyRadiusJson(int radius,QString jsonFilePath)
{
QString confFilePath = jsonFilePath;
@ -89,7 +117,16 @@ bool ConfigFileManager::modifyRadiusJson(int radius,QString jsonFilePath)
emit updateInfo();
}
/**
* @brief
*
*
*
* @param accentcolor
* @param confFilePath
*
* @return true false
*/
bool ConfigFileManager::modifyAccentColorConf(QColor accentcolor,QString confFilePath)
{
@ -127,6 +164,16 @@ bool ConfigFileManager::modifyAccentColorConf(QColor accentcolor,QString confFil
}
}
/**
* @brief
*
*
*
* @param wallpaperpath
* @param confFilePath
*
* @return true false
*/
bool ConfigFileManager::modifyWallPaperConf(QString wallpaperpath,QString confFilePath)
{
@ -161,6 +208,16 @@ bool ConfigFileManager::modifyWallPaperConf(QString wallpaperpath,QString confFi
}
}
/**
* @brief
*
*
*
* @param transparency
* @param confFilePath
*
* @return true false
*/
bool ConfigFileManager::modifyTransparencyConf(int transparency,QString confFilePath)
{
// 读取文件内容
@ -192,6 +249,16 @@ bool ConfigFileManager::modifyTransparencyConf(int transparency,QString confFile
}
}
/**
* @brief
*
*
*
* @param windowradius
* @param confFilePath
*
* @return true false
*/
bool ConfigFileManager::modifywindowRadiusConf(int windowradius,QString confFilePath)
{
QFile file(confFilePath);
@ -219,6 +286,16 @@ bool ConfigFileManager::modifywindowRadiusConf(int windowradius,QString confFile
}
}
/**
* @brief
*
*
*
* @param sourceFilePath
* @param destinationFilePath
*
* @return true false
*/
bool ConfigFileManager::copyFileContent(const QString &sourceFilePath, const QString &destinationFilePath)
{
QFile sourceFile(sourceFilePath);
@ -247,6 +324,16 @@ bool ConfigFileManager::copyFileContent(const QString &sourceFilePath, const QSt
return true;
}
/**
* @brief
*
*
*
* @param map
* @param cachedir
*
* @return
*/
bool ConfigFileManager::copyIcontoCacheDir(QMap<QString, QString> *map, QDir cachedir)
{
bool success = true;
@ -279,6 +366,15 @@ bool ConfigFileManager::copyIcontoCacheDir(QMap<QString, QString> *map, QDir cac
return success;
}
/**
* @brief
*
*
*
* @param destinationFilePath
* @param cachedir
* @param type
*/
void ConfigFileManager::copyPictoCacheDir(const QString &destinationFilePath, QDir cachedir, QString type)
{
QString sourceFilePath = destinationFilePath;
@ -305,6 +401,14 @@ void ConfigFileManager::copyPictoCacheDir(const QString &destinationFilePath, QD
qDebug() << "File copied successfully";
}
/**
* @brief
*
* 使ffmpeg命令将指定的MP4文件复制到缓存目录中
*
* @param destinationFilePath
* @param cachedir
*/
void ConfigFileManager::copyMp4toCacheDir(const QString &destinationFilePath, QDir cachedir)
{
QStringList list;

View File

@ -6,6 +6,14 @@
#include <QJsonDocument>
#include <QJsonObject>
/**
* @brief
*
* HistoryInfoLoad
*
* @param date
* @param parent
*/
HistoryInfoLoad::HistoryInfoLoad(const QString &date, QObject *parent)
{
m_historyInfo.historytime = date;
@ -17,6 +25,13 @@ HistoryInfoLoad::HistoryInfoLoad(const QString &date, QObject *parent)
getWindowRadius();
}
/**
* @brief
*
*
*
* @return
*/
QString HistoryInfoLoad::getCover()
{
QString filePath = m_historyInfo.filepath + "/src/globalTheme/preview";
@ -37,6 +52,13 @@ QString HistoryInfoLoad::getCover()
return m_historyInfo.coverpath;
}
/**
* @brief
*
*
*
* @return
*/
QString HistoryInfoLoad::getThemeName()
{
QString filePath = m_historyInfo.filepath + "/src/debian/control";
@ -64,6 +86,13 @@ QString HistoryInfoLoad::getThemeName()
return m_historyInfo.themename;
}
/**
* @brief
*
*
*
* @return
*/
QString HistoryInfoLoad::getThemeType()
{
QString filePath = m_historyInfo.filepath + "/src";
@ -85,6 +114,11 @@ QString HistoryInfoLoad::getThemeType()
return m_historyInfo.themetype;
}
/**
* @brief
*
* HistoryInfo radius
*/
void HistoryInfoLoad::getRadius()
{
QString filePath = m_historyInfo.filepath + "/src/globalTheme/default.json";
@ -114,6 +148,11 @@ void HistoryInfoLoad::getRadius()
}
/**
* @brief
*
*
*/
void HistoryInfoLoad::getWallpaper()
{
QString filePath = m_historyInfo.filepath + "/src/globalTheme/theme.conf";
@ -146,6 +185,11 @@ void HistoryInfoLoad::getWallpaper()
}
/**
* @brief
*
*
*/
void HistoryInfoLoad::getAccentColor()
{
QString filePath = m_historyInfo.filepath + "/src/globalTheme/theme.conf";
@ -176,6 +220,11 @@ void HistoryInfoLoad::getAccentColor()
}
}
/**
* @brief
*
* HistoryInfo transparency
*/
void HistoryInfoLoad::getTransparency()
{
QString filePath = m_historyInfo.filepath + "/src/globalTheme/theme.conf";
@ -212,6 +261,11 @@ void HistoryInfoLoad::getTransparency()
}
}
/**
* @brief
*
*
*/
void HistoryInfoLoad::getWindowRadius()
{
QString filePath = m_historyInfo.filepath + "/src/globalTheme/theme.conf";
@ -248,12 +302,24 @@ void HistoryInfoLoad::getWindowRadius()
}
}
/**
* @brief
*
*
*
* @return
*/
HistoryInfo HistoryInfoLoad::getInfoData()
{
qDebug()<<m_historyInfo.accentcolor<<m_historyInfo.wallpaperpath<<m_historyInfo.filepath<<m_historyInfo.windowradius;
return m_historyInfo;
}
/**
* @brief
*
*
*/
void HistoryInfoLoad::updateHistoryInfo()
{
getCover();

View File

@ -2,6 +2,13 @@
/**
* @brief MainInterface
*
* MainInterface
*
* @param parent
*/
MainInterface::MainInterface(QWidget *parent) : QWidget(parent)
{
// this->setBackgroundRole(QPalette::Base);
@ -55,11 +62,23 @@ MainInterface::MainInterface(QWidget *parent) : QWidget(parent)
});
}
/**
* @brief
*
*
*
* @param ishistory
*/
void MainInterface::isHistory(bool ishistory)
{
m_ishistory = ishistory;
}
/**
* @brief
*
*
*/
void MainInterface::init()
{
@ -120,6 +139,13 @@ void MainInterface::init()
}
/**
* @brief
*
* QWidget作为左侧工具栏QVBoxLayout来管理左侧工具栏的布局
* QButtonGroup来管理多个按钮的选中状态
*
*/
void MainInterface::initLeftBar()
{
m_navigationwidget = new QWidget(m_belowwidget);
@ -244,26 +270,44 @@ void MainInterface::getThemeInfo(const HistoryInfo &InfoData)
}
/**
* @brief
*
* QMap<QString, QString>
*
* @return
*/
QMap<QString, QString>* MainInterface::getAppIconsMap()
{
//资源文件的appiconmap
return m_iconthemewidget->getAppIconsMap();
}
QMap<QString, QString> *MainInterface::getSystemIconsMap()
{
//资源文件的systemiconmap
return m_iconthemewidget->getSystemIconsMap();
}
QMap<QString, QString> *MainInterface::getCurosrMap()
{
//资源文件的cursoriconmap
return m_cursorthemewidget->getCursorMap();
}
QMap<QString, QString> *MainInterface::getTimeCurosrMap()
{
//资源文件的timecursoriconmap
return m_cursorthemewidget->getTimeCursorMap();
}
/**
* @brief
*
*
*
* @param themeType
*/
void MainInterface::refresh(QString themeType)
{
if("global" == themeType){
@ -296,6 +340,13 @@ void MainInterface::updateButtonGroup(bool isGlobalTheme)
}
/**
* @brief
*
* PlymouthThemeWidget
*
* @param thumbnailPath
*/
void MainInterface::updateThumbnail(QString thumbnailPath)
{
m_plymouththemewidget->setThumbnailIcon(thumbnailPath);

View File

@ -46,6 +46,9 @@ MainWindow::~MainWindow()
{
}
/**
* @brief
*/
void MainWindow::initUI()
{
QPalette palette;
@ -211,6 +214,11 @@ void MainWindow::initUI()
});
}
/**
* @brief
*
*
*/
void MainWindow::initEntry()
{
m_globalbtn = new EntryButton();
@ -241,6 +249,11 @@ void MainWindow::refresh()
// m_maininterface->refresh();
}
/**
* @brief "GoHome"
*
* "GoHome"
*/
void MainWindow::onGoHomeClicked()
{
//返回主界面判断,是否在主界面点击返回按钮
@ -281,6 +294,14 @@ void MainWindow::onGoHomeClicked()
// refresh();
}
/**
* @brief
*
*
*
* @param icon QIcon
* @param text QString
*/
void EntryButton::setEntry(const QIcon &icon, const QString &text)
{
QFont font("Arial", 18);
@ -293,6 +314,13 @@ void EntryButton::setEntry(const QIcon &icon, const QString &text)
textLabel->setFont(QFont("Arial" , 18));
}
/**
* @brief
*
* EntryButton
*
* @param text
*/
void EntryButton::setTip(const QString &text)
{
tipLabel->setText(text);
@ -303,6 +331,13 @@ void EntryButton::setTip(const QString &text)
tipLabel->setWordWrap(true);
}
/**
* @brief
*
* EntryButton QPushButton
*
* @param parent
*/
EntryButton::EntryButton(QWidget *parent): QPushButton(parent)
{
this->setFixedSize(240,280);
@ -319,23 +354,45 @@ EntryButton::EntryButton(QWidget *parent): QPushButton(parent)
layout->addWidget(tipLabel);
}
/**
* @brief
*
*
*
* @param event
*/
void MainWindow::mousePressEvent(QMouseEvent *event)
{
// 判断是否按下左键
if (event->button() == Qt::LeftButton) {
// 设置拖动标志为真
this->m_drag = true;
// 记录按下位置的坐标
this->dragPos = event->pos();
// 记录全局位置
this->resizeDownPos = event->globalPos();
// 记录按下时窗口的矩形大小
this->mouseDownRect = this->rect();
}
}
/**
* @brief
*
*
*
* @param event
*/
void MainWindow::mouseMoveEvent(QMouseEvent * event)
{
if (resizeRegion != Default)
{
// 处理调整窗体大小的操作
handleResize();
return;
}
if(m_move) {
// 移动窗体
move(event->globalPos() - dragPos);
return;
}
@ -343,21 +400,34 @@ void MainWindow::mouseMoveEvent(QMouseEvent * event)
QRect r = this->rect();
QRect resizeInnerRect(resizeBorderWidth, resizeBorderWidth, r.width() - 2*resizeBorderWidth, r.height() - 2*resizeBorderWidth);
if(r.contains(clientCursorPos) && !resizeInnerRect.contains(clientCursorPos)) { //调整窗体大小
// 获取窗体的可调整大小区域
ResizeRegion resizeReg = getResizeRegion(clientCursorPos);
// 设置鼠标的形状为可调整大小形状
setResizeCursor(resizeReg);
if (m_drag && (event->buttons() & Qt::LeftButton)) {
// 设置窗体的可调整大小区域,并处理调整大小操作
resizeRegion = resizeReg;
handleResize();
}
}
else { //移动窗体
// 设置鼠标的形状为箭头形状
setCursor(Qt::ArrowCursor);
if (m_drag && (event->buttons() & Qt::LeftButton)) {
// 设置标志位为移动窗体状态,并移动窗体
m_move = true;
move(event->globalPos() - dragPos);
}
}
}
/**
* @brief
*
*
*
* @param event QMouseEvent
*/
void MainWindow::mouseReleaseEvent(QMouseEvent *event)
{
m_drag = false;
@ -368,52 +438,97 @@ void MainWindow::mouseReleaseEvent(QMouseEvent *event)
resizeRegion = Default;
setCursor(Qt::ArrowCursor);
}
/**
* @brief
*
*
*
* @param region
*/
void MainWindow::setResizeCursor(ResizeRegion region)
{
switch (region)
{
case North:
case South:
// 设置上下调整光标
setCursor(Qt::SizeVerCursor);
break;
case East:
case West:
// 设置左右调整光标
setCursor(Qt::SizeHorCursor);
break;
case NorthWest:
case SouthEast:
// 设置对角线调整光标(从左上到右下)
setCursor(Qt::SizeFDiagCursor);
break;
default:
// 设置对角线调整光标(从右上到左下)
setCursor(Qt::SizeBDiagCursor);
break;
}
}
/**
* @brief
*
*
*
* @param clientPos
*
* @return
*/
ResizeRegion MainWindow::getResizeRegion(QPoint clientPos)
{
// 如果客户点的y坐标小于等于边框宽度
if (clientPos.y() <= resizeBorderWidth) {
// 如果客户点的x坐标小于等于边框宽度
if (clientPos.x() <= resizeBorderWidth)
// 返回北西方向
return NorthWest;
// 如果客户点的x坐标大于等于窗口宽度减去边框宽度
else if (clientPos.x() >= this->width() - resizeBorderWidth)
// 返回北东方向
return NorthEast;
else
// 返回北方向
return North;
}
// 如果客户点的y坐标大于等于窗口高度减去边框宽度
else if (clientPos.y() >= this->height() - resizeBorderWidth) {
// 如果客户点的x坐标小于等于边框宽度
if (clientPos.x() <= resizeBorderWidth)
// 返回南西方向
return SouthWest;
// 如果客户点的x坐标大于等于窗口宽度减去边框宽度
else if (clientPos.x() >= this->width() - resizeBorderWidth)
// 返回南东方向
return SouthEast;
else
// 返回南方向
return South;
}
else {
// 如果客户点的x坐标小于等于边框宽度
if (clientPos.x() <= resizeBorderWidth)
// 返回西方向
return West;
else
// 返回东方向
return East;
}
}
/**
* @brief
*
*
*
* @param pt
*/
void MainWindow::handleMove(QPoint pt)
{
QDesktopWidget* desktop = QApplication::desktop(); // 创建 QDesktopWidget 实例
@ -429,57 +544,79 @@ void MainWindow::handleMove(QPoint pt)
}
move(currentPos);
}
/**
* @brief
*
*
*/
void MainWindow::handleResize()
{
// 计算x轴和y轴的偏移量
int xdiff = QCursor::pos().x() - resizeDownPos.x();
int ydiff = QCursor::pos().y() - resizeDownPos.y();
// 根据不同的resizeRegion进行不同的操作
switch (resizeRegion)
{
case East:
{
resize(mouseDownRect.width()+xdiff, this->height());
break;
}
case West:
{
resize(mouseDownRect.width()-xdiff, this->height());
move(resizeDownPos.x()+xdiff, this->y());
break;
}
case South:
{
resize(this->width(),mouseDownRect.height()+ydiff);
break;
}
case North:
{
resize(this->width(),mouseDownRect.height()-ydiff);
move(this->x(), resizeDownPos.y()+ydiff);
break;
}
case SouthEast:
{
resize(mouseDownRect.width() + xdiff, mouseDownRect.height() + ydiff);
break;
}
case NorthEast:
{
resize(mouseDownRect.width()+xdiff, mouseDownRect.height()-ydiff);
move(this->x(), resizeDownPos.y()+ydiff);
break;
}
case NorthWest:
{
resize(mouseDownRect.width()-xdiff, mouseDownRect.height()-ydiff);
move(resizeDownPos.x()+xdiff, resizeDownPos.y()+ydiff);
break;
}
case SouthWest:
{
resize(mouseDownRect.width()-xdiff, mouseDownRect.height()+ydiff);
move(resizeDownPos.x()+xdiff, this->y());
break;
}
case East:
{
// 东方向,宽度增加
resize(mouseDownRect.width()+xdiff, this->height());
break;
}
case West:
{
// 西方向,宽度减少
resize(mouseDownRect.width()-xdiff, this->height());
// 移动到原始位置x轴偏移量增加
move(resizeDownPos.x()+xdiff, this->y());
break;
}
case South:
{
// 南方向,高度增加
resize(this->width(),mouseDownRect.height()+ydiff);
break;
}
case North:
{
// 北方向,高度减少
resize(this->width(),mouseDownRect.height()-ydiff);
// 移动到原始位置y轴偏移量增加
move(this->x(), resizeDownPos.y()+ydiff);
break;
}
case SouthEast:
{
// 东南方向,宽度和高度都增加
resize(mouseDownRect.width() + xdiff, mouseDownRect.height() + ydiff);
break;
}
case NorthEast:
{
// 东北方向,宽度增加,高度减少
resize(mouseDownRect.width()+xdiff, mouseDownRect.height()-ydiff);
// 移动到原始位置x轴偏移量增加y轴偏移量增加
move(this->x(), resizeDownPos.y()+ydiff);
break;
}
case NorthWest:
{
// 西北方向,宽度减少,高度减少
resize(mouseDownRect.width()-xdiff, mouseDownRect.height()-ydiff);
// 移动到原始位置x轴偏移量减少y轴偏移量减少
move(resizeDownPos.x()+xdiff, resizeDownPos.y()+ydiff);
break;
}
case SouthWest:
{
// 西南方向,宽度减少,高度增加
resize(mouseDownRect.width()-xdiff, mouseDownRect.height()+ydiff);
// 移动到原始位置x轴偏移量减少y轴偏移量增加
move(resizeDownPos.x()+xdiff, this->y());
break;
}
}
}

View File

@ -86,18 +86,31 @@ void CursorImageWidget::updateImage(const QString& imagePath)
qDebug() << "Failed to load image:" << filePath;
}
}
// 适应视图,保持宽高比
graphicsView->fitInView(graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio);
// 获取当前视图转换矩阵
QTransform currentTransform = graphicsView->transform();
// 计算场景的中心点坐标,并转换为视图坐标系下的坐标
QPointF sceneCenter = graphicsView->mapToScene(graphicsView->viewport()->rect().center());
currentTransform.translate(sceneCenter.x(), sceneCenter.y());
// 设置新的视图转换矩阵,使视图中心点移动到场景中心点
graphicsView->setTransform(currentTransform);
// 计算场景的中心点坐标,并转换为视图坐标系下的坐标
QPointF viewCenter = graphicsView->mapFromScene(graphicsView->scene()->sceneRect().center());
// 将视图中心点移动到新的中心点
graphicsView->centerOn(viewCenter);
// 更新视口
graphicsView->viewport()->update();
}
/**
* @brief
*
*
*
* @param newIconMap
*/
void CursorImageWidget::updateIconMap(const QMap<QString, QString> *newIconMap)
{
m_iconMap = newIconMap;
@ -181,6 +194,14 @@ void CursorImageWidget::updateIconMap(const QMap<QString, QString> *newIconMap)
graphicsView->show();
}
/**
* @brief CursorImageWidget
*
* CursorImageWidget
*
* @param parent QWidget
* @param iconMap QMap
*/
CursorImageWidget::CursorImageWidget(QWidget *parent, const QMap<QString, QString>* iconMap)
: QWidget(parent), m_iconMap(iconMap)
{
@ -268,6 +289,14 @@ CursorImageWidget::CursorImageWidget(QWidget *parent, const QMap<QString, QStrin
graphicsView->setTransform(transform);
}
/**
* @brief
*
* widgetName newFilePath QGraphicsView
*
* @param widgetName
* @param newFilePath
*/
void CursorImageWidget::updateIcon(const QString& widgetName, const QString& newFilePath)
{
QGraphicsScene* scene = graphicsView->scene();
@ -300,7 +329,13 @@ void CursorImageWidget::setIconMap(QMap<QString, QString> *iconmap)
m_iconMap = iconmap;
}
/**
* @brief
*
* CursorEditWidget
*
* @param parent
*/
CursorEditWidget::CursorEditWidget(QWidget *parent)
{
@ -342,6 +377,13 @@ CursorCustomLabel::CursorCustomLabel(QWidget *parent): QLabel(parent), pixmap()
this->setFixedSize(48,48);
}
/**
* @brief
*
*
*
* @param event QPaintEvent
*/
void CursorCustomLabel::paintEvent(QPaintEvent *event)
{
QLabel::paintEvent(event); // 调用父类的 paintEvent 函数,绘制文本

View File

@ -35,6 +35,11 @@ void CursorThemeWidget::eidtInitWidget(const HistoryInfo &InfoData)
updateCustomPathMap(m_historytimeiconpathmap,"timecursor");
}
/**
* @brief
*
*
*/
void CursorThemeWidget::initPreviewWidget()
{
m_previewwidget = new QWidget(this);
@ -64,6 +69,15 @@ void CursorThemeWidget::initPreviewWidget()
m_previewlayout->addItem(spacer2);
}
/**
* @brief
*
*
*
* @param directoryPath
*
* @return
*/
QStringList CursorThemeWidget::getWidgetNamesFromFilesInDirectory(const QString& directoryPath) {
QStringList widgetNames;
QDir dir(directoryPath);
@ -78,6 +92,11 @@ QStringList CursorThemeWidget::getWidgetNamesFromFilesInDirectory(const QString&
return widgetNames;
}
/**
* @brief
*
*
*/
void CursorThemeWidget::refresh()
{
m_preview->updateIconMap(getResourcesAppIconMap("cursor"));
@ -86,6 +105,15 @@ void CursorThemeWidget::refresh()
updateCustomPathMap(m_timeiconpathmap,"timecursor");
}
/**
* @brief
*
*
*
* @param Type
*
* @return QMap<QString, QString>
*/
QMap<QString, QString> *CursorThemeWidget::getResourcesAppIconMap(QString Type)
{
if("cursor" == Type){
@ -112,6 +140,11 @@ QMap<QString, QString> *CursorThemeWidget::getResourcesAppIconMap(QString Type)
}
/**
* @brief Map
*
* Map数据
*/
void CursorThemeWidget::initMaps()
{
getResourcesAppIconMap("cursor");
@ -119,6 +152,11 @@ void CursorThemeWidget::initMaps()
m_pathWidgetMap = new QMap<QString, CursorEditWidget*>;
}
/**
* @brief
*
*
*/
void CursorThemeWidget::initTimeMaps()
{
getResourcesAppIconMap("timecursor");
@ -126,6 +164,9 @@ void CursorThemeWidget::initTimeMaps()
m_timepathWidgetMap = new QMap<QString, CursorEditWidget*>;
}
/**
* @brief
*/
void CursorThemeWidget::initRightWidget()
{
m_rightwidget = new QWidget(this);
@ -175,25 +216,41 @@ void CursorThemeWidget::initRightWidget()
});
// 遍历sortedList1中的每个元素创建一个CursorEditWidget对象并将其添加到主布局中
for (const auto& pair : sortedList1) {
const QString& widgetName = pair.first;
const QString& filePath = pair.second;
// 创建一个CursorEditWidget对象并将其设置为viewportWidget的子控件
CursorEditWidget* widget = new CursorEditWidget(viewportWidget);
// 设置widget的默认图标为filePath指定的文件路径
widget->setdefaulticon(filePath);
// 将widget添加到主布局中
mainLayout->addWidget(widget);
// 将widget插入到m_pathWidgetMap中以便后续可以通过widgetName找到对应的widget
m_pathWidgetMap->insert(widgetName, widget);
connect(widget->m_addiconbutton, &QPushButton::clicked, this, [=]() {
// 通过sender()获取发送信号的对象将其强制转换为QPushButton指针类型
QPushButton* clickedButton = qobject_cast<QPushButton*>(sender());
// 如果获取的对象是合法的QPushButton对象
if (clickedButton) {
// 通过clickedButton的parentWidget()获取widget对象并将其强制转换为CursorEditWidget指针类型
CursorEditWidget* clickedWidget = qobject_cast<CursorEditWidget*>(clickedButton->parentWidget());
// 如果获取的对象是合法的CursorEditWidget对象
if (clickedWidget) {
// 弹出文件选择对话框让用户选择一个SVG文件
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select SVG file"), "", tr("SVG file (*.svg)"));
// 如果用户选择了文件,且文件路径不为空
if (!newFilePath.isEmpty()) {
// 将widgetName和newFilePath插入到m_customiconpathmap中以便后续可以通过widgetName找到自定义图标路径
m_customiconpathmap->insert(widgetName, newFilePath);
// 调用m_preview的updateIcon函数更新预览图标
m_preview->updateIcon(widgetName, newFilePath);
// 设置widget的自定义图标为newFilePath指定的文件路径
clickedWidget->setcustomicon(newFilePath);
// 发出newCursorMap信号通知其他部分更新图标映射
emit newCursorMap(m_customiconpathmap);
g_themeChange = true;
} else {
@ -214,19 +271,32 @@ void CursorThemeWidget::initRightWidget()
m_timepathWidgetMap->insert(widgetName, widget);
connect(widget->m_addiconbutton, &QPushButton::clicked, this, [=]() {
// 获取发送信号的按钮对象
QPushButton* clickedButton = qobject_cast<QPushButton*>(sender());
// 判断获取的按钮对象是否为空,如果不为空,则继续执行下面的代码
if (clickedButton) {
// 通过按钮对象的parentWidget获取其父窗口对象假设该父窗口对象为CursorEditWidget
CursorEditWidget* clickedWidget = qobject_cast<CursorEditWidget*>(clickedButton->parentWidget());
// 判断获取的CursorEditWidget对象是否为空如果不为空则继续执行下面的代码
if (clickedWidget) {
// 使用QFileDialog::getOpenFileName函数打开一个文件选择对话框选择一个SVG文件
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select SVG file"), "", tr("SVG file (*.svg)"));
// 判断选择的文件路径是否为空,如果不为空,则执行下面的代码
if (!newFilePath.isEmpty()) {
// 将选择的文件路径插入到m_timecustomiconpathmap中假设widgetName为键
m_timecustomiconpathmap->insert(widgetName, newFilePath);
// 更新m_preview2的对应图标
m_preview2->updateIcon(widgetName, newFilePath);
// 设置clickedWidget的自定义图标
clickedWidget->setcustomicon(newFilePath);
// 发出一个新的时间光标映射信号假设m_timecustomiconpathmap为数据源
emit newTimeCursorMap(m_timecustomiconpathmap);
g_themeChange = true;
}
}
}
});
@ -237,6 +307,13 @@ void CursorThemeWidget::initRightWidget()
m_rightwidget->setLayout(mainWidgetLayout);
}
/**
* @brief
*
*
*
* @param type
*/
void CursorThemeWidget::setHistoryCursor(QString type)
{
if("cursor" == type){
@ -249,8 +326,11 @@ void CursorThemeWidget::setHistoryCursor(QString type)
m_historyiconpathmap = new QMap<QString, QString>;
foreach (const QString& fileName, fileList) {
QString filePath = directoryPath + fileName; // 使用文件名构建文件路径
// 使用文件名构建文件路径
QString filePath = directoryPath + fileName;
// 获取文件名(不包括扩展名)
QString name = fileName.left(fileName.lastIndexOf('.'));
// 将文件名和文件路径插入到历史图标路径映射表中
m_historyiconpathmap->insert(name, filePath);
}
} else if ("timecursor" == type){
@ -263,14 +343,25 @@ void CursorThemeWidget::setHistoryCursor(QString type)
m_historytimeiconpathmap = new QMap<QString, QString>;
foreach (const QString& fileName, fileList) {
// 使用文件名构建文件路径
QString filePath = directoryPath + fileName; // 使用文件名构建文件路径
// 获取文件名(不包括扩展名)
QString name = fileName.left(fileName.lastIndexOf('.'));
// 将文件名和文件路径插入到 map 中
m_historytimeiconpathmap->insert(name, filePath);
}
}
}
/**
* @brief
*
*
*
* @param historyMap
* @param type
*/
void CursorThemeWidget::updateCustomPathMap(QMap<QString, QString> *historyMap, QString type)
{
if("cursor" == type){

View File

@ -5,87 +5,178 @@
#include <QPainterPath>
#include <QGraphicsBlurEffect>
/**
* @brief CustomGraphicsView
*
* CustomGraphicsView
*
* @param scene QGraphicsScene
*/
CustomGraphicsView::CustomGraphicsView(QGraphicsScene* scene) : QGraphicsView(scene) {
// 设置视图跟随鼠标的变换锚点
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
// 设置拖拽模式为手滚动模式
setDragMode(QGraphicsView::ScrollHandDrag);
// 设置抗锯齿渲染提示,开启抗锯齿
setRenderHint(QPainter::Antialiasing, true);
// 设置优化标志,不调整抗锯齿优化和保存画家的状态
setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing |
QGraphicsView::DontSavePainterState);
// 设置背景色为透明
this->setStyleSheet("background-color: transparent;");
// 设置水平滚动条始终隐藏
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
// 设置垂直滚动条始终隐藏
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
/**
* @brief
*
* Ctrl 1.1
* Ctrl
*
* @param event
*/
void CustomGraphicsView::wheelEvent(QWheelEvent* event) {
// 判断是否按下了控制键
if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier) {
// 根据滚轮的滚动距离计算缩放因子
qreal scaleFactor = std::pow(qreal(2), event->delta() / 240.0);
qreal currentScale = transform().m11(); // 获取当前的缩放倍数
// 获取当前的缩放倍数
qreal currentScale = transform().m11();
// 限制最大为1.1倍
// 计算目标缩放倍数
qreal targetScale = currentScale * scaleFactor;
if (targetScale > 1.1) {
// 如果目标缩放倍数大于1.1则缩小到1.1倍
scaleFactor = 1.1 / currentScale;
}else if (targetScale < 0.3) {
// 如果目标缩放倍数小于0.3则放大到0.3倍
scaleFactor = 0.3 / currentScale;
}
// 执行缩放操作
scale(scaleFactor, scaleFactor);
} else {
// 如果不是控制键则调用QGraphicsView的滚轮事件处理方法
QGraphicsView::wheelEvent(event);
}
}
/**
* @brief
*
*
*
* @param sliderValue
*/
void GlobalImageWidget::updateWidgetRadius(int sliderValue) {
// 将滑块的值赋给半径变量
int radius = sliderValue;
// 将半径值设置给显示控件
m_showwidget->setRadius(radius);
// 更新显示控件的显示
m_showwidget->update();
}
/**
* @brief
*
*
*
* @param color
*/
void GlobalImageWidget::updateButtonColor(const QColor& color) {
// 获取m_showbtn的调色板
QPalette palette = m_showbtn->palette();
// 设置调色板中的按钮颜色为传入的color
palette.setColor(QPalette::Button, color);
// 将修改后的调色板应用到m_showbtn
m_showbtn->setPalette(palette);
// 更新m_showbtn的显示
m_showbtn->update();
}
/**
* @brief
*
*
*
* @param color
*/
void GlobalImageWidget::updateWidgetBackgroundColor(const QColor& color)
{
// 设置显示小部件的背景颜色
m_showwidget->setBackgroundColor(color);
}
/**
* @brief
*
*
*
* @param overlayImagePath
*/
void GlobalImageWidget::updateOverlayImage(const QString& overlayImagePath) {
// 加载叠加图像
QPixmap overlayImage(overlayImagePath);
// 如果叠加图像不为空
if (!overlayImage.isNull()) {
// 创建一个与原图像大小相同的透明图像
m_mergedImage = QPixmap(m_image.size());
m_mergedImage.fill(Qt::transparent);
// 创建一个画板,将原图像画到新的合并图像上
QPainter painter(&m_mergedImage);
painter.drawPixmap(0, 0, m_image);
// 计算叠加图像的位置,使其居中显示
int x = (m_image.width() - overlayImage.width()) / 2;
int y = m_image.height() - overlayImage.height();
painter.drawPixmap(x, y, overlayImage);
painter.end();
// 将原代理窗口删除,并清空场景
QGraphicsProxyWidget* newproxy = m_proxy;
m_scene->removeItem(m_proxy);
m_scene->clear();
// 将合并后的图像添加到场景中,并设置场景大小为合并图像的大小
m_scene->addPixmap(m_mergedImage);
m_scene->setSceneRect(m_mergedImage.rect());
// 调整视图大小,保持长宽比不变
graphicsView->fitInView(m_scene->sceneRect(), Qt::KeepAspectRatio);
// 将原代理窗口重新添加到场景中
m_scene->addItem(newproxy);
} else {
qDebug() << "Failed to load overlay image.";
}
}
/**
* @brief
*
*
*/
void GlobalImageWidget::updatescale()
{
// 重置视图变换
graphicsView->resetTransform();
// 定义中心点坐标为(1500, 600)
QPointF centerPoint(1500, 600);
// 将视图中心定位到中心点
graphicsView->centerOn(centerPoint);
// 缩放视图缩放比例为1:1即不进行缩放
graphicsView->scale(1, 1);
}
@ -97,17 +188,42 @@ void GlobalImageWidget::updatescale1()
graphicsView->scale(0.3, 0.3);
}
/**
* @brief
*
*
*
* @param Value
*/
void GlobalImageWidget::updateControlRadius(int Value)
{
// 设置显示按钮的半径
m_showbtn->setRadius(Value);
}
/**
* @brief
*
*
*
* @param transparency
*/
void GlobalImageWidget::updateTransparency(int transparency)
{
// 设置m_showwidget的透明度为传入的参数transparency
m_showwidget->setTransparency(transparency);
// 更新m_showwidget的显示
m_showwidget->update();
}
/**
* @brief GlobalImageWidget构造函数
*
* GlobalImageWidget对象
*
* @param parent QWidget对象
* @param coverFilePath
*/
GlobalImageWidget::GlobalImageWidget(QWidget *parent, const QString& coverFilePath)
: QWidget(parent), m_coverFilePath(coverFilePath) {
@ -184,6 +300,14 @@ GlobalImageWidget::GlobalImageWidget(QWidget *parent, const QString& coverFilePa
// m_showwidget->setGraphicsEffect(blurEffect);
}
/**
* @brief
*
*
*
* @param parent
* @param coverFilePath
*/
Globalthemefeature::Globalthemefeature(QWidget *parent, const QString& coverFilePath)
: QWidget(parent) {
GlobalImageWidget* globalImageWidget = new GlobalImageWidget(this, coverFilePath);
@ -216,15 +340,27 @@ void RoundedWidget::setBackgroundColor(const QColor &color)
// update();
}
/**
* @brief
*
*
*
* @param event
*/
void RoundedWidget::paintEvent(QPaintEvent *event)
{
// 创建QPainter对象用于绘制图形
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true); // 开启抗锯齿
// 开启抗锯齿绘制
painter.setRenderHint(QPainter::Antialiasing, true);
// 获取控件的内容矩形,并根据边框宽度进行调整
QRectF rect = contentsRect().adjusted(borderWidth, borderWidth, -borderWidth, -borderWidth);
int r = std::min(rect.width(), rect.height()) / 2; // 计算圆角半径
int actualRadius = std::min(m_radius, r); // 取实际圆角半径和计算半径的较小值
// 计算圆角半径
int r = std::min(rect.width(), rect.height()) / 2;
// 取实际圆角半径和计算半径的较小值
int actualRadius = std::min(m_radius, r);
// 设置背景色的透明度
backgroundColor.setAlphaF(m_transparency);
// 绘制背景
@ -232,13 +368,19 @@ void RoundedWidget::paintEvent(QPaintEvent *event)
painter.setBrush(backgroundColor);
painter.drawRoundedRect(rect, actualRadius, actualRadius);
// 绘制边框
// // 绘制边框
// painter.setPen(QPen(borderColor, borderWidth));
// painter.setBrush(Qt::NoBrush);
// painter.drawRoundedRect(rect, actualRadius, actualRadius);
}
/**
* @brief RoundedButton
*
* RoundedButton QPushButton
*
* @param parent
*/
RoundedButton::RoundedButton(QWidget *parent): QPushButton(parent)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
@ -247,12 +389,26 @@ RoundedButton::RoundedButton(QWidget *parent): QPushButton(parent)
setFocusPolicy(Qt::NoFocus);
}
/**
* @brief
*
*
*
* @param radius
*/
void RoundedButton::setRadius(int radius)
{
m_radius = radius;
update();
}
/**
* @brief
*
*
*
* @param event
*/
void RoundedButton::paintEvent(QPaintEvent *event) {
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);

View File

@ -2,6 +2,13 @@
#include "../fileProcess/filecheck.h"
bool GlobalThemeWidget::g_themeChange;
/**
* @brief
*
* GlobalThemeWidget
*
* @param parent
*/
GlobalThemeWidget::GlobalThemeWidget(QWidget *parent) : QWidget(parent)
{
initPreviewWidget();
@ -12,11 +19,25 @@ GlobalThemeWidget::GlobalThemeWidget(QWidget *parent) : QWidget(parent)
this->setLayout(m_globalthemelayout);
}
/**
* @brief
*
*
*
* @return
*/
QString GlobalThemeWidget::getWallpaperPath()
{
return m_wallpaperpath;
}
/**
* @brief
*
*
*
* @param InfoData
*/
void GlobalThemeWidget::eidtInitWidget(const HistoryInfo &InfoData)
{
m_info = InfoData;
@ -30,6 +51,11 @@ void GlobalThemeWidget::eidtInitWidget(const HistoryInfo &InfoData)
// this->update();
}
/**
* @brief
*
*
*/
void GlobalThemeWidget::refresh()
{
@ -42,6 +68,12 @@ void GlobalThemeWidget::refresh()
m_preview->updatescale1();
}
/**
* @brief
*
* QWidget
*
*/
void GlobalThemeWidget::initPreviewWidget()
{
m_previewwidget = new QWidget(this);
@ -60,6 +92,11 @@ void GlobalThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(m_previewlayout);
}
/**
* @brief
*
*
*/
void GlobalThemeWidget::initRightWidget()
{
m_rightwidget = new QWidget(this);
@ -107,6 +144,11 @@ void GlobalThemeWidget::initRightWidget()
}
/**
* @brief CoverWidget
*
* CoverWidget控件
*/
void GlobalThemeWidget::initCoverWidget()
{
m_coverwidget = new QWidget(m_viewportwidget);
@ -139,12 +181,13 @@ void GlobalThemeWidget::initCoverWidget()
connect(m_coverbtn, &QPushButton::clicked, this, [=]() {
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select picture file"), "", tr("Picture file (*.png *.jpg)"));
bool legalFile = FileCheck::isLegalWallPaperFile(newFilePath,"cover");
if (newFilePath.isEmpty() || !legalFile) {
if (newFilePath.isEmpty()) {
newFilePath = m_coverpath;
}else{
if(!FileCheck::isLegalWallPaperFile(newFilePath,"cover")){
newFilePath = m_coverpath;
}
}
m_coverpath = newFilePath;
m_coverbtn->setIcon(QIcon(m_coverpath));
m_coverbtn->setIconSize(m_coverbtn->size());
@ -160,6 +203,11 @@ void GlobalThemeWidget::initCoverWidget()
}
/**
* @brief
*
*
*/
void GlobalThemeWidget::initWallPaperWidget()
{
m_wallpaperwidget = new QWidget(m_viewportwidget);
@ -187,15 +235,17 @@ void GlobalThemeWidget::initWallPaperWidget()
connect(wallpaperbtn, &QPushButton::clicked, this, [=]() {
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select picture file"), "", tr("Picture file (*.png *.jpg)"));
if (!newFilePath.isEmpty() && FileCheck::isLegalWallPaperFile(newFilePath,"wallpaper")) {
updateWallpaperFilePath(newFilePath);
emit wallpaperupdate(newFilePath);
emit newWallpaperFilePath(newFilePath);
if (!newFilePath.isEmpty()) {
if(FileCheck::isLegalWallPaperFile(newFilePath,"wallpaper")){
updateWallpaperFilePath(newFilePath);
emit wallpaperupdate(newFilePath);
emit newWallpaperFilePath(newFilePath);
QPixmap pixmap(newFilePath);
wallpaperbtn->setIcon(QIcon(pixmap));
wallpaperbtn->setIconSize(wallpaperbtn->size());
g_themeChange = true;
QPixmap pixmap(newFilePath);
wallpaperbtn->setIcon(QIcon(pixmap));
wallpaperbtn->setIconSize(wallpaperbtn->size());
g_themeChange = true;
}
} else {
qDebug() << "Selected file path:" << newFilePath;
updateWallpaperFilePath(m_wallpaperpath);
@ -208,6 +258,15 @@ void GlobalThemeWidget::initWallPaperWidget()
m_wallpaperwidget->setLayout(layout);
}
/**
* @brief
*
* QWidget 65
* QLabel "Window appearance"
* QHBoxLayout QLabel QComboBox
* QComboBox "light" "dark"
* QComboBox currentIndexChanged newExterior
*/
void GlobalThemeWidget::initExteriorWidget()
{
m_exteriorwidget = new QWidget(m_viewportwidget);
@ -244,6 +303,11 @@ void GlobalThemeWidget::initExteriorWidget()
m_exteriorwidget->setLayout(layout);
}
/**
* @brief
*
*
*/
void GlobalThemeWidget::initFilletWidget()
{
m_filletwidget = new QWidget(m_viewportwidget);
@ -286,6 +350,11 @@ void GlobalThemeWidget::initFilletWidget()
m_filletwidget->setLayout(layout);
}
/**
* @brief
*
*
*/
void GlobalThemeWidget::initAccentColorWidget()
{
m_accentcolorwidget = new QWidget(m_viewportwidget);
@ -322,6 +391,16 @@ void GlobalThemeWidget::initAccentColorWidget()
m_accentcolorwidget->setLayout(layout);
}
/**
* @brief
*
* QWidget作为透明度控件
*
* 65
*
*
*
*/
void GlobalThemeWidget::initTransparencyWidget()
{
m_transparencywidget = new QWidget(m_viewportwidget);
@ -357,6 +436,17 @@ void GlobalThemeWidget::initTransparencyWidget()
m_transparencywidget->setLayout(layout);
}
/**
* @brief
*
* QWidget
* 65
*
* "Large""Medium" "Small" 126 0
* "Medium" currentIndexChanged
*
*
*/
void GlobalThemeWidget::initWindowFilletWidget()
{
m_windowfilletwidget = new QWidget(m_viewportwidget);
@ -370,11 +460,13 @@ void GlobalThemeWidget::initWindowFilletWidget()
m_filletcombobox->addItem(tr("Small"), int(0));
m_filletcombobox->setCurrentIndex(1);
connect(m_filletcombobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index){
// 获取当前选项对应的圆角大小值
int selectedSize = m_filletcombobox->itemData(index).value<int>();
// 更新预览部件的缩放比例
m_preview->updatescale();
// 更新预览部件的圆角大小
m_preview->updateWidgetRadius(selectedSize);
// 发出新的窗口圆角大小信号
emit newWindowRadius(selectedSize);
g_themeChange = true;
});
@ -383,6 +475,13 @@ void GlobalThemeWidget::initWindowFilletWidget()
m_windowfilletwidget->setLayout(layout);
}
/**
* @brief
*
*
*
* @param coverFilePath
*/
void GlobalThemeWidget::updateWallpaperFilePath(const QString& coverFilePath) {
m_wallpaperpath = coverFilePath;
@ -401,6 +500,11 @@ void GlobalThemeWidget::updateWallpaperFilePath(const QString& coverFilePath) {
}
}
/**
* @brief
*
*
*/
void GlobalThemeWidget::addspaceritem()
{
QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
@ -413,11 +517,25 @@ void GlobalThemeWidget::addspaceritem()
m_previewlayout->addItem(spacer2);
}
/**
* @brief
*
*
*
* @param radius
*/
void GlobalThemeWidget::setRadiusSetting(int radius)
{
m_filletslider->setValue(radius);
}
/**
* @brief
*
*
*
* @param accentcolor
*/
void GlobalThemeWidget::setAccentColor(QString accentcolor)
{
QColor color;
@ -429,21 +547,50 @@ void GlobalThemeWidget::setAccentColor(QString accentcolor)
}
}
/**
* @brief
*
*
*
* @param transparency
*/
void GlobalThemeWidget::setTransparency(int transparency)
{
// 设置透明度滑块的当前值
m_transparencyslider->setValue(transparency);
}
/**
* @brief
*
*
*
* @param coverpath
*/
void GlobalThemeWidget::setCover(QString coverpath)
{
m_coverbtn->setIcon(QIcon(coverpath));
}
/**
* @brief
*
*
*
* @param wallpaperpath
*/
void GlobalThemeWidget::setWallpaper(QString wallpaperpath)
{
wallpaperbtn->setIcon(QIcon(wallpaperpath));
}
/**
* @brief
*
*
*
* @param windowradius
*/
void GlobalThemeWidget::setWindowRadius(int windowradius)
{
QMap<int, int> radiusIndexMap;

View File

@ -36,6 +36,13 @@ void GrubGraphicsView::wheelEvent(QWheelEvent *event)
}
}
/**
* @brief GrubImageWidget
*
* GrubImageWidget
*
* @param parent
*/
GrubImageWidget::GrubImageWidget(QWidget *parent)
{
m_scene = new QGraphicsScene(this);
@ -83,6 +90,13 @@ GrubImageWidget::GrubImageWidget(QWidget *parent)
graphicsView->scale(initialScale, initialScale);
}
/**
* @brief
*
*
*
* @param imagePath
*/
void GrubImageWidget::updateBackground(const QString &imagePath)
{
// 加载新的背景图片

View File

@ -3,6 +3,13 @@
#include <QFileDialog>
bool GrubThemeWidget::g_themeChange;
/**
* @brief GrubThemeWidget
*
* GrubThemeWidget
*
* @param parent
*/
GrubThemeWidget::GrubThemeWidget(QWidget *parent) : QWidget(parent)
{
initPreviewWidget();
@ -13,6 +20,18 @@ GrubThemeWidget::GrubThemeWidget(QWidget *parent) : QWidget(parent)
this->setLayout(globalthemelayout);
}
/**
* @brief
*
* QWidget作为预览小部件
* QPalette::Window
* "#F5F5F5"
*
* GrubImageWidget作为预览图像小部件
* QVBoxLayout作为预览小部件的布局
*
*
*/
void GrubThemeWidget::initPreviewWidget()
{
m_previewwidget = new QWidget(this);
@ -33,6 +52,14 @@ void GrubThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(m_previewlayout);
}
/**
* @brief
*
* QWidget m_rightwidget
* 400x620 400
* QPalette::Base
* initEditWidget()
*/
void GrubThemeWidget::initRightWidget()
{
m_rightwidget = new QWidget(this);
@ -42,6 +69,16 @@ void GrubThemeWidget::initRightWidget()
initEditWidget();
}
/**
* @brief
*
* QWidget
* QLabel QPushButton
* QHBoxLayout QPushButton QLabel
* QPushButton clicked
* QPushButton
* newGrubFilePath Grub
*/
void GrubThemeWidget::initEditWidget()
{
m_grubwidget = new QWidget(m_rightwidget);
@ -60,23 +97,29 @@ void GrubThemeWidget::initEditWidget()
tipLabel1->setText("<html>尺寸3840*2160<br>大小:不超过 10 MB<br>格式PNG</html>");
connect(showBtn, &QPushButton::clicked, this, [=]() {
// 弹出文件选择对话框,选择图片文件
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select picture file"), "", tr("Picture file (*.png *.jpg)"));
if (!newFilePath.isEmpty()/* && FileCheck::isLegalWallPaperFile(newFilePath,"wallpaper")*/) {
m_preview->updateBackground(newFilePath);
QPixmap pixmap(newFilePath);
showBtn->setIcon(QIcon(pixmap));
showBtn->setIconSize(showBtn->size());
emit newGrubFilePath(newFilePath);
g_themeChange = true;
// 如果选择的文件路径不为空
if (!newFilePath.isEmpty()) {
// 判断选择的文件是否是合法的壁纸文件
if(FileCheck::isLegalWallPaperFile(newFilePath,"wallpaper")){
// 更新背景预览
m_preview->updateBackground(newFilePath);
// 加载图片文件并创建一个QPixmap对象
QPixmap pixmap(newFilePath);
// 设置按钮的图标为加载的图片文件对应的图标,并设置图标大小为按钮的大小
showBtn->setIcon(QIcon(pixmap));
showBtn->setIconSize(showBtn->size());
// 发出新的Grub文件路径信号
emit newGrubFilePath(newFilePath);
g_themeChange = true;
}
} else {
qDebug() << "Selected file path:" << newFilePath;
}
});
widgetLayout->addWidget(showBtn);
widgetLayout->addWidget(tipLabel1);
grubWidget->setLayout(widgetLayout);

View File

@ -2,6 +2,13 @@
#include "../fileProcess/historyinfoload.h"
#include "../fileProcess/diroperation.h"
/**
* @brief
*
*
*
* @param parent
*/
HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent)
{
QVBoxLayout *alllayout = new QVBoxLayout();
@ -72,6 +79,13 @@ HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent)
this->setLayout(alllayout);
}
/**
* @brief
*
*
*
* @param parent
*/
void HistoryWidget::updateHistoryDir()
{
QDir builderDir = QDir(QDir::homePath() + "/.cache/theme-build/");
@ -136,6 +150,13 @@ void HistoryWidget::updateHistoryDir()
}
}
/**
* @brief
*
*
*
* @param parent
*/
HistoryButton::HistoryButton(QWidget* parent): QPushButton(parent)
{
// this->setBackgroundRole(QPalette::Base);
@ -163,6 +184,11 @@ void HistoryButton::setThemeType(const QString &themeType)
m_themetype = themeType;
}
/**
* @brief UI
*
* HistoryButton UI
*/
void HistoryButton::initUI()
{
QVBoxLayout* layout = new QVBoxLayout(this);

View File

@ -1,5 +1,13 @@
#include "iconthemewidget.h"
/**
* @brief
*
* IconThemeWidget
*
* @param isHistory
* @param parent QWidget
*/
IconThemeWidget::IconThemeWidget(bool isHistory, QWidget *parent) : QWidget(parent)
{
initMaps();
@ -14,6 +22,16 @@ IconThemeWidget::IconThemeWidget(bool isHistory, QWidget *parent) : QWidget(pare
this->setLayout(m_iconthemelayout);
}
/**
* @brief
*
* QWidget作为预览小部件
* QStackedWidget作为图片预览的容器
* ImageWidget分别用于显示自定义图标和系统图标
* ImageWidget添加到QStackedWidget中
* QStackedWidget添加到布局中
*
*/
void IconThemeWidget::initPreviewWidget()
{
m_previewwidget = new QWidget(this);
@ -48,6 +66,11 @@ void IconThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(layout);
}
/**
* @brief
*
*
*/
void IconThemeWidget::initEditWidget()
{
@ -102,6 +125,14 @@ void IconThemeWidget::initEditWidget()
m_editwidget->setLayout(mainWidgetLayout);
}
/**
* @brief
*
* m_customiconpathmap historyMap m_customiconpathmap
*
*
* @param historyMap QMap
*/
void IconThemeWidget::updateCustomIconPathMap(QMap<QString, QString>*historyMap)
{
// 清空现有的 m_customiconpathmap
@ -133,6 +164,13 @@ void IconThemeWidget::updateCustomIconPathMap(QMap<QString, QString>*historyMap)
}
}
/**
* @brief
*
*
*
* @param historyMap
*/
void IconThemeWidget::updateCustomSyetemIconPathMap(QMap<QString, QString>*historyMap)
{
m_systemcustomiconpathmap->clear();
@ -160,6 +198,12 @@ void IconThemeWidget::updateCustomSyetemIconPathMap(QMap<QString, QString>*histo
}
}
}
/**
* @brief
*
*
*/
void IconThemeWidget::initSystemEditWidget()
{
m_systemeditwidget = new QWidget(m_stackedwidget);
@ -182,29 +226,44 @@ void IconThemeWidget::initSystemEditWidget()
m_systempathWidgetMap->insert(widgetName, widget);
// 当widget中的"添加图标"按钮被点击时,执行下面的函数。
connect(widget->m_addiconbutton, &QPushButton::clicked, this, [=]() {
// 获取发出信号的按钮并将其转换为QPushButton*类型。
QPushButton* clickedButton = qobject_cast<QPushButton*>(sender());
// 检查转换是否成功。如果成功,继续执行下面的代码。
if (clickedButton) {
// 定义一个IconEditWidget类型的指针变量并将其初始化为nullptr。
IconEditWidget* clickedWidget = nullptr;
// 获取点击的按钮的父窗口并将其作为QWidget类型保存。
QWidget *widget = clickedButton->parentWidget();
// 循环遍历父窗口直到找到一个窗口是IconEditWidget类型的窗口。
while (widget && !widget->inherits("IconEditWidget")) {
widget = widget->parentWidget();
}
// 将QWidget类型转换为IconEditWidget类型并将结果保存到clickedWidget变量中。
clickedWidget = qobject_cast<IconEditWidget*>(widget);
// 检查转换是否成功。如果成功,继续执行下面的代码。
if (clickedWidget) {
// 显示一个文件选择对话框让用户选择一个SVG文件。将文件路径保存到newFilePath变量中。
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select SVG file"), "", tr("SVG file (*.svg)"));
if (!newFilePath.isEmpty()) {
//check
if(FileCheck::isLegalIconFile(newFilePath)){
// 将新的文件路径插入到m_systemcustomiconpathmap中键为widgetName。
m_systemcustomiconpathmap->insert(widgetName, newFilePath);
// 设置clickedWidget的自定义图标为新的文件路径。
clickedWidget->setcustomicon(newFilePath);
// 输出选择的文件路径和对应的widgetName。
qDebug() << "Selected file path:" << newFilePath<< "Corresponding widgetName:" << widgetName;
// 更新系统预览图标的显示。
m_systempreview->updateIcon(widgetName, newFilePath);
}
}
// 发出一个新的系统图标映射信号。
emit newSystemIconsMap(m_systemcustomiconpathmap);
}
}
@ -216,6 +275,15 @@ void IconThemeWidget::initSystemEditWidget()
m_systemeditwidget->setLayout(mainWidgetLayout);
}
/**
* @brief widget名称
*
* widget名称列表
*
* @param directoryPath
*
* @return widget名称列表
*/
QStringList IconThemeWidget::getWidgetNamesFromFilesInDirectory(const QString& directoryPath) {
QStringList widgetNames;
QDir dir(directoryPath);
@ -230,6 +298,11 @@ QStringList IconThemeWidget::getWidgetNamesFromFilesInDirectory(const QString& d
return widgetNames;
}
/**
* @brief
*
*
*/
void IconThemeWidget::initMaps()
{
getResourcesAppIconMap("appicon");
@ -238,6 +311,15 @@ void IconThemeWidget::initMaps()
m_pathWidgetMap = new QMap<QString, IconEditWidget*>;
}
/**
* @brief
*
*
*
* @param Type
*
* @return QMap<QString, QString>
*/
QMap<QString, QString> *IconThemeWidget::getResourcesAppIconMap(QString Type)
{
if("appicon" == Type){
@ -266,6 +348,11 @@ QMap<QString, QString> *IconThemeWidget::getResourcesAppIconMap(QString Type)
}
/**
* @brief
*
* QMap
*/
void IconThemeWidget::initSystemMaps()
{
//解决历史记录三次之后第单数历史记录窗出现段错误
@ -275,6 +362,11 @@ void IconThemeWidget::initSystemMaps()
m_systempathWidgetMap = new QMap<QString, IconEditWidget*>;
}
/**
* @brief
*
*
*/
void IconThemeWidget::initRightWidget()
{
m_rightwidget = new QWidget(this);
@ -330,18 +422,37 @@ void IconThemeWidget::initRightWidget()
m_rightwidget->setLayout(m_rightwidgetlayout);
}
/**
* @brief QMap
*
* QMap
*
* @return QMap
*/
QMap<QString, QString>* IconThemeWidget::getAppIconsMap()
{
getResourcesAppIconMap("icon");
return m_iconpathmap;
}
/**
* @brief
*
* QMap
*
* @return
*/
QMap<QString, QString> *IconThemeWidget::getSystemIconsMap()
{
getResourcesAppIconMap("systemicon");
return m_systemiconpathmap;
}
/**
* @brief
*
*
*/
void IconThemeWidget::setHistoryAppIcon()
{
QString directoryPath = m_info.filepath + "/src/iconTheme/appicon/";
@ -361,6 +472,11 @@ void IconThemeWidget::setHistoryAppIcon()
}
}
/**
* @brief
*
*
*/
void IconThemeWidget::setHistorySystemIcon()
{
QString directoryPath = m_info.filepath + "/src/iconTheme/systemicon/";
@ -378,7 +494,13 @@ void IconThemeWidget::setHistorySystemIcon()
m_historysystemiconmap->insert(name, filePath);
}
}
/**
* @brief
*
* 使
*
* @param InfoData
*/
void IconThemeWidget::eidtInitWidget(const HistoryInfo &InfoData)
{
m_info = InfoData;
@ -390,6 +512,11 @@ void IconThemeWidget::eidtInitWidget(const HistoryInfo &InfoData)
updateCustomSyetemIconPathMap(m_historysystemiconmap);
}
/**
* @brief
*
*
*/
void IconThemeWidget::refresh()
{
m_preview->updateIconMap(getResourcesAppIconMap("appicon"));

View File

@ -1,4 +1,4 @@
#include "iconwidgetfeature.h"
#include "iconwidgetfeature.h"
MainInterFaceFeature::MainInterFaceFeature(QWidget *parent) : QWidget(parent)
{
@ -9,6 +9,13 @@ TypeButton::TypeButton(QWidget *parent): QPushButton(parent)
setCheckable(true);
}
/**
* @brief
*
*
*
* @param event
*/
void TypeButton::paintEvent(QPaintEvent *event)
{
QPushButton::paintEvent(event);
@ -22,8 +29,13 @@ void TypeButton::paintEvent(QPaintEvent *event)
}
}
/**
* @brief
*
* QGraphicsView
*
* @param scene QGraphicsScene
*/
IconGraphicsView::IconGraphicsView(QGraphicsScene* scene) : QGraphicsView(scene)
{
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
@ -36,6 +48,13 @@ IconGraphicsView::IconGraphicsView(QGraphicsScene* scene) : QGraphicsView(scene)
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
/**
* @brief
*
* QGraphicsView
*
* @param event
*/
void IconGraphicsView::wheelEvent(QWheelEvent* event)
{
// if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier) {
@ -64,6 +83,14 @@ void IconGraphicsView::wheelEvent(QWheelEvent* event)
}
bool ImageWidget::g_themeChange;
/**
* @brief ImageWidget构造函数
*
* ImageWidget的构造函数ImageWidget对象
*
* @param parent QWidget对象指针ImageWidget的父窗口
* @param iconMap QMap<QString, QString>
*/
ImageWidget::ImageWidget(QWidget *parent, const QMap<QString, QString>* iconMap)
: QWidget(parent), m_iconMap(iconMap)
{
@ -77,7 +104,10 @@ ImageWidget::ImageWidget(QWidget *parent, const QMap<QString, QString>* iconMap)
setLayout(layout);
// 获取图标映射表的大小
int count = m_iconMap->size();
// 如果图标映射表的大小等于11加载特定的背景图片并添加到场景中
if(count == 11){
image = new QPixmap(":/resource/background/controlcenter-light.png");
if (image->isNull()) {
@ -89,75 +119,107 @@ ImageWidget::ImageWidget(QWidget *parent, const QMap<QString, QString>* iconMap)
qDebug() << "Failed to load image.";
}
}
// 将场景添加到视图,并设置视图显示的场景
scene->addPixmap(*image);
graphicsView->setScene(scene);
// 根据视图的大小调整场景的大小,保持宽高比不变
graphicsView->fitInView(scene->sceneRect(), Qt::KeepAspectRatio);
// 显示视图
graphicsView->show();
// 如果图标映射表的大小等于11则进行特定的图片加载和添加操作
if (count == 11) {
// 获取图标映射表的所有键值对
QList<QString> keys = m_iconMap->keys();
// 根据特定的顺序创建键值的数组
QString positions[11] = { keys[0], keys[9], keys[4], keys[5], keys[6],
keys[3], keys[10], keys[8], keys[1], keys[7], keys[2] };
// 定义图片的位置数组
int posX[3] = { 208, 879, 1550 };
int posY[4] = { 275, 535, 795, 1055 };
int index = 0;
// 遍历位置数组,加载并添加图片到场景中
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 3; ++j) {
// 检查索引是否超出范围
if (index >= 11) {
break; // 处理超出索引范围的情况
}
// 根据键值获取图片路径,并加载图片
QString pixmapPath = m_iconMap->value(positions[index]);
QPixmap pixmap(pixmapPath);
QGraphicsPixmapItem* item = scene->addPixmap(pixmap.scaled(100, 100));
// 设置图形的可选择和可聚焦属性,以触发选择和焦点事件
item->setFlag(QGraphicsItem::ItemIsSelectable); // 启用选择事件
item->setFlag(QGraphicsItem::ItemIsFocusable); // 启用焦点事件
// 将键值和图片路径保存到图形的数据中,以便后续使用
item->setData(0, keys[index]);
item->setData(1, pixmapPath);
// 设置图形的位置
item->setPos(posX[j], posY[i]);
// 增加索引的值,准备处理下一个图片的加载和添加操作
++index;
}
}
}
else{
int columnCount = 10;
int row = 1;
int col = 2;
for (auto it = m_iconMap->begin(); it != m_iconMap->end(); ++it) {
const QString& widgetName = it.key();
}else{ // 如果图标映射表的大小不等于11则进行常规的图片加载和添加操作
// 定义列数和行数,以及初始的列和行索引值
int columnCount = 10;
int row = 1;
int col = 2;
// 遍历图标映射表的所有键值对,加载并添加图片到场景中
for (auto it = m_iconMap->begin(); it != m_iconMap->end(); ++it) {
const QString& widgetName = it.key(); // 获取键值对应的名称,用于后续数据的保存和处理中用到此处名称的部分。
// 获取当前迭代器it的值
const QString& filePath = it.value();
// 根据文件路径加载QPixmap对象这将加载文件并创建一个QPixmap对象
QPixmap pixmap(filePath);
// 判断图片是否成功加载如果QPixmap对象为空说明加载失败
if (!pixmap.isNull()) {
// 如果图片加载成功则将图片添加到QGraphicsScene中并按照128x128的尺寸进行缩放
QGraphicsPixmapItem* item = scene->addPixmap(pixmap.scaled(128, 128));
item->setFlag(QGraphicsItem::ItemIsSelectable); // 启用选择事件
item->setFlag(QGraphicsItem::ItemIsFocusable); // 启用焦点事件
// 设置该项可以被选择,即响应用户的点击选择事件
item->setFlag(QGraphicsItem::ItemIsSelectable);
// 设置该项在场景中的位置
item->setPos(col * 160, row * 160);
item->setScale(1.0);
item->setData(0, widgetName);
item->setData(1, filePath);
// 为该项设置一些自定义的数据这些数据可以通过调用QGraphicsItem::data方法来获取
item->setData(0, widgetName); // 将widgetName数据保存到该项的第一个数据槽中
item->setData(1, filePath); // 将filePath数据保存到该项的第二个数据槽中
qDebug()<<"widgetName"<<widgetName<<"filePath"<<filePath;
// 增加列计数器
col++;
// 如果列计数器超过了指定的列数,就重新开始行计数器,同时增加一行
if (col >= columnCount) {
col = 2;
row++;
col = 2; // 重新开始列计数器,但这次从第二列开始计数
row++; // 增加一行计数器
} else {
qDebug() << "Failed to load image:" << filePath;
}
} else {
qDebug() << "Failed to load image:" << filePath;
}
}
}
// 设置初始缩放倍数为0.9倍
qreal initialScale = 0.9;
graphicsView->scale(initialScale, initialScale);
}
}
/**
* @brief
*
*
*
* @param newIconMap
*/
void ImageWidget::updateIconMap(const QMap<QString, QString>* newIconMap)
{
m_iconMap = newIconMap;
@ -244,49 +306,79 @@ void ImageWidget::updateIconMap(const QMap<QString, QString>* newIconMap)
graphicsView->fitInView(scene->sceneRect(), Qt::KeepAspectRatio);
}
/**
* @brief
*
*
*
* @param imagePath
*/
void ImageWidget::updateImage(const QString& imagePath)
{
// 如果已经有图片存在,则删除并置空
if (image != nullptr) {
delete image;
image = nullptr;
}
// 根据给定的路径加载图片
image = new QPixmap(imagePath);
if (image->isNull()) {
qDebug() << "Failed to load image.";
}
// 获取图形视图的对象,并清空场景中的内容
QGraphicsScene* scene = graphicsView->scene();
scene->clear();
// 在场景中添加图片
scene->addPixmap(*image);
// 定义列数和初始行列位置
int columnCount = 10;
int row = 1;
int col = 2;
for (auto it = m_iconMap->begin(); it != m_iconMap->end(); ++it) {
const QString& widgetName = it.key();
const QString& filePath = it.value();
// 遍历图标映射表,逐个添加图标到场景中
for (auto it = m_iconMap->begin(); it != m_iconMap->end(); ++it) {
const QString& widgetName = it.key(); // 获取键值对应的widgetName
const QString& filePath = it.value(); // 获取键值对应的文件路径
// 根据文件路径加载图标
QPixmap pixmap(filePath);
if (!pixmap.isNull()) {
// 缩放图标大小为128x128并添加到场景中
QGraphicsPixmapItem* item = scene->addPixmap(pixmap.scaled(128, 128));
item->setPos(col * 160, row * 160);
item->setScale(1.0);
item->setData(0, widgetName);
item->setData(1, filePath);
// 设置图标的初始位置和缩放比例并将widgetName和文件路径保存到图标的数据中
item->setPos(col * 160, row * 160);
item->setScale(1.0);
item->setData(0, widgetName);
item->setData(1, filePath);
col++;
if (col >= columnCount) {
col = 2;
row++;
}
} else {
// 更新列的位置如果超过列数则重新开始行行数加1
col++;
if (col >= columnCount) {
col = 2;
row++;
}
} else {
qDebug() << "Failed to load image:" << filePath;
}
}
// 根据场景的边界自适应视图大小,保持视图比例不变
graphicsView->fitInView(scene->sceneRect(), Qt::KeepAspectRatio);
}
/**
* @brief
*
* widgetName newFilePath
*
* @param widgetName
* @param newFilePath
*/
void ImageWidget::updateIcon(const QString& widgetName, const QString& newFilePath)
{
QGraphicsScene* scene = graphicsView->scene();
@ -298,26 +390,40 @@ void ImageWidget::updateIcon(const QString& widgetName, const QString& newFilePa
<< "Position:" << item->pos()
<< "Type:" << item->type();
}
// 遍历所有的图形项
for (QGraphicsItem* item : items) {
// 尝试将当前图形项转换为图形位图项
QGraphicsPixmapItem* pixmapItem = dynamic_cast<QGraphicsPixmapItem*>(item);
qDebug()<<widgetName<<"!!!!!!!!!!!";
// 如果图形位图项存在并且它的数据索引为0与widgetName相同
if (pixmapItem && pixmapItem->data(0).toString() == widgetName) {
qDebug()<<"!!!!!sss!!!!!!";
// 保存图形位图项的旧位置
QPointF oldPosition = pixmapItem->pos();
// 从场景中移除图形位图项
scene->removeItem(pixmapItem);
// 删除图形位图项
delete pixmapItem;
// 加载新的位图从newFilePath路径
QPixmap newPixmap(newFilePath);
// 如果新的位图不为空
if (!newPixmap.isNull()) {
// 如果widgetName包含"kylin-setting"字符串
if(widgetName.contains("kylin-setting")){
// 添加新的位图缩放为100x100到场景中并设置数据索引为0为widgetName, 索引为1为newFilePath
QGraphicsPixmapItem* newPixmapItem = scene->addPixmap(newPixmap.scaled(100, 100));
newPixmapItem->setData(0, widgetName);
newPixmapItem->setData(1, newFilePath);
// 设置新的位图的位置为旧位置
newPixmapItem->setPos(oldPosition);
}else{
QGraphicsPixmapItem* newPixmapItem = scene->addPixmap(newPixmap.scaled(128, 128));
newPixmapItem->setData(0, widgetName);
newPixmapItem->setData(1, newFilePath);
newPixmapItem->setPos(oldPosition);
// 添加新的位图缩放为128x128到场景中并设置数据索引为0为widgetName, 索引为1为newFilePath
QGraphicsPixmapItem* newPixmapItem = scene->addPixmap(newPixmap.scaled(128, 128));
newPixmapItem->setData(0, widgetName);
newPixmapItem->setData(1, newFilePath);
// 设置新的位图的位置为旧位置
newPixmapItem->setPos(oldPosition);
}
}else {
qDebug() << "Failed to load image:" << newFilePath;
}
g_themeChange = true;
} else {
@ -328,6 +434,13 @@ void ImageWidget::updateIcon(const QString& widgetName, const QString& newFilePa
}
}
/**
* @brief
*
*
*
* @param parent
*/
IconEditWidget::IconEditWidget(QWidget *parent)
{
QVBoxLayout *widgetLayout = new QVBoxLayout(this);
@ -369,28 +482,62 @@ IconEditWidget::IconEditWidget(QWidget *parent)
}
/**
* @brief
*
*
*
* @param iconname
*/
void IconEditWidget::setdefaulticon(QString iconname)
{
m_icondefaultlabel->setPixmap(QIcon::fromTheme(iconname).pixmap(48,48));
}
/**
* @brief
*
*
*
* @param iconname
*/
void IconEditWidget::setdefaulticonname(QString iconname)
{
m_label->setText(iconname);
}
/**
* @brief
*
*
*
* @param iconFilePath
*/
void IconEditWidget::setcustomicon(QString iconFilePath)
{
QPixmap pixmap(iconFilePath);
m_icondecustomlabel->setPixmap(pixmap.scaled(48, 48));
}
/**
* @brief
*
* CustomLabel
*
* @param parent
*/
CustomLabel::CustomLabel(QWidget *parent): QLabel(parent), pixmap()
{
this->setFixedSize(48,48);
}
/**
* @brief
*
*
*
* @param event
*/
void CustomLabel::paintEvent(QPaintEvent *event)
{
QLabel::paintEvent(event);
@ -414,6 +561,13 @@ void CustomLabel::paintEvent(QPaintEvent *event)
}
}
/**
* @brief QPixmap
*
* CustomLabel QPixmap
*
* @param pixmap QPixmap
*/
void CustomLabel::setPixmap(const QPixmap &pixmap)
{
this->pixmap = pixmap;

View File

@ -12,6 +12,13 @@ PlymouthThemeFeature::PlymouthThemeFeature(QWidget *parent) : QWidget(parent)
}
/**
* @brief PlymouthImageWidget
*
* PlymouthImageWidget
*
* @param parent
*/
PlymouthImageWidget::PlymouthImageWidget(QWidget *parent)
{
scene = new QGraphicsScene(this);
@ -37,6 +44,13 @@ PlymouthImageWidget::PlymouthImageWidget(QWidget *parent)
graphicsView->scale(initialScale, initialScale);
}
/**
* @brief Plymouth
*
* Plymouth
*
* @param imagePath
*/
void PlymouthImageWidget::updatePlymouth(const QString &imagePath)
{
scene->clear(); // 清空当前场景
@ -71,6 +85,11 @@ void PlymouthImageWidget::updatePlymouth(const QString &imagePath)
graphicsView->fitInView(scene->sceneRect(), Qt::KeepAspectRatio); // 调整视图以适应新内容
}
/**
* @brief Plymouth
*
* pixmaps
*/
PlymouthGraphicsView::PlymouthGraphicsView(QGraphicsScene *scene)
{
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);

View File

@ -1,6 +1,13 @@
#include "plymouththemewidget.h"
bool PlymouthThemeWidget::g_themeChange;
/**
* @brief PlymouthThemeWidget
*
* PlymouthThemeWidget
*
* @param parent
*/
PlymouthThemeWidget::PlymouthThemeWidget(QWidget *parent) : QWidget(parent)
{
initPreviewWidget();
@ -11,6 +18,15 @@ PlymouthThemeWidget::PlymouthThemeWidget(QWidget *parent) : QWidget(parent)
this->setLayout(globalthemelayout);
}
/**
* @brief
*
* QWidget
* QPalette::Window
*
* PlymouthImageWidget
*
*/
void PlymouthThemeWidget::initPreviewWidget()
{
m_previewwidget = new QWidget(this);
@ -31,6 +47,12 @@ void PlymouthThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(m_previewlayout);
}
/**
* @brief
*
* QWidget对象作为右侧小部件
*
*/
void PlymouthThemeWidget::initRightWidget()
{
m_rightwidget = new QWidget(this);
@ -40,6 +62,11 @@ void PlymouthThemeWidget::initRightWidget()
initEditWidget();
}
/**
* @brief
*
*
*/
void PlymouthThemeWidget::initEditWidget()
{
m_plymouthwidget = new QWidget(m_rightwidget);
@ -70,7 +97,7 @@ void PlymouthThemeWidget::initEditWidget()
addButton->setIcon(QIcon::fromTheme("list-add-symbolic"));
addButton->setFixedSize(36,36);
connect(addButton, &QPushButton::clicked, this, [=]() {
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select SVG file"), "", tr("SVG file (*.svg *.png *.gif *.mp4)"));
QString newFilePath = QFileDialog::getOpenFileName(this, tr("Select MP4 file"), "", tr("MP4 file (*.svg *.png *.gif *.mp4)"));
if (!newFilePath.isEmpty()) {
QPixmap pixmap(newFilePath);
pixmap = pixmap.scaled(64,64, Qt::KeepAspectRatio);

View File

@ -1,5 +1,12 @@
#include "titlebar.h"
/**
* @brief TitleBar类的构造函数
*
* TitleBar类的构造函数
*
* @param parent
*/
TitleBar::TitleBar(QWidget *parent) : QWidget(parent)
{
m_ismaximized = false;
@ -79,17 +86,31 @@ TitleBar::TitleBar(QWidget *parent) : QWidget(parent)
layout->addLayout(buttonLayout);
}
/**
* @brief
*
*
*
*/
void TitleBar::toggleMaximize()
{
// 如果当前窗口不是最大化状态
if (!m_ismaximized) {
// 显示最大化窗口
parentWidget()->parentWidget()->showMaximized();
// 设置状态为已最大化
m_ismaximized = true;
// 设置最大化按钮的图标为还原图标
m_maximumbtn->setIcon(QIcon::fromTheme("window-restore-symbolic"));
// 如果当前窗口已经是最大化状态
} else {
// 显示普通窗口
parentWidget()->parentWidget()->showNormal();
// 设置状态为未最大化
m_ismaximized = false;
// 设置最大化按钮的图标为最大化图标
m_maximumbtn->setIcon(QIcon::fromTheme("window-maximize-symbolic"));
}
}

View File

@ -4,12 +4,14 @@
<context>
<name>CursorThemeWidget</name>
<message>
<location filename="../src/module/cursorthemewidget.cpp" line="119"/>
<location filename="../src/module/cursorthemewidget.cpp" line="191"/>
<location filename="../src/module/cursorthemewidget.cpp" line="217"/>
<source>Select SVG file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/cursorthemewidget.cpp" line="119"/>
<location filename="../src/module/cursorthemewidget.cpp" line="191"/>
<location filename="../src/module/cursorthemewidget.cpp" line="217"/>
<source>SVG file (*.svg)</source>
<translation type="unfinished"></translation>
</message>
@ -48,87 +50,125 @@
<context>
<name>GlobalThemeWidget</name>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="92"/>
<location filename="../src/module/globalthemewidget.cpp" line="117"/>
<source>Overall theme rendering</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="115"/>
<location filename="../src/module/globalthemewidget.cpp" line="161"/>
<location filename="../src/module/globalthemewidget.cpp" line="140"/>
<location filename="../src/module/globalthemewidget.cpp" line="186"/>
<source>Select picture file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="115"/>
<location filename="../src/module/globalthemewidget.cpp" line="161"/>
<location filename="../src/module/globalthemewidget.cpp" line="140"/>
<location filename="../src/module/globalthemewidget.cpp" line="186"/>
<source>Picture file (*.png *.jpg)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="141"/>
<location filename="../src/module/globalthemewidget.cpp" line="166"/>
<source>Desktop wallpaper</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="189"/>
<location filename="../src/module/globalthemewidget.cpp" line="214"/>
<source>Window appearance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="193"/>
<location filename="../src/module/globalthemewidget.cpp" line="218"/>
<source>light</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="194"/>
<location filename="../src/module/globalthemewidget.cpp" line="219"/>
<source>dark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="224"/>
<location filename="../src/module/globalthemewidget.cpp" line="249"/>
<source>Control fillet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="265"/>
<location filename="../src/module/globalthemewidget.cpp" line="290"/>
<source>Accent colour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="268"/>
<location filename="../src/module/globalthemewidget.cpp" line="293"/>
<source>daybreakBlue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="269"/>
<location filename="../src/module/globalthemewidget.cpp" line="294"/>
<source>jamPurple</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="270"/>
<location filename="../src/module/globalthemewidget.cpp" line="295"/>
<source>magenta</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="271"/>
<location filename="../src/module/globalthemewidget.cpp" line="296"/>
<source>sunRed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="272"/>
<location filename="../src/module/globalthemewidget.cpp" line="297"/>
<source>sunsetOrange</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="273"/>
<location filename="../src/module/globalthemewidget.cpp" line="298"/>
<source>dustGold</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="274"/>
<location filename="../src/module/globalthemewidget.cpp" line="299"/>
<source>polarGreen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="324"/>
<source>Window transparency</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="358"/>
<source>Window fillet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="361"/>
<source>Large</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="362"/>
<source>Medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="363"/>
<source>Small</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GrubThemeWidget</name>
<message>
<location filename="../src/module/grubthemewidget.cpp" line="62"/>
<source>Select picture file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/grubthemewidget.cpp" line="62"/>
<source>Picture file (*.png *.jpg)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>HistoryWidget</name>
@ -146,24 +186,24 @@
<context>
<name>IconThemeWidget</name>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="81"/>
<location filename="../src/module/iconthemewidget.cpp" line="164"/>
<location filename="../src/module/iconthemewidget.cpp" line="87"/>
<location filename="../src/module/iconthemewidget.cpp" line="197"/>
<source>Select SVG file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="81"/>
<location filename="../src/module/iconthemewidget.cpp" line="164"/>
<location filename="../src/module/iconthemewidget.cpp" line="87"/>
<location filename="../src/module/iconthemewidget.cpp" line="197"/>
<source>SVG file (*.svg)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="258"/>
<location filename="../src/module/iconthemewidget.cpp" line="293"/>
<source>APP</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="260"/>
<location filename="../src/module/iconthemewidget.cpp" line="295"/>
<source>System setting</source>
<translation type="unfinished"></translation>
</message>
@ -207,11 +247,14 @@
</message>
<message>
<location filename="../src/module/infocreatewidget.cpp" line="144"/>
<location filename="../src/module/infocreatewidget.cpp" line="179"/>
<location filename="../src/module/infocreatewidget.cpp" line="214"/>
<source>Input format error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/infocreatewidget.cpp" line="153"/>
<location filename="../src/module/infocreatewidget.cpp" line="223"/>
<source>Input is empty!</source>
<translation type="unfinished"></translation>
</message>
@ -219,32 +262,32 @@
<context>
<name>MainInterface</name>
<message>
<location filename="../src/maininterface.cpp" line="125"/>
<location filename="../src/maininterface.cpp" line="135"/>
<source>GlobalTheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="127"/>
<location filename="../src/maininterface.cpp" line="137"/>
<source>IconTheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="129"/>
<location filename="../src/maininterface.cpp" line="139"/>
<source>CursorTheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="131"/>
<location filename="../src/maininterface.cpp" line="141"/>
<source>PlymouthTheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="133"/>
<location filename="../src/maininterface.cpp" line="143"/>
<source>GrubTheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="136"/>
<location filename="../src/maininterface.cpp" line="146"/>
<source>Start Building</source>
<translation type="unfinished"></translation>
</message>
@ -252,33 +295,76 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/mainwindow.cpp" line="71"/>
<location filename="../src/mainwindow.cpp" line="78"/>
<source>kylin-theme-builder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="74"/>
<location filename="../src/mainwindow.cpp" line="81"/>
<source>User guide</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="105"/>
<location filename="../src/mainwindow.cpp" line="230"/>
<source>Global Theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="107"/>
<location filename="../src/mainwindow.cpp" line="231"/>
<source>Topics include basic styles for windows and controls, icons, cursors, and more!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="233"/>
<source>Icon Theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="109"/>
<location filename="../src/mainwindow.cpp" line="234"/>
<source>The icon theme includes multiple application icons and system settings homepage icons.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="236"/>
<source>Cursor Theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="111"/>
<source>Boot Theme</source>
<location filename="../src/mainwindow.cpp" line="237"/>
<source>Cursor theme for pointer cursor icon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="239"/>
<source>Plymouth Theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="240"/>
<source>Boot animation can be customized to boot screen effect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="242"/>
<source>GRUB Theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="243"/>
<source>Modify GURB background wallpaper</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PlymouthThemeWidget</name>
<message>
<location filename="../src/module/plymouththemewidget.cpp" line="73"/>
<source>Select MP4 file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/module/plymouththemewidget.cpp" line="73"/>
<source>MP4 file (*.svg *.png *.gif *.mp4)</source>
<translation type="unfinished"></translation>
</message>
</context>

Binary file not shown.

View File

@ -4,12 +4,14 @@
<context>
<name>CursorThemeWidget</name>
<message>
<location filename="../src/module/cursorthemewidget.cpp" line="119"/>
<location filename="../src/module/cursorthemewidget.cpp" line="191"/>
<location filename="../src/module/cursorthemewidget.cpp" line="217"/>
<source>Select SVG file</source>
<translation>SVG文件</translation>
</message>
<message>
<location filename="../src/module/cursorthemewidget.cpp" line="119"/>
<location filename="../src/module/cursorthemewidget.cpp" line="191"/>
<location filename="../src/module/cursorthemewidget.cpp" line="217"/>
<source>SVG file (*.svg)</source>
<translation>SVG (*.svg)</translation>
</message>
@ -48,87 +50,125 @@
<context>
<name>GlobalThemeWidget</name>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="92"/>
<location filename="../src/module/globalthemewidget.cpp" line="117"/>
<source>Overall theme rendering</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="115"/>
<location filename="../src/module/globalthemewidget.cpp" line="161"/>
<location filename="../src/module/globalthemewidget.cpp" line="140"/>
<location filename="../src/module/globalthemewidget.cpp" line="186"/>
<source>Select picture file</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="115"/>
<location filename="../src/module/globalthemewidget.cpp" line="161"/>
<location filename="../src/module/globalthemewidget.cpp" line="140"/>
<location filename="../src/module/globalthemewidget.cpp" line="186"/>
<source>Picture file (*.png *.jpg)</source>
<translation> (*.png *.jpg)</translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="141"/>
<location filename="../src/module/globalthemewidget.cpp" line="166"/>
<source>Desktop wallpaper</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="189"/>
<location filename="../src/module/globalthemewidget.cpp" line="214"/>
<source>Window appearance</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="193"/>
<location filename="../src/module/globalthemewidget.cpp" line="218"/>
<source>light</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="194"/>
<location filename="../src/module/globalthemewidget.cpp" line="219"/>
<source>dark</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="224"/>
<location filename="../src/module/globalthemewidget.cpp" line="249"/>
<source>Control fillet</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="265"/>
<location filename="../src/module/globalthemewidget.cpp" line="290"/>
<source>Accent colour</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="268"/>
<location filename="../src/module/globalthemewidget.cpp" line="293"/>
<source>daybreakBlue</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="269"/>
<location filename="../src/module/globalthemewidget.cpp" line="294"/>
<source>jamPurple</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="270"/>
<location filename="../src/module/globalthemewidget.cpp" line="295"/>
<source>magenta</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="271"/>
<location filename="../src/module/globalthemewidget.cpp" line="296"/>
<source>sunRed</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="272"/>
<location filename="../src/module/globalthemewidget.cpp" line="297"/>
<source>sunsetOrange</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="273"/>
<location filename="../src/module/globalthemewidget.cpp" line="298"/>
<source>dustGold</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="274"/>
<location filename="../src/module/globalthemewidget.cpp" line="299"/>
<source>polarGreen</source>
<translation>绿</translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="324"/>
<source>Window transparency</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="358"/>
<source>Window fillet</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="361"/>
<source>Large</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="362"/>
<source>Medium</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/globalthemewidget.cpp" line="363"/>
<source>Small</source>
<translation></translation>
</message>
</context>
<context>
<name>GrubThemeWidget</name>
<message>
<location filename="../src/module/grubthemewidget.cpp" line="62"/>
<source>Select picture file</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/grubthemewidget.cpp" line="62"/>
<source>Picture file (*.png *.jpg)</source>
<translation> (*.png *.jpg)</translation>
</message>
</context>
<context>
<name>HistoryWidget</name>
@ -146,24 +186,24 @@
<context>
<name>IconThemeWidget</name>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="81"/>
<location filename="../src/module/iconthemewidget.cpp" line="164"/>
<location filename="../src/module/iconthemewidget.cpp" line="87"/>
<location filename="../src/module/iconthemewidget.cpp" line="197"/>
<source>Select SVG file</source>
<translation>SVG文件</translation>
</message>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="81"/>
<location filename="../src/module/iconthemewidget.cpp" line="164"/>
<location filename="../src/module/iconthemewidget.cpp" line="87"/>
<location filename="../src/module/iconthemewidget.cpp" line="197"/>
<source>SVG file (*.svg)</source>
<translation>SVG (*.svg)</translation>
</message>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="258"/>
<location filename="../src/module/iconthemewidget.cpp" line="293"/>
<source>APP</source>
<translation>APP</translation>
</message>
<message>
<location filename="../src/module/iconthemewidget.cpp" line="260"/>
<location filename="../src/module/iconthemewidget.cpp" line="295"/>
<source>System setting</source>
<translation></translation>
</message>
@ -207,11 +247,14 @@
</message>
<message>
<location filename="../src/module/infocreatewidget.cpp" line="144"/>
<location filename="../src/module/infocreatewidget.cpp" line="179"/>
<location filename="../src/module/infocreatewidget.cpp" line="214"/>
<source>Input format error!</source>
<translation></translation>
</message>
<message>
<location filename="../src/module/infocreatewidget.cpp" line="153"/>
<location filename="../src/module/infocreatewidget.cpp" line="223"/>
<source>Input is empty!</source>
<translation></translation>
</message>
@ -219,32 +262,32 @@
<context>
<name>MainInterface</name>
<message>
<location filename="../src/maininterface.cpp" line="125"/>
<location filename="../src/maininterface.cpp" line="135"/>
<source>GlobalTheme</source>
<translation></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="127"/>
<location filename="../src/maininterface.cpp" line="137"/>
<source>IconTheme</source>
<translation></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="129"/>
<location filename="../src/maininterface.cpp" line="139"/>
<source>CursorTheme</source>
<translation></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="131"/>
<location filename="../src/maininterface.cpp" line="141"/>
<source>PlymouthTheme</source>
<translation></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="133"/>
<location filename="../src/maininterface.cpp" line="143"/>
<source>GrubTheme</source>
<translation></translation>
</message>
<message>
<location filename="../src/maininterface.cpp" line="136"/>
<location filename="../src/maininterface.cpp" line="146"/>
<source>Start Building</source>
<translation></translation>
</message>
@ -252,34 +295,89 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/mainwindow.cpp" line="71"/>
<location filename="../src/mainwindow.cpp" line="78"/>
<source>kylin-theme-builder</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="74"/>
<location filename="../src/mainwindow.cpp" line="81"/>
<source>User guide</source>
<translation>使</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="105"/>
<location filename="../src/mainwindow.cpp" line="230"/>
<source>Global Theme</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="107"/>
<location filename="../src/mainwindow.cpp" line="231"/>
<source>Topics include basic styles for windows and controls, icons, cursors, and more!</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="233"/>
<source>Icon Theme</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="109"/>
<location filename="../src/mainwindow.cpp" line="234"/>
<source>The icon theme includes multiple application icons and system settings homepage icons.</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="236"/>
<source>Cursor Theme</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="111"/>
<location filename="../src/mainwindow.cpp" line="237"/>
<source>Cursor theme for pointer cursor icon</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="239"/>
<source>Plymouth Theme</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="240"/>
<source>Boot animation can be customized to boot screen effect</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="242"/>
<source>GRUB Theme</source>
<translation>GRUB背景</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="243"/>
<source>Modify GURB background wallpaper</source>
<translation>GURB背景壁纸</translation>
</message>
<message>
<source>Boot Theme</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>PlymouthThemeWidget</name>
<message>
<source>Select SVG file</source>
<translation type="vanished">SVG文件</translation>
</message>
<message>
<source>SVG file (*.svg *.png *.gif *.mp4)</source>
<translation type="obsolete"> (*.svg *.png *.gif *.mp4)</translation>
</message>
<message>
<location filename="../src/module/plymouththemewidget.cpp" line="73"/>
<source>Select MP4 file</source>
<translation>MP4文件</translation>
</message>
<message>
<location filename="../src/module/plymouththemewidget.cpp" line="73"/>
<source>MP4 file (*.svg *.png *.gif *.mp4)</source>
<translation>MP4文件(*.mp4)</translation>
</message>
</context>
<context>