From 2aa61c9e5a07bbb029a7aa1b99bba908b0edb672 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 26 Feb 2021 23:13:46 -0600 Subject: [PATCH 1/2] perf: remove config for hover animation BREAKING this removes the config for hover animation --- lib/config.json | 6 ------ lib/datatip-manager.ts | 7 ++----- styles/atom-ide-datatips.less | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/config.json b/lib/config.json index 985947b..266104d 100644 --- a/lib/config.json +++ b/lib/config.json @@ -16,11 +16,5 @@ "description": "The time that the mouse/cursor should hover/stay to show a datatip. Also specifies the time that the datatip is still shown when the mouse/cursor moves [ms].", "type": "number", "default": 100 - }, - "glowOnHover": { - "title": "Glow on hover", - "description": "Should the datatip glow when you hover on it?", - "type": "boolean", - "default": true } } diff --git a/lib/datatip-manager.ts b/lib/datatip-manager.ts index 950eb49..b3e0dc4 100644 --- a/lib/datatip-manager.ts +++ b/lib/datatip-manager.ts @@ -79,9 +79,6 @@ export class DataTipManager { /** The time that the mouse/cursor should hover/stay to show a datatip. Also specifies the time that the datatip is still shown when the mouse/cursor moves [ms]. */ hoverTime = atom.config.get("atom-ide-datatip.hoverTime") - // glow on hover - glowClass = atom.config.get("atom-ide-datatip.glowOnHover") ? "datatip-glow" : "" - constructor() { /** * the mouse move event handler that evaluates the screen position and eventually shows a data tip @@ -371,7 +368,7 @@ export class DataTipManager { containerClassName: "datatip-component-container", contentClassName: "datatip-component", }, - className: `datatip-element select-list popover-list ${this.glowClass}`, + className: "datatip-element select-list popover-list datatip-transform", }) this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView) } else if (datatip.markedStrings.length > 0) { @@ -409,7 +406,7 @@ export class DataTipManager { const dataTipView = new ViewContainer({ snippet, markdown, - className: `datatip-element select-list popover-list ${this.glowClass}`, + className: "datatip-element select-list popover-list datatip-transform", }) this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView) diff --git a/styles/atom-ide-datatips.less b/styles/atom-ide-datatips.less index 5ac535c..29b55e4 100644 --- a/styles/atom-ide-datatips.less +++ b/styles/atom-ide-datatips.less @@ -38,7 +38,7 @@ width: auto; } -.datatip-element.datatip-glow { +.datatip-element.datatip-transform { // glow on hover transition: background-color 0.15s ease; &:hover { From 3a56420496975781cac7dfc2e6d859a734482f1c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 27 Feb 2021 05:37:58 -0600 Subject: [PATCH 2/2] feat: only glow info bar --- lib/datatip-manager.ts | 4 ++-- styles/atom-ide-datatips.less | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/datatip-manager.ts b/lib/datatip-manager.ts index b3e0dc4..20b83b7 100644 --- a/lib/datatip-manager.ts +++ b/lib/datatip-manager.ts @@ -368,7 +368,7 @@ export class DataTipManager { containerClassName: "datatip-component-container", contentClassName: "datatip-component", }, - className: "datatip-element select-list popover-list datatip-transform", + className: "datatip-element select-list popover-list", }) this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView) } else if (datatip.markedStrings.length > 0) { @@ -406,7 +406,7 @@ export class DataTipManager { const dataTipView = new ViewContainer({ snippet, markdown, - className: "datatip-element select-list popover-list datatip-transform", + className: "datatip-element select-list popover-list", }) this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView) diff --git a/styles/atom-ide-datatips.less b/styles/atom-ide-datatips.less index 29b55e4..269d658 100644 --- a/styles/atom-ide-datatips.less +++ b/styles/atom-ide-datatips.less @@ -38,18 +38,16 @@ width: auto; } -.datatip-element.datatip-transform { - // glow on hover - transition: background-color 0.15s ease; - &:hover { - background-color: mix(@syntax-background-color, @syntax-selection-color, 95%); - } -} - .datatip-overlay { // info border border-bottom: 5px solid @background-color-highlight; border-radius: 3px; + + // info bar glow + transition: border-bottom-color 0.15s ease; + &:hover { + border-bottom-color: lighten(@background-color-highlight, 10%); + } } /** Applied to ReactView (Components) */