From aead8854b089bfcf2ce2f8b163c275f12185b2ba Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Thu, 9 Nov 2023 11:46:08 +0800 Subject: [PATCH] Optimize theme --- Wox.UI.Tauri/src/components/WoxQueryBox.tsx | 1 + .../src/components/WoxQueryResult.tsx | 2 +- Wox.UI.Tauri/src/entity/Theme.typings.d.ts | 2 ++ Wox/resource/ui/themes/dark.json | 20 ++++++++++++++++--- Wox/ui/theme.go | 2 ++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Wox.UI.Tauri/src/components/WoxQueryBox.tsx b/Wox.UI.Tauri/src/components/WoxQueryBox.tsx index ae47c817e..829455e62 100644 --- a/Wox.UI.Tauri/src/components/WoxQueryBox.tsx +++ b/Wox.UI.Tauri/src/components/WoxQueryBox.tsx @@ -83,6 +83,7 @@ const Style = styled.div<{ theme: Theme }>` cursor: auto; color: ${props => props.theme.QueryBoxFontColor}; background-color: ${props => props.theme.QueryBoxBackgroundColor}; + border-radius: ${props => props.theme.QueryBoxBorderRadius}px; display: inline-block; box-sizing: border-box; } diff --git a/Wox.UI.Tauri/src/components/WoxQueryResult.tsx b/Wox.UI.Tauri/src/components/WoxQueryResult.tsx index 77fda88b2..699adc679 100644 --- a/Wox.UI.Tauri/src/components/WoxQueryResult.tsx +++ b/Wox.UI.Tauri/src/components/WoxQueryResult.tsx @@ -470,7 +470,7 @@ const Style = styled.div<{ theme: Theme, resultCount: number }>` left: 0; right: 0; top: ${props => (props.resultCount > 10 ? 10 : props.resultCount) * 50 + 60}px; - background-color: ${props => props.theme.AppBackgroundColor}; + background-color: ${props => props.theme.ActionContainerBackgroundColor}; bottom: 0; z-index: 8888; } diff --git a/Wox.UI.Tauri/src/entity/Theme.typings.d.ts b/Wox.UI.Tauri/src/entity/Theme.typings.d.ts index 64434a4d5..e7ef0b6ce 100644 --- a/Wox.UI.Tauri/src/entity/Theme.typings.d.ts +++ b/Wox.UI.Tauri/src/entity/Theme.typings.d.ts @@ -20,6 +20,8 @@ export interface Theme { ResultItemActiveBackgroundColor: string QueryBoxFontColor: string QueryBoxBackgroundColor: string + QueryBoxBorderRadius: number + ActionContainerBackgroundColor: string ActionContainerHeaderFontColor: string ActionItemActiveBackgroundColor: string ActionQueryBoxFontColor: string diff --git a/Wox/resource/ui/themes/dark.json b/Wox/resource/ui/themes/dark.json index 6b0c1279c..0e64e1989 100644 --- a/Wox/resource/ui/themes/dark.json +++ b/Wox/resource/ui/themes/dark.json @@ -4,11 +4,25 @@ "ThemeAuthor": "Wox launcher", "ThemeUrl": "http://www.github.com/wox-launcher/wox", "AppBackgroundColor": "rgba(44, 48, 50, 0.7)", - "ResultContainerPadding": "0", - "ResultItemBorderRadius": "0", + "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, "ResultItemActiveBackgroundColor": "rgba(31, 118, 124, 0.8)", "QueryBoxFontColor": "#e4e7e7", + "QueryBoxBackgroundColor": "rgba(44, 48, 50, 0.7)", + "QueryBoxBorderRadius": 0, + "ActionContainerBackgroundColor": "rgba(44, 48, 50, 0.7)", "ActionContainerHeaderFontColor": "#e4e7e7", - "ActionItemActiveBackgroundColor": "rgba(47, 63, 73, 0.8)", + "ActionItemActiveBackgroundColor": "rgba(31, 118, 124, 0.8)", "ActionQueryBoxFontColor": "#e4e7e7" } \ No newline at end of file diff --git a/Wox/ui/theme.go b/Wox/ui/theme.go index 22d39965c..4c225b1cd 100644 --- a/Wox/ui/theme.go +++ b/Wox/ui/theme.go @@ -22,6 +22,8 @@ type Theme struct { ResultItemActiveBackgroundColor string QueryBoxFontColor string QueryBoxBackgroundColor string + QueryBoxBorderRadius int + ActionContainerBackgroundColor string ActionContainerHeaderFontColor string ActionItemActiveBackgroundColor string ActionQueryBoxFontColor string