Skip to content

Commit

Permalink
Use custom scrollbar
Browse files Browse the repository at this point in the history
It gives the same better good looking scrollbar in all OS.

Close #208
  • Loading branch information
maxcnunes committed Jul 19, 2016
1 parent 4a385e8 commit b5cba47
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/renderer/components/query-result-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@

.Grid.grid-body {
background: rgb(245, 245, 245);
overflow: hidden !important;
}

.Grid.grid-body ::-webkit-scrollbar{ display: none }
.Grid.grid-body:hover { overflow:auto !important; }
.Grid.grid-body:hover ::-webkit-scrollbar { display: block }

.Grid.grid-body > .Grid__innerScrollContainer {
background: #fff;
}
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/containers/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ span.list-item {
span.clickable {
cursor: pointer;
}

::-webkit-scrollbar { width:8px; height:8px }
::-webkit-scrollbar-track { background: #fff; }
::-webkit-scrollbar-thumb { background: #666; border-radius:5px }
11 changes: 11 additions & 0 deletions src/renderer/containers/query-browser.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#sidebar { overflow-y: hidden; overflow-x: hidden; }
#sidebar ::-webkit-scrollbar{ display:none }

#sidebar:hover { overflow-y:auto; overflow-y:overlay }
#sidebar:hover ::-webkit-scrollbar { display:block }

#sidebar ::-webkit-scrollbar { -webkit-appearance:none }
#sidebar ::-webkit-scrollbar-thumb {
box-shadow: inset 0 -2px,inset 0 -8px,inset 0 2px,inset 0 8px;
min-height: 36px
}
5 changes: 3 additions & 2 deletions src/renderer/containers/query-browser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import MenuHandler from '../menu-handler';


import { ResizableBox } from 'react-resizable';
require('./query-browser.css');
require('../components/react-resizable.css');
require('../components/react-tabs.scss');

Expand All @@ -37,7 +38,7 @@ const STYLES = {
boxSizing: 'border-box',
padding: '50px 10px 40px 10px',
},
sidebar: { overflowY: 'auto' },
sidebar: {},
content: { flex: 1, overflow: 'auto', paddingLeft: '5px' },
resizeable: { width: 'auto', maxWidth: '100%' },
};
Expand Down Expand Up @@ -443,7 +444,7 @@ class QueryBrowserContainer extends Component {
onReConnectionClick={::this.onReConnectionClick} />
</div>
<div style={STYLES.container}>
<div style={STYLES.sidebar}>
<div id="sidebar" style={STYLES.sidebar}>
<ResizableBox className="react-resizable react-resizable-ew-resize"
onResizeStop={(event, { size }) => this.setState({ sideBarWidth: size.width })}
width={SIDEBAR_WIDTH}
Expand Down

0 comments on commit b5cba47

Please sign in to comment.