From ad0be125f5d7751438668b2637e2c2dc054beb9a Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 23 Feb 2024 16:32:13 +0100 Subject: [PATCH] [Glitch] Fix pixel alignment for some composer icons Port 25ffe0af453cfdcad787913b57f217303bfa59a2 to glitch-soc Signed-off-by: Claire --- .../compose/components/content_type_button.jsx | 9 ++++++--- .../compose/components/emoji_picker_dropdown.jsx | 2 +- .../compose/components/federation_button.jsx | 4 +++- .../features/compose/components/poll_button.jsx | 2 +- .../compose/components/thread_mode_button.jsx | 2 +- .../glitch/features/compose/components/upload.jsx | 2 +- .../features/compose/components/upload_button.jsx | 2 +- .../compose/containers/spoiler_button_container.js | 2 +- .../flavours/glitch/styles/components.scss | 12 ++++++------ app/javascript/material-icons/400-20px/code-fill.svg | 1 + app/javascript/material-icons/400-20px/code.svg | 1 + .../material-icons/400-20px/description-fill.svg | 1 + .../material-icons/400-20px/description.svg | 1 + .../material-icons/400-20px/markdown-fill.svg | 1 + app/javascript/material-icons/400-20px/markdown.svg | 1 + .../material-icons/400-20px/quickreply-fill.svg | 1 + .../material-icons/400-20px/quickreply.svg | 1 + .../material-icons/400-20px/share-fill.svg | 1 + app/javascript/material-icons/400-20px/share.svg | 1 + .../material-icons/400-20px/share_off-fill.svg | 1 + app/javascript/material-icons/400-20px/share_off.svg | 1 + .../material-icons/400-24px/quickreply-fill.svg | 1 - .../material-icons/400-24px/quickreply.svg | 1 - 23 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 app/javascript/material-icons/400-20px/code-fill.svg create mode 100644 app/javascript/material-icons/400-20px/code.svg create mode 100644 app/javascript/material-icons/400-20px/description-fill.svg create mode 100644 app/javascript/material-icons/400-20px/description.svg create mode 100644 app/javascript/material-icons/400-20px/markdown-fill.svg create mode 100644 app/javascript/material-icons/400-20px/markdown.svg create mode 100644 app/javascript/material-icons/400-20px/quickreply-fill.svg create mode 100644 app/javascript/material-icons/400-20px/quickreply.svg create mode 100644 app/javascript/material-icons/400-20px/share-fill.svg create mode 100644 app/javascript/material-icons/400-20px/share.svg create mode 100644 app/javascript/material-icons/400-20px/share_off-fill.svg create mode 100644 app/javascript/material-icons/400-20px/share_off.svg delete mode 100644 app/javascript/material-icons/400-24px/quickreply-fill.svg delete mode 100644 app/javascript/material-icons/400-24px/quickreply.svg diff --git a/app/javascript/flavours/glitch/features/compose/components/content_type_button.jsx b/app/javascript/flavours/glitch/features/compose/components/content_type_button.jsx index c1d6860bde..0de05ce7aa 100644 --- a/app/javascript/flavours/glitch/features/compose/components/content_type_button.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/content_type_button.jsx @@ -2,6 +2,9 @@ import { useCallback } from 'react'; import { useIntl, defineMessages } from 'react-intl'; +import SmallCodeIcon from '@/material-icons/400-20px/code.svg?react'; +import SmallDescriptionIcon from '@/material-icons/400-20px/description.svg?react'; +import SmallMarkdownIcon from '@/material-icons/400-20px/markdown.svg?react'; import CodeIcon from '@/material-icons/400-24px/code.svg?react'; import DescriptionIcon from '@/material-icons/400-24px/description.svg?react'; import MarkdownIcon from '@/material-icons/400-24px/markdown.svg?react'; @@ -48,9 +51,9 @@ export const ContentTypeButton = () => { }[contentType]; const iconComponent = { - 'text/plain': DescriptionIcon, - 'text/markdown': MarkdownIcon, - 'text/html': CodeIcon, + 'text/plain': SmallDescriptionIcon, + 'text/markdown': SmallMarkdownIcon, + 'text/html': SmallCodeIcon, }[contentType]; return ( diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx index 557f60e807..afe2981d05 100644 --- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx @@ -10,7 +10,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { supportsPassiveEvents } from 'detect-passive-events'; import Overlay from 'react-overlays/Overlay'; -import MoodIcon from '@/material-icons/400-24px/mood.svg?react'; +import MoodIcon from '@/material-icons/400-20px/mood.svg?react'; import { IconButton } from 'flavours/glitch/components/icon_button'; import { useSystemEmojiFont } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; diff --git a/app/javascript/flavours/glitch/features/compose/components/federation_button.jsx b/app/javascript/flavours/glitch/features/compose/components/federation_button.jsx index 2ac0a9d3ec..7c71d72f5e 100644 --- a/app/javascript/flavours/glitch/features/compose/components/federation_button.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/federation_button.jsx @@ -2,6 +2,8 @@ import { useCallback } from 'react'; import { useIntl, defineMessages } from 'react-intl'; +import SmallShareIcon from '@/material-icons/400-20px/share.svg?react'; +import SmallShareOffIcon from '@/material-icons/400-20px/share_off.svg?react'; import ShareIcon from '@/material-icons/400-24px/share.svg?react'; import ShareOffIcon from '@/material-icons/400-24px/share_off.svg?react'; import { changeComposeAdvancedOption } from 'flavours/glitch/actions/compose'; @@ -37,7 +39,7 @@ export const FederationButton = () => { [data-popper-placement] { } .icon-button.compose-form__upload__delete { - padding: 3px; + padding: 2px; border-radius: 50%; .icon { - width: 18px; - height: 18px; + width: 20px; + height: 20px; } } @@ -769,12 +769,12 @@ body > [data-popper-placement] { } .icon-button { - padding: 3px; + padding: 2px; } .icon-button .icon { - width: 18px; - height: 18px; + width: 20px; + height: 20px; } } diff --git a/app/javascript/material-icons/400-20px/code-fill.svg b/app/javascript/material-icons/400-20px/code-fill.svg new file mode 100644 index 0000000000..83fb85354f --- /dev/null +++ b/app/javascript/material-icons/400-20px/code-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/code.svg b/app/javascript/material-icons/400-20px/code.svg new file mode 100644 index 0000000000..83fb85354f --- /dev/null +++ b/app/javascript/material-icons/400-20px/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/description-fill.svg b/app/javascript/material-icons/400-20px/description-fill.svg new file mode 100644 index 0000000000..5eed963e0b --- /dev/null +++ b/app/javascript/material-icons/400-20px/description-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/description.svg b/app/javascript/material-icons/400-20px/description.svg new file mode 100644 index 0000000000..7ad7907881 --- /dev/null +++ b/app/javascript/material-icons/400-20px/description.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/markdown-fill.svg b/app/javascript/material-icons/400-20px/markdown-fill.svg new file mode 100644 index 0000000000..6fed3547f6 --- /dev/null +++ b/app/javascript/material-icons/400-20px/markdown-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/markdown.svg b/app/javascript/material-icons/400-20px/markdown.svg new file mode 100644 index 0000000000..c5e480e938 --- /dev/null +++ b/app/javascript/material-icons/400-20px/markdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/quickreply-fill.svg b/app/javascript/material-icons/400-20px/quickreply-fill.svg new file mode 100644 index 0000000000..8adf5df308 --- /dev/null +++ b/app/javascript/material-icons/400-20px/quickreply-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/quickreply.svg b/app/javascript/material-icons/400-20px/quickreply.svg new file mode 100644 index 0000000000..4956ffcf3c --- /dev/null +++ b/app/javascript/material-icons/400-20px/quickreply.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/share-fill.svg b/app/javascript/material-icons/400-20px/share-fill.svg new file mode 100644 index 0000000000..dc7011ff9f --- /dev/null +++ b/app/javascript/material-icons/400-20px/share-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/share.svg b/app/javascript/material-icons/400-20px/share.svg new file mode 100644 index 0000000000..5094eb336c --- /dev/null +++ b/app/javascript/material-icons/400-20px/share.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/share_off-fill.svg b/app/javascript/material-icons/400-20px/share_off-fill.svg new file mode 100644 index 0000000000..eeb1cb4f39 --- /dev/null +++ b/app/javascript/material-icons/400-20px/share_off-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-20px/share_off.svg b/app/javascript/material-icons/400-20px/share_off.svg new file mode 100644 index 0000000000..970fa28a25 --- /dev/null +++ b/app/javascript/material-icons/400-20px/share_off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-24px/quickreply-fill.svg b/app/javascript/material-icons/400-24px/quickreply-fill.svg deleted file mode 100644 index a9ce9705ac..0000000000 --- a/app/javascript/material-icons/400-24px/quickreply-fill.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/javascript/material-icons/400-24px/quickreply.svg b/app/javascript/material-icons/400-24px/quickreply.svg deleted file mode 100644 index 522093e3cc..0000000000 --- a/app/javascript/material-icons/400-24px/quickreply.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file