1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Various bug fixes, optimisations and improvements

This commit is contained in:
Laurent Cozic
2017-07-26 17:49:01 +00:00
parent 81d4810018
commit 76914d6c28
9 changed files with 198 additions and 88 deletions

View File

@@ -279,6 +279,7 @@ const ScreenHeader = connect(
(state) => {
return {
historyCanGoBack: state.historyCanGoBack,
locale: state.settings.locale,
};
}
)(ScreenHeaderComponent)

View File

@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { View, Switch, StyleSheet, Picker, Text, Button } from 'react-native';
import { View, Switch, Slider, StyleSheet, Picker, Text, Button } from 'react-native';
import { connect } from 'react-redux'
import { ScreenHeader } from 'lib/components/screen-header.js';
import { _, setLocale } from 'lib/locale.js';
@@ -21,10 +21,17 @@ let styles = {
color: globalStyle.color,
},
settingControl: {
//color: globalStyle.color,
color: globalStyle.color,
},
}
styles.switchSettingContainer = Object.assign({}, styles.settingContainer);
styles.switchSettingContainer.flexDirection = 'row';
styles.switchSettingContainer.justifyContent = 'space-between';
styles.switchSettingControl = Object.assign({}, styles.settingControl);
delete styles.switchSettingControl.color;
styles = StyleSheet.create(styles);
class ConfigScreenComponent extends BaseScreenComponent {
@@ -82,12 +89,19 @@ class ConfigScreenComponent extends BaseScreenComponent {
);
} else if (setting.type == Setting.TYPE_BOOL) {
return (
<View key={key} style={styles.settingContainer}>
<View key={key} style={styles.switchSettingContainer}>
<Text key="label" style={styles.settingText}>{setting.label()}</Text>
<Switch key="control" style={styles.settingControl} value={value} onValueChange={(value) => updateSettingValue(key, value)} />
<Switch key="control" style={styles.switchSettingControl} value={value} onValueChange={(value) => updateSettingValue(key, value)} />
</View>
);
} else if (setting.type == Setting.TYPE_INT) {
return (
<View key={key} style={styles.settingContainer}>
<Text key="label" style={styles.settingText}>{setting.label()}</Text>
<Slider key="control" style={styles.settingControl} value={value} onValueChange={(value) => updateSettingValue(key, value)} />
</View>
);
} else {
//throw new Error('Unsupported setting type: ' + setting.type);
}

View File

@@ -231,6 +231,7 @@ const SideMenuContent = connect(
selectedFolderId: state.selectedFolderId,
selectedTagId: state.selectedTagId,
notesParentType: state.notesParentType,
locale: state.settings.locale,
};
}
)(SideMenuContentComponent)