From 07971aa2c1744749d99e4d826ccf2a9bb6617a3a Mon Sep 17 00:00:00 2001 From: denghao Date: Fri, 25 Aug 2023 14:03:23 +0800 Subject: [PATCH] fix bug #I7GYTA/#I7GYC4/#I72MZG/#I72MWF/#I72PBL --- debian/changelog | 13 ++++++++++++ src/view/kyview.cpp | 27 +++++++++++++++++++++++- src/view/kyview.h | 1 + src/view/menumodule.cpp | 2 +- src/view/showimagewidget.cpp | 9 +++++++- src/view/toolbar.cpp | 4 ++-- translations/kylin-photo-viewer_zh_CN.ts | 6 +++--- 7 files changed, 54 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c7f715..db362dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +kylin-photo-viewer (1.3.0.3-ok16) yangtze; urgency=medium + + * BUG号: #I7GYTA 【ukui 4】【看图】深色模式看图工具栏图标颜色偏暗 + #I7GYC4 【ukui 4】【看图】浅色模式看图工具栏图标颜色偏浅 + #I72MZG 【看图】ocr未识别到文字信息,“未检测到文本”字样可以被导出 + #I72MWF 【看图】看图-关于版本号与dpkg -l查看的版本号不一致 + ##I72PBL 【不重要】【看图】右上角“三”按钮悬浮提示为菜单,应为选项 + * 需求号:无 + * 其他改动说明:无 + * 影响域:无 + + -- denghao Fri, 25 Aug 2023 14:00:26 +0800 + kylin-photo-viewer (1.3.0.3-ok15) yangtze; urgency=medium * BUG号: #I5SXTA #I5TBH5 diff --git a/src/view/kyview.cpp b/src/view/kyview.cpp index fe658b2..4327ec2 100644 --- a/src/view/kyview.cpp +++ b/src/view/kyview.cpp @@ -1680,11 +1680,36 @@ void KyView::setTitleBtnHide() } } +QString KyView::getAppVersion() +{ + FILE *file = NULL; + char *line = NULL; + size_t size = 0; + ssize_t read; + char *q = NULL; + QString version = nullptr; + file = popen("dpkg -l kylin-photo-viewer", "r"); + if(NULL == file) + return version; + while((read = getline(&line, &size, file)) != -1){ + q = strrchr(line, '\n'); + *q = '\0'; + QString content = line; + QStringList list = content.split(" "); + list.removeAll(""); + if (list.size() >= 3) + version = list.at(2); + } + free(line); + pclose(file); + return version; +} + void KyView::initAboutDialog() { m_aboutDialog->setAppIcon(QIcon::fromTheme("kylin-photo-viewer")); m_aboutDialog->setAppName(tr("Pictures")); - m_aboutDialog->setAppVersion(tr("Version:") + APP_VERSION_DETAIL); + m_aboutDialog->setAppVersion(tr("Version:")+getAppVersion()); m_aboutDialog->setBodyText(tr("A system picture tool that can quickly open common formats. It provides zoom,flip " "and other processing simplely.")); } diff --git a/src/view/kyview.h b/src/view/kyview.h index e250039..7d13600 100644 --- a/src/view/kyview.h +++ b/src/view/kyview.h @@ -188,6 +188,7 @@ private: bool m_recordInfoStateBeforeOtherOperate = false; //信息栏 void restoreAllBallState(); bool m_nowFullScreen = false; + QString getAppVersion(); private Q_SLOTS: diff --git a/src/view/menumodule.cpp b/src/view/menumodule.cpp index e866fbb..d6b5204 100644 --- a/src/view/menumodule.cpp +++ b/src/view/menumodule.cpp @@ -37,7 +37,7 @@ void menuModule::initAction() m_bodyAppDescribe->setWordWrap(true); //设置自动换行 menuButton = new QToolButton(this); - menuButton->setToolTip(tr("menu")); + menuButton->setToolTip(tr("Option")); menuButton->setIcon(QIcon::fromTheme("open-menu-symbolic")); menuButton->setProperty("isWindowButton", 0x1); menuButton->setProperty("useIconHighlightEffect", 0x2); diff --git a/src/view/showimagewidget.cpp b/src/view/showimagewidget.cpp index a4b75e2..cb25248 100644 --- a/src/view/showimagewidget.cpp +++ b/src/view/showimagewidget.cpp @@ -735,7 +735,14 @@ void ShowImageWidget::startGetText() void ShowImageWidget::setGetTextResult(QVector result) { m_ocrWid->setFormatedText(result); - if (result.isEmpty()) { + QString text; + for (QString line : result) { + if (line.isEmpty()) { + continue; + } + text += line + '\n'; + } + if (text.isEmpty()) { m_ocrExportToTxt->setEnabled(false); } else { m_ocrExportToTxt->setEnabled(true); diff --git a/src/view/toolbar.cpp b/src/view/toolbar.cpp index 9fdfd0a..8dfed8f 100644 --- a/src/view/toolbar.cpp +++ b/src/view/toolbar.cpp @@ -488,7 +488,7 @@ void ToolBar::changeStyle() //需要重新梳理此处的QSS nowThemeStyle = kdk::kabase::Gsettings::getSystemTheme().toString(); if ("ukui-dark" == nowThemeStyle || "ukui-black" == nowThemeStyle) { - this->setStyleSheet("QWidget{border-radius:" + widRadius + ";border:none;}"); + this->setStyleSheet("QWidget{border-radius:" + widRadius + ";border:none;color:rgb(255,255,255);}"); g_tooleWid->setStyleSheet("QWidget{background-color:rgba(0,0,0,0.66);border-radius:" + widRadius + ";border:none;}"); m_zoomWid->setStyleSheet("QWidget{background-color:transparent;border:none;}"); @@ -496,7 +496,7 @@ void ToolBar::changeStyle() m_line1->setStyleSheet("QLabel{border: 1px solid #727272;background-color: #727272;}"); m_line2->setStyleSheet("QLabel{border: 1px solid #727272;background-color: #727272;}"); } else { - this->setStyleSheet("QWidget{border-radius:" + widRadius + ";border:none;}"); + this->setStyleSheet("QWidget{border-radius:" + widRadius + ";border:none;color:rgb(0,0,0);}"); m_zoomWid->setStyleSheet("QWidget{background-color:transparent;border:none;}"); g_tooleWid->setStyleSheet("QWidget{background-color:rgba(255,255,255,1);border:none;border-radius:" + widRadius + ";}"); diff --git a/translations/kylin-photo-viewer_zh_CN.ts b/translations/kylin-photo-viewer_zh_CN.ts index 76d6555..a42012d 100644 --- a/translations/kylin-photo-viewer_zh_CN.ts +++ b/translations/kylin-photo-viewer_zh_CN.ts @@ -517,9 +517,9 @@ 看图是一款系统图片查看工具,可快速打开浏览常见格式的图片。同时也提供了缩放、翻转等简单的图片处理,操作简单方便。 - - menu - 菜单 + + Option + 选项 Open..