Skip to content

Commit

Permalink
Merge pull request #2618 from matrix-org/bwindels/fixstickers
Browse files Browse the repository at this point in the history
Fix: stickers layout
  • Loading branch information
bwindels committed Feb 13, 2019
2 parents 27a5211 + f189ff5 commit 12b6383
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
18 changes: 14 additions & 4 deletions res/css/views/rooms/_AppsDrawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
the tile title bar is 5 (top border) + 12 (title, buttons) + 5 (bottom padding) px = 22px
the body is assumed to be 300px (assumed by at least the sticker pickerm, perhaps elsewhere),
so the body height would be 300px - 22px (room for title bar) = 278px
BUT! the sticker picker also assumes it's a little less high than that because the iframe
for the sticker picker doesn't have any padding or margin on it's bottom.
so subtracking another 5px, which brings us at 273px.
*/
$AppsDrawerBodyHeight: 273px;

.mx_AppsDrawer {
margin: 5px;
}
Expand Down Expand Up @@ -83,7 +93,7 @@ limitations under the License.
}

.mx_AppTile_persistedWrapper {
height: 280px;
height: $AppsDrawerBodyHeight;
}

.mx_AppTile_mini .mx_AppTile_persistedWrapper {
Expand Down Expand Up @@ -189,7 +199,7 @@ limitations under the License.
}

.mx_AppTileBody{
height: 280px;
height: $AppsDrawerBodyHeight;
width: 100%;
overflow: hidden;
}
Expand All @@ -208,7 +218,7 @@ limitations under the License.

.mx_AppTileBody iframe {
width: 100%;
height: 280px;
height: $AppsDrawerBodyHeight;
overflow: hidden;
border: none;
padding: 0;
Expand Down Expand Up @@ -332,7 +342,7 @@ form.mx_Custom_Widget_Form div {
align-items: center;
font-weight: bold;
position: relative;
height: 280px;
height: $AppsDrawerBodyHeight;
}

.mx_AppLoading .mx_Spinner {
Expand Down
8 changes: 6 additions & 2 deletions res/css/views/rooms/_Stickers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
height: 300px;
}

.mx_Stickers_content .mx_AppTileFullWidth {
border: none;
#mx_persistedElement_stickerPicker .mx_AppTileFullWidth {
height: unset;
box-sizing: border-box;
border-left: none;
border-right: none;
border-bottom: none;
}

.mx_Stickers_contentPlaceholder {
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/elements/AppTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ export default class AppTile extends React.Component {
// editing is done in scalar
const canUserModify = this._canUserModify();
const showEditButton = Boolean(this._scalarClient && canUserModify);
const showDeleteButton = canUserModify;
const showCancelButton = !showDeleteButton;
const showDeleteButton = (this.props.showDelete === undefined || this.props.showDelete) && canUserModify;
const showCancelButton = (this.props.showCancel === undefined || this.props.showCancel) && !showDeleteButton;
// Picture snapshot - only show button when apps are maximised.
const showPictureSnapshotButton = this._hasCapability('m.capability.screenshot') && this.props.show;
const showMinimiseButton = this.props.showMinimise && this.props.show;
Expand Down
1 change: 1 addition & 0 deletions src/components/views/rooms/Stickerpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export default class Stickerpicker extends React.Component {
showTitle={false}
showMinimise={true}
showDelete={false}
showCancel={false}
showPopout={false}
onMinimiseClick={this._onHideStickersClick}
handleMinimisePointerEvents={true}
Expand Down

0 comments on commit 12b6383

Please sign in to comment.