Skip to content

Commit

Permalink
Merge d6cf220 into cb51af8
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Oct 2, 2019
2 parents cb51af8 + d6cf220 commit cfe67b9
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
2 changes: 2 additions & 0 deletions res/strings/renderer.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ en:
skip: Skip duplicate photos
import: Accept duplicate photos
prompt: Ask me every time
density:
label: DPI
export:
label: Export
note:
Expand Down
8 changes: 7 additions & 1 deletion src/components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ class FormField extends React.PureComponent {
ref={this.setInput}
id={this.props.id}
className="form-control"
max={this.props.max}
min={this.props.min}
name={this.props.name}
placeholder={this.props.placeholder}
tabIndex={this.props.tabIndex}
type="text"
type={this.props.type}
value={this.props.value || ''}
isDisabled={this.props.isDisabled}
isReadOnly={this.props.isReadOnly}
Expand All @@ -168,10 +170,13 @@ class FormField extends React.PureComponent {
isReadOnly: bool,
isRequired: bool,
label: string,
max: number,
min: number,
name: string.isRequired,
placeholder: string,
size: number.isRequired,
tabIndex: number,
type: string.isRequired,
title: string,
value: string,
onBlur: func.isRequired,
Expand All @@ -182,6 +187,7 @@ class FormField extends React.PureComponent {
static defaultProps = {
isReadOnly: false,
size: 8,
type: 'text',
onBlur: noop,
onChange: noop,
onInputChange: noop
Expand Down
4 changes: 4 additions & 0 deletions src/components/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ class Input extends React.PureComponent {
required={this.props.isRequired}
tabIndex={this.props.tabIndex}
type={this.props.type}
max={this.props.max}
min={this.props.min}
value={this.state.value}
onBlur={this.handleBlur}
onChange={this.handleChange}
Expand Down Expand Up @@ -241,6 +243,8 @@ class Input extends React.PureComponent {
isReadOnly: bool,
isRequired: bool,
match: func.isRequired,
max: number,
min: number,
placeholder: string,
resize: bool,
tabIndex: number,
Expand Down
20 changes: 17 additions & 3 deletions src/components/prefs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const React = require('react')
const { TemplateSelect } = require('../template/select')
const { ResourceSelect } = require('../resource/select')
const { ipcRenderer: ipc } = require('electron')
const { ESPER, ITEM } = require('../../constants')
const { ESPER, ITEM, IMPORTS } = require('../../constants')
const { darwin } = require('../../common/os')

const {
Expand All @@ -14,11 +14,12 @@ const {
} = require('../icons')

const {
array, arrayOf, bool, func, object, shape, string
array, arrayOf, bool, func, object, shape, string, number
} = require('prop-types')

const {
FormElement,
FormField,
FormSelect,
FormToggle,
FormToggleGroup,
Expand Down Expand Up @@ -142,6 +143,15 @@ class AppPrefs extends React.PureComponent {
name="force"
value={this.props.settings.title.force}
onChange={this.handleTitleChange}/>
<FormField
id="prefs.app.density.label"
isCompact
max={this.props.importMax}
min={this.props.importMin}
name="density"
onChange={this.props.onSettingsUpdate}
type="number"
value={this.props.settings.density}/>
<hr/>
<FormSelect
id="prefs.app.style.theme"
Expand Down Expand Up @@ -268,6 +278,8 @@ class AppPrefs extends React.PureComponent {
}).isRequired,
layouts: arrayOf(string).isRequired,
locales: arrayOf(string).isRequired,
importMin: number.isRequired,
importMax: number.isRequired,
themes: arrayOf(string).isRequired,
dupOptions: arrayOf(string).isRequired,
zoomModes: arrayOf(string).isRequired,
Expand All @@ -281,7 +293,9 @@ class AppPrefs extends React.PureComponent {
locales: ['de', 'en', 'es', 'fr', 'it', 'ja'],
dupOptions: ['skip', 'import', 'prompt'],
zoomModes: [ESPER.MODE.FIT, ESPER.MODE.FILL],
printModes: ['item', 'photo', 'selection']
printModes: ['item', 'photo', 'selection'],
importMin: IMPORTS.DPIMIN,
importMax: IMPORTS.DPIMAX
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/constants/import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

module.exports = {
RESTORE: 'imports.restore'
RESTORE: 'imports.restore',
DPIMAX: 300,
DPIMIN: 72
}
1 change: 1 addition & 0 deletions src/reducers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { darwin } = require('../common/os')
const defaults = {
debug: ARGS.debug,
dup: 'prompt',
density: 300,
export: {
note: {
format: {
Expand Down

0 comments on commit cfe67b9

Please sign in to comment.