1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-23 18:53:36 +02:00

Fixing locale and making the Notebook name no longer behave like a button.

This commit is contained in:
Ladislav Benc 2018-06-06 14:11:46 +02:00
parent c7f61271a0
commit 6dbc691973
3 changed files with 56 additions and 2 deletions

View File

@ -840,8 +840,9 @@ class NoteTextComponent extends React.Component {
&& this.state.folder !== null
&& this.props.notesParentType == 'Search') {
toolbarItems.push({
title: _(this.state.folder.title),
title: this.state.folder.title,
iconName: 'fa-folder-o',
type: 'text',
});
}

View File

@ -4,6 +4,7 @@ const { reg } = require('lib/registry.js');
const { themeStyle } = require('../theme.js');
const { _ } = require('lib/locale.js');
const ToolbarButton = require('./ToolbarButton.min.js');
const ToolbarLabel = require('./ToolbarLabel.min.js');
class ToolbarComponent extends React.Component {
@ -35,7 +36,9 @@ class ToolbarComponent extends React.Component {
{...props}
/>);
} else if (itemType === 'text') {
itemComps.push(<ToolbarLabel
{...props}
/>);
}
}
}

View File

@ -0,0 +1,50 @@
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');
class ToolbarLabel extends React.Component {
render() {
const theme = themeStyle(this.props.theme);
const style = {
height: theme.toolbarHeight,
minWidth: theme.toolbarHeight,
display: 'flex',
alignItems: 'center',
paddingLeft: theme.headerButtonHPadding,
paddingRight: theme.headerButtonHPadding,
color: theme.color,
textDecoration: 'none',
fontFamily: theme.fontFamily,
fontSize: theme.fontSize,
boxSizing: 'border-box',
cursor: 'default',
justifyContent: 'center',
};
let icon = null;
if (this.props.iconName) {
const iconStyle = {
fontSize: Math.round(theme.fontSize * 1.4),
color: theme.color
};
if (this.props.title) iconStyle.marginRight = 5;
icon = <i style={iconStyle} className={"fa " + this.props.iconName}></i>
}
let classes = [];
return (
<a
className={classes.join(' ')}
style={style}
href="#"
>
{icon}{this.props.title ? this.props.title : ''}
</a>
);
}
}
module.exports = ToolbarLabel;