WIP for keith
This commit is contained in:
parent
088668ecf8
commit
f963c0ed45
4 changed files with 105 additions and 69 deletions
|
@ -38,11 +38,7 @@ pub struct Theme {
|
||||||
pub struct Workspace {
|
pub struct Workspace {
|
||||||
pub background: Color,
|
pub background: Color,
|
||||||
pub titlebar: Titlebar,
|
pub titlebar: Titlebar,
|
||||||
pub active_pane_active_tab: Tab,
|
pub tab_bar: TabBar,
|
||||||
pub active_pane_inactive_tab: Tab,
|
|
||||||
pub inactive_pane_active_tab: Tab,
|
|
||||||
pub inactive_pane_inactive_tab: Tab,
|
|
||||||
pub pane_button: Interactive<IconButton>,
|
|
||||||
pub pane_divider: Border,
|
pub pane_divider: Border,
|
||||||
pub leader_border_opacity: f32,
|
pub leader_border_opacity: f32,
|
||||||
pub leader_border_width: f32,
|
pub leader_border_width: f32,
|
||||||
|
@ -72,6 +68,21 @@ pub struct Titlebar {
|
||||||
pub outdated_warning: ContainedText,
|
pub outdated_warning: ContainedText,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Deserialize, Default)]
|
||||||
|
pub struct TabBar {
|
||||||
|
#[serde(flatten)]
|
||||||
|
pub container: ContainerStyle,
|
||||||
|
pub pane_button: Interactive<IconButton>,
|
||||||
|
pub active_pane: TabStyles,
|
||||||
|
pub inactive_pane: TabStyles,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Deserialize, Default)]
|
||||||
|
pub struct TabStyles {
|
||||||
|
active_tab: Tab,
|
||||||
|
inactive_tab: Tab,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Deserialize, Default)]
|
#[derive(Clone, Deserialize, Default)]
|
||||||
pub struct AvatarRibbon {
|
pub struct AvatarRibbon {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
|
85
styles/src/styleTree/tabBar.ts
Normal file
85
styles/src/styleTree/tabBar.ts
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
import Theme from "../themes/common/theme";
|
||||||
|
import { iconColor, text, border, backgroundColor } from "./components";
|
||||||
|
|
||||||
|
export default function tabBar(theme: Theme) {
|
||||||
|
const height = 32;
|
||||||
|
|
||||||
|
const tab = {
|
||||||
|
height,
|
||||||
|
background: backgroundColor(theme, 300),
|
||||||
|
border: border(theme, "primary", {
|
||||||
|
left: true,
|
||||||
|
bottom: true,
|
||||||
|
overlay: true,
|
||||||
|
}),
|
||||||
|
iconClose: iconColor(theme, "muted"),
|
||||||
|
iconCloseActive: iconColor(theme, "active"),
|
||||||
|
iconConflict: iconColor(theme, "warning"),
|
||||||
|
iconDirty: iconColor(theme, "info"),
|
||||||
|
iconWidth: 8,
|
||||||
|
spacing: 8,
|
||||||
|
text: text(theme, "sans", "secondary", { size: "sm" }),
|
||||||
|
padding: {
|
||||||
|
left: 8,
|
||||||
|
right: 8,
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
margin: { left: 6, top: 1 },
|
||||||
|
...text(theme, "sans", "muted", { size: "2xs" })
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const activePaneActiveTab = {
|
||||||
|
...tab,
|
||||||
|
background: backgroundColor(theme, 500),
|
||||||
|
text: text(theme, "sans", "active", { size: "sm" }),
|
||||||
|
border: {
|
||||||
|
...tab.border,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const inactivePaneInactiveTab = {
|
||||||
|
...tab,
|
||||||
|
background: backgroundColor(theme, 300),
|
||||||
|
text: text(theme, "sans", "muted", { size: "sm" }),
|
||||||
|
};
|
||||||
|
|
||||||
|
const inactivePaneActiveTab = {
|
||||||
|
...tab,
|
||||||
|
background: backgroundColor(theme, 500),
|
||||||
|
text: text(theme, "sans", "secondary", { size: "sm" }),
|
||||||
|
border: {
|
||||||
|
...tab.border,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
height,
|
||||||
|
background: backgroundColor(theme, 300),
|
||||||
|
border: border(theme, "primary", {
|
||||||
|
left: true,
|
||||||
|
bottom: true,
|
||||||
|
overlay: true,
|
||||||
|
}),
|
||||||
|
activePane: {
|
||||||
|
activeTab: activePaneActiveTab,
|
||||||
|
inactiveTab: tab,
|
||||||
|
},
|
||||||
|
inactivePane: {
|
||||||
|
activeTab: inactivePaneActiveTab,
|
||||||
|
inactiveTab: inactivePaneInactiveTab,
|
||||||
|
},
|
||||||
|
paneButton: {
|
||||||
|
color: iconColor(theme, "secondary"),
|
||||||
|
border: {
|
||||||
|
...activePaneActiveTab.border,
|
||||||
|
},
|
||||||
|
iconWidth: 12,
|
||||||
|
buttonWidth: activePaneActiveTab.height,
|
||||||
|
hover: {
|
||||||
|
color: iconColor(theme, "active"),
|
||||||
|
background: backgroundColor(theme, 300),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,58 +8,13 @@ import {
|
||||||
text,
|
text,
|
||||||
} from "./components";
|
} from "./components";
|
||||||
import statusBar from "./statusBar";
|
import statusBar from "./statusBar";
|
||||||
|
import tabBar from "./tabBar";
|
||||||
|
|
||||||
export function workspaceBackground(theme: Theme) {
|
export function workspaceBackground(theme: Theme) {
|
||||||
return backgroundColor(theme, 300);
|
return backgroundColor(theme, 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function workspace(theme: Theme) {
|
export default function workspace(theme: Theme) {
|
||||||
const activePaneInactiveTab = {
|
|
||||||
height: 32,
|
|
||||||
background: workspaceBackground(theme),
|
|
||||||
iconClose: iconColor(theme, "muted"),
|
|
||||||
iconCloseActive: iconColor(theme, "active"),
|
|
||||||
iconConflict: iconColor(theme, "warning"),
|
|
||||||
iconDirty: iconColor(theme, "info"),
|
|
||||||
iconWidth: 8,
|
|
||||||
spacing: 8,
|
|
||||||
text: text(theme, "sans", "secondary", { size: "sm" }),
|
|
||||||
border: border(theme, "primary", {
|
|
||||||
left: true,
|
|
||||||
bottom: true,
|
|
||||||
overlay: true,
|
|
||||||
}),
|
|
||||||
padding: {
|
|
||||||
left: 8,
|
|
||||||
right: 8,
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
margin: { left: 6, top: 1 },
|
|
||||||
...text(theme, "sans", "muted", { size: "2xs" })
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const activePaneActiveTab = {
|
|
||||||
...activePaneInactiveTab,
|
|
||||||
background: backgroundColor(theme, 500),
|
|
||||||
text: text(theme, "sans", "active", { size: "sm" }),
|
|
||||||
border: {
|
|
||||||
...activePaneInactiveTab.border,
|
|
||||||
bottom: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const inactivePaneInactiveTab = {
|
|
||||||
...activePaneInactiveTab,
|
|
||||||
background: backgroundColor(theme, 100),
|
|
||||||
text: text(theme, "sans", "placeholder", { size: "sm" }),
|
|
||||||
};
|
|
||||||
|
|
||||||
const inactivePaneActiveTab = {
|
|
||||||
...activePaneInactiveTab,
|
|
||||||
text: text(theme, "sans", "placeholder", { size: "sm" }),
|
|
||||||
}
|
|
||||||
|
|
||||||
const titlebarPadding = 6;
|
const titlebarPadding = 6;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -74,22 +29,7 @@ export default function workspace(theme: Theme) {
|
||||||
},
|
},
|
||||||
leaderBorderOpacity: 0.7,
|
leaderBorderOpacity: 0.7,
|
||||||
leaderBorderWidth: 2.0,
|
leaderBorderWidth: 2.0,
|
||||||
activePaneActiveTab,
|
tabBar: tabBar(theme),
|
||||||
activePaneInactiveTab,
|
|
||||||
inactivePaneActiveTab,
|
|
||||||
inactivePaneInactiveTab,
|
|
||||||
paneButton: {
|
|
||||||
color: iconColor(theme, "secondary"),
|
|
||||||
border: {
|
|
||||||
...activePaneActiveTab.border,
|
|
||||||
},
|
|
||||||
iconWidth: 12,
|
|
||||||
buttonWidth: activePaneActiveTab.height,
|
|
||||||
hover: {
|
|
||||||
color: iconColor(theme, "active"),
|
|
||||||
background: backgroundColor(theme, 300),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
modal: {
|
modal: {
|
||||||
margin: {
|
margin: {
|
||||||
bottom: 52,
|
bottom: 52,
|
||||||
|
|
|
@ -115,8 +115,8 @@ export function createTheme(
|
||||||
const textColor = {
|
const textColor = {
|
||||||
primary: sample(ramps.neutral, 6),
|
primary: sample(ramps.neutral, 6),
|
||||||
secondary: sample(ramps.neutral, 5),
|
secondary: sample(ramps.neutral, 5),
|
||||||
muted: sample(ramps.neutral, 5),
|
muted: sample(ramps.neutral, 4),
|
||||||
placeholder: sample(ramps.neutral, 4),
|
placeholder: sample(ramps.neutral, 3),
|
||||||
active: sample(ramps.neutral, 7),
|
active: sample(ramps.neutral, 7),
|
||||||
feature: sample(ramps.blue, 0.5),
|
feature: sample(ramps.blue, 0.5),
|
||||||
ok: sample(ramps.green, 0.5),
|
ok: sample(ramps.green, 0.5),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue