Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 99bf216

Browse files
committed
Fix image background
1 parent 6ce60dc commit 99bf216

10 files changed

Lines changed: 278 additions & 187 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules/
22
build/
33
tools/settings.json
4-
lightm-webkit2-material2*.tar.gz
4+
lightdm-webkit2-material2*.tar.gz

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"scripts": {
88
"test": "echo \"Error: no test specified\" && exit 1",
99
"dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress",
10-
"build": "cross-env NODE_ENV=production webpack -p --progress",
10+
"build": "tools/build.js",
1111
"clean": "rm -rf build/*",
12-
"package": "npm run build && tar -C build -cvzf lightdm-webkit2-material2-0.0.1-3.tar.gz .",
13-
"translate": "node tools/translate.js",
12+
"translate": "tools/translate.js",
1413
"preinstall": "git submodule update --init --recursive"
1514
},
1615
"repository": {

src/components/About.jsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
CardText
1515
} from 'material-ui/Card';
1616
import {FormattedMessage} from 'react-intl';
17+
const PackageConfig = require('../../package.json');
1718

1819
export default class About extends React.PureComponent {
1920
constructor(props) {
@@ -39,23 +40,25 @@ export default class About extends React.PureComponent {
3940
}}><FormattedMessage id="settingAProfileIcon" defaultMessage="Setting a profile icon"/></h4>
4041
<br/>
4142
<small><FormattedMessage id="seeForMoreInfo" defaultMessage="See {link} for more info." values={{
42-
link: <i key="link" style={{
43-
wordBreak: 'break-all'
44-
}}>https://github.com/Antergos/lightdm-webkit2-greeter/tree/master/themes/antergos#user-icons-management</i>
45-
}}/></small>
43+
link: <i key="link" style={{
44+
wordBreak: 'break-all'
45+
}}>https://github.com/Antergos/lightdm-webkit2-greeter/tree/master/themes/antergos#user-icons-management</i>
46+
}}/></small>
4647
<br/><br/>
47-
<div style={{
48+
<section style={{
4849
textAlign: 'center'
4950
}}>
50-
<small>Crafted with
51-
&nbsp;<i className="fa fa-heart"></i>&nbsp;
52-
in the USA.</small>
53-
</div>
51+
<small>Crafted with &nbsp;<i className="fa fa-heart"></i>&nbsp; in the USA.</small>
52+
<br/>
53+
<small style={{fontSize: '0.6em', color: 'grey'}}><FormattedMessage id="version" defaultMessage="Version {version}" values={{
54+
version: PackageConfig.version + '-' + PackageConfig.subversion
55+
}}/></small>
56+
</section>
5457
</div>https://github.com/Antergos/lightdm-webkit2-greeter/tree/master/themes/antergos#user-icons-management
5558
<CardActions>
5659
<FlatButton style={{
5760
width: 100 + '%'
58-
}} icon={< i className = "fa fa-undo" > </i>} onTouchTap={() => this.props.router.push('/login')} label={<FormattedMessage id="back" defaultMessage="Back"/>}/>
61+
}} icon={< i className = "fa fa-undo" > </i>} onTouchTap={() => this.props.router.push('/login')} label={< FormattedMessage id = "back" defaultMessage = "Back" />}/>
5962
</CardActions>
6063
</Card>
6164
);

src/components/Background.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Clock from 'react-clockwall';
44
import Trianglify from './background/Trianglify.jsx';
55
import Zodiac from './background/Zodiac.jsx';
66
import RandomImage from './background/RandomImage.jsx';
7+
import Image from './background/Image.jsx';
78

89
const Denque = require("denque");
910

@@ -78,16 +79,13 @@ class Background extends React.PureComponent {
7879
return true;
7980
}
8081
updateBackground(settings = this.props.settings) {
81-
this.style = Style;
8282
this.background = null;
8383
switch (settings.backgroundEngine) {
8484
case 'zodiac':
8585
this.background = <Zodiac colors={settings.backgroundColorScheme} density={settings.zodiacDensity}/>;
8686
break;
8787
case 'image':
88-
this.style = Object.assign({}, Style, {
89-
backgroundImage: 'url(\'file://' + settings.backgroundImageLocation + '\'), url(\'' + require('../static/no-mans-sky.jpg') + '\')'
90-
});
88+
this.background = <Image path={settings.backgroundImageLocation}/>;
9189
break;
9290
case 'random-image':
9391
this.background = <RandomImage directory={settings.backgroundImagesDirectory}/>;
@@ -130,7 +128,7 @@ class Background extends React.PureComponent {
130128
}
131129
render() {
132130
return (
133-
<div style={this.style}>
131+
<div style={Style}>
134132
{this.background}
135133
{this.clock}
136134
</div>

0 commit comments

Comments
 (0)