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:
parent
c7f61271a0
commit
6dbc691973
@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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}
|
||||
/>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
50
ElectronClient/app/gui/ToolbarLabel.jsx
Normal file
50
ElectronClient/app/gui/ToolbarLabel.jsx
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user