Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 扩展主题,修改原有主题逻辑 #300

Merged
merged 2 commits into from
Oct 10, 2023
Merged

feat: 扩展主题,修改原有主题逻辑 #300

merged 2 commits into from
Oct 10, 2023

Conversation

DaiZW007
Copy link
Contributor

  1. 用户可以在/usr/share/terminalwidget5/color-schemes下按格式新增自己的主题会加到主题可选列表中
  2. 修改终端主题随背景色变化,hsv模式下亮度>=192后采用深色模式
  3. 减少代码逻辑

Log: 扩展主题,修改原有主题逻辑

1. 用户可以在/usr/share/terminalwidget5/color-schemes下按格式新增自己的主题会加到主题可选列表中
2. 修改终端主题随背景色变化,hsv模式下亮度>=192后采用深色模式
3. 减少代码逻辑

Log: 扩展主题,修改原有主题逻辑
@github-actions
Copy link

github-actions bot commented Sep 28, 2023

CLA Assistant Lite bot:

如果你是以企业贡献者的身份进行提交,请联系我们签署企业贡献者许可协议
If you submit as corporate contributor, please contact us to sign our Corporate Contributor License Agreement

感谢您的提交,我们非常感谢。 像许多开源项目一样,在接受您的贡献之前,我们要求您签署我们的个人贡献者许可协议。 您只需发布与以下格式相同的评论即可签署个人贡献者许可协议
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Individual Contributor License Agreement before we can accept your contribution. You can sign the Individual Contributor License Agreement by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA.


提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

daizhengwen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@@ -2059,37 +1998,28 @@ void MainWindow::checkThemeItem()

QAction *action;
QString expandThemeStr = THEME_NO;
// 从配置取值
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以给expandThemeStr进行一个初始化的改。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面的逻辑就是在初始化expandThemeStr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面的逻辑就是在初始化expandThemeStr

就是说合成一行。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改了

QAction *pAction = nullptr;
m_normalWindow->checkExtendThemeItem("Theme1", pAction);
EXPECT_EQ(m_normalWindow->themeOneAction, pAction);
//TEST_F(UT_MainWindow_Test, checkExtendThemeItemTest)
Copy link
Contributor

@ArchieMeng ArchieMeng Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一大段注释掉的是???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Theme1"这种的都删掉了,不需要了,可能需要改下UT

合并无用行
Copy link
Contributor

@ArchieMeng ArchieMeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ArchieMeng, DaiZW007

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wineee
Copy link
Member

wineee commented Oct 17, 2023

是否同时支持在 ~/.config/deepin/deepin-terminal/ 新增自己的主题, /usr 是系统级目录,需要 root 权限才能修过,有些时候改 HOME 目录更方便

@DaiZW007
Copy link
Contributor Author

DaiZW007 commented Oct 19, 2023

是否同时支持在 ~/.config/deepin/deepin-terminal/ 新增自己的主题, /usr 是系统级目录,需要 root 权限才能修过,有些时候改 HOME 目录更方便

  • 有root权限
    可以在/usr/share/terminalwidget5/color-schemes目录下添加主题,这样可以给你的终端主题选项下固定添加一个主题
  • 没有root权限,可以使用自定义主题选项
    如果自定义主题没有满足你的要求,可以选择自定义主题后,修改 ~/.config/deepin/deepin-terminal/customTheme.colorscheme
    颜色定义可以参考/usr/share/terminalwidget5/color-schemes中的主题颜色设置

@wineee
Copy link
Member

wineee commented Oct 19, 2023

  • 没有root权限,可以使用自定义主题选项
    如果自定义主题没有满足你的要求,可以选择自定义主题后,修改 ~/.config/deepin/deepin-terminal/customTheme.colorscheme
    颜色定义可以参考/usr/share/terminalwidget5/color-schemes中的主题颜色设置

linuxdeepin/developer-center#5160

问题是 customTheme.colorscheme 只有一个,不能保存不同主题

而且手动修改customTheme.colorscheme,每次切换会把 PS1/2 的修改会被覆盖掉,切换界面的设置是不读取 customTheme.colorscheme 的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants