Improve the look and feel of the picker

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-16 21:16:07 +02:00
parent 77c8425c3c
commit 31f5d012b8
No known key found for this signature in database
GPG Key ID: CC823428E9B582FB
2 changed files with 40 additions and 56 deletions

View File

@ -16,28 +16,8 @@ limitations under the License.
.mx_desktopCapturerSourcePicker { .mx_desktopCapturerSourcePicker {
overflow: hidden; overflow: hidden;
}
.mx_desktopCapturerSourcePicker_tabLabels { .mx_desktopCapturerSourcePicker_tab {
display: flex;
padding: 0 0 8px 0;
}
.mx_desktopCapturerSourcePicker_tabLabel,
.mx_desktopCapturerSourcePicker_tabLabel_selected {
width: 100%;
text-align: center;
border-radius: 8px;
padding: 8px 0;
font-size: $font-13px;
}
.mx_desktopCapturerSourcePicker_tabLabel_selected {
background-color: $tab-label-active-bg-color;
color: $tab-label-active-fg-color;
}
.mx_desktopCapturerSourcePicker_panel {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
@ -46,28 +26,32 @@ limitations under the License.
overflow: overlay; overflow: overlay;
} }
.mx_desktopCapturerSourcePicker_stream_button { .mx_desktopCapturerSourcePicker_source {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 8px; margin: 8px;
border-radius: 4px;
} }
.mx_desktopCapturerSourcePicker_stream_button_selected, .mx_desktopCapturerSourcePicker_source_thumbnail {
.mx_desktopCapturerSourcePicker_stream_button:hover,
.mx_desktopCapturerSourcePicker_stream_button:focus {
background: $roomtile-selected-bg-color;
}
.mx_desktopCapturerSourcePicker_stream_thumbnail {
margin: 4px; margin: 4px;
width: 312px; width: 312px;
border-width: 2px;
border-radius: 8px;
border-style: solid;
border-color: transparent;
&.mx_desktopCapturerSourcePicker_source_thumbnail_selected,
&:hover,
&:focus {
border-color: $accent-color;
}
} }
.mx_desktopCapturerSourcePicker_stream_name { .mx_desktopCapturerSourcePicker_source_name {
margin: 0 4px; margin: 0 4px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
width: 312px; width: 312px;
} }
}

View File

@ -51,22 +51,22 @@ export class ExistingSource extends React.Component<ExistingSourceIProps> {
}; };
render() { render() {
const classes = classNames({ const thumbnailClasses = classNames({
mx_desktopCapturerSourcePicker_stream_button: true, mx_desktopCapturerSourcePicker_source_thumbnail: true,
mx_desktopCapturerSourcePicker_stream_button_selected: this.props.selected, mx_desktopCapturerSourcePicker_source_thumbnail_selected: this.props.selected,
}); });
return ( return (
<AccessibleButton <AccessibleButton
className={classes} className="mx_desktopCapturerSourcePicker_source"
title={this.props.source.name} title={this.props.source.name}
onClick={this.onClick} onClick={this.onClick}
> >
<img <img
className="mx_desktopCapturerSourcePicker_stream_thumbnail" className={thumbnailClasses}
src={this.props.source.thumbnailURL} src={this.props.source.thumbnailURL}
/> />
<span className="mx_desktopCapturerSourcePicker_stream_name">{this.props.source.name}</span> <span className="mx_desktopCapturerSourcePicker_source_name">{this.props.source.name}</span>
</AccessibleButton> </AccessibleButton>
); );
} }
@ -147,7 +147,7 @@ export default class DesktopCapturerSourcePicker extends React.Component<
}); });
return new Tab(type, label, null, ( return new Tab(type, label, null, (
<div className="mx_desktopCapturerSourcePicker_panel"> <div className="mx_desktopCapturerSourcePicker_tab">
{ sources } { sources }
</div> </div>
)); ));