diff --git a/Telegram/Resources/icons/bubble_tail1.png b/Telegram/Resources/icons/bubble_tail1.png new file mode 100644 index 000000000..65d577e95 Binary files /dev/null and b/Telegram/Resources/icons/bubble_tail1.png differ diff --git a/Telegram/Resources/icons/bubble_tail1@2x.png b/Telegram/Resources/icons/bubble_tail1@2x.png new file mode 100644 index 000000000..ebeca1511 Binary files /dev/null and b/Telegram/Resources/icons/bubble_tail1@2x.png differ diff --git a/Telegram/Resources/icons/bubble_tail1@3x.png b/Telegram/Resources/icons/bubble_tail1@3x.png new file mode 100644 index 000000000..e11ccb08b Binary files /dev/null and b/Telegram/Resources/icons/bubble_tail1@3x.png differ diff --git a/Telegram/Resources/icons/bubble_tail2.png b/Telegram/Resources/icons/bubble_tail2.png new file mode 100644 index 000000000..3b6614560 Binary files /dev/null and b/Telegram/Resources/icons/bubble_tail2.png differ diff --git a/Telegram/Resources/icons/bubble_tail2@2x.png b/Telegram/Resources/icons/bubble_tail2@2x.png new file mode 100644 index 000000000..eb2b0a364 Binary files /dev/null and b/Telegram/Resources/icons/bubble_tail2@2x.png differ diff --git a/Telegram/Resources/icons/bubble_tail2@3x.png b/Telegram/Resources/icons/bubble_tail2@3x.png new file mode 100644 index 000000000..aa368174b Binary files /dev/null and b/Telegram/Resources/icons/bubble_tail2@3x.png differ diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index a5c1e466a..665304725 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -80,6 +80,12 @@ "ktg_settings_recent_stickers_limit_none": "Recent stickers: hide all", "ktg_settings_filters": "Folders", "ktg_settings_messages": "Messages", + "ktg_settings_userpic_rounding": "Profile pictures rounding", + "ktg_settings_userpic_rounding_none": "Square", + "ktg_settings_userpic_rounding_small": "Small", + "ktg_settings_userpic_rounding_big": "Big", + "ktg_settings_userpic_rounding_full": "Circle", + "ktg_settings_userpic_rounding_desc": "You'll need to restart app to save changes.", "ktg_settings_chat_id": "Chat ID in profile", "ktg_settings_chat_id_desc": "You can choose desired format here.\n\nTelegram API uses IDs as-is, but Bot API adds minus in the beginning for groups, and -100 for channels and supergroups to fit it in one field.\n\nIf you have profile panel opened, re-open it to see changes.", "ktg_settings_chat_id_disable": "Hide", diff --git a/Telegram/SourceFiles/api/api_chat_invite.cpp b/Telegram/SourceFiles/api/api_chat_invite.cpp index 3e96bf20f..0b4b3a498 100644 --- a/Telegram/SourceFiles/api/api_chat_invite.cpp +++ b/Telegram/SourceFiles/api/api_chat_invite.cpp @@ -345,13 +345,15 @@ void ConfirmInviteBox::paintEvent(QPaintEvent *e) { if (_photo) { if (const auto image = _photo->image(Data::PhotoSize::Small)) { - const auto size = st::confirmInvitePhotoSize; + auto source = [=] { + const auto size = st::confirmInvitePhotoSize; + const auto roundOption = KotatoImageRoundOption(); + return image->pix(size, size, { .options = roundOption }); + }(); p.drawPixmap( - (width() - size) / 2, + (width() - st::confirmInvitePhotoSize) / 2, st::confirmInvitePhotoTop, - image->pix( - { size, size }, - { .options = Images::Option::RoundCircle })); + source); } } else if (_photoEmpty) { _photoEmpty->paint( diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp index 7642c050a..32c3aa1cb 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp @@ -277,7 +277,24 @@ void PaintFilterChatsTypeIcon( auto hq = PainterHighQualityEnabler(p); p.setBrush(color->b); p.setPen(Qt::NoPen); - p.drawEllipse(rect); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + p.drawRoundedRect(rect, 0, 0); + break; + + case ImageRoundRadius::Small: + p.drawRoundedRect(rect, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + p.drawRoundedRect(rect, + st::dateRadius, st::dateRadius); + break; + + default: + p.drawEllipse(rect); + } icon.paintInCenter(p, rect); } diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index d81ba849e..e28acd10f 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -769,7 +769,24 @@ void PeerListRow::paintDisabledCheckUserpic( p.setPen(userpicBorderPen); p.setBrush(Qt::NoBrush); - p.drawEllipse(userpicEllipse); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + p.drawRoundedRect(userpicEllipse, 0, 0); + break; + + case ImageRoundRadius::Small: + p.drawRoundedRect(userpicEllipse, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + p.drawRoundedRect(userpicEllipse, + st::dateRadius, st::dateRadius); + break; + + default: + p.drawEllipse(userpicEllipse); + } p.setPen(iconBorderPen); p.setBrush(st.disabledCheckFg); diff --git a/Telegram/SourceFiles/calls/calls_top_bar.cpp b/Telegram/SourceFiles/calls/calls_top_bar.cpp index da26bc1be..0e02f46e7 100644 --- a/Telegram/SourceFiles/calls/calls_top_bar.cpp +++ b/Telegram/SourceFiles/calls/calls_top_bar.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "calls/calls_top_bar.h" +#include "kotato/kotato_settings.h" #include "ui/effects/cross_line.h" #include "ui/paint/blobs_linear.h" #include "ui/widgets/buttons.h" @@ -253,7 +254,8 @@ TopBar::TopBar( : std::make_unique( st::groupCallTopBarUserpics, rpl::single(true), - [=] { updateUserpics(); })) + [=] { updateUserpics(); }, + ::Kotato::JsonSettings::GetInt("userpic_corner_type"))) , _durationLabel(_call ? object_ptr(this, st::callBarLabel) : object_ptr(nullptr)) diff --git a/Telegram/SourceFiles/calls/calls_userpic.cpp b/Telegram/SourceFiles/calls/calls_userpic.cpp index cca9a096c..8d3a28d46 100644 --- a/Telegram/SourceFiles/calls/calls_userpic.cpp +++ b/Telegram/SourceFiles/calls/calls_userpic.cpp @@ -16,8 +16,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_photo_media.h" #include "data/data_file_origin.h" #include "ui/empty_userpic.h" +#include "ui/rect_part.h" #include "apiwrap.h" // requestFullPeer. #include "styles/style_calls.h" +#include "styles/style_widgets.h" namespace Calls { namespace { @@ -104,7 +106,25 @@ void Userpic::paint() { _mutePosition.y() - _muteSize / 2, _muteSize, _muteSize); - p.drawEllipse(rect); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + p.drawRoundedRect(rect, 0, 0); + break; + + case ImageRoundRadius::Small: + p.drawRoundedRect(rect, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + p.drawRoundedRect(rect, + st::dateRadius, st::dateRadius); + break; + + default: + p.drawEllipse(rect); + } + st::callMutedPeerIcon.paintInCenter(p, rect); } } @@ -180,13 +200,10 @@ void Userpic::createCache(Image *image) { height = qMax((height * real) / width, 1); width = real; } - _userPhoto = image->pixNoCache( - { width, height }, - { - .options = Images::Option::RoundCircle, - .outer = { size, size }, - }); - _userPhoto.setDevicePixelRatio(cRetinaFactor()); + const auto roundOption = KotatoImageRoundOption(); + _userPhoto = image->pix(size, size, { + .options = roundOption, + .outer = { size, size }}); } else { auto filled = QImage( QSize(real, real), diff --git a/Telegram/SourceFiles/data/data_folder.cpp b/Telegram/SourceFiles/data/data_folder.cpp index cb3f51a60..fe0344598 100644 --- a/Telegram/SourceFiles/data/data_folder.cpp +++ b/Telegram/SourceFiles/data/data_folder.cpp @@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "apiwrap.h" #include "mainwidget.h" #include "styles/style_dialogs.h" +#include "styles/style_widgets.h" namespace Data { namespace { @@ -252,7 +253,24 @@ void Folder::paintUserpic( p.setBrush(overrideBg ? *overrideBg : st::historyPeerArchiveUserpicBg); { PainterHighQualityEnabler hq(p); - p.drawEllipse(x, y, size, size); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + p.drawRoundedRect(QRect{ x, y, size, size }, 0, 0); + break; + + case ImageRoundRadius::Small: + p.drawRoundedRect(QRect{ x, y, size, size }, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + p.drawRoundedRect(QRect{ x, y, size, size }, + st::dateRadius, st::dateRadius); + break; + + default: + p.drawEllipse(x, y, size, size); + } } if (size == st::dialogsPhotoSize) { const auto rect = QRect{ x, y, size, size }; diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 18433abed..359067fc7 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -271,6 +271,30 @@ void PeerData::paintUserpic( int x, int y, int size) const { + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + paintUserpicSquare(p, view, x, y, size); + break; + + case ImageRoundRadius::Small: + paintUserpicRounded(p, view, x, y, size); + break; + + case ImageRoundRadius::Large: + paintUserpicRoundedLarge(p, view, x, y, size); + break; + + default: + paintUserpicCircled(p, view, x, y, size); + } +} + +void PeerData::paintUserpicCircled( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const { if (const auto userpic = currentUserpic(view)) { const auto circled = Images::Option::RoundCircle; p.drawPixmap( @@ -282,6 +306,47 @@ void PeerData::paintUserpic( } } +void PeerData::paintUserpicRoundedLarge( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const { + if (const auto userpic = currentUserpic(view)) { + const auto rounded = Images::Option::RoundLarge; + p.drawPixmap(x, y, userpic->pix(size, size, { .options = rounded })); + } else { + ensureEmptyUserpic()->paintRoundedLarge(p, x, y, x + size + x, size); + } +} + +void PeerData::paintUserpicRounded( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const { + if (const auto userpic = currentUserpic(view)) { + const auto rounded = Images::Option::RoundSmall; + p.drawPixmap(x, y, userpic->pix(size, size, { .options = rounded })); + } else { + ensureEmptyUserpic()->paintRounded(p, x, y, x + size + x, size); + } +} + +void PeerData::paintUserpicSquare( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const { + if (const auto userpic = currentUserpic(view)) { + p.drawPixmap(x, y, userpic->pix(size, size)); + } else { + ensureEmptyUserpic()->paintSquare(p, x, y, x + size + x, size); + } +} + void PeerData::loadUserpic() { _userpic.load(&session(), userpicOrigin()); } @@ -336,7 +401,7 @@ QPixmap PeerData::genUserpic( std::shared_ptr &view, int size) const { if (const auto userpic = currentUserpic(view)) { - const auto circle = Images::Option::RoundCircle; + const auto circle = KotatoImageRoundOption(); return userpic->pix(size, size, { .options = circle }); } const auto ratio = style::DevicePixelRatio(); @@ -355,7 +420,7 @@ QPixmap PeerData::genUserpic( QImage PeerData::generateUserpicImage( std::shared_ptr &view, int size) const { - return generateUserpicImage(view, size, ImageRoundRadius::Ellipse); + return generateUserpicImage(view, size, KotatoImageRoundRadius()); } QImage PeerData::generateUserpicImage( @@ -365,6 +430,8 @@ QImage PeerData::generateUserpicImage( if (const auto userpic = currentUserpic(view)) { const auto options = (radius == ImageRoundRadius::Ellipse) ? Images::Option::RoundCircle + : (radius == ImageRoundRadius::Large) + ? Images::Option::RoundLarge : (radius == ImageRoundRadius::None) ? Images::Option() : Images::Option::RoundSmall; @@ -380,6 +447,8 @@ QImage PeerData::generateUserpicImage( Painter p(&result); if (radius == ImageRoundRadius::Ellipse) { ensureEmptyUserpic()->paint(p, 0, 0, size, size); + } else if (radius == ImageRoundRadius::Large) { + ensureEmptyUserpic()->paintRoundedLarge(p, 0, 0, size, size); } else if (radius == ImageRoundRadius::None) { ensureEmptyUserpic()->paintSquare(p, 0, 0, size, size); } else { diff --git a/Telegram/SourceFiles/data/data_peer.h b/Telegram/SourceFiles/data/data_peer.h index 27ec1c03b..633fb2500 100644 --- a/Telegram/SourceFiles/data/data_peer.h +++ b/Telegram/SourceFiles/data/data_peer.h @@ -274,6 +274,30 @@ public: int size) const { paintUserpic(p, view, rtl() ? (w - x - size) : x, y, size); } + void paintUserpicCircled( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const; + void paintUserpicRoundedLarge( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const; + void paintUserpicRounded( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const; + void paintUserpicSquare( + Painter &p, + std::shared_ptr &view, + int x, + int y, + int size) const; void loadUserpic(); [[nodiscard]] bool hasUserpic() const; [[nodiscard]] std::shared_ptr activeUserpicView(); diff --git a/Telegram/SourceFiles/data/data_peer_values.cpp b/Telegram/SourceFiles/data/data_peer_values.cpp index b9e15930c..5f7030013 100644 --- a/Telegram/SourceFiles/data/data_peer_values.cpp +++ b/Telegram/SourceFiles/data/data_peer_values.cpp @@ -469,7 +469,7 @@ bool ChannelHasActiveCall(not_null channel) { rpl::producer PeerUserpicImageValue( not_null peer, int size) { - return PeerUserpicImageValue(peer, size, ImageRoundRadius::Ellipse); + return PeerUserpicImageValue(peer, size, KotatoImageRoundRadius()); } rpl::producer PeerUserpicImageValue( diff --git a/Telegram/SourceFiles/dialogs/dialogs_row.cpp b/Telegram/SourceFiles/dialogs/dialogs_row.cpp index 5d8937217..02d814ab2 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_row.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_row.cpp @@ -282,8 +282,12 @@ void Row::PaintCornerBadgeFrame( ? st::dialogsOnlineBadgeFgActive : st::dialogsOnlineBadgeFg); q.drawEllipse(QRectF( - st::dialogsPhotoSize - skip.x() - size, - st::dialogsPhotoSize - skip.y() - size, + st::dialogsPhotoSize - size - + (KotatoImageRoundRadius() == ImageRoundRadius::Ellipse + ? skip.x() : -(stroke / 2)), + st::dialogsPhotoSize - size - + (KotatoImageRoundRadius() == ImageRoundRadius::Ellipse + ? skip.y() : -(stroke / 2)), size, size ).marginsRemoved({ shrink, shrink, shrink, shrink })); @@ -358,12 +362,17 @@ void Row::paintUserpic( : st::dialogsBg; const auto size = st::dialogsCallBadgeSize; const auto skip = st::dialogsCallBadgeSkip; + const auto stroke = st::dialogsOnlineBadgeStroke; p.setOpacity(shown); p.translate(st::dialogsPadding); actionPainter->paintSpeaking( p, - st::dialogsPhotoSize - skip.x() - size, - st::dialogsPhotoSize - skip.y() - size, + st::dialogsPhotoSize - size - + (KotatoImageRoundRadius() == ImageRoundRadius::Ellipse + ? skip.x() : -(stroke / 2)), + st::dialogsPhotoSize - size - + (KotatoImageRoundRadius() == ImageRoundRadius::Ellipse + ? skip.y() : -(stroke / 2)), fullWidth, bg, now); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index ad0555171..66f112501 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2668,7 +2668,7 @@ void HistoryWidget::refreshSendAsToggle() { } else if (_sendAs) { return; } - _sendAs.create(this, st::sendAsButton); + _sendAs.create(this, st::sendAsButton, ::Kotato::JsonSettings::GetInt("userpic_corner_type")); Ui::SetupSendAsButton(_sendAs.data(), controller()); } @@ -6660,7 +6660,8 @@ void HistoryWidget::setupGroupCallBar() { HistoryView::GroupCallBarContentByPeer( peer, st::historyGroupCallUserpics.size), - Core::App().appDeactivatedValue()); + Core::App().appDeactivatedValue(), + ::Kotato::JsonSettings::GetInt("userpic_corner_type")); controller()->adaptive().oneColumnValue( ) | rpl::start_with_next([=](bool one) { @@ -6711,7 +6712,8 @@ void HistoryWidget::setupRequestsBar() { this, HistoryView::RequestsBarContentByPeer( peer, - st::historyRequestsUserpics.size)); + st::historyRequestsUserpics.size), + ::Kotato::JsonSettings::GetInt("userpic_corner_type")); controller()->adaptive().oneColumnValue( ) | rpl::start_with_next([=](bool one) { diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 6e33846c7..f11d7d957 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -2245,7 +2245,8 @@ bool ComposeControls::updateSendAsButton() { } _sendAs = std::make_unique( _wrap.get(), - st::sendAsButton); + st::sendAsButton, + ::Kotato::JsonSettings::GetInt("userpic_corner_type")); Ui::SetupSendAsButton( _sendAs.get(), rpl::single(peer.get()), diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index b2da03677..1a03959e8 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "history/view/history_view_context_menu.h" +#include "kotato/kotato_settings.h" #include "api/api_attached_stickers.h" #include "api/api_editing.h" #include "api/api_polls.h" @@ -1164,7 +1165,8 @@ void AddWhoReactedAction( menu.get(), Api::WhoReacted(item, context, st::defaultWhoRead, whoReadIds), participantChosen, - showAllChosen)); + showAllChosen, + ::Kotato::JsonSettings::GetInt("userpic_corner_type"))); } void ShowWhoReactedMenu( diff --git a/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp b/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp index 03a1fbe6d..b524da2d8 100644 --- a/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_group_call_bar.cpp @@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "calls/calls_instance.h" #include "core/application.h" #include "styles/style_chat.h" +#include "styles/style_widgets.h" namespace HistoryView { @@ -57,7 +58,24 @@ void GenerateUserpicsInRow( q.setCompositionMode(QPainter::CompositionMode_Source); q.setBrush(Qt::NoBrush); q.setPen(pen); - q.drawEllipse(x, 0, single, single); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + q.drawRoundedRect(QRect{ x, 0, single, single }, 0, 0); + break; + + case ImageRoundRadius::Small: + q.drawRoundedRect(QRect{ x, 0, single, single }, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + q.drawRoundedRect(QRect{ x, 0, single, single }, + st::dateRadius, st::dateRadius); + break; + + default: + q.drawEllipse(x, 0, single, single); + } x -= single - shift; } } diff --git a/Telegram/SourceFiles/history/view/media/history_view_contact.cpp b/Telegram/SourceFiles/history/view/media/history_view_contact.cpp index 3222bf47a..b31d3c78d 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_contact.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_contact.cpp @@ -188,7 +188,25 @@ void Contact::draw(Painter &p, const PaintContext &context) const { PainterHighQualityEnabler hq(p); p.setBrush(p.textPalette().selectOverlay); p.setPen(Qt::NoPen); - p.drawEllipse(rthumb); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + p.drawRoundedRect(rthumb, 0, 0); + break; + + case ImageRoundRadius::Small: + p.drawRoundedRect(rthumb, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + p.drawRoundedRect(rthumb, + st::dateRadius, st::dateRadius); + break; + + default: + p.drawEllipse(rthumb); + } + } bool over = ClickHandler::showAsActive(_linkl); diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index 516634307..f6a76e555 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -894,7 +894,24 @@ void Poll::paintRecentVoters( p.setPen(pen); p.setBrush(Qt::NoBrush); PainterHighQualityEnabler hq(p); - p.drawEllipse(x, y, size, size); + switch (KotatoImageRoundRadius()) { + case ImageRoundRadius::None: + p.drawRoundedRect(QRect{ x, y, size, size }, 0, 0); + break; + + case ImageRoundRadius::Small: + p.drawRoundedRect(QRect{ x, y, size, size }, + st::buttonRadius, st::buttonRadius); + break; + + case ImageRoundRadius::Large: + p.drawRoundedRect(QRect{ x, y, size, size }, + st::dateRadius, st::dateRadius); + break; + + default: + p.drawEllipse(x, y, size, size); + } }; if (usesBubblePattern(context)) { const auto add = st::lineWidth * 2; diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp index 6d69c1acb..becff9495 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp @@ -363,6 +363,10 @@ const std::map> DefinitionMap { .type = SettingType::IntSetting, .defaultValue = 20, .limitHandler = IntLimit(0, 200, 20), }}, + { "userpic_corner_type", { + .type = SettingType::IntSetting, + .defaultValue = 3, + .limitHandler = IntLimit(0, 3, 3), }}, }; using OldOptionKey = QString; diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp index 44bf9a196..c4140ea49 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -66,6 +66,26 @@ QString NetBoostLabel(int boost) { return QString(); } +QString UserpicRoundingLabel(int rounding) { + switch (rounding) { + case 0: + return ktr("ktg_settings_userpic_rounding_none"); + + case 1: + return ktr("ktg_settings_userpic_rounding_small"); + + case 2: + return ktr("ktg_settings_userpic_rounding_big"); + + case 3: + return ktr("ktg_settings_userpic_rounding_full"); + + default: + Unexpected("Rounding in Settings::UserpicRoundingLabel."); + } + return QString(); +} + QString ChatIdLabel(int option) { switch (option) { case 0: @@ -176,6 +196,38 @@ void SetupKotatoChats( Ui::show(Box()); }); + const auto userpicCornerButton = container->add( + object_ptr