FIx roomsublist heights.

- also fiddles the font size numbers
This commit is contained in:
Jorik Schellekens 2020-05-13 22:08:29 +01:00
parent 20ec900405
commit fc6e5227ac
8 changed files with 26 additions and 18 deletions

View file

@ -69,7 +69,7 @@ limitations under the License.
height: 100%; height: 100%;
} }
.mx_TagPanel .mx_TagPanel_tagTileContainer > div { .mx_TagPanel .mx_TagPanel_tagTileContainer > div {
height: $font-40px; height: 40px;
padding: 10px 0 9px 0; padding: 10px 0 9px 0;
} }

View file

@ -20,7 +20,7 @@ limitations under the License.
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
height: $font-34px; height: 32px;
margin: 0; margin: 0;
padding: 0 8px 0 10px; padding: 0 8px 0 10px;
position: relative; position: relative;
@ -81,6 +81,7 @@ limitations under the License.
.mx_RoomTile_avatar_container { .mx_RoomTile_avatar_container {
position: relative; position: relative;
display: flex;
} }
.mx_RoomTile_avatar { .mx_RoomTile_avatar {

View file

@ -32,7 +32,7 @@ import RoomTile from "../views/rooms/RoomTile";
import LazyRenderList from "../views/elements/LazyRenderList"; import LazyRenderList from "../views/elements/LazyRenderList";
import {_t} from "../../languageHandler"; import {_t} from "../../languageHandler";
import {RovingTabIndexWrapper} from "../../accessibility/RovingTabIndex"; import {RovingTabIndexWrapper} from "../../accessibility/RovingTabIndex";
import {toRem} from "../../utils/rem"; import {toPx} from "../../utils/units";
// turn this on for drop & drag console debugging galore // turn this on for drop & drag console debugging galore
const debug = false; const debug = false;
@ -420,7 +420,7 @@ export default class RoomSubList extends React.PureComponent {
setHeight = (height) => { setHeight = (height) => {
if (this._subList.current) { if (this._subList.current) {
this._subList.current.style.height = toRem(height); this._subList.current.style.height = toPx(height);
} }
this._updateLazyRenderHeight(height); this._updateLazyRenderHeight(height);
}; };

View file

@ -24,7 +24,7 @@ import * as AvatarLogic from '../../../Avatar';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
import AccessibleButton from '../elements/AccessibleButton'; import AccessibleButton from '../elements/AccessibleButton';
import MatrixClientContext from "../../../contexts/MatrixClientContext"; import MatrixClientContext from "../../../contexts/MatrixClientContext";
import {toRem} from "../../../utils/rem"; import {toPx} from "../../../utils/units";
export default createReactClass({ export default createReactClass({
displayName: 'BaseAvatar', displayName: 'BaseAvatar',
@ -166,9 +166,9 @@ export default createReactClass({
const textNode = ( const textNode = (
<span className="mx_BaseAvatar_initial" aria-hidden="true" <span className="mx_BaseAvatar_initial" aria-hidden="true"
style={{ style={{
fontSize: toRem(width * 0.65), fontSize: toPx(width * 0.65),
width: toRem(width), width: toPx(width),
lineHeight: toRem(height), lineHeight: toPx(height),
}} }}
> >
{ initialLetter } { initialLetter }
@ -179,8 +179,8 @@ export default createReactClass({
alt="" title={title} onError={this.onError} alt="" title={title} onError={this.onError}
aria-hidden="true" aria-hidden="true"
style={{ style={{
width: toRem(width), width: toPx(width),
height: toRem(height) height: toPx(height)
}} /> }} />
); );
if (onClick != null) { if (onClick != null) {
@ -210,8 +210,8 @@ export default createReactClass({
onClick={onClick} onClick={onClick}
onError={this.onError} onError={this.onError}
style={{ style={{
width: toRem(width), width: toPx(width),
height: toRem(height), height: toPx(height),
}} }}
title={title} alt="" title={title} alt=""
inputRef={inputRef} inputRef={inputRef}
@ -224,8 +224,8 @@ export default createReactClass({
src={imageUrl} src={imageUrl}
onError={this.onError} onError={this.onError}
style={{ style={{
width: toRem(width), width: toPx(width),
height: toRem(height), height: toPx(height),
}} }}
title={title} alt="" title={title} alt=""
ref={inputRef} ref={inputRef}

View file

@ -34,7 +34,7 @@ import {ALL_RULE_TYPES} from "../../../mjolnir/BanList";
import * as ObjectUtils from "../../../ObjectUtils"; import * as ObjectUtils from "../../../ObjectUtils";
import MatrixClientContext from "../../../contexts/MatrixClientContext"; import MatrixClientContext from "../../../contexts/MatrixClientContext";
import {E2E_STATE} from "./E2EIcon"; import {E2E_STATE} from "./E2EIcon";
import {toRem} from "../../../utils/rem"; import {toRem} from "../../../utils/units";
const eventTileTypes = { const eventTileTypes = {
'm.room.message': 'messages.MessageEvent', 'm.room.message': 'messages.MessageEvent',

View file

@ -23,7 +23,7 @@ import { _t } from '../../../languageHandler';
import {formatDate} from '../../../DateUtils'; import {formatDate} from '../../../DateUtils';
import Velociraptor from "../../../Velociraptor"; import Velociraptor from "../../../Velociraptor";
import * as sdk from "../../../index"; import * as sdk from "../../../index";
import {toRem} from "../../../utils/rem"; import {toRem} from "../../../utils/units";
let bounce = false; let bounce = false;
try { try {

View file

@ -252,7 +252,7 @@ export default class AppearanceUserSettingsTab extends React.Component {
<div className="mx_AppearanceUserSettingsTab_fontSlider"> <div className="mx_AppearanceUserSettingsTab_fontSlider">
<div className="mx_AppearanceUserSettingsTab_fontSlider_smallText">Aa</div> <div className="mx_AppearanceUserSettingsTab_fontSlider_smallText">Aa</div>
<Slider <Slider
values={[13, 14, 15, 18, 20]} values={[13, 15, 16, 18, 20]}
value={this.state.fontSize} value={this.state.fontSize}
onSelectionChange={this._onFontSizeChanged} onSelectionChange={this._onFontSizeChanged}
displayFunc={value => {}} displayFunc={value => {}}

View file

@ -14,7 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* Simple utils for formatting style values
*/
// converts a pixel value to rem. // converts a pixel value to rem.
export function toRem(pixelValue) { export function toRem(pixelValue: number): string {
return pixelValue / 15 + "rem"; return pixelValue / 15 + "rem";
} }
export function toPx(pixelValue: number): string {
return pixelValue + "px";
}