mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
[img-editor] Added icons for text style options in context menu.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Menu / text_framed</title>
|
||||
<g id="Icon-/-Menu-/-text_framed" stroke="none" fill="none" fill-rule="evenodd" stroke-width="1">
|
||||
<g id="Group-Copy" transform="translate(2.5, 2.5)" fill="#FFFFFF">
|
||||
<path d="M14,-0.599999989 C17.0927946,-0.599999989 19.6,1.9072054 19.6,5 L19.6,14 C19.6,17.0927946 17.0927946,19.6 14,19.6 L5,19.6 C1.9072054,19.6 -0.6,17.0927946 -0.6,14 L-0.6,5 C-0.6,1.9072054 1.9072054,-0.599999989 5,-0.599999989 L14,-0.599999989 Z M14,0.6 L5,0.6 L4.55012557,0.622716709 C2.33139882,0.848040676 0.6,2.72182541 0.6,5 L0.6,14 C0.6,16.4300529 2.5699471,18.4 5,18.4 L14,18.4 C16.4300529,18.4 18.4,16.4300529 18.4,14 L18.4,5 C18.4,2.5699471 16.4300529,0.6 14,0.6 Z M9.97655065,4.03401385 C10.3593484,4.17343225 10.6607815,4.47517036 10.7998126,4.85810895 L14.110978,13.9781761 C14.233488,14.3156099 14.0592578,14.688468 13.7218239,14.810978 C13.3843901,14.933488 13.011532,14.7592578 12.889022,14.4218239 L11.966,11.88 L7.036,11.88 L6.11075332,14.4224419 C5.98790207,14.7597516 5.61486788,14.9336046 5.27755814,14.8107533 C4.94024839,14.6879021 4.76639543,14.3148679 4.88924668,13.9775581 L8.21110911,4.85679966 C8.4714163,4.14208042 9.2618314,3.77370666 9.97655065,4.03401385 Z M9.43261575,5.30168339 L7.509,10.58 L11.494,10.58 L9.57785654,5.30175685 C9.57005611,5.28027185 9.55314403,5.26334264 9.53166693,5.25552049 C9.49156717,5.2409158 9.44722044,5.26158363 9.43261575,5.30168339 Z" id="Shape" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Menu / text_plain</title>
|
||||
<g id="Icon-/-Menu-/-text_plain" stroke="none" fill="none" fill-rule="nonzero">
|
||||
<path d="M12.5653175,4.74076496 C13.033686,4.90830287 13.4021688,5.27715336 13.5692393,5.74568882 L17.7064322,17.3481001 C17.8455527,17.7382518 17.6420516,18.1673117 17.2518999,18.3064322 C16.8617482,18.4455527 16.4326883,18.2420516 16.2935678,17.8518999 L15.1227957,14.570379 L8.87979566,14.570379 L7.70618054,17.8526045 C7.56667093,18.2426173 7.13740824,18.4456902 6.74739549,18.3061805 C6.35738275,18.1666709 6.15430984,17.7374082 6.29381946,17.3473955 L10.4443687,5.74413013 C10.7529809,4.88137467 11.702562,4.43215278 12.5653175,4.74076496 Z M11.8567298,6.24933915 L9.41579566,13.070379 L14.5877957,13.070379 L12.1563749,6.24948861 C12.1403545,6.20456056 12.1050205,6.16919133 12.0601085,6.15312605 C11.9773785,6.1235331 11.8863228,6.16660918 11.8567298,6.24933915 Z" id="Shape" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Menu / text_semi</title>
|
||||
<g id="Icon-/-Menu-/-text_semi" stroke="none" fill="none">
|
||||
<path d="M8,2 L16,2 C19.3137085,2 22,4.6862915 22,8 L22,16 C22,19.3137085 19.3137085,22 16,22 L8,22 C4.6862915,22 2,19.3137085 2,16 L2,8 C2,4.76160306 4.56557489,2.12242824 7.77506174,2.00413847 L8,2 Z" id="Rectangle" fill="#FFFFFF" fill-rule="evenodd" opacity="0.15"></path>
|
||||
<path d="M12.4765507,6.53401385 C12.8593484,6.67343225 13.1607815,6.97517036 13.2998126,7.35810895 L16.610978,16.4781761 C16.733488,16.8156099 16.5592578,17.188468 16.2218239,17.310978 C15.8843901,17.433488 15.511532,17.2592578 15.389022,16.9218239 L14.4658231,14.38048 L9.53582311,14.38048 L8.61075332,16.9224419 C8.48790207,17.2597516 8.11486788,17.4336046 7.77755814,17.3107533 C7.44024839,17.1879021 7.26639543,16.8148679 7.38924668,16.4775581 L10.7111091,7.35679966 C10.9714163,6.64208042 11.7618314,6.27370666 12.4765507,6.53401385 Z M11.9326158,7.80168339 L10.0088231,13.08048 L13.9948231,13.08048 L12.0778565,7.80175685 C12.0700561,7.78027185 12.053144,7.76334264 12.0316669,7.75552049 C11.9915672,7.7409158 11.9472204,7.76158363 11.9326158,7.80168339 Z" id="Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -588,33 +588,42 @@ void ItemText::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
|
||||
_contextMenu = base::make_unique_q<Ui::PopupMenu>(
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user