Skip to content

React UI: Added button to reset color settings #1347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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