diff --git a/res/img/button-text-quote-o-n.svg b/res/img/button-text-block-quote-on.svg
similarity index 100%
rename from res/img/button-text-quote-o-n.svg
rename to res/img/button-text-block-quote-on.svg
diff --git a/res/img/button-text-quote.svg b/res/img/button-text-block-quote.svg
similarity index 100%
rename from res/img/button-text-quote.svg
rename to res/img/button-text-block-quote.svg
diff --git a/res/img/button-text-bold-o-n.svg b/res/img/button-text-bold-on.svg
similarity index 100%
rename from res/img/button-text-bold-o-n.svg
rename to res/img/button-text-bold-on.svg
diff --git a/res/img/button-text-bullet-o-n.svg b/res/img/button-text-bulleted-list-on.svg
similarity index 100%
rename from res/img/button-text-bullet-o-n.svg
rename to res/img/button-text-bulleted-list-on.svg
diff --git a/res/img/button-text-bullet.svg b/res/img/button-text-bulleted-list.svg
similarity index 100%
rename from res/img/button-text-bullet.svg
rename to res/img/button-text-bulleted-list.svg
diff --git a/res/img/button-text-code-o-n.svg b/res/img/button-text-code-on.svg
similarity index 100%
rename from res/img/button-text-code-o-n.svg
rename to res/img/button-text-code-on.svg
diff --git a/res/img/button-text-strike-o-n.svg b/res/img/button-text-deleted-on.svg
similarity index 100%
rename from res/img/button-text-strike-o-n.svg
rename to res/img/button-text-deleted-on.svg
diff --git a/res/img/button-text-strike.svg b/res/img/button-text-deleted.svg
similarity index 100%
rename from res/img/button-text-strike.svg
rename to res/img/button-text-deleted.svg
diff --git a/res/img/button-text-italic-o-n.svg b/res/img/button-text-italic-on.svg
similarity index 100%
rename from res/img/button-text-italic-o-n.svg
rename to res/img/button-text-italic-on.svg
diff --git a/res/img/button-text-numbullet-o-n.svg b/res/img/button-text-numbered-list-on.svg
similarity index 100%
rename from res/img/button-text-numbullet-o-n.svg
rename to res/img/button-text-numbered-list-on.svg
diff --git a/res/img/button-text-numbullet.svg b/res/img/button-text-numbered-list.svg
similarity index 100%
rename from res/img/button-text-numbullet.svg
rename to res/img/button-text-numbered-list.svg
diff --git a/res/img/button-text-underline-o-n.svg b/res/img/button-text-underlined-on.svg
similarity index 100%
rename from res/img/button-text-underline-o-n.svg
rename to res/img/button-text-underlined-on.svg
diff --git a/res/img/button-text-underline.svg b/res/img/button-text-underlined.svg
similarity index 100%
rename from res/img/button-text-underline.svg
rename to res/img/button-text-underlined.svg
diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js
index 157dc9e704..4d00927767 100644
--- a/src/components/views/rooms/MessageComposer.js
+++ b/src/components/views/rooms/MessageComposer.js
@@ -215,7 +215,7 @@ export default class MessageComposer extends React.Component {
}
}
- onFormatButtonClicked(name: "bold" | "italic" | "strike" | "code" | "underline" | "quote" | "bullet" | "numbullet", event) {
+ onFormatButtonClicked(name, event) {
event.preventDefault();
this.messageComposerInput.onFormatButtonClicked(name, event);
}
@@ -303,14 +303,14 @@ export default class MessageComposer extends React.Component {
);
- const formattingButton = (
+ const formattingButton = this.state.inputState.isRichTextEnabled ? (
- );
+ ) : null;
let placeholderText;
if (this.state.isQuoting) {
@@ -353,31 +353,27 @@ export default class MessageComposer extends React.Component {
);
}
- const {marks, blockType} = this.state.inputState;
- const formatButtons = ["bold", "italic", "strike", "underline", "code", "quote", "bullet", "numbullet"].map(
- (name) => {
- const active = marks.includes(name) || blockType === name;
- const suffix = active ? '-o-n' : '';
- const onFormatButtonClicked = this.onFormatButtonClicked.bind(this, name);
- const className = 'mx_MessageComposer_format_button mx_filterFlipColor';
- return
;
- },
- );
+ let formatBar;
+ if (this.state.showFormatting) {
+ const {marks, blockType} = this.state.inputState;
+ const formatButtons = ["bold", "italic", "deleted", "underlined", "code", "block-quote", "bulleted-list", "numbered-list"].map(
+ (name) => {
+ const active = marks.some(mark => mark.type === name) || blockType === name;
+ const suffix = active ? '-on' : '';
+ const onFormatButtonClicked = this.onFormatButtonClicked.bind(this, name);
+ const className = 'mx_MessageComposer_format_button mx_filterFlipColor';
+ return
;
+ },
+ );
- return (
-