adjust spacing and group button groups
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
8844b80c51
commit
3f083d9882
@@ -105,6 +105,8 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ToolbarContainer>
|
<ToolbarContainer>
|
||||||
|
{/* History/Edit Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -123,7 +125,12 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<Redo2 />
|
<Redo2 />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* Format Tools Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -132,7 +139,23 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<PaintRoller />
|
<PaintRoller />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
<StyledButton
|
||||||
|
type="button"
|
||||||
|
$pressed={false}
|
||||||
|
onClick={() => {
|
||||||
|
properties.onClearFormatting();
|
||||||
|
}}
|
||||||
|
disabled={!canEdit}
|
||||||
|
title={t("toolbar.clear_formatting")}
|
||||||
|
>
|
||||||
|
<RemoveFormatting />
|
||||||
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* Number Format Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -206,7 +229,12 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
<ChevronDown />
|
<ChevronDown />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
</FormatMenu>
|
</FormatMenu>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* Font Size Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -230,7 +258,12 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<Plus />
|
<Plus />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* Text Style Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={properties.bold}
|
$pressed={properties.bold}
|
||||||
@@ -267,7 +300,12 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<Strikethrough />
|
<Strikethrough />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* Color & Border Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -300,7 +338,12 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<Grid2X2 />
|
<Grid2X2 />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* Alignment Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={properties.horizontalAlign === "left"}
|
$pressed={properties.horizontalAlign === "left"}
|
||||||
@@ -378,8 +421,12 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<WrapText />
|
<WrapText />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{/* View & Tools Group */}
|
||||||
|
<ButtonGroup>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -391,7 +438,6 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
{properties.showGridLines ? <Grid2x2Check /> : <Grid2x2X />}
|
{properties.showGridLines ? <Grid2x2Check /> : <Grid2x2X />}
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
<Divider />
|
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -403,19 +449,6 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<Tags />
|
<Tags />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
|
||||||
<Divider />
|
|
||||||
<StyledButton
|
|
||||||
type="button"
|
|
||||||
$pressed={false}
|
|
||||||
onClick={() => {
|
|
||||||
properties.onClearFormatting();
|
|
||||||
}}
|
|
||||||
disabled={!canEdit}
|
|
||||||
title={t("toolbar.clear_formatting")}
|
|
||||||
>
|
|
||||||
<RemoveFormatting />
|
|
||||||
</StyledButton>
|
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type="button"
|
type="button"
|
||||||
$pressed={false}
|
$pressed={false}
|
||||||
@@ -427,6 +460,7 @@ function Toolbar(properties: ToolbarProperties) {
|
|||||||
>
|
>
|
||||||
<ImageDown />
|
<ImageDown />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
<ColorPicker
|
<ColorPicker
|
||||||
color={properties.fontColor}
|
color={properties.fontColor}
|
||||||
@@ -562,7 +596,7 @@ const Divider = styled("div")({
|
|||||||
width: "0px",
|
width: "0px",
|
||||||
height: "12px",
|
height: "12px",
|
||||||
borderLeft: `1px solid ${theme.palette.grey["300"]}`,
|
borderLeft: `1px solid ${theme.palette.grey["300"]}`,
|
||||||
margin: "0px 12px",
|
margin: "0px 8px",
|
||||||
});
|
});
|
||||||
|
|
||||||
const FontSizeBox = styled("div")({
|
const FontSizeBox = styled("div")({
|
||||||
@@ -577,4 +611,10 @@ const FontSizeBox = styled("div")({
|
|||||||
minWidth: "24px",
|
minWidth: "24px",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ButtonGroup = styled("div")({
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "4px",
|
||||||
|
});
|
||||||
|
|
||||||
export default Toolbar;
|
export default Toolbar;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export const TOOLBAR_HEIGHT = 48;
|
export const TOOLBAR_HEIGHT = 40;
|
||||||
export const FORMULA_BAR_HEIGHT = 40;
|
export const FORMULA_BAR_HEIGHT = 40;
|
||||||
export const NAVIGATION_HEIGHT = 40;
|
export const NAVIGATION_HEIGHT = 40;
|
||||||
|
|||||||
Reference in New Issue
Block a user