Skip to content

Commit

Permalink
Add some themes
Browse files Browse the repository at this point in the history
  • Loading branch information
qianlifeng committed May 31, 2024
1 parent bada06f commit dc4d45c
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 17 deletions.
12 changes: 8 additions & 4 deletions Wox/plugin/system/theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -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. 背景跟字体需要有区分度,不要让背景跟字体颜色太接近(这里包括正常未选中的结果与被高亮选中的结果)
`,
})

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Wox/resource/ui/themes/dark.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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)"
}
10 changes: 5 additions & 5 deletions Wox/resource/ui/themes/light.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -47,7 +49,5 @@
"PreviewSplitLineColor": "#caced0",
"PreviewPropertyTitleColor": "#716b6b",
"PreviewPropertyContentColor": "#716b6b",
"PreviewTextSelectionColor": "#529df7",
"Description": "Wox default light theme",
"ScreenshotUrls": []
"PreviewTextSelectionColor": "#529df7"
}
53 changes: 53 additions & 0 deletions Wox/resource/ui/themes/macaroon delight.json
Original file line number Diff line number Diff line change
@@ -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)"
}
53 changes: 53 additions & 0 deletions Wox/resource/ui/themes/morandi dream.json
Original file line number Diff line number Diff line change
@@ -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)"
}
53 changes: 53 additions & 0 deletions Wox/resource/ui/themes/rococo dream.json
Original file line number Diff line number Diff line change
@@ -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)"
}
2 changes: 1 addition & 1 deletion Wox/ui/ui_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 15 additions & 1 deletion docs/ai_theme.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
`theme ai <your theme requirement>`
# 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)
Binary file added docs/images/ai_theme.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc4d45c

Please sign in to comment.