Skip to content

Commit

Permalink
Merge pull request #1347 from opencv/bs/reset_color_settings
Browse files Browse the repository at this point in the history
React UI: Added button to reset color settings
  • Loading branch information
ActiveChooN authored Apr 3, 2020
2 parents 7bdf9bb + abbc635 commit dadd3e6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Special behaviour for attribute value ``__undefined__`` (invisibility, no shortcuts to be set in AAM)
- Dialog window with some helpful information about using filters
- Ability to display a bitmap in the new UI
- Button to reset colors settings (brightness, saturation, contrast) in the new UI

### Changed
-
Expand Down
15 changes: 15 additions & 0 deletions cvat-ui/src/components/settings-page/player-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from 'react';

import { Row, Col } from 'antd/lib/grid';
import Checkbox, { CheckboxChangeEvent } from 'antd/lib/checkbox';
import Button from 'antd/lib/button';
import Slider from 'antd/lib/slider';
import Select from 'antd/lib/select';
import InputNumber from 'antd/lib/input-number';
Expand All @@ -16,6 +17,7 @@ import { clamp } from 'utils/math';
import { BackJumpIcon, ForwardJumpIcon } from 'icons';
import { FrameSpeed, GridColor } from 'reducers/interfaces';


interface Props {
frameStep: number;
frameSpeed: FrameSpeed;
Expand Down Expand Up @@ -263,6 +265,19 @@ export default function PlayerSettingsComponent(props: Props): JSX.Element {
/>
</Col>
</Row>
<Row className='cvat-player-reset-color-settings'>
<Col>
<Button
onClick={() => {
onChangeBrightnessLevel(100);
onChangeContrastLevel(100);
onChangeSaturationLevel(100);
}}
>
Reset color settings
</Button>
</Col>
</Row>
</div>
);
}
10 changes: 10 additions & 0 deletions cvat-ui/src/components/settings-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
@import '../../base.scss';

.cvat-settings-page {
height: 90%;
overflow-y: auto;

> div:nth-child(1) {
margin-top: 30px;
margin-bottom: 10px;
Expand Down Expand Up @@ -73,12 +76,19 @@
width: 90px;
}

.cvat-player-reset-color-settings,
.cvat-player-settings-brightness,
.cvat-player-settings-contrast,
.cvat-player-settings-saturation {
width: 40%;
}

.cvat-player-reset-color-settings {
> .ant-col {
text-align: center;
}
}

.cvat-settings-page-back-button {
width: 100px;
margin-top: 15px;
Expand Down

0 comments on commit dadd3e6

Please sign in to comment.