diff --git a/src/plugins/console/color-schemes/Dark.colorscheme b/src/plugins/console/color-schemes/Dark.colorscheme new file mode 100644 index 000000000..80c844106 --- /dev/null +++ b/src/plugins/console/color-schemes/Dark.colorscheme @@ -0,0 +1,104 @@ + +[Background] +Bold=true +Color=37,37,37 +Transparency=false + +[BackgroundIntense] +Bold=true +Color=0,0,0 +Transparency=false + +[Color0] +Bold=true +Color=0,0,0 +Transparency=false + +[Color0Intense] +Bold=true +Color=104,104,104 +Transparency=false + +[Color1] +Bold=true +Color=178,24,24 +Transparency=false + +[Color1Intense] +Bold=true +Color=255,84,84 +Transparency=false + +[Color2] +Bold=true +Color=24,178,24 +Transparency=false + +[Color2Intense] +Bold=true +Color=133,153,0 +Transparency=false + +[Color3] +Bold=true +Color=178,104,24 +Transparency=false + +[Color3Intense] +Bold=true +Color=255,255,84 +Transparency=false + +[Color4] +Bold=true +Color=52,101,164 +Transparency=false + +[Color4Intense] +Bold=true +Color=52,101,164 +Transparency=false + +[Color5] +Bold=true +Color=225,30,225 +Transparency=false + +[Color5Intense] +Bold=true +Color=30,144,255 +Transparency=false + +[Color6] +Bold=true +Color=24,178,178 +Transparency=false + +[Color6Intense] +Bold=true +Color=253,246,227 +Transparency=false + +[Color7] +Bold=true +Color=238,232,213 +Transparency=false + +[Color7Intense] +Bold=true +Color=255,255,255 +Transparency=false + +[Foreground] +Bold=true +Color=0,205,0 +Transparency=false + +[ForegroundIntense] +Bold=true +Color=0,205,0 +Transparency=false + +[General] +Description=Green on Black +Opacity=1 diff --git a/src/plugins/console/color-schemes/Light.colorscheme b/src/plugins/console/color-schemes/Light.colorscheme new file mode 100644 index 000000000..fec4d9db2 --- /dev/null +++ b/src/plugins/console/color-schemes/Light.colorscheme @@ -0,0 +1,104 @@ + +[Background] +Bold=true +Color=248,248,248 +Transparency=false + +[BackgroundIntense] +Bold=true +Color=255,255,255 +Transparency=false + +[Color0] +Bold=true +Color=0,0,0 +Transparency=false + +[Color0Intense] +Bold=true +Color=104,104,104 +Transparency=false + +[Color1] +Bold=true +Color=178,24,24 +Transparency=false + +[Color1Intense] +Bold=true +Color=255,84,84 +Transparency=false + +[Color2] +Bold=true +Color=24,178,24 +Transparency=false + +[Color2Intense] +Bold=true +Color=133,153,0 +Transparency=false + +[Color3] +Bold=true +Color=178,104,24 +Transparency=false + +[Color3Intense] +Bold=true +Color=233,233,79 +Transparency=false + +[Color4] +Bold=true +Color=24,24,178 +Transparency=false + +[Color4Intense] +Bold=true +Color=52,101,164 +Transparency=false + +[Color5] +Bold=true +Color=225,30,225 +Transparency=false + +[Color5Intense] +Bold=true +Color=30,144,255 +Transparency=false + +[Color6] +Bold=true +Color=24,178,178 +Transparency=false + +[Color6Intense] +Bold=true +Color=24,178,178 +Transparency=false + +[Color7] +Bold=true +Color=238,232,213 +Transparency=false + +[Color7Intense] +Bold=true +Color=238,232,213 +Transparency=false + +[Foreground] +Bold=true +Color=0,0,0 +Transparency=false + +[ForegroundIntense] +Bold=true +Color=0,0,0 +Transparency=false + +[General] +Description=Green on Black +Opacity=1 diff --git a/src/plugins/console/console.qrc b/src/plugins/console/console.qrc new file mode 100644 index 000000000..63ac1e355 --- /dev/null +++ b/src/plugins/console/console.qrc @@ -0,0 +1,8 @@ + + + + + color-schemes/Dark.colorscheme + color-schemes/Light.colorscheme + + diff --git a/src/plugins/console/consolewidget.cpp b/src/plugins/console/consolewidget.cpp index c5839c199..86c4b1f09 100644 --- a/src/plugins/console/consolewidget.cpp +++ b/src/plugins/console/consolewidget.cpp @@ -7,6 +7,7 @@ #include +#include #include DWIDGET_USE_NAMESPACE @@ -32,6 +33,12 @@ ConsoleWidget::ConsoleWidget(QWidget *parent, bool startNow) setAutoFillBackground(true); setTerminalOpacity(1); + // using default deepin-terminal style schemes + // U can see schemes path with deepin-os + QString sys_schemes_path = "/usr/share/terminalwidget5/color-schemes"; + if (QDir(sys_schemes_path).exists()) + addCustomColorSchemeDir(sys_schemes_path); + auto theme = DGuiApplicationHelper::instance()->themeType(); updateColorScheme(theme); if (availableKeyBindings().contains("linux")) @@ -85,11 +92,19 @@ void ConsoleWidget::contextMenuEvent(QContextMenuEvent *event) void ConsoleWidget::updateColorScheme(DGuiApplicationHelper::ColorType themetype) { - if (themetype == DGuiApplicationHelper::DarkType - && availableColorSchemes().contains("Linux")) - this->setColorScheme("Linux"); - else if (availableColorSchemes().contains("BlackOnWhite")) - this->setColorScheme("BlackOnWhite"); + if (DGuiApplicationHelper::DarkType == themetype) { + // need add member option setting check logic + if (availableColorSchemes().contains("Dark")) + this->setColorScheme("Dark"); + else + this->setColorScheme(":/color-schemes/Dark.colorscheme"); + } else if (DGuiApplicationHelper::LightType == themetype) { + // need add member option setting check logic + if (availableColorSchemes().contains("Light")) + this->setColorScheme("Light"); + else + this->setColorScheme(":/color-schemes/Light.colorscheme"); + } } void ConsoleWidget::enterCurrentProjectPath()