1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes #1265: Fixed column resize on Windows. Also increased minimum and maximum sizes of columns.

This commit is contained in:
Laurent Cozic 2019-02-27 00:13:56 +00:00
parent cf57be6e98
commit 95188b71b8
2 changed files with 10 additions and 6 deletions

View File

@ -34,11 +34,13 @@ class VerticalResizer extends React.PureComponent {
this.setState({
drag: {
startX: event.nativeEvent.screenX,
lastX: event.nativeEvent.screenX,
startX: event.nativeEvent.clientX,
lastX: event.nativeEvent.clientX,
}
});
console.info('START', event.nativeEvent);
if (this.props.onDragStart) this.props.onDragStart({});
}
@ -46,9 +48,11 @@ class VerticalResizer extends React.PureComponent {
// If we got a drag event with no buttons pressed, it's the last drag event
// that we should ignore, because it's sometimes use to put the dragged element
// back to its original position (if there was no valid drop target), which we don't want.
if (!event.nativeEvent.buttons) return;
// Also if clientX, screenX, etc. are 0, it's also the last event and we want to ignore these buggy values.
const e = event.nativeEvent;
if (!e.buttons || (!e.clientX && !e.clientY && !e.screenX && !e.screenY)) return;
const newX = event.nativeEvent.screenX;
const newX = event.nativeEvent.clientX;
const delta = newX - this.state.drag.lastX;
if (!delta) return;

View File

@ -104,8 +104,8 @@ class Setting extends BaseModel {
'style.zoom': {value: 100, type: Setting.TYPE_INT, public: true, appTypes: ['desktop'], section: 'appearance', label: () => _('Global zoom percentage'), minimum: 50, maximum: 500, step: 10},
'style.editor.fontSize': {value: 13, type: Setting.TYPE_INT, public: true, appTypes: ['desktop'], section: 'appearance', label: () => _('Editor font size'), minimum: 4, maximum: 50, step: 1},
'style.editor.fontFamily': {value: "", type: Setting.TYPE_STRING, public: true, appTypes: ['desktop'], section: 'appearance', label: () => _('Editor font family'), description: () => _('This must be *monospace* font or it will not work properly. If the font is incorrect or empty, it will default to a generic monospace font.')},
'style.sidebar.width': {value: 150, minimum: 100, maximum: 200, type: Setting.TYPE_INT, public: false, appTypes: ['desktop'] },
'style.noteList.width': {value: 150, minimum: 100, maximum: 200, type: Setting.TYPE_INT, public: false, appTypes: ['desktop'] },
'style.sidebar.width': {value: 150, minimum: 80, maximum: 400, type: Setting.TYPE_INT, public: false, appTypes: ['desktop'] },
'style.noteList.width': {value: 150, minimum: 80, maximum: 400, type: Setting.TYPE_INT, public: false, appTypes: ['desktop'] },
'autoUpdateEnabled': { value: true, type: Setting.TYPE_BOOL, section:'application', public: true, appTypes: ['desktop'], label: () => _('Automatically update the application') },
'autoUpdate.includePreReleases': { value: false, type: Setting.TYPE_BOOL, section:'application', public: true, appTypes: ['desktop'], label: () => _('Get pre-releases when checking for updates'), description: () => _('See the pre-release page for more details: %s', 'https://joplin.cozic.net/prereleases') },
'clipperServer.autoStart': { value: false, type: Setting.TYPE_BOOL, public: false },