Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions browser/components/MarkdownPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Carousel from 'react-image-carousel'
import ConfigManager from '../main/lib/ConfigManager'
import uiThemes from 'browser/lib/ui-themes'
import i18n from 'browser/lib/i18n'
import config from 'browser/main/lib/ConfigManager'

const { remote, shell } = require('electron')
const attachmentManagement = require('../main/lib/dataApi/attachmentManagement')
Expand Down Expand Up @@ -186,10 +187,12 @@ ${allowCustomCSS ? customCSS : ''}

const scrollBarStyle = `
::-webkit-scrollbar {
${config.get().ui.showScrollBar ? '' : 'display: none;'}
width: 12px;
}

::-webkit-scrollbar-thumb {
${config.get().ui.showScrollBar ? '' : 'display: none;'}
background-color: rgba(0, 0, 0, 0.15);
}

Expand All @@ -199,10 +202,12 @@ const scrollBarStyle = `
`
const scrollBarDarkStyle = `
::-webkit-scrollbar {
${config.get().ui.showScrollBar ? '' : 'display: none;'}
width: 12px;
}

::-webkit-scrollbar-thumb {
${config.get().ui.showScrollBar ? '' : 'display: none;'}
background-color: rgba(0, 0, 0, 0.3);
}

Expand Down
12 changes: 12 additions & 0 deletions browser/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require('!!style!css!stylus?sourceMap!./global.styl')
import { Route, Switch, Redirect } from 'react-router-dom'
import { ConnectedRouter } from 'connected-react-router'
import DevTools from './DevTools'
import config from 'browser/main/lib/ConfigManager'

require('./lib/ipcClient')
require('../lib/customMeta')
Expand Down Expand Up @@ -77,6 +78,17 @@ document.addEventListener('click', function(e) {
if (infoPanel) infoPanel.style.display = 'none'
})

if (!config.get().ui.showScrollBar) {
document.styleSheets[54].insertRule('::-webkit-scrollbar {display: none}')
document.styleSheets[54].insertRule(
'::-webkit-scrollbar-corner {display: none}'
)

document.styleSheets[54].insertRule(
'::-webkit-scrollbar-thumb {display: none}'
)
}

const el = document.getElementById('content')

function notify(...args) {
Expand Down
1 change: 1 addition & 0 deletions browser/main/lib/ConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const DEFAULT_CONFIG = {
theme: 'default',
showCopyNotification: true,
disableDirectWrite: false,
showScrollBar: true,
defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE'
showMenuBar: false
},
Expand Down
16 changes: 14 additions & 2 deletions browser/main/modals/PreferencesModal/UiTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class UiTab extends React.Component {
enableLiveNoteCounts: this.refs.enableLiveNoteCounts.checked,
showMenuBar: this.refs.showMenuBar.checked,
disableDirectWrite:
this.refs.uiD2w != null ? this.refs.uiD2w.checked : false
this.refs.uiD2w != null ? this.refs.uiD2w.checked : false,
showScrollBar: this.refs.showScrollBar.checked
},
editor: {
theme: this.refs.editorTheme.value,
Expand Down Expand Up @@ -351,7 +352,18 @@ class UiTab extends React.Component {
</label>
</div>
) : null}

<div styleName='group-checkBoxSection'>
<label>
<input
onChange={e => this.handleUIChange(e)}
checked={this.state.config.ui.showScrollBar}
ref='scrollBar'
type='checkBox'
/>
&nbsp;
{i18n.__('Show the scroll bars')}
</label>
</div>
<div styleName='group-header2'>Tags</div>

<div styleName='group-checkBoxSection'>
Expand Down