diff --git a/debian/changelog b/debian/changelog index 3f422e2..7afd17c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (4.3.2) UNRELEASED; urgency=medium + + * ssinstall支持安装conflict包 + * 支持紧凑模式 + + -- shenmo Tue, 24 Sep 2024 11:27:08 +0800 + spark-store (4.3.1) UNRELEASED; urgency=medium * 修复自提权更新问题 diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index 1341d9d..219bec4 100755 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -22,9 +22,6 @@ #define AppPageSearchlist 1 #define AppPageAppdetail 2 #define AppPageSettings 3 -#define WaylandSearchCenter 1 -#define OtherSearchCenter 2 -#define RightSearchSpace 1 #define UploadServerUrl "https://upload.deepinos.org.cn/" MainWindow::MainWindow(QWidget *parent) @@ -126,6 +123,16 @@ void MainWindow::closeEvent(QCloseEvent *event) BaseWidgetOpacity::closeEvent(event); } +void MainWindow::changeEvent(QEvent *event) +{ + if (event->type() != QEvent::StyleChange) { + return BaseWidgetOpacity::changeEvent(event); + } + + BaseWidgetOpacity::changeEvent(event); + downloadButton->setFixedSize(searchEdit->sizeHint().height(), searchEdit->sizeHint().height()); +} + void MainWindow::initUI() { QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); @@ -159,8 +166,9 @@ void MainWindow::initTitleBar() ui->titlebar->setBackgroundTransparent(true); // 初始化标题栏控件 - DLabel *title = new DLabel(ui->titlebar); - title->setText(tr("Spark Store")); + DLabel *titleLabel = new DLabel(ui->titlebar); + titleLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + titleLabel->setText(tr("Spark Store")); backButton = new DPushButton(ui->titlebar); @@ -170,34 +178,36 @@ void MainWindow::initTitleBar() searchEdit->lineEdit()->setFixedWidth(350); downloadButton = new ProgressButton(ui->titlebar); + downloadButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); downloadButton->setDownloadListWidget(downloadlistwidget); downloadButton->setFocusPolicy(Qt::FocusPolicy::ClickFocus); + downloadButton->setFixedSize(searchEdit->sizeHint().height(), searchEdit->sizeHint().height()); downloadlistwidget->setFocusProxy(downloadButton); - QWidget *w_titlebar = new QWidget(ui->titlebar); - QHBoxLayout *ly_titlebar = new QHBoxLayout(w_titlebar); - ly_titlebar->addWidget(title); - ly_titlebar->addWidget(backButton); - // Check wayland configs - QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat); - if (!config.value("runtime/isDDE").toBool() && config.value("runtime/useWayland").toBool()) - { - // Wayland 搜索栏居中 - ly_titlebar->addStretch(WaylandSearchCenter); - } - else - { - // dwayland dxcb 搜索栏顶部右侧居中 - ly_titlebar->addStretch(OtherSearchCenter); - } - ly_titlebar->addWidget(searchEdit); - ly_titlebar->addWidget(downloadButton); - ly_titlebar->addStretch(RightSearchSpace); - ui->titlebar->setCustomWidget(w_titlebar); + QWidget *customWidget = new QWidget(ui->titlebar); + customWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + ui->titlebar->setCustomWidget(customWidget); + + QHBoxLayout *customWidgetLayout = new QHBoxLayout(customWidget); + customWidgetLayout->setContentsMargins(8, 0, 0, 0); + customWidgetLayout->setSpacing(8); + customWidgetLayout->addWidget(titleLabel, 0, Qt::AlignLeft); + customWidgetLayout->addWidget(backButton, 0, Qt::AlignLeft); + QWidget *centralWidget = new QWidget(customWidget); + centralWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + customWidgetLayout->addWidget(centralWidget, 1, Qt::AlignHCenter); + + QHBoxLayout *centralLayout = new QHBoxLayout(centralWidget); + centralLayout->setContentsMargins(0, 0, 10, 0); + centralLayout->setSpacing(0); + + centralLayout->addWidget(searchEdit, 0, Qt::AlignHCenter); + centralLayout->addSpacing(10); + centralLayout->addWidget(downloadButton, 0, Qt::AlignHCenter); initTitleBarMenu(); - backButton->hide(); + backButton->setDisabled(true); downloadlistwidget->hide(); } @@ -353,9 +363,9 @@ void MainWindow::initConnections() ui->stackedWidget->setCurrentIndex(pageHistory.at(pageHistory.count() - 2)); pageHistory.removeLast(); if (pageHistory.count() > 1) { - backButton->show(); + backButton->setEnabled(true); } else { - backButton->hide(); + backButton->setDisabled(true); } }); // 搜索事件 @@ -446,11 +456,11 @@ void MainWindow::switchPage(int now) // 临时方案,回家后修改 qDebug() << pageHistory.count(); if (pageHistory.count() >= 1) { - backButton->show(); + backButton->setEnabled(true); } else { - backButton->hide(); + backButton->setDisabled(true); } ui->stackedWidget->setCurrentIndex(now); ui->stackedWidget->currentWidget()->setFocus(); diff --git a/src/mainwindow-dtk.h b/src/mainwindow-dtk.h index a5621c3..791e885 100755 --- a/src/mainwindow-dtk.h +++ b/src/mainwindow-dtk.h @@ -34,6 +34,7 @@ public: protected: void closeEvent(QCloseEvent *event) override; + void changeEvent(QEvent *event) override; private: void initUI(); diff --git a/src/mainwindow-dtk.ui b/src/mainwindow-dtk.ui index ccccf14..490e700 100644 --- a/src/mainwindow-dtk.ui +++ b/src/mainwindow-dtk.ui @@ -13,7 +13,10 @@ MainWindow - + + + 0 + 0 @@ -26,560 +29,24 @@ 0 - - 0 - - - - - true + + + + + 0 + 0 + - - .QWidget#mainpage { - background: transparent; - border-radius: 14px; -} - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 3 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - 150 + 0 0 - - - 150 - 16777215 - - - - - - - - 0 - 36 - - - - Home - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Network - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Chat - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Music - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Video - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Picture - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Game - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Office - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Reading - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Development - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Tool - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Theme - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - Other - - - true - - - true - - - true - - - true - - - buttonGroup - - - - - - - - 0 - 36 - - - - APP Upgrade - - - false - - - true - - - true - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 0 - 50 - - 16777215 - 50 + 16777215 @@ -598,6 +65,572 @@ + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + + + + + 0 + 36 + + + + Home + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Network + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Chat + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Music + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Video + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Picture + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Game + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Office + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Reading + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Development + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Tool + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Theme + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + Other + + + true + + + true + + + true + + + true + + + buttonGroup + + + + + + + + 0 + 36 + + + + APP Upgrade + + + false + + + true + + + true + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + false + + + .QWidget#mainpage { + background: transparent; + border-radius: 14px; +} + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + diff --git a/src/widgets/common/progressbutton.cpp b/src/widgets/common/progressbutton.cpp index 41a140a..464664e 100644 --- a/src/widgets/common/progressbutton.cpp +++ b/src/widgets/common/progressbutton.cpp @@ -9,10 +9,6 @@ ProgressButton::ProgressButton(QWidget *parent) : QWidget{parent} { - // this->setWindowFlags(Qt::FramelessWindowHint); - // this->setAttribute(Qt::WA_TranslucentBackground, true); - setMinimumSize(36, 36); - svgPath = ""; backColor = Qt::transparent; @@ -77,12 +73,9 @@ void ProgressButton::mousePressEvent(QMouseEvent *event) void ProgressButton::mouseReleaseEvent(QMouseEvent *event) { - if (buttonState == state::hover || buttonState == state::normal) - { - widthChangeValue = (this->width() - 6) / 2; - update(); - } - else if (buttonState == state::closeProgress) + if (buttonState == state::hover + || buttonState == state::normal + || buttonState == state::closeProgress) { update(); } @@ -135,15 +128,11 @@ void ProgressButton::paintEvent(QPaintEvent *event) if (buttonState == state::normal || buttonState == state::hover) { - int radius = (rect.height() - 6) / 2; - painter.translate(rect.center()); + qreal radius = rect.height() / 2.0; + painter.translate(QRectF(rect).center()); painter.setPen(Qt::transparent); - painter.setBrush(QColor(buttonState == state::normal ? color : color.darker())); - // painter.drawEllipse(QPoint(0, 0), radius, radius); - - // radiu -= 3; painter.setBrush(backColor); - painter.drawEllipse(QPoint(0, 0), radius, radius); + painter.drawEllipse(QPointF(0, 0), radius, radius); QSvgRenderer m_svgRender; m_svgRender.load(svgPath); @@ -151,42 +140,34 @@ void ProgressButton::paintEvent(QPaintEvent *event) } else if (buttonState == state::openProgress) { - painter.translate(rect.center()); - int radius = (rect.height() - 6) / 2 - 3; + qreal radius = rect.height() / 2.0 - 1; + painter.translate(QRectF(rect).center()); + painter.setPen(QPen(backColor.darker(), 2)); painter.setBrush(backColor); - painter.setPen(QPen(backColor, 3)); - painter.drawEllipse(QPoint(0, 0), radius, radius); + painter.drawEllipse(QPointF(0, 0), radius, radius); - painter.setPen(QPen(backColor, 3)); + QRectF rectF = QRectF(-radius, -radius, radius * 2, radius * 2); + painter.setPen(QPen(color.darker(100), 2)); + qreal angle = progress * 360 / 100 * 1.0; + painter.drawArc(rectF, 90 * 16, -qIntCast(angle * 16)); QSvgRenderer m_svgRender; m_svgRender.load(svgPath); m_svgRender.render(&painter, QRectF(-radius / 2, -radius / 2, radius, radius)); - - QRect rect = QRect(-radius, -radius, - radius * 2, radius * 2); - - painter.setPen(QPen(color.darker(100), 3)); - qreal angle = progress * 360 / 100 * 1.0; - painter.drawArc(rect.adjusted(-3, -3, 3, 3), 90 * 16, -qIntCast(angle * 16)); } else if (buttonState == state::closeProgress) { - auto radius = (rect.height() - 6) / 2; - painter.translate(rect.center()); - painter.setPen(Qt::transparent); - painter.setBrush(QColor(0, 0, 0, 63)); - painter.drawEllipse(QPoint(0, 0), radius, radius); - - radius -= 3; + qreal radius = rect.height() / 2.0 - 1; + painter.translate(QRectF(rect).center()); + painter.setPen(QPen(color.darker(100), 2)); painter.setBrush(backColor); - painter.drawEllipse(QPoint(0, 0), radius, radius); + painter.drawEllipse(QPointF(0, 0), radius, radius); - painter.setPen(QPen(color, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.drawLine(QPoint(-radius / 3, 0), - QPoint(-radius / 5, radius / 3)); - painter.drawLine(QPoint(-radius / 5, radius / 3), - QPoint(radius / 4, -radius / 4)); + painter.setPen(QPen(color, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + painter.drawLine(QPointF(-radius / 3, 0), + QPointF(-radius / 5, radius / 3)); + painter.drawLine(QPointF(-radius / 5, radius / 3), + QPointF(radius / 4, -radius / 4)); } QWidget::paintEvent(event); } @@ -212,7 +193,7 @@ WaterDrop::WaterDrop(QWidget *parent) // 把鼠标点击的点转换为圆心点坐标 void WaterDrop::move(const QPoint &point) { - QPoint translatePoint = point - QPoint(RADIUS, RADIUS); + QPoint translatePoint = point - rect().center(); QWidget::move(translatePoint); } @@ -223,7 +204,7 @@ void WaterDrop::show() m_waterDropAnimation->setDuration(350); connect(m_waterDropAnimation, &QVariantAnimation::valueChanged, this, &WaterDrop::onRadiusChanged); - connect(m_waterDropAnimation, &QVariantAnimation::finished, this, &WaterDrop::close); + connect(m_waterDropAnimation, &QVariantAnimation::finished, this, &WaterDrop::deleteLater); m_waterDropAnimation->start(QVariantAnimation::DeleteWhenStopped); QWidget::show(); } diff --git a/src/widgets/common/progressbutton.h b/src/widgets/common/progressbutton.h index 1762600..514622f 100644 --- a/src/widgets/common/progressbutton.h +++ b/src/widgets/common/progressbutton.h @@ -52,7 +52,6 @@ private: QColor backColor; QColor color; QString svgPath; - int widthChangeValue{0}; int progress{0};//处理百分比 bool m_mouseMoved = false; diff --git a/tool/ssaudit b/tool/ssaudit index 7bb11da..0c529ea 100755 --- a/tool/ssaudit +++ b/tool/ssaudit @@ -122,7 +122,8 @@ DEBPATH=$(realpath "$1") exit "$try_run_ret" fi - dpkg -i "$DEBPATH" || aptss install -yf + dpkg --force-conflicts -i "$DEBPATH" + aptss install "$DEBPATH" -yf if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then if dpkg -s "$package_name" >/dev/null 2>&1; then diff --git a/tool/ssinstall b/tool/ssinstall index 5b27b92..5ca76da 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -165,7 +165,8 @@ if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then exit "$try_run_ret" fi - dpkg -i "$DEBPATH" || aptss install -yf + dpkg --force-conflicts -i "$DEBPATH" + aptss install "$DEBPATH" -yf unlock_file "$DEBPATH" diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index baea222..1f16de4 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -411,103 +411,103 @@ - + Home - + Network - + Chat - + Music - + Video - + Picture - + Game - + Office - + Reading - + Development - + Tool - + Theme - + Other - + APP Upgrade - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - - + + Spark Store - + Search or enter spk:// @@ -517,7 +517,7 @@ - + Spark Store @@ -537,7 +537,7 @@ - + Show MainWindow @@ -658,12 +658,12 @@ TitleBarMenu - + About - + Exit diff --git a/translations/spark-store_es.ts b/translations/spark-store_es.ts index 98d4b03..bd55a84 100644 --- a/translations/spark-store_es.ts +++ b/translations/spark-store_es.ts @@ -411,103 +411,103 @@ Ventana principal - + Home Casa - + Network Red - + Chat Charla - + Music Música - + Video Vídeo - + Picture Foto - + Game Juego - + Office Oficina - + Reading Leer - + Development Desarrollo - + Tool Herramientas - + Theme Tema - + Other Además - + APP Upgrade Actualización de app - + Submit App Presentación de la aplicación - + Submit App with client(Recommanded) Enviar la aplicación al cliente (recomendación) - + Settings Configuración - + APP Upgrade and Install Settings Actualización e instalación de app - - + + Spark Store SPARK Store - + Search or enter spk:// Buscar o introducir spk: /% @@ -517,7 +517,7 @@ - + Spark Store SPARK Store @@ -537,7 +537,7 @@ Descargar lista - + Show MainWindow Mostrar la ventana principal @@ -658,12 +658,12 @@ TitleBarMenu - + About Sobre - + Exit Exportaciones diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index d2e2a3e..35e9239 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -411,103 +411,103 @@ Fenêtre principale - + Home Maison - + Network Réseau - + Chat Bavarder - + Music Musique - + Video Vidéo - + Picture Photos - + Game Jeux - + Office Bureaux - + Reading Lire - + Development Développement - + Tool Outils - + Theme Thèmes - + Other En outre - + APP Upgrade Mise à niveau app - + Submit App Soumettre une application - + Submit App with client(Recommanded) Soumettre une demande au client (recommandé) - + Settings Paramètres - + APP Upgrade and Install Settings Paramètres de mise à niveau et d'installation de l'app - - + + Spark Store Le Spark store - + Search or enter spk:// Rechercher ou entrer SPK / @@ -517,7 +517,7 @@ - + Spark Store Le Spark store @@ -537,7 +537,7 @@ Télécharger la Liste - + Show MainWindow Afficher la fenêtre principale @@ -658,12 +658,12 @@ TitleBarMenu - + About À propos - + Exit Exportations diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index e041cff..f295e7b 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -411,103 +411,103 @@ - + Home 主页 - + Network 网络 - + Chat 社交 - + Music 音乐 - + Video 视频 - + Picture 图像 - + Game 游戏 - + Office 办公 - + Reading 阅读 - + Development 开发 - + Tool 工具 - + Theme 主题 - + Other 其他 - + APP Upgrade 更新 - + Submit App 投递应用 - + Submit App with client(Recommanded) 使用本地投稿器投递应用(推荐) - + Settings 设置 - + APP Upgrade and Install Settings 应用更新和安装设置 - - + + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -517,7 +517,7 @@ - + Spark Store 星火应用商店 @@ -537,7 +537,7 @@ 下载列表 - + Show MainWindow 显示主窗口 @@ -658,12 +658,12 @@ TitleBarMenu - + About 关于 - + Exit 退出 diff --git a/translations/spark-store_zh_TW.ts b/translations/spark-store_zh_TW.ts index 442d45b..0e0ea9b 100644 --- a/translations/spark-store_zh_TW.ts +++ b/translations/spark-store_zh_TW.ts @@ -411,103 +411,103 @@ - + Home 首頁 - + Network 網路 - + Chat 聊天 - + Music 音樂 - + Video 播放 - + Picture 圖片 - + Game 遊戲 - + Office 辦公 - + Reading 閱讀 - + Development 開發 - + Tool 工具 - + Theme 主題 - + Other 其他 - + APP Upgrade 軟體更新 - + Submit App 上傳軟體 - + Submit App with client(Recommanded) 從客戶端上傳軟體(推薦的) - + Settings 設定 - + APP Upgrade and Install Settings 軟體升級 和 安裝設定 - - + + Spark Store 星火应用商店 - + Search or enter spk:// 搜索或打开链接 @@ -517,7 +517,7 @@ - + Spark Store 星火应用商店 @@ -537,7 +537,7 @@ 下载列表 - + Show MainWindow 显示主窗口 @@ -658,12 +658,12 @@ TitleBarMenu - + About 关于 - + Exit 退出