Skip to content
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

[maps] fix toolbar action button not filled when selected #158284

Merged
merged 6 commits into from May 26, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -10,7 +10,7 @@
position: relative;
transition: transform $euiAnimSpeedNormal ease-in-out, background $euiAnimSpeedNormal ease-in-out;

.euiButtonIcon:not(.euiButtonIcon--fill) {
MichaelMarcialis marked this conversation as resolved.
Show resolved Hide resolved
.mapToolbarOverlay__buttonIcon-empty {
color: $euiTextColor !important;
}

Expand All @@ -26,7 +26,7 @@

// Removes the focus background state because it can induce users to think these buttons are "enabled".
// The buttons functionality are just applied once, so they shouldn't stay highlighted.
.euiButtonIcon:focus:not(:hover) {
.mapToolbarOverlay__buttonIcon-empty:focus:not(:hover) {
background: none;
}
}
Expand Down
Expand Up @@ -6,6 +6,7 @@
*/

import React from 'react';
import classNames from 'classnames';
import { EuiButtonIcon, EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { TrackApplicationView } from '@kbn/usage-collection-plugin/public';
Expand Down Expand Up @@ -53,6 +54,9 @@ export function FeatureEditTools(props: Props) {
{props.pointsOnly ? null : (
<>
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !drawLineSelected,
})}
key="line"
size="s"
onClick={() => toggleDrawShape(DRAW_SHAPE.LINE)}
Expand All @@ -69,6 +73,9 @@ export function FeatureEditTools(props: Props) {
/>

<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !drawPolygonSelected,
})}
key="polygon"
size="s"
onClick={() => toggleDrawShape(DRAW_SHAPE.POLYGON)}
Expand All @@ -84,6 +91,9 @@ export function FeatureEditTools(props: Props) {
display={drawPolygonSelected ? 'fill' : 'empty'}
/>
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !drawCircleSelected,
})}
key="circle"
size="s"
onClick={() => toggleDrawShape(DRAW_SHAPE.DISTANCE)}
Expand All @@ -99,6 +109,9 @@ export function FeatureEditTools(props: Props) {
display={drawCircleSelected ? 'fill' : 'empty'}
/>
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !drawBBoxSelected,
})}
key="boundingBox"
size="s"
onClick={() => toggleDrawShape(DRAW_SHAPE.BOUNDS)}
Expand All @@ -116,6 +129,9 @@ export function FeatureEditTools(props: Props) {
</>
)}
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !drawPointSelected,
})}
key="point"
size="s"
onClick={() => toggleDrawShape(DRAW_SHAPE.POINT)}
Expand All @@ -131,6 +147,9 @@ export function FeatureEditTools(props: Props) {
display={drawPointSelected ? 'fill' : 'empty'}
/>
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !deleteSelected,
})}
key="delete"
size="s"
onClick={() => toggleDrawShape(DRAW_SHAPE.DELETE)}
Expand Down
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';

import classNames from 'classnames';
import { EuiButtonIcon, EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

Expand All @@ -31,6 +31,9 @@ export function FitToData(props: Props) {
return (
<EuiPanel paddingSize="none" className="mapToolbarOverlay__button">
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !props.autoFitToDataBounds,
})}
size="s"
onClick={props.fitToBounds}
data-test-subj="fitToData"
Expand Down
Expand Up @@ -52,6 +52,7 @@ export class SetViewControl extends Component<Props, State> {
button={
<EuiPanel paddingSize="none" className="mapToolbarOverlay__button">
<EuiButtonIcon
className="mapToolbarOverlay__buttonIcon-empty"
size="s"
onClick={this._togglePopover}
data-test-subj="toggleSetViewVisibilityButton"
Expand Down
Expand Up @@ -6,6 +6,7 @@
*/

import React from 'react';
import classNames from 'classnames';
import { i18n } from '@kbn/i18n';
import { EuiButtonIcon, EuiPanel } from '@elastic/eui';

Expand Down Expand Up @@ -35,6 +36,9 @@ export function TimesliderToggleButton(props: Props) {
return (
<EuiPanel paddingSize="none" className="mapToolbarOverlay__button">
<EuiButtonIcon
className={classNames({
'mapToolbarOverlay__buttonIcon-empty': !props.isTimesliderOpen,
})}
size="s"
onClick={onClick}
data-test-subj="timesliderToggleButton"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -201,6 +201,7 @@ export class ToolsControl extends Component<Props, State> {
return (
<EuiPanel paddingSize="none" className="mapToolbarOverlay__button">
<EuiButtonIcon
className="mapToolbarOverlay__buttonIcon-empty"
size="s"
color="text"
iconType="wrench"
Expand Down