This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 830
Zoom/scale setting #1651
Closed
Closed
Zoom/scale setting #1651
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c1c2944
Zoom/scale setting: Initial
monokh af86415
Scale setting: Delayed update without reload
monokh 834b03e
Scale setting: english string
monokh 23a38e6
Scale setting: interface cleanup
monokh c37817e
Scale setting: code review cleanup
monokh cd8eba7
Scale setting: update copyright
monokh 0421f9a
Scale setting: import proptypes in scale slider component
monokh 37802e1
Merge branch 'develop' into scale-setting
monokh ede442e
Scale settings: Font scale initial
monokh a11ada1
Scale settings: only apply setting on value commit
monokh 4511e69
Scale settings: Chat font scale string -en
monokh 20dae9c
Scale settings: relative font scale size
monokh 18cf921
Scale setting: Settings slider default className
monokh bbccc26
Scale setting: appropriate min max for scaling settings
monokh 3eacee0
Scale setting: chat font scale applies to room view only
monokh e6acc65
Scale setting: fix linting errors
monokh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright 2017 Marcel Radzio (MTRNord) | ||
Copyright 2017 Vector Creations Ltd. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import SettingsStore from "../../../settings/SettingsStore"; | ||
|
||
export default class InterfaceScaleSlider extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this._onValueChange = this._onValueChange.bind(this); | ||
} | ||
|
||
componentWillMount() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no point having an empty willMount There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry about the goofs 🙂 updated those now |
||
} | ||
|
||
_onValueChange(e) { | ||
this.props.onValueChange(parseInt(e.target.value)); | ||
} | ||
|
||
render() { | ||
const interfaceScale = SettingsStore.getValue("interfaceScale", null, /*excludeDefault:*/true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comment? |
||
const value = this.props.value || interfaceScale; | ||
return <div className={this.props.className}> | ||
<input type="range" min="70" max="150" step="10" className={this.props.className + "_input"} | ||
onChange={this._onValueChange} value={value} /> | ||
<div className={this.props.className + "_label"}>{ value }%</div> | ||
</div>; | ||
} | ||
} | ||
|
||
InterfaceScaleSlider.propTypes = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can be moved into the body of the class as
|
||
className: React.PropTypes.string, | ||
onValueChange: React.PropTypes.func.isRequired, | ||
value: React.PropTypes.number, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ this needs fixing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should this be changed to? This was a copy from another component. Should I be putting it under my own name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, unless someone else wrote it :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 😄 and also remove
Copyright 2017 Vector Creations
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 😃 hope my name is not taking too much space in the repo