diff --git a/Wox/plugin/system/theme.go b/Wox/plugin/system/theme.go index 2647d4038..1f7175a5c 100644 --- a/Wox/plugin/system/theme.go +++ b/Wox/plugin/system/theme.go @@ -115,10 +115,9 @@ func (c *ThemePlugin) queryAI(ctx context.Context, query plugin.Query) []plugin. 现在我想让你根据上面的格式生成一个新的主题,主题的要求是:` + query.Search + `。 有一些注意点需要你遵守: -1. 你的回答结果必须是JSON格式,且只能回答json相关内容,忽略解释,注释等信息 -2. 主题名称你自己决定,主题ID为随机生成的UUID -3. 主题作者统一为:Wox launcher AI -4. IsSystemTheme字段必须为false +1. 你的回答结果必须是JSON格式,以{开头,以}结尾. 忽略解释,注释等信息 +2. 主题名称你自己决定,但是必须有意义 +3. 背景跟字体需要有区分度,不要让背景跟字体颜色太接近(这里包括正常未选中的结果与被高亮选中的结果) `, }) @@ -159,6 +158,11 @@ func (c *ThemePlugin) queryAI(ctx context.Context, query plugin.Query) []plugin. } theme.ThemeId = uuid.NewString() + theme.ThemeAuthor = "Wox launcher AI" + theme.ThemeUrl = "https://www.github.com/wox-launcher/wox" + theme.Version = "1.0.0" + theme.IsSystem = false + theme.ScreenshotUrls = []string{} plugin.GetPluginManager().GetUI().InstallTheme(ctx, theme) }) return current diff --git a/Wox/resource/ui/themes/dark.json b/Wox/resource/ui/themes/dark.json index f32bc8691..5bceae530 100644 --- a/Wox/resource/ui/themes/dark.json +++ b/Wox/resource/ui/themes/dark.json @@ -1,10 +1,12 @@ { "ThemeId": "53c1d0a4-ffc8-4d90-91dc-b408fb0b9a03", - "ThemeName": "Wox Default Dark Theme", + "ThemeName": "Wox Dark", + "Description": "Wox default dark theme", "ThemeAuthor": "Wox launcher", "Version": "1.0.0", - "ThemeUrl": "http://www.github.com/wox-launcher/wox", + "ThemeUrl": "https://www.github.com/wox-launcher/wox", "IsSystemTheme": true, + "ScreenshotUrls": [], "AppBackgroundColor": "rgba(0,0,0, 0.65)", "AppPaddingLeft": 10, "AppPaddingTop": 10, @@ -47,7 +49,5 @@ "PreviewSplitLineColor": "#3a474e", "PreviewPropertyTitleColor": "#b0b3b5", "PreviewPropertyContentColor": "#f0f0f0", - "PreviewTextSelectionColor": "rgba(31, 118, 124, 0.8)", - "Description": "Wox default dark theme", - "ScreenshotUrls": [] + "PreviewTextSelectionColor": "rgba(31, 118, 124, 0.8)" } \ No newline at end of file diff --git a/Wox/resource/ui/themes/light.json b/Wox/resource/ui/themes/light.json index 91b2b7b2a..87648abea 100644 --- a/Wox/resource/ui/themes/light.json +++ b/Wox/resource/ui/themes/light.json @@ -1,10 +1,12 @@ { "ThemeId": "92dc0ea7-a52f-4b0a-9f0d-7cb36a634860", - "ThemeName": "Wox Default Light Theme", + "ThemeName": "Wox Light", + "Description": "Wox default light theme", "ThemeAuthor": "Wox launcher", "Version": "1.0.0", - "ThemeUrl": "http://www.github.com/wox-launcher/wox", + "ThemeUrl": "https://www.github.com/wox-launcher/wox", "IsSystemTheme": true, + "ScreenshotUrls": [], "AppBackgroundColor": "rgba(236, 240, 240, 0.65)", "AppPaddingLeft": 10, "AppPaddingTop": 10, @@ -47,7 +49,5 @@ "PreviewSplitLineColor": "#caced0", "PreviewPropertyTitleColor": "#716b6b", "PreviewPropertyContentColor": "#716b6b", - "PreviewTextSelectionColor": "#529df7", - "Description": "Wox default light theme", - "ScreenshotUrls": [] + "PreviewTextSelectionColor": "#529df7" } diff --git a/Wox/resource/ui/themes/macaroon delight.json b/Wox/resource/ui/themes/macaroon delight.json new file mode 100755 index 000000000..2d77f9b67 --- /dev/null +++ b/Wox/resource/ui/themes/macaroon delight.json @@ -0,0 +1,53 @@ +{ + "ThemeId": "8dcbe04d-48c2-43fa-a7b9-a83167101aa3", + "ThemeName": "Macaroon Delight", + "ThemeAuthor": "Wox launcher", + "ThemeUrl": "https://www.github.com/wox-launcher/wox", + "Version": "1.0.0", + "IsSystem": true, + "Description": "A sweet and colorful theme inspired by macaroons", + "ScreenshotUrls": [], + "AppBackgroundColor": "rgba(255, 235, 205, 0.8)", + "AppPaddingLeft": 10, + "AppPaddingTop": 10, + "AppPaddingRight": 10, + "AppPaddingBottom": 10, + "ResultContainerPaddingLeft": 0, + "ResultContainerPaddingTop": 10, + "ResultContainerPaddingRight": 0, + "ResultContainerPaddingBottom": 0, + "ResultItemBorderRadius": 0, + "ResultItemPaddingLeft": 0, + "ResultItemPaddingTop": 0, + "ResultItemPaddingRight": 0, + "ResultItemPaddingBottom": 0, + "ResultItemTitleColor": "#663399", + "ResultItemSubTitleColor": "#999999", + "ResultItemBorderLeft": "0", + "ResultItemActiveBackgroundColor": "rgba(255, 192, 203, 0.8)", + "ResultItemActiveTitleColor": "#663399", + "ResultItemActiveSubTitleColor": "#999999", + "ResultItemActiveBorderLeft": "0", + "QueryBoxFontColor": "#663399", + "QueryBoxBackgroundColor": "rgba(255, 235, 205, 0.4)", + "QueryBoxBorderRadius": 8, + "QueryBoxCursorColor": "#663399", + "QueryBoxTextSelectionColor": "rgba(255, 192, 203, 0.8)", + "ActionContainerBackgroundColor": "#F7F7F7", + "ActionContainerHeaderFontColor": "#663399", + "ActionContainerPaddingLeft": 14, + "ActionContainerPaddingTop": 10, + "ActionContainerPaddingRight": 14, + "ActionContainerPaddingBottom": 10, + "ActionItemActiveBackgroundColor": "rgba(255, 192, 203, 0.8)", + "ActionItemActiveFontColor": "#663399", + "ActionItemFontColor": "#663399", + "ActionQueryBoxFontColor": "#663399", + "ActionQueryBoxBackgroundColor": "rgba(255, 235, 205, 0.4)", + "ActionQueryBoxBorderRadius": 8, + "PreviewFontColor": "#663399", + "PreviewSplitLineColor": "#CCCCCC", + "PreviewPropertyTitleColor": "#999999", + "PreviewPropertyContentColor": "#663399", + "PreviewTextSelectionColor": "rgba(255, 192, 203, 0.8)" +} diff --git a/Wox/resource/ui/themes/morandi dream.json b/Wox/resource/ui/themes/morandi dream.json new file mode 100755 index 000000000..b7181bac4 --- /dev/null +++ b/Wox/resource/ui/themes/morandi dream.json @@ -0,0 +1,53 @@ +{ + "ThemeId": "e4006bd3-6bfe-4020-8d1c-4c32a8e567e5", + "ThemeName": "Morandi Dream", + "ThemeAuthor": "Wox launcher", + "ThemeUrl": "https://www.github.com/wox-launcher/wox", + "Version": "1.0.0", + "IsSystem": true, + "Description": "A soothing theme inspired by Giorgio Morandi's still life paintings", + "ScreenshotUrls": [], + "AppBackgroundColor": "rgba(240, 235, 225, 0.95)", + "AppPaddingLeft": 10, + "AppPaddingTop": 10, + "AppPaddingRight": 10, + "AppPaddingBottom": 10, + "ResultContainerPaddingLeft": 0, + "ResultContainerPaddingTop": 10, + "ResultContainerPaddingRight": 0, + "ResultContainerPaddingBottom": 0, + "ResultItemBorderRadius": 0, + "ResultItemPaddingLeft": 0, + "ResultItemPaddingTop": 0, + "ResultItemPaddingRight": 0, + "ResultItemPaddingBottom": 0, + "ResultItemTitleColor": "#455A64", + "ResultItemSubTitleColor": "#788494", + "ResultItemBorderLeft": "0", + "ResultItemActiveBackgroundColor": "rgba(173, 216, 230, 0.8)", + "ResultItemActiveTitleColor": "#455A64", + "ResultItemActiveSubTitleColor": "#788494", + "ResultItemActiveBorderLeft": "0", + "QueryBoxFontColor": "#455A64", + "QueryBoxBackgroundColor": "rgba(240, 235, 225, 0.4)", + "QueryBoxBorderRadius": 8, + "QueryBoxCursorColor": "#455A64", + "QueryBoxTextSelectionColor": "rgba(173, 216, 230, 0.8)", + "ActionContainerBackgroundColor": "#F7F7F7", + "ActionContainerHeaderFontColor": "#455A64", + "ActionContainerPaddingLeft": 14, + "ActionContainerPaddingTop": 10, + "ActionContainerPaddingRight": 14, + "ActionContainerPaddingBottom": 10, + "ActionItemActiveBackgroundColor": "rgba(173, 216, 230, 0.8)", + "ActionItemActiveFontColor": "#455A64", + "ActionItemFontColor": "#455A64", + "ActionQueryBoxFontColor": "#455A64", + "ActionQueryBoxBackgroundColor": "rgba(240, 235, 225, 0.4)", + "ActionQueryBoxBorderRadius": 8, + "PreviewFontColor": "#455A64", + "PreviewSplitLineColor": "#788494", + "PreviewPropertyTitleColor": "#455A64", + "PreviewPropertyContentColor": "#455A64", + "PreviewTextSelectionColor": "rgba(173, 216, 230, 0.8)" +} diff --git a/Wox/resource/ui/themes/rococo dream.json b/Wox/resource/ui/themes/rococo dream.json new file mode 100755 index 000000000..b2cb55d3b --- /dev/null +++ b/Wox/resource/ui/themes/rococo dream.json @@ -0,0 +1,53 @@ +{ + "ThemeId": "404d08b1-8366-4fb5-89a7-8edaff7cd397", + "ThemeName": "Rococo Dream", + "ThemeAuthor": "Wox launcher", + "ThemeUrl": "https://www.github.com/wox-launcher/wox", + "Version": "1.0.0", + "IsSystem": true, + "Description": "A luxurious and elegant theme inspired by the Rococo era", + "ScreenshotUrls": [], + "AppBackgroundColor": "rgba(245, 245, 220, 0.8)", + "AppPaddingLeft": 10, + "AppPaddingTop": 10, + "AppPaddingRight": 10, + "AppPaddingBottom": 10, + "ResultContainerPaddingLeft": 0, + "ResultContainerPaddingTop": 10, + "ResultContainerPaddingRight": 0, + "ResultContainerPaddingBottom": 0, + "ResultItemBorderRadius": 0, + "ResultItemPaddingLeft": 0, + "ResultItemPaddingTop": 0, + "ResultItemPaddingRight": 0, + "ResultItemPaddingBottom": 0, + "ResultItemTitleColor": "#663300", + "ResultItemSubTitleColor": "#999999", + "ResultItemBorderLeft": "0", + "ResultItemActiveBackgroundColor": "rgba(255, 215, 0, 0.8)", + "ResultItemActiveTitleColor": "#663300", + "ResultItemActiveSubTitleColor": "#999999", + "ResultItemActiveBorderLeft": "0", + "QueryBoxFontColor": "#663300", + "QueryBoxBackgroundColor": "rgba(245, 245, 220, 0.4)", + "QueryBoxBorderRadius": 8, + "QueryBoxCursorColor": "#663300", + "QueryBoxTextSelectionColor": "rgba(255, 215, 0, 0.8)", + "ActionContainerBackgroundColor": "#F5F5DC", + "ActionContainerHeaderFontColor": "#663300", + "ActionContainerPaddingLeft": 14, + "ActionContainerPaddingTop": 10, + "ActionContainerPaddingRight": 14, + "ActionContainerPaddingBottom": 10, + "ActionItemActiveBackgroundColor": "rgba(255, 215, 0, 0.8)", + "ActionItemActiveFontColor": "#663300", + "ActionItemFontColor": "#663300", + "ActionQueryBoxFontColor": "#663300", + "ActionQueryBoxBackgroundColor": "rgba(245, 245, 220, 0.4)", + "ActionQueryBoxBorderRadius": 8, + "PreviewFontColor": "#663300", + "PreviewSplitLineColor": "#999999", + "PreviewPropertyTitleColor": "#663300", + "PreviewPropertyContentColor": "#663300", + "PreviewTextSelectionColor": "rgba(255, 215, 0, 0.8)" +} diff --git a/Wox/ui/ui_impl.go b/Wox/ui/ui_impl.go index 84faff7ac..65294e921 100644 --- a/Wox/ui/ui_impl.go +++ b/Wox/ui/ui_impl.go @@ -60,7 +60,7 @@ func (u *uiImpl) ChangeTheme(ctx context.Context, theme share.Theme) { func (u *uiImpl) InstallTheme(ctx context.Context, theme share.Theme) { logger.Info(ctx, fmt.Sprintf("install theme: %s", theme.ThemeName)) - GetUIManager().AddTheme(ctx, theme) + GetStoreManager().Install(ctx, theme) } func (u *uiImpl) OpenSettingWindow(ctx context.Context, windowContext share.SettingWindowContext) { diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 2827b64d0..3e45e2789 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -21,6 +21,6 @@ - Theme - [Install Theme](theme.md) - - [AI Theme](ai_theme.md) + - [Create Theme with AI](ai_theme.md) - [Github](https://github.com/Wox-launcher/Wox) diff --git a/docs/ai_theme.md b/docs/ai_theme.md index 15026a3d9..e348a4912 100644 --- a/docs/ai_theme.md +++ b/docs/ai_theme.md @@ -1 +1,15 @@ -`theme ai ` \ No newline at end of file +# Create Theme with AI + +> Please note that this feature requires the configuration of LLM settings to be used. If you have not configured LLM settings, please refer to the [LLM settings](llm_settings.md) +> documentation. + +Wox provides a unique feature that allows you to create themes using AI. This feature can be accessed using the `theme ai` command followed by your theme description. The AI will +interpret your description and create a theme based on it. + +For example, if you want to create a theme with a macaroon color scheme, you can use the command `theme ai macaroon color`. The AI will then generate a theme that matches the +macaroon color scheme. + +This feature provides a quick and easy way to create unique and personalized themes for your Wox launcher. Enjoy the flexibility and creativity that comes with AI-powered theme +creation. + +![AI Theme](https://raw.githubusercontent.com/Wox-launcher/Wox/v2/docs/images/ai_theme.jpg) \ No newline at end of file diff --git a/docs/images/ai_theme.jpg b/docs/images/ai_theme.jpg new file mode 100644 index 000000000..9609eb562 Binary files /dev/null and b/docs/images/ai_theme.jpg differ