Skip to content

Commit

Permalink
fix: 修复ui bug
Browse files Browse the repository at this point in the history
  • Loading branch information
myk1343 authored and deepin-bot[bot] committed Feb 20, 2024
1 parent e2aa47a commit df197d3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ bool ReadWriteLibarchivePlugin::writeFileTodestination(const QString &sourceFile
absoluteDestinationPath = extractTempDir->path() + QDir::separator() + destination;
QDir dir;
dir.mkpath(absoluteDestinationPath);
QString strFilePath = absoluteDestinationPath + sourceFileInfo.fileName();
QString strFilePath = absoluteDestinationPath + sourceFileInfo.fileName().left(TRUNCATION_FILE_LONG);
if (QFile::link(sourceFileFullPath, strFilePath)) {
// qInfo() << "Symlink's created:" << destination << sourceFileFullPath;
} else {
Expand Down Expand Up @@ -477,7 +477,7 @@ bool ReadWriteLibarchivePlugin::writeFileFromEntry(const QString &relativeName,
absoluteDestinationPath = extractTempDir->path() + QDir::separator() + destination;
QDir dir;
dir.mkpath(absoluteDestinationPath);//创建临时文件夹
QString newFilePath = absoluteDestinationPath + relativeFileInfo.fileName();
QString newFilePath = absoluteDestinationPath + relativeFileInfo.fileName().left(TRUNCATION_FILE_LONG);
if (QFile::link(relativeName, newFilePath)) {
// qInfo() << "Symlink's created:" << destination << relativeName;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/source/page/compresspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void CompressPage::initUI()
pMainLayout->addLayout(pBtnLayout);
pMainLayout->setStretchFactor(m_pCompressView, 10);
pMainLayout->setStretchFactor(pBtnLayout, 1);
pMainLayout->setContentsMargins(20, 1, 20, 20);
pMainLayout->setContentsMargins(10, 1, 10, 20);

// 设置快捷键
auto openkey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_O), this);
Expand Down
9 changes: 9 additions & 0 deletions src/source/page/compresssettingpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QMenu>
#include <QMimeDatabase>
#include <QDebug>
#include <DApplicationHelper>

#include <cmath>
#include <QProcess>
Expand Down Expand Up @@ -213,6 +214,11 @@ void CompressSettingPage::initUI()
DStyle style; // 设置菜单箭头
QPixmap pixmap = style.standardIcon(DStyle::StandardPixmap::SP_ReduceElement).pixmap(QSize(10, 10));
pArrowPixmapLbl->setPixmap(pixmap);
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=]() {
DStyle style; // 设置菜单箭头
QPixmap pixmap = style.standardIcon(DStyle::StandardPixmap::SP_ReduceElement).pixmap(QSize(10, 10));
pArrowPixmapLbl->setPixmap(pixmap);
});

DFontSizeManager::instance()->bind(m_pCompressTypeLbl, DFontSizeManager::T5, QFont::DemiBold);

Expand Down Expand Up @@ -798,6 +804,9 @@ void CompressSettingPage::slotAdvancedEnabled(bool bEnabled)

void CompressSettingPage::slotSplitEdtEnabled()
{
if(m_pSplitValueEdt->hasFocus() || m_pCommentEdt->hasFocus()) {
parentWidget()->setFocus();
}
// 设置分卷输入框是否可用
m_pSplitValueEdt->setEnabled(m_pSplitCkb->isChecked());

Expand Down
2 changes: 1 addition & 1 deletion src/source/page/uncompresspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void UnCompressPage::initUI()
pMainLayout->setStretchFactor(m_pUnCompressView, 9);
pMainLayout->setStretchFactor(pPathLayout, 1);
pMainLayout->setStretchFactor(pBtnLayout, 1);
pMainLayout->setContentsMargins(20, 1, 20, 20);
pMainLayout->setContentsMargins(10, 1, 10, 20);


// 设置快捷键
Expand Down
9 changes: 7 additions & 2 deletions src/source/tree/datatreeview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,13 @@ void DataTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option
//根据实际情况设置颜色,奇数行为灰色
auto palette = options.palette;
QBrush background;
if (!(index.row() & 1)) {
background = palette.color(cg, DPalette::AlternateBase);
bool bVis = m_pHeaderView->getpreLbl()->isVisible();
if (bVis ? (index.row() & 1) : !(index.row() & 1)) {
if(DGuiApplicationHelper::DarkType == DGuiApplicationHelper::instance()->themeType()) {
background = QColor(255, 255, 255, 12);
} else {
background = palette.color(cg, DPalette::AlternateBase);
}
} else {
background = palette.color(cg, DPalette::Base);
}
Expand Down
6 changes: 5 additions & 1 deletion src/source/tree/treeheaderview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ void PreviousLabel::paintEvent(QPaintEvent *e)
if (focusIn_) {
bgColor = QColor(44, 44, 44);
} else {
bgColor = QColor(38, 38, 38);
if(DGuiApplicationHelper::DarkType == DGuiApplicationHelper::instance()->themeType()) {
bgColor = QColor(255, 255, 255, 12);
} else {
bgColor = QColor(38, 38, 38);
}
}
}

Expand Down

0 comments on commit df197d3

Please sign in to comment.