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

Commit

Permalink
Fix formatting buttons in edition
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Nov 2, 2022
1 parent 479aa45 commit 1055dd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ limitations under the License.
margin-right: 6px;
gap: 8px;

.mx_FormattingButtons {
margin-left: 12px;
}

.mx_WysiwygComposer_Editor {
border: 1px solid;
border-color: $quaternary-content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
.mx_FormattingButtons {
display: flex;
justify-content: flex-start;
gap: 8px;

.mx_FormattingButtons_Button {
--size: 28px;
Expand All @@ -26,18 +27,9 @@ limitations under the License.
line-height: var(--size);
width: auto;
padding-left: 22px;
margin-right: 8px;
background-color: transparent;
border: none;

&:first-child {
margin-left: 12px;
}

&:last-child {
margin-right: auto;
}

&::before {
content: '';
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Stickerpicker from './Stickerpicker';
import { makeRoomPermalink, RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks';
import E2EIcon from './E2EIcon';
import SettingsStore from "../../../settings/SettingsStore";
import { aboveLeftOf, AboveLeftOf } from "../../structures/ContextMenu";
import { aboveLeftOf } from "../../structures/ContextMenu";
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
import ReplyPreview from "./ReplyPreview";
import { UPDATE_EVENT } from "../../../stores/AsyncStore";
Expand Down Expand Up @@ -428,7 +428,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
// Instead of doing a querySelector or pass a ref to find the compute the height formatting buttons
// We are using an arbitrary value, the formatting buttons height doesn't change during the lifecycle of the component
// It's easier to just use a constant here instead of an over-engineering way to find the height
const heightToRemove = hasFormattingButtons ? 45 : 0;
const heightToRemove = hasFormattingButtons ? 36 : 0;
const fixedRect = new DOMRect(
contentRect.x,
contentRect.y + heightToRemove,
Expand Down

0 comments on commit 1055dd4

Please sign in to comment.