Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7dae2d4

Browse files
committed
Deprecate Tinter and TintableSVG
1 parent a8f5b7e commit 7dae2d4

File tree

12 files changed

+8
-604
lines changed

12 files changed

+8
-604
lines changed

src/Tinter.js

Lines changed: 0 additions & 458 deletions
This file was deleted.

src/components/structures/GroupView.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,11 @@ class CategoryRoomList extends React.Component {
126126
};
127127

128128
render() {
129-
const TintableSvg = sdk.getComponent("elements.TintableSvg");
130129
const addButton = this.props.editing ?
131130
(<AccessibleButton className="mx_GroupView_featuredThings_addButton"
132131
onClick={this.onAddRoomsToSummaryClicked}
133132
>
134-
<TintableSvg src={require("../../../res/img/icons-create-room.svg")} width="64" height="64" />
133+
<img src={require("../../../res/img/icons-create-room.svg")} width="64" height="64" />
135134
<div className="mx_GroupView_featuredThings_addButton_label">
136135
{ _t('Add a Room') }
137136
</div>
@@ -300,10 +299,9 @@ class RoleUserList extends React.Component {
300299
};
301300

302301
render() {
303-
const TintableSvg = sdk.getComponent("elements.TintableSvg");
304302
const addButton = this.props.editing ?
305303
(<AccessibleButton className="mx_GroupView_featuredThings_addButton" onClick={this.onAddUsersClicked}>
306-
<TintableSvg src={require("../../../res/img/icons-create-room.svg")} width="64" height="64" />
304+
<img src={require("../../../res/img/icons-create-room.svg")} width="64" height="64" />
307305
<div className="mx_GroupView_featuredThings_addButton_label">
308306
{ _t('Add a User') }
309307
</div>
@@ -855,7 +853,6 @@ export default class GroupView extends React.Component {
855853
_getRoomsNode() {
856854
const RoomDetailList = sdk.getComponent('rooms.RoomDetailList');
857855
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
858-
const TintableSvg = sdk.getComponent('elements.TintableSvg');
859856
const Spinner = sdk.getComponent('elements.Spinner');
860857
const TooltipButton = sdk.getComponent('elements.TooltipButton');
861858

@@ -871,7 +868,7 @@ export default class GroupView extends React.Component {
871868
onClick={this._onAddRoomsClick}
872869
>
873870
<div className="mx_GroupView_rooms_header_addRow_button">
874-
<TintableSvg src={require("../../../res/img/icons-room-add.svg")} width="24" height="24" />
871+
<img src={require("../../../res/img/icons-room-add.svg")} width="24" height="24" />
875872
</div>
876873
<div className="mx_GroupView_rooms_header_addRow_label">
877874
{ _t('Add rooms to this community') }

src/components/structures/MatrixChat.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import dis from "../../dispatcher/dispatcher";
3434
import Notifier from '../../Notifier';
3535

3636
import Modal from "../../Modal";
37-
import Tinter from "../../Tinter";
3837
import * as sdk from '../../index';
3938
import { showRoomInviteDialog, showStartChatInviteDialog } from '../../RoomInvite';
4039
import * as Rooms from '../../Rooms';
@@ -283,11 +282,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
283282

284283
this.pageChanging = false;
285284

286-
// check we have the right tint applied for this theme.
287-
// N.B. we don't call the whole of setTheme() here as we may be
288-
// racing with the theme CSS download finishing from index.js
289-
Tinter.tint();
290-
291285
// For PersistentElement
292286
this.state.resizeNotifier.on("middlePanelResized", this.dispatchTimelineResize);
293287

@@ -1573,10 +1567,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
15731567
});
15741568
}
15751569
});
1576-
// Fire the tinter right on startup to ensure the default theme is applied
1577-
// A later sync can/will correct the tint to be the right value for the user
1578-
const colorScheme = SettingsStore.getValue("roomColor");
1579-
Tinter.tint(colorScheme.primary_color, colorScheme.secondary_color);
15801570
}
15811571

15821572
/**

src/components/structures/MyGroups.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default class MyGroups extends React.Component {
123123
</div>
124124
{/*<div className="mx_MyGroups_joinBox mx_MyGroups_headerCard">
125125
<AccessibleButton className='mx_MyGroups_headerCard_button' onClick={this._onJoinGroupClick}>
126-
<TintableSvg src={require("../../../res/img/icons-create-room.svg")} width="50" height="50" />
126+
<img src={require("../../../res/img/icons-create-room.svg")} width="50" height="50" />
127127
</AccessibleButton>
128128
<div className="mx_MyGroups_headerCard_content">
129129
<div className="mx_MyGroups_headerCard_header">

src/components/structures/RoomView.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import Modal from '../../Modal';
3737
import * as sdk from '../../index';
3838
import CallHandler, { PlaceCallType } from '../../CallHandler';
3939
import dis from '../../dispatcher/dispatcher';
40-
import Tinter from '../../Tinter';
4140
import rateLimitedFunc from '../../ratelimitedfunc';
4241
import * as Rooms from '../../Rooms';
4342
import eventSearch, { searchPagination } from '../../Searching';
@@ -677,10 +676,6 @@ export default class RoomView extends React.Component<IProps, IState> {
677676
// cancel any pending calls to the rate_limited_funcs
678677
this.updateRoomMembers.cancelPendingCall();
679678

680-
// no need to do this as Dir & Settings are now overlays. It just burnt CPU.
681-
// console.log("Tinter.tint from RoomView.unmount");
682-
// Tinter.tint(); // reset colourscheme
683-
684679
for (const watcher of this.settingWatchers) {
685680
SettingsStore.unwatchSetting(watcher);
686681
}
@@ -1030,10 +1025,6 @@ export default class RoomView extends React.Component<IProps, IState> {
10301025
private updateTint() {
10311026
const room = this.state.room;
10321027
if (!room) return;
1033-
1034-
console.log("Tinter.tint from updateTint");
1035-
const colorScheme = SettingsStore.getValue("roomColor", room.roomId);
1036-
Tinter.tint(colorScheme.primary_color, colorScheme.secondary_color);
10371028
}
10381029

10391030
private onAccountData = (event: MatrixEvent) => {
@@ -1047,12 +1038,7 @@ export default class RoomView extends React.Component<IProps, IState> {
10471038
private onRoomAccountData = (event: MatrixEvent, room: Room) => {
10481039
if (room.roomId == this.state.roomId) {
10491040
const type = event.getType();
1050-
if (type === "org.matrix.room.color_scheme") {
1051-
const colorScheme = event.getContent();
1052-
// XXX: we should validate the event
1053-
console.log("Tinter.tint from onRoomAccountData");
1054-
Tinter.tint(colorScheme.primary_color, colorScheme.secondary_color);
1055-
} else if (type === "org.matrix.room.preview_urls" || type === "im.vector.web.settings") {
1041+
if (type === "org.matrix.room.preview_urls" || type === "im.vector.web.settings") {
10561042
// non-e2ee url previews are stored in legacy event type `org.matrix.room.preview_urls`
10571043
this.updatePreviewUrlVisibility(room);
10581044
}

src/components/views/elements/ActionButton.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ export default class ActionButton extends React.Component {
6262
};
6363

6464
render() {
65-
const TintableSvg = sdk.getComponent("elements.TintableSvg");
66-
6765
let tooltip;
6866
if (this.state.showTooltip) {
6967
const Tooltip = sdk.getComponent("elements.Tooltip");
7068
tooltip = <Tooltip className="mx_RoleButton_tooltip" label={this.props.label} />;
7169
}
7270

7371
const icon = this.props.iconPath ?
74-
(<TintableSvg src={this.props.iconPath} width={this.props.size} height={this.props.size} />) :
72+
(<img src={this.props.iconPath} width={this.props.size} height={this.props.size} />) :
7573
undefined;
7674

7775
const classNames = ["mx_RoleButton"];

src/components/views/elements/AddressTile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default class AddressTile extends React.Component {
124124
if (this.props.canDismiss) {
125125
dismiss = (
126126
<div className="mx_AddressTile_dismiss" onClick={this.props.onDismissed} >
127-
<TintableSvg src={require("../../../../res/img/icon-address-delete.svg")} width="9" height="9" />
127+
<img src={require("../../../../res/img/icon-address-delete.svg")} width="9" height="9" />
128128
</div>
129129
);
130130
}

src/components/views/elements/TintableSvg.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/components/views/rooms/SimpleRoomHeader.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export default class SimpleRoomHeader extends React.Component {
3535
render() {
3636
let icon;
3737
if (this.props.icon) {
38-
const TintableSvg = sdk.getComponent('elements.TintableSvg');
39-
icon = <TintableSvg
38+
icon = <img
4039
className="mx_RoomHeader_icon" src={this.props.icon}
4140
width="25" height="25"
4241
/>;

src/settings/Settings.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -606,14 +606,6 @@ export const SETTINGS: {[setting: string]: ISetting} = {
606606
default: false,
607607
controller: new UIFeatureController(UIFeature.URLPreviews),
608608
},
609-
"roomColor": {
610-
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
611-
displayName: _td("Room Colour"),
612-
default: {
613-
primary_color: null, // Hex string, eg: #000000
614-
secondary_color: null, // Hex string, eg: #000000
615-
},
616-
},
617609
"notificationsEnabled": {
618610
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
619611
default: false,

0 commit comments

Comments
 (0)