Improve the styling

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-10-12 13:36:09 +01:00
parent 7820f9c28a
commit c1fef5a941
2 changed files with 38 additions and 18 deletions

View File

@ -61,6 +61,15 @@ $MiniAppTileHeight: 200px;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
margin-bottom: 8px; margin-bottom: 8px;
.mx_AppTile:first-of-type {
border-left-width: 8px;
border-radius: 10px 0 0 10px;
}
.mx_AppTile:last-of-type {
border-right-width: 8px;
border-radius: 0 10px 10px 0;
}
} }
.mx_AppsDrawer_minimised .mx_AppsContainer { .mx_AppsDrawer_minimised .mx_AppsContainer {
@ -89,13 +98,15 @@ $MiniAppTileHeight: 200px;
.mx_AppTile { .mx_AppTile {
width: 50%; width: 50%;
border: 5px solid $widget-menu-bar-bg-color; border: 8px solid $widget-menu-bar-bg-color;
border-radius: 4px; border-left-width: 5px;
border-right-width: 5px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-sizing: border-box;
& + .mx_AppTile { & + .mx_AppTile {
margin-left: 5px;
} }
} }
@ -138,14 +149,19 @@ $MiniAppTileHeight: 200px;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
padding-bottom: 5px; padding-top: 8px;
padding-bottom: 12px;
} }
.mx_AppTileMenuBarTitle { .mx_AppTileMenuBarTitle {
display: flex; line-height: 20px;
flex-direction: row; white-space: nowrap;
align-items: center; overflow: hidden;
pointer-events: none; text-overflow: ellipsis;
.mx_WidgetAvatar {
margin-right: 12px;
}
} }
.mx_AppTileMenuBarTitle > :last-child { .mx_AppTileMenuBarTitle > :last-child {

View File

@ -107,6 +107,10 @@ export default class AppsDrawer extends React.Component {
} }
} }
setResizing = (resizing) => {
this.setState({ resizing });
};
render() { render() {
if (!this.props.showApps) return <div />; if (!this.props.showApps) return <div />;
@ -142,10 +146,11 @@ export default class AppsDrawer extends React.Component {
} }
const classes = classNames({ const classes = classNames({
"mx_AppsDrawer": true, mx_AppsDrawer: true,
"mx_AppsDrawer_hidden": this.props.hide, mx_AppsDrawer_hidden: this.props.hide,
"mx_AppsDrawer_fullWidth": apps.length < 2, mx_AppsDrawer_fullWidth: apps.length < 2,
"mx_AppsDrawer_minimised": !this.props.showApps, mx_AppsDrawer_minimised: !this.props.showApps,
mx_AppsDrawer_resizing: this.state.resizing,
}); });
return ( return (
@ -157,6 +162,7 @@ export default class AppsDrawer extends React.Component {
handleClass="mx_AppsContainer_resizerHandle" handleClass="mx_AppsContainer_resizerHandle"
className="mx_AppsContainer" className="mx_AppsContainer"
resizeNotifier={this.props.resizeNotifier} resizeNotifier={this.props.resizeNotifier}
setResizing={this.setResizing}
> >
{ apps } { apps }
{ spinner } { spinner }
@ -174,17 +180,17 @@ const PersistentVResizer = ({
handleWrapperClass, handleWrapperClass,
handleClass, handleClass,
resizeNotifier, resizeNotifier,
setResizing,
children, children,
}) => { }) => {
const [height, setHeight] = useLocalStorageState("pvr_" + id, 280); // old fixed height was 273px const [height, setHeight] = useLocalStorageState("pvr_" + id, 280); // old fixed height was 273px
const [resizing, setResizing] = useState(false);
return <Resizable return <Resizable
size={{height: Math.min(height, maxHeight)}} size={{height: Math.min(height, maxHeight)}}
minHeight={minHeight} minHeight={minHeight}
maxHeight={maxHeight} maxHeight={maxHeight}
onResizeStart={() => { onResizeStart={() => {
if (!resizing) setResizing(true); setResizing(true);
resizeNotifier.startResizing(); resizeNotifier.startResizing();
}} }}
onResize={() => { onResize={() => {
@ -192,14 +198,12 @@ const PersistentVResizer = ({
}} }}
onResizeStop={(e, dir, ref, d) => { onResizeStop={(e, dir, ref, d) => {
setHeight(height + d.height); setHeight(height + d.height);
if (resizing) setResizing(false); setResizing(false);
resizeNotifier.stopResizing(); resizeNotifier.stopResizing();
}} }}
handleWrapperClass={handleWrapperClass} handleWrapperClass={handleWrapperClass}
handleClasses={{bottom: handleClass}} handleClasses={{bottom: handleClass}}
className={classNames(className, { className={className}
mx_AppsDrawer_resizing: resizing,
})}
enable={{bottom: true}} enable={{bottom: true}}
> >
{ children } { children }