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

Enable horizontal scrolling for toolbars #8417

Merged
merged 3 commits into from May 25, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions packages/application/style/scrollbar.css
Expand Up @@ -20,6 +20,13 @@
scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;
}

/* tiny scrollbar */

.jp-scrollbar-tiny {
scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;
scrollbar-width: thin;
}

/*
* Webkit scrollbar styling
*/
Expand Down Expand Up @@ -85,6 +92,29 @@
border-bottom: var(--jp-scrollbar-endpad) solid transparent;
}

/* tiny scrollbar */

.jp-scrollbar-tiny::-webkit-scrollbar,
.jp-scrollbar-tiny::-webkit-scrollbar-corner {
background-color: transparent;
height: 4px;
width: 4px;
}

.jp-scrollbar-tiny::-webkit-scrollbar-thumb {
background: rgba(var(--jp-scrollbar-thumb-color), 0.5);
}

.jp-scrollbar-tiny::-webkit-scrollbar-track:horizontal {
border-left: 0px solid transparent;
border-right: 0px solid transparent;
}

.jp-scrollbar-tiny::-webkit-scrollbar-track:vertical {
border-top: 0px solid transparent;
border-bottom: 0px solid transparent;
}

/*
* Phosphor
*/
Expand Down
9 changes: 7 additions & 2 deletions packages/apputils/src/toolbar.tsx
Expand Up @@ -178,6 +178,7 @@ export class Toolbar<T extends Widget = Widget> extends Widget {
constructor() {
super();
this.addClass(TOOLBAR_CLASS);
this.addClass('jp-scrollbar-tiny');
this.layout = new ToolbarLayout();
}

Expand Down Expand Up @@ -735,14 +736,18 @@ namespace Private {
container: this.node,
title: `Kernel ${Text.titleCase(status)}`,

stylesheet: 'toolbarButton'
stylesheet: 'toolbarButton',
alignSelf: 'normal',
height: '24px'
});
} else {
circleEmptyIcon.element({
container: this.node,
title: `Kernel ${Text.titleCase(status)}`,

stylesheet: 'toolbarButton'
stylesheet: 'toolbarButton',
alignSelf: 'normal',
height: '24px'
});
}
}
Expand Down
5 changes: 5 additions & 0 deletions packages/apputils/style/toolbar.css
Expand Up @@ -21,6 +21,11 @@
min-height: var(--jp-toolbar-micro-height);
padding: 2px;
z-index: 1;
overflow-x: hidden;
}

.jp-Toolbar:hover {
overflow-x: auto;
}

/* Toolbar items */
Expand Down