diff options
| author | Hank <hank@mullvad.net> | 2022-10-03 16:19:47 +0200 |
|---|---|---|
| committer | Hank <hank@mullvad.net> | 2022-10-03 16:19:47 +0200 |
| commit | 2b5c9c0ed5f05f463b36c39593a1ff7a2481fc8e (patch) | |
| tree | dd6872d1b6f37fd9053fd401d0b7521d95e0fd0c /gui/src | |
| parent | 63e1abcdea8505430e73d852f1651cc55a8a17d1 (diff) | |
| parent | ba301ee212152e5bc37dc0b8ce326324c689bdd7 (diff) | |
| download | mullvadvpn-2b5c9c0ed5f05f463b36c39593a1ff7a2481fc8e.tar.xz mullvadvpn-2b5c9c0ed5f05f463b36c39593a1ff7a2481fc8e.zip | |
Merge branch 'scrollbar'
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/renderer/components/CustomScrollbars.tsx | 1 | ||||
| -rw-r--r-- | gui/src/renderer/components/NavigationBar.tsx | 23 |
2 files changed, 1 insertions, 23 deletions
diff --git a/gui/src/renderer/components/CustomScrollbars.tsx b/gui/src/renderer/components/CustomScrollbars.tsx index 7acabeaeab..a760647cbe 100644 --- a/gui/src/renderer/components/CustomScrollbars.tsx +++ b/gui/src/renderer/components/CustomScrollbars.tsx @@ -35,6 +35,7 @@ const StyledTrack = styled.div({}, (props: { canScroll: boolean; show: boolean } bottom: 0, width: '16px', backgroundColor: props.show ? 'rgba(0, 0, 0, 0.2)' : 'rgba(0, 0, 0, 0)', + borderRadius: '8px', transition: 'width 0.1s ease-in-out, background-color 0.25s ease-in-out', zIndex: 99, pointerEvents: props.canScroll ? 'auto' : 'none', diff --git a/gui/src/renderer/components/NavigationBar.tsx b/gui/src/renderer/components/NavigationBar.tsx index 0b119efe30..4c27665b65 100644 --- a/gui/src/renderer/components/NavigationBar.tsx +++ b/gui/src/renderer/components/NavigationBar.tsx @@ -45,8 +45,6 @@ export class NavigationContainer extends React.Component< showsBarSeparator: false, }; - private scrollEventListeners: Array<(event: IScrollEvent) => void> = []; - public componentDidMount() { this.updateBarAppearance({ scrollLeft: 0, scrollTop: 0 }); } @@ -64,28 +62,9 @@ export class NavigationContainer extends React.Component< } public onScroll = (event: IScrollEvent) => { - this.notifyScrollEventListeners(event); this.updateBarAppearance(event); }; - public addScrollEventListener(fn: (event: IScrollEvent) => void) { - const index = this.scrollEventListeners.indexOf(fn); - if (index === -1) { - this.scrollEventListeners.push(fn); - } - } - - public removeScrollEventListener(fn: (event: IScrollEvent) => void) { - const index = this.scrollEventListeners.indexOf(fn); - if (index !== -1) { - this.scrollEventListeners.splice(index, 1); - } - } - - private notifyScrollEventListeners(event: IScrollEvent) { - this.scrollEventListeners.forEach((listener) => listener(event)); - } - private updateBarAppearance(event: IScrollEvent) { // that's where SettingsHeader.HeaderTitle intersects the navigation bar const showsBarSeparator = event.scrollTop > 11; @@ -103,7 +82,6 @@ export class NavigationContainer extends React.Component< } interface INavigationScrollbarsProps { - onScroll?: (value: IScrollEvent) => void; className?: string; fillContainer?: boolean; children?: React.ReactNode; @@ -155,7 +133,6 @@ export const NavigationScrollbars = React.forwardRef(function NavigationScrollba const handleScroll = useCallback((event: IScrollEvent) => { onScroll(event); - props.onScroll?.(event); }, []); return ( |
