mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
New colors for workspace switcher (#1443)
Also updates workspace switcher button and tab bg colors
This commit is contained in:
parent
c071cc04c3
commit
edab90aa55
@ -41,7 +41,7 @@
|
|||||||
.tab-inner {
|
.tab-inner {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: rgb(from var(--main-text-color) r g b / 0.14);
|
background: rgb(from var(--main-text-color) r g b / 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
@ -111,7 +111,7 @@ body:not(.nohover) .tab:hover {
|
|||||||
|
|
||||||
.tab-inner {
|
.tab-inner {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
background: rgb(from var(--main-text-color) r g b / 0.14);
|
background: rgb(from var(--main-text-color) r g b / 0.1);
|
||||||
}
|
}
|
||||||
.close {
|
.close {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
|
@ -9,10 +9,14 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: var(--modal-bg-color);
|
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
margin-right: 13px;
|
margin-right: 13px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
background-color: rgb(from var(--main-text-color) r g b / 0.1) !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: rgb(from var(--main-text-color) r g b / 0.14) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.workspace-icon {
|
.workspace-icon {
|
||||||
width: 15px;
|
width: 15px;
|
||||||
|
@ -32,6 +32,33 @@ interface ColorSelectorProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const colors = [
|
||||||
|
"#58C142", // Green (accent)
|
||||||
|
"#00FFDB", // Teal
|
||||||
|
"#429DFF", // Blue
|
||||||
|
"#BF55EC", // Purple
|
||||||
|
"#FF453A", // Red
|
||||||
|
"#FF9500", // Orange
|
||||||
|
"#FFE900", // Yellow
|
||||||
|
];
|
||||||
|
|
||||||
|
const icons = [
|
||||||
|
"triangle",
|
||||||
|
"star",
|
||||||
|
"cube",
|
||||||
|
"gem",
|
||||||
|
"chess-knight",
|
||||||
|
"heart",
|
||||||
|
"plane",
|
||||||
|
"rocket",
|
||||||
|
"shield-cat",
|
||||||
|
"paw-simple",
|
||||||
|
"umbrella",
|
||||||
|
"graduation-cap",
|
||||||
|
"mug-hot",
|
||||||
|
"circle",
|
||||||
|
];
|
||||||
|
|
||||||
const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => {
|
const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => {
|
||||||
const handleColorClick = (color: string) => {
|
const handleColorClick = (color: string) => {
|
||||||
onSelect(color);
|
onSelect(color);
|
||||||
@ -117,31 +144,8 @@ const ColorAndIconSelector = memo(
|
|||||||
value={title}
|
value={title}
|
||||||
autoFocus
|
autoFocus
|
||||||
/>
|
/>
|
||||||
<ColorSelector
|
<ColorSelector selectedColor={color} colors={colors} onSelect={onColorChange} />
|
||||||
selectedColor={color}
|
<IconSelector selectedIcon={icon} icons={icons} onSelect={onIconChange} />
|
||||||
colors={["#e91e63", "#8bc34a", "#ff9800", "#ffc107", "#03a9f4", "#3f51b5", "#f44336"]}
|
|
||||||
onSelect={onColorChange}
|
|
||||||
/>
|
|
||||||
<IconSelector
|
|
||||||
selectedIcon={icon}
|
|
||||||
icons={[
|
|
||||||
"triangle",
|
|
||||||
"star",
|
|
||||||
"cube",
|
|
||||||
"gem",
|
|
||||||
"chess-knight",
|
|
||||||
"heart",
|
|
||||||
"plane",
|
|
||||||
"rocket",
|
|
||||||
"shield-cat",
|
|
||||||
"paw-simple",
|
|
||||||
"umbrella",
|
|
||||||
"graduation-cap",
|
|
||||||
"mug-hot",
|
|
||||||
"circle",
|
|
||||||
]}
|
|
||||||
onSelect={onIconChange}
|
|
||||||
/>
|
|
||||||
<div className="delete-ws-btn-wrapper">
|
<div className="delete-ws-btn-wrapper">
|
||||||
<Button className="ghost red font-size-12" onClick={onDeleteWorkspace}>
|
<Button className="ghost red font-size-12" onClick={onDeleteWorkspace}>
|
||||||
Delete workspace
|
Delete workspace
|
||||||
@ -204,7 +208,11 @@ const WorkspaceSwitcher = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const saveWorkspace = () => {
|
const saveWorkspace = () => {
|
||||||
setObjectValue({ ...activeWorkspace, name: "New Workspace", icon: "circle", color: "green" }, undefined, true);
|
setObjectValue(
|
||||||
|
{ ...activeWorkspace, name: "New Workspace", icon: "circle", color: colors[0] },
|
||||||
|
undefined,
|
||||||
|
true
|
||||||
|
);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
fireAndForget(updateWorkspaceList);
|
fireAndForget(updateWorkspaceList);
|
||||||
}, 10);
|
}, 10);
|
||||||
|
@ -54,7 +54,7 @@ func EnsureInitialData() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
log.Println("client has no windows, creating starter workspace")
|
log.Println("client has no windows, creating starter workspace")
|
||||||
starterWs, err := CreateWorkspace(ctx, "Starter workspace", "circle", "green", true)
|
starterWs, err := CreateWorkspace(ctx, "Starter workspace", "circle", "#58C142", true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error creating starter workspace: %w", err)
|
return fmt.Errorf("error creating starter workspace: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func CreateWorkspace(ctx context.Context, name string, icon string, color string, isInitialLaunch bool) (*waveobj.Workspace, error) {
|
func CreateWorkspace(ctx context.Context, name string, icon string, color string, isInitialLaunch bool) (*waveobj.Workspace, error) {
|
||||||
log.Println("CreateWorkspace")
|
|
||||||
ws := &waveobj.Workspace{
|
ws := &waveobj.Workspace{
|
||||||
OID: uuid.NewString(),
|
OID: uuid.NewString(),
|
||||||
TabIds: []string{},
|
TabIds: []string{},
|
||||||
|
Loading…
Reference in New Issue
Block a user