make backdrop closer to what is happening in production

This commit is contained in:
Germain Souquet 2021-06-25 14:09:49 +01:00
parent 533d5ad664
commit 5932b93325
6 changed files with 24 additions and 5 deletions

View file

@ -16,8 +16,8 @@ limitations under the License.
.mx_GroupFilterPanel { .mx_GroupFilterPanel {
flex: 1; flex: 1;
background-color: $groupFilterPanel-bg-color;
cursor: pointer; cursor: pointer;
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View file

@ -42,7 +42,7 @@ limitations under the License.
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
z-index: 0; z-index: 0;
opacity: .15; pointer-events: none;
} }
.mx_MatrixToolbar { .mx_MatrixToolbar {

View file

@ -22,6 +22,7 @@ interface IProps {
height?: number; height?: number;
backgroundImage?: CanvasImageSource; backgroundImage?: CanvasImageSource;
blur?: string; blur?: string;
opacity?: number;
} }
@ -31,6 +32,7 @@ export default class BackdropPanel extends React.PureComponent<IProps> {
static defaultProps = { static defaultProps = {
blur: "60px", blur: "60px",
opacity: .15,
} }
public componentDidMount() { public componentDidMount() {
@ -82,6 +84,9 @@ export default class BackdropPanel extends React.PureComponent<IProps> {
return <canvas return <canvas
ref={this.canvasRef} ref={this.canvasRef}
className="mx_BackdropPanel" className="mx_BackdropPanel"
style={{
opacity: this.props.opacity,
}}
/>; />;
} }
} }

View file

@ -29,7 +29,9 @@ import MatrixClientContext from "../../contexts/MatrixClientContext";
import AutoHideScrollbar from "./AutoHideScrollbar"; import AutoHideScrollbar from "./AutoHideScrollbar";
import SettingsStore from "../../settings/SettingsStore"; import SettingsStore from "../../settings/SettingsStore";
import UserTagTile from "../views/elements/UserTagTile"; import UserTagTile from "../views/elements/UserTagTile";
import {replaceableComponent} from "../../utils/replaceableComponent"; import { replaceableComponent } from "../../utils/replaceableComponent";
import BackdropPanel from "./BackdropPanel";
import UIStore from "../../stores/UIStore";
@replaceableComponent("structures.GroupFilterPanel") @replaceableComponent("structures.GroupFilterPanel")
class GroupFilterPanel extends React.Component { class GroupFilterPanel extends React.Component {
@ -40,6 +42,8 @@ class GroupFilterPanel extends React.Component {
selectedTags: [], selectedTags: [],
}; };
ref = React.createRef()
componentDidMount() { componentDidMount() {
this.unmounted = false; this.unmounted = false;
this.context.on("Group.myMembership", this._onGroupMyMembership); this.context.on("Group.myMembership", this._onGroupMyMembership);
@ -56,6 +60,7 @@ class GroupFilterPanel extends React.Component {
}); });
// This could be done by anything with a matrix client // This could be done by anything with a matrix client
dis.dispatch(GroupActions.fetchJoinedGroups(this.context)); dis.dispatch(GroupActions.fetchJoinedGroups(this.context));
UIStore.instance.trackElementDimensions("GroupPanel", this.ref.current);
} }
componentWillUnmount() { componentWillUnmount() {
@ -65,6 +70,7 @@ class GroupFilterPanel extends React.Component {
if (this._groupFilterOrderStoreToken) { if (this._groupFilterOrderStoreToken) {
this._groupFilterOrderStoreToken.remove(); this._groupFilterOrderStoreToken.remove();
} }
UIStore.instance.stopTrackingElementDimensions("GroupPanel");
} }
_onGroupMyMembership = () => { _onGroupMyMembership = () => {
@ -147,7 +153,14 @@ class GroupFilterPanel extends React.Component {
); );
} }
return <div className={classes} onClick={this.onClearFilterClick}> const panelDimensions = UIStore.instance.getElementDimensions("GroupPanel");
return <div className={classes} onClick={this.onClearFilterClick} ref={this.ref}>
<BackdropPanel
backgroundImage={this.props.backgroundImage}
width={panelDimensions?.width}
height={panelDimensions?.height}
/>
<AutoHideScrollbar <AutoHideScrollbar
className="mx_GroupFilterPanel_scroller" className="mx_GroupFilterPanel_scroller"
onClick={this.onClick} onClick={this.onClick}

View file

@ -405,7 +405,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
if (this.state.showGroupFilterPanel) { if (this.state.showGroupFilterPanel) {
leftLeftPanel = ( leftLeftPanel = (
<div className="mx_LeftPanel_GroupFilterPanelContainer"> <div className="mx_LeftPanel_GroupFilterPanelContainer">
<GroupFilterPanel /> <GroupFilterPanel backgroundImage={this.props.backgroundImage} />
{SettingsStore.getValue("feature_custom_tags") ? <CustomRoomTagPanel /> : null} {SettingsStore.getValue("feature_custom_tags") ? <CustomRoomTagPanel /> : null}
</div> </div>
); );

View file

@ -292,6 +292,7 @@ const SpacePanel = (props: IProps) => {
backgroundImage={props.backgroundImage} backgroundImage={props.backgroundImage}
width={panelDimensions?.width} width={panelDimensions?.width}
height={panelDimensions?.height} height={panelDimensions?.height}
opacity={.3}
/> />
<Droppable droppableId="top-level-spaces"> <Droppable droppableId="top-level-spaces">
{(provided, snapshot) => ( {(provided, snapshot) => (