fix: pass shortcut viewer theme from voice note#400
Conversation
Pass the effective theme to deepin-shortcut-viewer when showing shortcuts. 显示快捷键弹窗时传递语音记事本当前有效主题。 Log: 传递快捷键弹窗主题 PMS: BUG-365837 Influence: 深色主题下由语音记事本触发的快捷键弹窗可按深色背景显示。
There was a problem hiding this comment.
Sorry @Resurgamz, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Note
详情{
"src/views/vnotemainwindow.cpp": [
{
"line": " url = \"https://www.deepin.org/zh/agreement/privacy/\";",
"line_number": 1926,
"rule": "S35",
"reason": "Url link | 20e2eab189"
},
{
"line": " url = \"https://www.uniontech.com/agreement/privacy-cn\";",
"line_number": 1928,
"rule": "S35",
"reason": "Url link | 4850a00dd7"
},
{
"line": " url = \"https://www.deepin.org/en/agreement/privacy/\";",
"line_number": 1932,
"rule": "S35",
"reason": "Url link | 38d42f63bf"
},
{
"line": " url = \"https://www.uniontech.com/agreement/privacy-en\";",
"line_number": 1934,
"rule": "S35",
"reason": "Url link | f82409d3b5"
}
]
} |
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 void VNoteMainWindow::onPreviewShortcut()
{
QStringList shortcutString;
QString param1 = "-j=" + QString(doc.toJson().data());
QString param2 = "-p=" + QString::number(pos.x()) + "," + QString::number(pos.y());
auto *guiHelper = DGuiApplicationHelper::instance();
bool darkTheme = false;
if (guiHelper) {
const auto themeType = guiHelper->themeType();
const QColor windowColor = guiHelper->applicationPalette().window().color();
darkTheme = themeType == DGuiApplicationHelper::DarkType || windowColor.value() < 128;
}
QString param3 = "--theme=" + QString(darkTheme ? "dark" : "light");
shortcutString << param1 << param2 << param3;
QProcess *shortcutViewProcess = new QProcess(this);
shortcutViewProcess->startDetached("deepin-shortcut-viewer", shortcutString);
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: max-lvs, Resurgamz The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
Summary
Test
PMS: BUG-365837