From 092f81dad60d96822458e48429c49537cd3aab49 Mon Sep 17 00:00:00 2001
From: 23rd <23rd@vivaldi.net>
Date: Wed, 22 Apr 2026 08:59:20 +0300
Subject: [PATCH] [img-editor] Added icons for text style options in context
menu.
---
.../icons/menu/text_style_framed.svg | 9 ++++++
.../Resources/icons/menu/text_style_plain.svg | 7 +++++
.../Resources/icons/menu/text_style_semi.svg | 8 +++++
.../editor/scene/scene_item_text.cpp | 31 ++++++++++++-------
Telegram/SourceFiles/ui/menu_icons.style | 3 ++
5 files changed, 47 insertions(+), 11 deletions(-)
create mode 100644 Telegram/Resources/icons/menu/text_style_framed.svg
create mode 100644 Telegram/Resources/icons/menu/text_style_plain.svg
create mode 100644 Telegram/Resources/icons/menu/text_style_semi.svg
diff --git a/Telegram/Resources/icons/menu/text_style_framed.svg b/Telegram/Resources/icons/menu/text_style_framed.svg
new file mode 100644
index 0000000000..de5e3ff728
--- /dev/null
+++ b/Telegram/Resources/icons/menu/text_style_framed.svg
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/Telegram/Resources/icons/menu/text_style_plain.svg b/Telegram/Resources/icons/menu/text_style_plain.svg
new file mode 100644
index 0000000000..72acd48596
--- /dev/null
+++ b/Telegram/Resources/icons/menu/text_style_plain.svg
@@ -0,0 +1,7 @@
+
+
\ No newline at end of file
diff --git a/Telegram/Resources/icons/menu/text_style_semi.svg b/Telegram/Resources/icons/menu/text_style_semi.svg
new file mode 100644
index 0000000000..95cca3188f
--- /dev/null
+++ b/Telegram/Resources/icons/menu/text_style_semi.svg
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/Telegram/SourceFiles/editor/scene/scene_item_text.cpp b/Telegram/SourceFiles/editor/scene/scene_item_text.cpp
index 619079bf90..32870696e1 100644
--- a/Telegram/SourceFiles/editor/scene/scene_item_text.cpp
+++ b/Telegram/SourceFiles/editor/scene/scene_item_text.cpp
@@ -588,33 +588,42 @@ void ItemText::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
_contextMenu = base::make_unique_q(
nullptr,
st::popupMenuWithIcons);
- const auto add = [&](const QString &text, TextStyle style) {
+ const auto add = [&](
+ const QString &text,
+ TextStyle style,
+ const style::icon *icon) {
const auto checked = (_textStyle == style);
- auto action = _contextMenu->addAction(text, [=] {
- setTextStyle(style);
- });
+ auto action = _contextMenu->addAction(
+ text,
+ [=] { setTextStyle(style); },
+ icon);
if (checked) {
action->setChecked(true);
}
};
- add(tr::lng_photo_editor_text_style_plain(tr::now), TextStyle::Plain);
+ add(
+ tr::lng_photo_editor_text_style_plain(tr::now),
+ TextStyle::Plain,
+ &st::menuIconTextStylePlain);
add(
tr::lng_photo_editor_text_style_framed(tr::now),
- TextStyle::Framed);
+ TextStyle::Framed,
+ &st::menuIconTextStyleFramed);
add(
tr::lng_photo_editor_text_style_semi_transparent(tr::now),
- TextStyle::SemiTransparent);
+ TextStyle::SemiTransparent,
+ &st::menuIconTextStyleSemiTransparent);
_contextMenu->addSeparator();
- _contextMenu->addAction(
- tr::lng_photo_editor_menu_delete(tr::now),
- [=] { actionDelete(); },
- &st::menuIconDelete);
_contextMenu->addAction(
tr::lng_photo_editor_menu_duplicate(tr::now),
[=] { actionDuplicate(); },
&st::menuIconCopy);
+ _contextMenu->addAction(
+ tr::lng_photo_editor_menu_delete(tr::now),
+ [=] { actionDelete(); },
+ &st::menuIconDelete);
_contextMenu->popup(event->screenPos());
}
diff --git a/Telegram/SourceFiles/ui/menu_icons.style b/Telegram/SourceFiles/ui/menu_icons.style
index 068d0d2b9a..5d11dbe729 100644
--- a/Telegram/SourceFiles/ui/menu_icons.style
+++ b/Telegram/SourceFiles/ui/menu_icons.style
@@ -211,6 +211,9 @@ menuIconDownloadOff: icon {{ "menu/download_off-24x24", menuIconColor }};
menuIconShareOff: icon {{ "menu/share_off-24x24", menuIconColor }};
menuIconShareOn: icon {{ "menu/share_on-24x24", menuIconColor }};
menuIconStar: icon {{ "menu/star", menuIconColor }};
+menuIconTextStylePlain: icon {{ "menu/text_style_plain-22x22", menuIconColor, point(0px, 2px) }};
+menuIconTextStyleFramed: icon {{ "menu/text_style_framed-22x22", menuIconColor, point(0px, 2px) }};
+menuIconTextStyleSemiTransparent: icon {{ "menu/text_style_semi-22x22", menuIconColor, point(0px, 2px) }};
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
menuIconTTLAnyTextPosition: point(11px, 22px);