mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
Change border on disabled undo/enabled redo
thanks @fsih
This commit is contained in:
parent
9ef967aa24
commit
cdb235a876
2 changed files with 30 additions and 5 deletions
|
@ -49,11 +49,19 @@ $border-radius: 0.25rem;
|
|||
}
|
||||
|
||||
.button-group-button:first-of-type {
|
||||
border-left: 1px solid #ddd;
|
||||
border-left: 1px solid $ui-pane-border;
|
||||
border-top-left-radius: $border-radius;
|
||||
border-bottom-left-radius: $border-radius;
|
||||
}
|
||||
|
||||
.button-group-button.mod-left-border {
|
||||
border-left: 1px solid $ui-pane-border;
|
||||
}
|
||||
|
||||
.button-group-button.mod-no-right-border {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.button-group-button-icon {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
|
|
|
@ -61,6 +61,9 @@ class PaintEditorComponent extends React.Component {
|
|||
this.setState({canvas: canvas});
|
||||
}
|
||||
render () {
|
||||
const redoDisabled = !this.props.canRedo();
|
||||
const undoDisabled = !this.props.canUndo();
|
||||
|
||||
return (
|
||||
<div className={styles.editorContainer}>
|
||||
{this.state.canvas ? (
|
||||
|
@ -82,8 +85,15 @@ class PaintEditorComponent extends React.Component {
|
|||
<InputGroup>
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
className={styles.buttonGroupButton}
|
||||
disabled={!this.props.canUndo()}
|
||||
className={
|
||||
classNames(
|
||||
styles.buttonGroupButton,
|
||||
{
|
||||
[styles.modNoRightBorder]: !redoDisabled
|
||||
}
|
||||
)
|
||||
}
|
||||
disabled={undoDisabled}
|
||||
onClick={this.props.onUndo}
|
||||
>
|
||||
<img
|
||||
|
@ -93,8 +103,15 @@ class PaintEditorComponent extends React.Component {
|
|||
/>
|
||||
</Button>
|
||||
<Button
|
||||
className={styles.buttonGroupButton}
|
||||
disabled={!this.props.canRedo()}
|
||||
className={
|
||||
classNames(
|
||||
styles.buttonGroupButton,
|
||||
{
|
||||
[styles.modLeftBorder]: !redoDisabled
|
||||
}
|
||||
)
|
||||
}
|
||||
disabled={redoDisabled}
|
||||
onClick={this.props.onRedo}
|
||||
>
|
||||
<img
|
||||
|
|
Loading…
Reference in a new issue