mirror of https://github.com/laurent22/joplin.git
Styling
parent
a2219bedd7
commit
26deb2ceb4
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 326 KiB |
Binary file not shown.
Binary file not shown.
|
@ -10,8 +10,13 @@ class HeaderComponent extends React.Component {
|
|||
this.props.dispatch({ type: 'NAV_BACK' });
|
||||
}
|
||||
|
||||
makeButton(key, options) {
|
||||
return <a key={key} href="#" onClick={() => {options.onClick()}}>{options.title}</a>
|
||||
makeButton(key, style, options) {
|
||||
let icon = null;
|
||||
if (options.iconName) {
|
||||
icon = <i style={{fontSize: style.fontSize * 1.4, marginRight: 5}} className={"icon " + options.iconName}></i>
|
||||
}
|
||||
console.info(style);
|
||||
return <a className="button" style={style} key={key} href="#" onClick={() => {options.onClick()}}>{icon}{options.title}</a>
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -19,20 +24,35 @@ class HeaderComponent extends React.Component {
|
|||
const theme = themeStyle(this.props.theme);
|
||||
const showBackButton = this.props.showBackButton === undefined || this.props.showBackButton === true;
|
||||
style.height = theme.headerHeight;
|
||||
style.display = 'flex';
|
||||
style.flexDirection = 'row';
|
||||
|
||||
const buttons = [];
|
||||
if (showBackButton) {
|
||||
buttons.push(this.makeButton('back', { title: _('Back'), onClick: () => this.back_click() }));
|
||||
buttons.push(this.makeButton('back', {}, { title: _('Back'), onClick: () => this.back_click() }));
|
||||
}
|
||||
|
||||
const buttonStyle = {
|
||||
height: theme.headerHeight,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
paddingLeft: theme.headerButtonHPadding,
|
||||
paddingRight: theme.headerButtonHPadding,
|
||||
color: theme.color,
|
||||
textDecoration: 'none',
|
||||
fontFamily: theme.fontFamily,
|
||||
fontSize: theme.fontSize,
|
||||
boxSizing: 'border-box',
|
||||
};
|
||||
|
||||
if (this.props.buttons) {
|
||||
for (let i = 0; i < this.props.buttons.length; i++) {
|
||||
buttons.push(this.makeButton('btn_' + i, this.props.buttons[i]));
|
||||
buttons.push(this.makeButton('btn_' + i, buttonStyle, this.props.buttons[i]));
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={style}>
|
||||
<div className="header" style={style}>
|
||||
{ buttons }
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -62,11 +62,13 @@ class MainScreenComponent extends React.Component {
|
|||
onClick: () => {
|
||||
this.setState({ newNotePromptVisible: true });
|
||||
},
|
||||
iconName: 'ion-document',
|
||||
}, {
|
||||
title: _('New notebook'),
|
||||
onClick: () => {
|
||||
this.setState({ newFolderPromptVisible: true });
|
||||
},
|
||||
iconName: 'ion-android-folder-open',
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Joplin</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="css/ionicons.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="react-root"></div>
|
||||
|
|
|
@ -29,4 +29,13 @@ body, textarea {
|
|||
|
||||
.side-bar .selected {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.header .button:hover {
|
||||
background-color: rgba(0,160,255,0.1);
|
||||
border: 1px solid rgba(0,160,255,0.5);
|
||||
}
|
||||
|
||||
.header .button {
|
||||
border: 1px solid rgba(0,160,255,0);
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
const { Setting } = require('lib/models/setting.js');
|
||||
|
||||
const globalStyle = {
|
||||
fontSize: 16,
|
||||
fontSize: 13,
|
||||
fontFamily: 'sans-serif',
|
||||
margin: 15, // No text and no interactive component should be within this margin
|
||||
itemMarginTop: 10,
|
||||
itemMarginBottom: 10,
|
||||
backgroundColor: "#ffffff",
|
||||
oddBackgroundColor: "#dddddd",
|
||||
color: "#555555", // For regular text
|
||||
color: "#222222", // For regular text
|
||||
colorError: "red",
|
||||
colorWarn: "#9A5B00",
|
||||
colorFaded: "#777777", // For less important text
|
||||
|
@ -15,24 +16,26 @@ const globalStyle = {
|
|||
dividerColor: "#dddddd",
|
||||
selectedColor: '#e5e5e5',
|
||||
disabledOpacity: 0.3,
|
||||
headerHeight: 20,
|
||||
buttonMinWidth: 50,
|
||||
buttonMinHeight: 30,
|
||||
textAreaLineHeight: 17,
|
||||
|
||||
headerHeight: 35,
|
||||
headerButtonHPadding: 6,
|
||||
|
||||
raisedBackgroundColor: "#0080EF",
|
||||
raisedColor: "#003363",
|
||||
raisedHighlightedColor: "#ffffff",
|
||||
|
||||
// For WebView - must correspond to the properties above
|
||||
htmlFontSize: '16px',
|
||||
htmlColor: 'black', // Note: CSS in WebView component only supports named colors or rgb() notation
|
||||
htmlBackgroundColor: 'white',
|
||||
htmlDividerColor: 'Gainsboro',
|
||||
htmlLinkColor: 'blue',
|
||||
htmlLineHeight: '20px',
|
||||
};
|
||||
|
||||
// For WebView - must correspond to the properties above
|
||||
globalStyle.htmlFontSize =globalStyle.fontSize + 'px';
|
||||
globalStyle.htmlColor ='black'; // Note: CSS in WebView component only supports named colors or rgb() notation
|
||||
globalStyle.htmlBackgroundColor ='white';
|
||||
globalStyle.htmlDividerColor ='Gainsboro';
|
||||
globalStyle.htmlLinkColor ='blue';
|
||||
globalStyle.htmlLineHeight ='20px';
|
||||
|
||||
globalStyle.marginRight = globalStyle.margin;
|
||||
globalStyle.marginLeft = globalStyle.margin;
|
||||
globalStyle.marginTop = globalStyle.margin;
|
||||
|
|
Loading…
Reference in New Issue