diff --git a/src/renderer/components/hotbar/hotbar-icon.scss b/src/renderer/components/hotbar/hotbar-icon.scss index c1bd048b09..bce7070ad1 100644 --- a/src/renderer/components/hotbar/hotbar-icon.scss +++ b/src/renderer/components/hotbar/hotbar-icon.scss @@ -1,44 +1,58 @@ -.HotbarIcon { - --size: 37px; +.HotbarMenu { + .HotbarIcon { + --size: 37px; - position: relative; - border-radius: 8px; - padding: 2px; - user-select: none; - cursor: pointer; + position: relative; + border-radius: 8px; + padding: 2px; + user-select: none; + cursor: pointer; - div.MuiAvatar-colorDefault { - font-weight:500; - text-transform: uppercase; - border-radius: 4px; - } + div.MuiAvatar-colorDefault { + font-weight:500; + text-transform: uppercase; + border-radius: 4px; + } - div.active { - background-color: var(--primary); - } - - div.default { - background-color: var(--halfGray); - } - - &.active { - margin-left: -3px; - border: 3px solid #fff; - } - - &.active, &.interactive:hover { - - div { + div.active { background-color: var(--primary); } + div.default { + background-color: var(--halfGray); + } + + &.active { + margin-left: -3px; + border: 3px solid #fff; + } + + &.active, &.interactive:hover { + + div { + background-color: var(--primary); + } + + img { + opacity: 1; + } + } + img { - opacity: 1; + width: var(--size); + height: var(--size); } } - img { - width: var(--size); - height: var(--size); + .HotbarIconMenu { + left: 30px; + min-width: 250px; + + ul { + li { + font-size: 12px; + + } + } } } diff --git a/src/renderer/components/hotbar/hotbar-icon.tsx b/src/renderer/components/hotbar/hotbar-icon.tsx index a6c2d8cc42..6739411441 100644 --- a/src/renderer/components/hotbar/hotbar-icon.tsx +++ b/src/renderer/components/hotbar/hotbar-icon.tsx @@ -14,6 +14,7 @@ import { hotbarStore } from "../../../common/hotbar-store"; interface Props extends DOMAttributes { entity: CatalogEntity; + index: number; className?: IClassName; errorClass?: IClassName; isActive?: boolean; @@ -70,7 +71,7 @@ export class HotbarIcon extends React.Component { entity, errorClass, isActive, children, ...elemProps } = this.props; - const entityIconId = `hotbar-icon-${entity.metadata.uid}`; + const entityIconId = `hotbar-icon-${this.props.index}`; const className = cssNames("HotbarIcon flex inline", this.props.className, { interactive: true, active: isActive, @@ -81,15 +82,16 @@ export class HotbarIcon extends React.Component { }; return ( -
+
{entity.metadata.name} - {this.iconString} + {this.iconString} onOpen()} close={() => this.toggleMenu()}> this.removeFromHotbar(entity) }> diff --git a/src/renderer/components/hotbar/hotbar-menu.scss b/src/renderer/components/hotbar/hotbar-menu.scss index 6d85ff6c87..22af27e486 100644 --- a/src/renderer/components/hotbar/hotbar-menu.scss +++ b/src/renderer/components/hotbar/hotbar-menu.scss @@ -14,9 +14,9 @@ } .items { - @include hidden-scrollbar; padding: 0 $spacing; // extra spacing for cluster-icon's badge margin-bottom: $margin; + overflow: visible; &:empty { display: none; diff --git a/src/renderer/components/hotbar/hotbar-menu.tsx b/src/renderer/components/hotbar/hotbar-menu.tsx index bef3fc759d..9a2b8de484 100644 --- a/src/renderer/components/hotbar/hotbar-menu.tsx +++ b/src/renderer/components/hotbar/hotbar-menu.tsx @@ -27,10 +27,11 @@ export class HotbarMenu extends React.Component { return (
- {items.map((entity) => { + {items.map((entity, index) => { return ( entity.onRun(catalogEntityRunContext)}