this.handleMouseDown(e)}
>
diff --git a/browser/components/MarkdownSplitEditor.styl b/browser/components/MarkdownSplitEditor.styl
index 49bd927a..2722f13d 100644
--- a/browser/components/MarkdownSplitEditor.styl
+++ b/browser/components/MarkdownSplitEditor.styl
@@ -3,6 +3,7 @@
height 100%
font-size 30px
display flex
+ flex-wrap wrap
.slider
absolute top bottom
top -2px
@@ -15,6 +16,14 @@
left -3px
z-index 10
cursor col-resize
+ .slider-hoz
+ absolute left right
+ .slider-hitbox
+ absolute left right
+ width: 100%
+ height 7px
+ cursor row-resize
+
apply-theme(theme)
body[data-theme={theme}]
diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js
index 7770252b..9007989e 100755
--- a/browser/main/Detail/MarkdownNoteDetail.js
+++ b/browser/main/Detail/MarkdownNoteDetail.js
@@ -60,6 +60,7 @@ class MarkdownNoteDetail extends React.Component {
this.toggleLockButton = this.handleToggleLockButton.bind(this)
this.generateToc = this.handleGenerateToc.bind(this)
this.handleUpdateContent = this.handleUpdateContent.bind(this)
+ this.handleSwitchStackDirection = this.handleSwitchStackDirection.bind(this)
}
focus() {
@@ -67,6 +68,7 @@ class MarkdownNoteDetail extends React.Component {
}
componentDidMount() {
+ ee.on('editor:orientation', this.handleSwitchStackDirection)
ee.on('topbar:togglelockbutton', this.toggleLockButton)
ee.on('topbar:toggledirectionbutton', () => this.handleSwitchDirection())
ee.on('topbar:togglemodebutton', () => {
@@ -383,7 +385,7 @@ class MarkdownNoteDetail extends React.Component {
handleSwitchMode(type) {
// If in split mode, hide the lock button
this.setState(
- { editorType: type, isLockButtonShown: !(type === 'SPLIT') },
+ { editorType: type, isLockButtonShown: type !== 'SPLIT' },
() => {
this.focus()
const newConfig = Object.assign({}, this.props.config)
@@ -393,6 +395,18 @@ class MarkdownNoteDetail extends React.Component {
)
}
+ handleSwitchStackDirection() {
+ this.setState(
+ prevState => ({ isStacking: !prevState.isStacking }),
+ () => {
+ this.focus()
+ const newConfig = Object.assign({}, this.props.config)
+ newConfig.ui.isStacking = this.state.isStacking
+ ConfigManager.set(newConfig)
+ }
+ )
+ }
+
handleSwitchDirection() {
if (!this.props.config.editor.rtlEnabled) {
return
@@ -429,7 +443,7 @@ class MarkdownNoteDetail extends React.Component {
renderEditor() {
const { config, ignorePreviewPointerEvents } = this.props
- const { note } = this.state
+ const { note, isStacking } = this.state
if (this.state.editorType === 'EDITOR_PREVIEW') {
return (
@@ -455,6 +469,7 @@ class MarkdownNoteDetail extends React.Component {
value={note.content}
storageKey={note.storage}
noteKey={note.key}
+ isStacking={isStacking}
linesHighlighted={note.linesHighlighted}
onChange={this.handleUpdateContent}
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js
index 81c2cbb7..a0b23fc2 100644
--- a/browser/main/lib/ConfigManager.js
+++ b/browser/main/lib/ConfigManager.js
@@ -71,7 +71,8 @@ export const DEFAULT_CONFIG = {
disableDirectWrite: false,
showScrollBar: true,
defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE'
- showMenuBar: false
+ showMenuBar: false,
+ isStacking: false
},
editor: {
theme: 'base16-light',
diff --git a/lib/main-menu.js b/lib/main-menu.js
index 7caef0bf..0c91cf1f 100644
--- a/lib/main-menu.js
+++ b/lib/main-menu.js
@@ -314,6 +314,12 @@ const view = {
mainWindow.webContents.send('editor:fullscreen')
}
},
+ {
+ label: 'Toggle Editor Orientation',
+ click() {
+ mainWindow.webContents.send('editor:orientation')
+ }
+ },
{
type: 'separator'
},