From 93f0d3c1cf2a000ea4e061edc1973b45a3b1ac20 Mon Sep 17 00:00:00 2001 From: Callum booth Date: Tue, 19 Mar 2019 20:39:34 +0000 Subject: [PATCH 1/9] fixes #2903 - Rearrange layout of columns --- browser/components/CodeEditor.js | 15 +-- browser/components/MarkdownPreview.js | 2 +- browser/components/MarkdownSplitEditor.js | 91 ++++++++++++++----- browser/components/MarkdownSplitEditor.styl | 9 ++ browser/main/Detail/MarkdownNoteDetail.js | 21 ++++- .../main/Detail/ToggleStackDirectionButton.js | 24 +++++ .../Detail/ToggleStackDirectionButton.styl | 31 +++++++ browser/main/lib/ConfigManager.js | 1 + .../icon/icon-panel-split-horizontal.svg | 36 ++++++++ resources/icon/icon-panel-split-vertical.svg | 36 ++++++++ 10 files changed, 234 insertions(+), 32 deletions(-) create mode 100644 browser/main/Detail/ToggleStackDirectionButton.js create mode 100644 browser/main/Detail/ToggleStackDirectionButton.styl create mode 100644 resources/icon/icon-panel-split-horizontal.svg create mode 100644 resources/icon/icon-panel-split-vertical.svg diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index 6ad294ed..556e2f7b 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -747,14 +747,14 @@ export default class CodeEditor extends React.Component { } incrementLines (start, linesAdded, linesRemoved, editor) { - let highlightedLines = editor.options.linesHighlighted + const highlightedLines = editor.options.linesHighlighted const totalHighlightedLines = highlightedLines.length - let offset = linesAdded - linesRemoved + const offset = linesAdded - linesRemoved // Store new items to be added as we're changing the lines - let newLines = [] + const newLines = [] let i = totalHighlightedLines @@ -1128,10 +1128,12 @@ export default class CodeEditor extends React.Component { render () { const { className, - fontSize + fontSize, + width, + height } = this.props const fontFamily = normalizeEditorFontFamily(this.props.fontFamily) - const width = this.props.width + return (< div className={ className == null ? 'CodeEditor' : `CodeEditor ${className}` @@ -1142,7 +1144,8 @@ export default class CodeEditor extends React.Component { { fontFamily, fontSize: fontSize, - width: width + width: width, + height: height } } onDrop={ diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index a6819ce9..b3ece56a 100755 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -321,7 +321,7 @@ export default class MarkdownPreview extends React.Component { allowCustomCSS, customCSS ) - let body = this.markdown.render(noteContent) + const body = this.markdown.render(noteContent) const files = [this.GetCodeThemeLink(codeBlockTheme), ...CSS_FILES] files.forEach(file => { if (global.process.platform === 'win32') { diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index 4477288a..0d71ab93 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -16,7 +16,8 @@ class MarkdownSplitEditor extends React.Component { this.userScroll = true this.state = { isSliderFocused: false, - codeEditorWidthInPercent: 50 + codeEditorWidthInPercent: 50, + codeEditorHeightInPercent: 50 } } @@ -102,22 +103,41 @@ class MarkdownSplitEditor extends React.Component { handleMouseMove (e) { if (this.state.isSliderFocused) { const rootRect = this.refs.root.getBoundingClientRect() - const rootWidth = rootRect.width - const offset = rootRect.left - let newCodeEditorWidthInPercent = (e.pageX - offset) / rootWidth * 100 + if (this.props.isStacking) { + const rootHeight = rootRect.height + const offset = rootRect.top + let newCodeEditorHeightInPercent = (e.pageY - offset) / rootHeight * 100 - // limit minSize to 10%, maxSize to 90% - if (newCodeEditorWidthInPercent <= 10) { - newCodeEditorWidthInPercent = 10 + // limit minSize to 10%, maxSize to 90% + if (newCodeEditorHeightInPercent <= 10) { + newCodeEditorHeightInPercent = 10 + } + + if (newCodeEditorHeightInPercent >= 90) { + newCodeEditorHeightInPercent = 90 + } + + this.setState({ + codeEditorHeightInPercent: newCodeEditorHeightInPercent + }) + } else { + const rootWidth = rootRect.width + const offset = rootRect.left + let newCodeEditorWidthInPercent = (e.pageX - offset) / rootWidth * 100 + + // limit minSize to 10%, maxSize to 90% + if (newCodeEditorWidthInPercent <= 10) { + newCodeEditorWidthInPercent = 10 + } + + if (newCodeEditorWidthInPercent >= 90) { + newCodeEditorWidthInPercent = 90 + } + + this.setState({ + codeEditorWidthInPercent: newCodeEditorWidthInPercent + }) } - - if (newCodeEditorWidthInPercent >= 90) { - newCodeEditorWidthInPercent = 90 - } - - this.setState({ - codeEditorWidthInPercent: newCodeEditorWidthInPercent - }) } } @@ -136,15 +156,39 @@ class MarkdownSplitEditor extends React.Component { } render () { - const {config, value, storageKey, noteKey, linesHighlighted} = this.props + const {config, value, storageKey, noteKey, linesHighlighted, isStacking} = this.props const storage = findStorage(storageKey) + + const editorStyle = {} + const previewStyle = {} + const sliderStyle = {} + let editorFontSize = parseInt(config.editor.fontSize, 10) if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 + editorStyle.fontSize = editorFontSize + let editorIndentSize = parseInt(config.editor.indentSize, 10) - if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4 - const previewStyle = {} - previewStyle.width = (100 - this.state.codeEditorWidthInPercent) + '%' + if (!(editorStyle.fontSize > 0 && editorStyle.fontSize < 132)) editorIndentSize = 4 + editorStyle.indentSize = editorIndentSize + + if (isStacking) { + editorStyle.width = 100 + '%' + editorStyle.height = this.state.codeEditorHeightInPercent + '%' + previewStyle.width = 100 + '%' + previewStyle.height = (100 - this.state.codeEditorHeightInPercent) + '%' + sliderStyle.left = 0 + sliderStyle.top = this.state.codeEditorHeightInPercent + '%' + } else { + editorStyle.width = this.state.codeEditorWidthInPercent + '%' + editorStyle.height = 100 + '%' + previewStyle.width = (100 - this.state.codeEditorWidthInPercent) + '%' + previewStyle.height = 100 + '%' + sliderStyle.left = this.state.codeEditorWidthInPercent + '%' + sliderStyle.top = 0 + } + if (this.props.ignorePreviewPointerEvents || this.state.isSliderFocused) previewStyle.pointerEvents = 'none' + return (
this.handleMouseMove(e)} @@ -152,19 +196,20 @@ class MarkdownSplitEditor extends React.Component { -
this.handleMouseDown(e)} > +
this.handleMouseDown(e)} >
{ + this.focus() + const newConfig = Object.assign({}, this.props.config) + newConfig.editor.isStacking = type + ConfigManager.set(newConfig) + }) + } + handleDeleteNote () { this.handleTrashButtonClick() } @@ -363,7 +374,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 this.handleClearTodo(e)} percentageOfTodo={getTodoPercentageOfCompleted(note.content)} />
+ {editorType === 'SPLIT' + ? this.handleSwitchStackDirection(e)} isStacking={isStacking} /> + : null + } + this.handleSwitchMode(e)} editorType={editorType} /> this.handleStarButtonClick(e)} diff --git a/browser/main/Detail/ToggleStackDirectionButton.js b/browser/main/Detail/ToggleStackDirectionButton.js new file mode 100644 index 00000000..c16e92e0 --- /dev/null +++ b/browser/main/Detail/ToggleStackDirectionButton.js @@ -0,0 +1,24 @@ +import PropTypes from 'prop-types' +import React from 'react' +import CSSModules from 'browser/lib/CSSModules' +import styles from './ToggleStackDirectionButton.styl' +import i18n from 'browser/lib/i18n' + +const ToggleStackDirectionButton = ({ + onClick, isStacking +}) => ( + +) + +ToggleStackDirectionButton.propTypes = { + onClick: PropTypes.func.isRequired, + isStacking: PropTypes.bool.isRequired +} + +export default CSSModules(ToggleStackDirectionButton, styles) diff --git a/browser/main/Detail/ToggleStackDirectionButton.styl b/browser/main/Detail/ToggleStackDirectionButton.styl new file mode 100644 index 00000000..9d8274f3 --- /dev/null +++ b/browser/main/Detail/ToggleStackDirectionButton.styl @@ -0,0 +1,31 @@ +.control-splitPanelDirection + topBarButtonRight() + position relative + .iconInfo + width 13px + height 13px + &:hover .tooltip + opacity 1 + +.tooltip + tooltip() + position absolute + pointer-events none + top 100% + left 50% + transform translateX(-50%) + white-space nowrap + z-index 200 + padding 5px + line-height normal + border-radius 2px + opacity 0 + transition 0.1s + +.tooltip:lang(ja) + @extend .tooltip + right 35px + +body[data-theme="dark"] + .control-splitPanelDirection + topBarButtonDark() \ No newline at end of file diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index 5558b3bd..bdb55895 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -54,6 +54,7 @@ export const DEFAULT_CONFIG = { delfaultStatus: 'PREVIEW', // 'PREVIEW', 'CODE' scrollPastEnd: false, type: 'SPLIT', // 'SPLIT', 'EDITOR_PREVIEW' + isStacking: false, fetchUrlTitle: true, enableTableEditor: false, enableFrontMatterTitle: true, diff --git a/resources/icon/icon-panel-split-horizontal.svg b/resources/icon/icon-panel-split-horizontal.svg new file mode 100644 index 00000000..c212cfd3 --- /dev/null +++ b/resources/icon/icon-panel-split-horizontal.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + +icon-mode-split-on +Created with Sketch. + + + + + + + + + + + + + + diff --git a/resources/icon/icon-panel-split-vertical.svg b/resources/icon/icon-panel-split-vertical.svg new file mode 100644 index 00000000..ba7f740a --- /dev/null +++ b/resources/icon/icon-panel-split-vertical.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + +icon-mode-split-on +Created with Sketch. + + + + + + + + + + + + + + From a2fb50a71c645e7cdb123c98d9d599f4162e9f89 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Mon, 10 Jun 2019 19:21:33 +0100 Subject: [PATCH 2/9] adds destructed fontFamily from props --- browser/components/CodeEditor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index 093752bb..0e6106c4 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -1128,10 +1128,11 @@ export default class CodeEditor extends React.Component { const { className, fontSize, + fontFamily, width, height } = this.props - const fontFamily = normalizeEditorFontFamily(this.props.fontFamily) + const normalizedFontFamily = normalizeEditorFontFamily(fontFamily) return (< div className={ @@ -1140,7 +1141,7 @@ export default class CodeEditor extends React.Component { ref='root' tabIndex='-1' style={{ - fontFamily, + normalizedFontFamily, fontSize: fontSize, width: width, height: height From ba34458febaf40d0aecf84fff5f9264a15add131 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Mon, 10 Jun 2019 20:27:55 +0100 Subject: [PATCH 3/9] changes if state to be more readable --- browser/components/MarkdownSplitEditor.js | 44 +++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index 8912c289..b2a6ff2b 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -159,9 +159,9 @@ class MarkdownSplitEditor extends React.Component { const {config, value, storageKey, noteKey, linesHighlighted, isStacking} = this.props const storage = findStorage(storageKey) - const editorStyle = {} - const previewStyle = {} - const sliderStyle = {} + let editorStyle = {} + let previewStyle = {} + let sliderStyle = {} let editorFontSize = parseInt(config.editor.fontSize, 10) if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 @@ -171,21 +171,29 @@ class MarkdownSplitEditor extends React.Component { if (!(editorStyle.fontSize > 0 && editorStyle.fontSize < 132)) editorIndentSize = 4 editorStyle.indentSize = editorIndentSize - if (isStacking) { - editorStyle.width = 100 + '%' - editorStyle.height = this.state.codeEditorHeightInPercent + '%' - previewStyle.width = 100 + '%' - previewStyle.height = (100 - this.state.codeEditorHeightInPercent) + '%' - sliderStyle.left = 0 - sliderStyle.top = this.state.codeEditorHeightInPercent + '%' - } else { - editorStyle.width = this.state.codeEditorWidthInPercent + '%' - editorStyle.height = 100 + '%' - previewStyle.width = (100 - this.state.codeEditorWidthInPercent) + '%' - previewStyle.height = 100 + '%' - sliderStyle.left = this.state.codeEditorWidthInPercent + '%' - sliderStyle.top = 0 - } + editorStyle = Object.assign(editorStyle, isStacking ? { + width: '100%', + height: `${this.state.codeEditorHeightInPercent}%` + } : { + width: `${this.state.codeEditorWidthInPercent}%`, + height: '100%' + }) + + previewStyle = Object.assign(previewStyle, isStacking ? { + width: '100%', + height: `${100 - this.state.codeEditorHeightInPercent}%` + } : { + width: `${100 - this.state.codeEditorWidthInPercent}%`, + height: '100%' + }) + + sliderStyle = Object.assign(sliderStyle, isStacking ? { + left: 0, + top: `${this.state.codeEditorHeightInPercent}%` + } : { + left: `${this.state.codeEditorWidthInPercent}%`, + top: 0 + }) if (this.props.ignorePreviewPointerEvents || this.state.isSliderFocused) previewStyle.pointerEvents = 'none' From 218fba1aa17bfc53fe068eb11fdd35bf7a86e4fa Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Wed, 9 Oct 2019 12:41:26 +0100 Subject: [PATCH 4/9] fix formatting --- browser/components/CodeEditor.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index cfa0c637..24c573b5 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -1173,8 +1173,7 @@ export default class CodeEditor extends React.Component { fontSize: fontSize, width: width, height: height - } - } + }} onDrop={ e => this.handleDropImage(e) } From 1993a6588da298816589bead2e2839502dd55987 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Wed, 9 Oct 2019 12:45:52 +0100 Subject: [PATCH 5/9] Cleans up toggle button component --- .../main/Detail/ToggleStackDirectionButton.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/browser/main/Detail/ToggleStackDirectionButton.js b/browser/main/Detail/ToggleStackDirectionButton.js index c16e92e0..fb65a9bb 100644 --- a/browser/main/Detail/ToggleStackDirectionButton.js +++ b/browser/main/Detail/ToggleStackDirectionButton.js @@ -6,15 +6,16 @@ import i18n from 'browser/lib/i18n' const ToggleStackDirectionButton = ({ onClick, isStacking -}) => ( - -) +}) => { + const imgSrc = isStacking ? '../resources/icon/icon-panel-split-vertical.svg' : '../resources/icon/icon-panel-split-horizontal.svg' + const text = isStacking ? i18n.__('Split Panels Horizontally') : i18n.__('Split Panels Vertically') + return ( + + ) +} ToggleStackDirectionButton.propTypes = { onClick: PropTypes.func.isRequired, From 59e361cb37e90a3d410f53cea687117637cf2c5c Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Wed, 9 Oct 2019 12:59:53 +0100 Subject: [PATCH 6/9] move config value into ui --- browser/main/Detail/MarkdownNoteDetail.js | 4 ++-- browser/main/lib/ConfigManager.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index ad954d9e..bb0b7df5 100755 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -47,7 +47,7 @@ class MarkdownNoteDetail extends React.Component { isLockButtonShown: props.config.editor.type !== 'SPLIT', isLocked: false, editorType: props.config.editor.type, - isStacking: props.config.editor.isStacking, + isStacking: props.config.ui.isStacking, switchPreview: props.config.editor.switchPreview } @@ -360,7 +360,7 @@ class MarkdownNoteDetail extends React.Component { this.setState({ isStacking: type }, () => { this.focus() const newConfig = Object.assign({}, this.props.config) - newConfig.editor.isStacking = type + newConfig.ui.isStacking = type ConfigManager.set(newConfig) }) } diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index 9e995682..1d4dc69e 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -42,7 +42,8 @@ export const DEFAULT_CONFIG = { showCopyNotification: true, disableDirectWrite: false, defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE' - showMenuBar: false + showMenuBar: false, + isStacking: false }, editor: { theme: 'base16-light', @@ -62,7 +63,6 @@ export const DEFAULT_CONFIG = { delfaultStatus: 'PREVIEW', // 'PREVIEW', 'CODE' scrollPastEnd: false, type: 'SPLIT', // 'SPLIT', 'EDITOR_PREVIEW' - isStacking: false, fetchUrlTitle: true, enableTableEditor: false, enableFrontMatterTitle: true, From a7ead67c2d91a6f0e3297688d619eb1b62d39ff9 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Sat, 18 Apr 2020 14:17:08 +0100 Subject: [PATCH 7/9] moves orientation button to view menu --- browser/main/Detail/MarkdownNoteDetail.js | 28 ++++++++-------- .../main/Detail/ToggleStackDirectionButton.js | 32 ------------------- .../Detail/ToggleStackDirectionButton.styl | 31 ------------------ lib/main-menu.js | 6 ++++ 4 files changed, 19 insertions(+), 78 deletions(-) delete mode 100644 browser/main/Detail/ToggleStackDirectionButton.js delete mode 100644 browser/main/Detail/ToggleStackDirectionButton.styl diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index 70de80a9..12553d04 100755 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -23,7 +23,6 @@ import RestoreButton from './RestoreButton' import PermanentDeleteButton from './PermanentDeleteButton' import InfoButton from './InfoButton' import ToggleModeButton from './ToggleModeButton' -import ToggleStackDirectionButton from './ToggleStackDirectionButton' import InfoPanel from './InfoPanel' import InfoPanelTrashed from './InfoPanelTrashed' import { formatDate } from 'browser/lib/date-formatter' @@ -60,6 +59,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 +67,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', () => { @@ -393,13 +394,16 @@ class MarkdownNoteDetail extends React.Component { ) } - handleSwitchStackDirection(type) { - this.setState({ isStacking: type }, () => { - this.focus() - const newConfig = Object.assign({}, this.props.config) - newConfig.ui.isStacking = type - ConfigManager.set(newConfig) - }) + 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() { @@ -476,7 +480,7 @@ class MarkdownNoteDetail extends React.Component { render() { const { data, dispatch, location, config } = this.props - const { note, editorType, isStacking } = this.state + const { note, editorType } = this.state const storageKey = note.storage const folderKey = note.folder @@ -553,12 +557,6 @@ class MarkdownNoteDetail extends React.Component { />
- {editorType === 'SPLIT' ? ( - this.handleSwitchStackDirection(e)} - isStacking={isStacking} - /> - ) : null} this.handleSwitchMode(e)} editorType={editorType} diff --git a/browser/main/Detail/ToggleStackDirectionButton.js b/browser/main/Detail/ToggleStackDirectionButton.js deleted file mode 100644 index f3a0ac48..00000000 --- a/browser/main/Detail/ToggleStackDirectionButton.js +++ /dev/null @@ -1,32 +0,0 @@ -import PropTypes from 'prop-types' -import React from 'react' -import CSSModules from 'browser/lib/CSSModules' -import styles from './ToggleStackDirectionButton.styl' -import i18n from 'browser/lib/i18n' - -const ToggleStackDirectionButton = ({ onClick, isStacking }) => { - const imgSrc = isStacking - ? '../resources/icon/icon-panel-split-vertical.svg' - : '../resources/icon/icon-panel-split-horizontal.svg' - const text = isStacking - ? i18n.__('Split Panels Horizontally') - : i18n.__('Split Panels Vertically') - return ( - - ) -} - -ToggleStackDirectionButton.propTypes = { - onClick: PropTypes.func.isRequired, - isStacking: PropTypes.bool.isRequired -} - -export default CSSModules(ToggleStackDirectionButton, styles) diff --git a/browser/main/Detail/ToggleStackDirectionButton.styl b/browser/main/Detail/ToggleStackDirectionButton.styl deleted file mode 100644 index 9d8274f3..00000000 --- a/browser/main/Detail/ToggleStackDirectionButton.styl +++ /dev/null @@ -1,31 +0,0 @@ -.control-splitPanelDirection - topBarButtonRight() - position relative - .iconInfo - width 13px - height 13px - &:hover .tooltip - opacity 1 - -.tooltip - tooltip() - position absolute - pointer-events none - top 100% - left 50% - transform translateX(-50%) - white-space nowrap - z-index 200 - padding 5px - line-height normal - border-radius 2px - opacity 0 - transition 0.1s - -.tooltip:lang(ja) - @extend .tooltip - right 35px - -body[data-theme="dark"] - .control-splitPanelDirection - topBarButtonDark() \ No newline at end of file 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' }, From d138a54dfd45b9a303629317a4a99ebe80b666a7 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Mon, 20 Apr 2020 08:42:45 +0100 Subject: [PATCH 8/9] fix accidental deletion of rtl state --- browser/main/Detail/MarkdownNoteDetail.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index 12553d04..9007989e 100755 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -51,7 +51,8 @@ class MarkdownNoteDetail extends React.Component { isLockButtonShown: props.config.editor.type !== 'SPLIT', isLocked: false, editorType: props.config.editor.type, - switchPreview: props.config.editor.switchPreview + switchPreview: props.config.editor.switchPreview, + RTL: false } this.dispatchTimer = null From c355f81525bb41b40fc428ff08af42950c2df5e0 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Mon, 20 Apr 2020 08:43:01 +0100 Subject: [PATCH 9/9] remove redundant icons --- .../icon/icon-panel-split-horizontal.svg | 36 ------------------- resources/icon/icon-panel-split-vertical.svg | 36 ------------------- 2 files changed, 72 deletions(-) delete mode 100644 resources/icon/icon-panel-split-horizontal.svg delete mode 100644 resources/icon/icon-panel-split-vertical.svg diff --git a/resources/icon/icon-panel-split-horizontal.svg b/resources/icon/icon-panel-split-horizontal.svg deleted file mode 100644 index c212cfd3..00000000 --- a/resources/icon/icon-panel-split-horizontal.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - -icon-mode-split-on -Created with Sketch. - - - - - - - - - - - - - - diff --git a/resources/icon/icon-panel-split-vertical.svg b/resources/icon/icon-panel-split-vertical.svg deleted file mode 100644 index ba7f740a..00000000 --- a/resources/icon/icon-panel-split-vertical.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - -icon-mode-split-on -Created with Sketch. - - - - - - - - - - - - - -