mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Apply dark theme to reply controls in stories.
This commit is contained in:
parent
a745c9ff75
commit
75d2b5994f
32 changed files with 836 additions and 552 deletions
|
@ -11,9 +11,17 @@ using "boxes/boxes.style";
|
||||||
using "ui/layers/layers.style";
|
using "ui/layers/layers.style";
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
|
|
||||||
|
GroupCallUserpics {
|
||||||
|
size: pixels;
|
||||||
|
shift: pixels;
|
||||||
|
stroke: pixels;
|
||||||
|
align: align;
|
||||||
|
}
|
||||||
|
|
||||||
TabbedSearch {
|
TabbedSearch {
|
||||||
outer: color;
|
outer: color;
|
||||||
bg: color;
|
bg: color;
|
||||||
|
bgActive: color;
|
||||||
fg: color;
|
fg: color;
|
||||||
fgActive: color;
|
fgActive: color;
|
||||||
fadeLeft: icon;
|
fadeLeft: icon;
|
||||||
|
@ -44,14 +52,53 @@ EmojiPan {
|
||||||
iconArea: pixels;
|
iconArea: pixels;
|
||||||
bg: color;
|
bg: color;
|
||||||
overBg: color;
|
overBg: color;
|
||||||
|
expandBg: color;
|
||||||
|
pathBg: color;
|
||||||
|
pathFg: color;
|
||||||
|
textFg: color;
|
||||||
categoriesBg: color;
|
categoriesBg: color;
|
||||||
categoriesBgOver: color;
|
categoriesBgOver: color;
|
||||||
fadeLeft: icon;
|
fadeLeft: icon;
|
||||||
fadeRight: icon;
|
fadeRight: icon;
|
||||||
|
tabs: SettingsSlider;
|
||||||
search: TabbedSearch;
|
search: TabbedSearch;
|
||||||
searchMargin: margins;
|
searchMargin: margins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MessageBar {
|
||||||
|
title: TextStyle;
|
||||||
|
titleFg: color;
|
||||||
|
text: TextStyle;
|
||||||
|
textFg: color;
|
||||||
|
textPalette: TextPalette;
|
||||||
|
duration: int;
|
||||||
|
}
|
||||||
|
|
||||||
|
EmojiButton {
|
||||||
|
inner: IconButton;
|
||||||
|
bg: color;
|
||||||
|
lineFg: color;
|
||||||
|
lineFgOver: color;
|
||||||
|
}
|
||||||
|
|
||||||
|
SendButton {
|
||||||
|
inner: IconButton;
|
||||||
|
record: icon;
|
||||||
|
recordOver: icon;
|
||||||
|
sendDisabledFg: color;
|
||||||
|
}
|
||||||
|
|
||||||
|
ComposeControls {
|
||||||
|
bg: color;
|
||||||
|
radius: pixels;
|
||||||
|
|
||||||
|
field: InputField;
|
||||||
|
send: SendButton;
|
||||||
|
attach: IconButton;
|
||||||
|
emoji: EmojiButton;
|
||||||
|
tabbed: EmojiPan;
|
||||||
|
}
|
||||||
|
|
||||||
switchPmButton: RoundButton(defaultBoxButton) {
|
switchPmButton: RoundButton(defaultBoxButton) {
|
||||||
width: 320px;
|
width: 320px;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
|
@ -196,33 +243,7 @@ emojiPanSlideDuration: 200;
|
||||||
emojiPanArea: size(34px, 32px);
|
emojiPanArea: size(34px, 32px);
|
||||||
emojiPanRadius: 8px;
|
emojiPanRadius: 8px;
|
||||||
|
|
||||||
defaultTabbedSearch: TabbedSearch {
|
defaultTabbedSearchCancel: CrossButton {
|
||||||
outer: emojiPanBg;
|
|
||||||
bg: emojiPanHover;
|
|
||||||
fg: emojiIconFg;
|
|
||||||
fgActive: emojiSubIconFgActive;
|
|
||||||
fadeLeft: icon {{ "fade_horizontal-flip_horizontal", emojiPanHover }};
|
|
||||||
fadeRight: icon {{ "fade_horizontal", emojiPanHover }};
|
|
||||||
field: InputField(defaultMultiSelectSearchField) {
|
|
||||||
textMargins: margins(2px, 7px, 2px, 0px);
|
|
||||||
}
|
|
||||||
search: IconButton(defaultIconButton) {
|
|
||||||
width: 33px;
|
|
||||||
height: 33px;
|
|
||||||
icon: icon{{ "emoji/emoji_search_input", emojiIconFg }};
|
|
||||||
iconOver: icon{{ "emoji/emoji_search_input", emojiIconFg }};
|
|
||||||
iconPosition: point(7px, -1px);
|
|
||||||
ripple: emptyRippleAnimation;
|
|
||||||
}
|
|
||||||
back: IconButton(defaultIconButton) {
|
|
||||||
width: 33px;
|
|
||||||
height: 33px;
|
|
||||||
icon: icon{{ "emoji/emoji_back", menuIconFg }};
|
|
||||||
iconOver: icon{{ "emoji/emoji_back", menuIconFg }};
|
|
||||||
iconPosition: point(7px, -1px);
|
|
||||||
ripple: emptyRippleAnimation;
|
|
||||||
}
|
|
||||||
cancel: CrossButton {
|
|
||||||
width: 33px;
|
width: 33px;
|
||||||
height: 33px;
|
height: 33px;
|
||||||
|
|
||||||
|
@ -240,6 +261,37 @@ defaultTabbedSearch: TabbedSearch {
|
||||||
loadingPeriod: 1000;
|
loadingPeriod: 1000;
|
||||||
ripple: emptyRippleAnimation;
|
ripple: emptyRippleAnimation;
|
||||||
}
|
}
|
||||||
|
defaultTabbedSearchField: InputField(defaultMultiSelectSearchField) {
|
||||||
|
textMargins: margins(2px, 7px, 2px, 0px);
|
||||||
|
}
|
||||||
|
defaultTabbedSearchButton: IconButton(defaultIconButton) {
|
||||||
|
width: 33px;
|
||||||
|
height: 33px;
|
||||||
|
icon: icon{{ "emoji/emoji_search_input", emojiIconFg }};
|
||||||
|
iconOver: icon{{ "emoji/emoji_search_input", emojiIconFg }};
|
||||||
|
iconPosition: point(7px, -1px);
|
||||||
|
ripple: emptyRippleAnimation;
|
||||||
|
}
|
||||||
|
defaultTabbedSearchBack: IconButton(defaultIconButton) {
|
||||||
|
width: 33px;
|
||||||
|
height: 33px;
|
||||||
|
icon: icon{{ "emoji/emoji_back", menuIconFg }};
|
||||||
|
iconOver: icon{{ "emoji/emoji_back", menuIconFg }};
|
||||||
|
iconPosition: point(7px, -1px);
|
||||||
|
ripple: emptyRippleAnimation;
|
||||||
|
}
|
||||||
|
defaultTabbedSearch: TabbedSearch {
|
||||||
|
outer: emojiPanBg;
|
||||||
|
bg: emojiPanHover;
|
||||||
|
bgActive: windowBgRipple;
|
||||||
|
fg: emojiIconFg;
|
||||||
|
fgActive: emojiSubIconFgActive;
|
||||||
|
fadeLeft: icon {{ "fade_horizontal-flip_horizontal", emojiPanHover }};
|
||||||
|
fadeRight: icon {{ "fade_horizontal", emojiPanHover }};
|
||||||
|
field: defaultTabbedSearchField;
|
||||||
|
search: defaultTabbedSearchButton;
|
||||||
|
back: defaultTabbedSearchBack;
|
||||||
|
cancel: defaultTabbedSearchCancel;
|
||||||
defaultFieldWidth: 103px;
|
defaultFieldWidth: 103px;
|
||||||
groupWidth: 30px;
|
groupWidth: 30px;
|
||||||
groupSkip: 2px;
|
groupSkip: 2px;
|
||||||
|
@ -261,10 +313,15 @@ defaultEmojiPan: EmojiPan {
|
||||||
iconArea: 28px;
|
iconArea: 28px;
|
||||||
bg: emojiPanBg;
|
bg: emojiPanBg;
|
||||||
overBg: emojiPanHover;
|
overBg: emojiPanHover;
|
||||||
|
expandBg: emojiPanHeaderFg;
|
||||||
|
pathBg: windowBgRipple;
|
||||||
|
pathFg: windowBgOver;
|
||||||
|
textFg: windowFg;
|
||||||
categoriesBg: emojiPanCategories;
|
categoriesBg: emojiPanCategories;
|
||||||
categoriesBgOver: windowBgRipple;
|
categoriesBgOver: windowBgRipple;
|
||||||
fadeLeft: icon {{ "fade_horizontal-flip_horizontal", emojiPanCategories }};
|
fadeLeft: icon {{ "fade_horizontal-flip_horizontal", emojiPanCategories }};
|
||||||
fadeRight: icon {{ "fade_horizontal", emojiPanCategories }};
|
fadeRight: icon {{ "fade_horizontal", emojiPanCategories }};
|
||||||
|
tabs: emojiTabs;
|
||||||
search: defaultTabbedSearch;
|
search: defaultTabbedSearch;
|
||||||
searchMargin: margins(1px, 11px, 2px, 5px);
|
searchMargin: margins(1px, 11px, 2px, 5px);
|
||||||
}
|
}
|
||||||
|
@ -428,3 +485,377 @@ emojiSuggestionsFadeRight: icon {{ "fade_horizontal", boxBg }};
|
||||||
choosePeerGroupIcon: icon {{ "info/edit/create_group", lightButtonFg }};
|
choosePeerGroupIcon: icon {{ "info/edit/create_group", lightButtonFg }};
|
||||||
choosePeerChannelIcon: icon {{ "info/edit/create_channel", lightButtonFg }};
|
choosePeerChannelIcon: icon {{ "info/edit/create_channel", lightButtonFg }};
|
||||||
choosePeerCreateIconLeft: 25px;
|
choosePeerCreateIconLeft: 25px;
|
||||||
|
|
||||||
|
historyRequestsUserpics: GroupCallUserpics {
|
||||||
|
size: 22px;
|
||||||
|
shift: 8px;
|
||||||
|
stroke: 4px;
|
||||||
|
align: align(left);
|
||||||
|
}
|
||||||
|
historyRequestsHeight: 33px;
|
||||||
|
|
||||||
|
historySlowmodeCounterMargins: margins(0px, 0px, 10px, 0px);
|
||||||
|
|
||||||
|
historyComposeAreaPalette: TextPalette(defaultTextPalette) {
|
||||||
|
linkFg: historyComposeAreaFgService;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultMessageBar: MessageBar {
|
||||||
|
title: semiboldTextStyle;
|
||||||
|
titleFg: windowActiveTextFg;
|
||||||
|
text: defaultTextStyle;
|
||||||
|
textFg: historyComposeAreaFg;
|
||||||
|
textPalette: historyComposeAreaPalette;
|
||||||
|
duration: 160;
|
||||||
|
}
|
||||||
|
|
||||||
|
historyComposeButton: FlatButton {
|
||||||
|
color: windowActiveTextFg;
|
||||||
|
overColor: windowActiveTextFg;
|
||||||
|
|
||||||
|
bgColor: historyComposeButtonBg;
|
||||||
|
overBgColor: historyComposeButtonBgOver;
|
||||||
|
|
||||||
|
width: -32px;
|
||||||
|
height: 46px;
|
||||||
|
|
||||||
|
textTop: 14px;
|
||||||
|
|
||||||
|
font: semiboldFont;
|
||||||
|
overFont: semiboldFont;
|
||||||
|
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: historyComposeButtonBgRipple;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
historyUnblock: FlatButton(historyComposeButton) {
|
||||||
|
color: attentionButtonFg;
|
||||||
|
overColor: attentionButtonFgOver;
|
||||||
|
}
|
||||||
|
historyContactStatusButton: FlatButton(historyComposeButton) {
|
||||||
|
height: 49px;
|
||||||
|
textTop: 16px;
|
||||||
|
overBgColor: historyComposeButtonBg;
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: historyComposeButtonBgOver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
historyContactStatusBlock: FlatButton(historyContactStatusButton) {
|
||||||
|
color: attentionButtonFg;
|
||||||
|
overColor: attentionButtonFg;
|
||||||
|
}
|
||||||
|
historyContactStatusLabel: FlatLabel(defaultFlatLabel) {
|
||||||
|
minWidth: 240px;
|
||||||
|
}
|
||||||
|
historyEmojiStatusInfoLabel: FlatLabel(historyContactStatusLabel) {
|
||||||
|
align: align(top);
|
||||||
|
textFg: windowSubTextFg;
|
||||||
|
}
|
||||||
|
historyContactStatusMinSkip: 16px;
|
||||||
|
|
||||||
|
historyReplySkip: 51px;
|
||||||
|
historyReplyNameFg: windowActiveTextFg;
|
||||||
|
historyReplyHeight: 49px;
|
||||||
|
historyReplyIconPosition: point(5px, 5px);
|
||||||
|
historyReplyIcon: icon {{ "chat/input_reply", historyReplyIconFg }};
|
||||||
|
historyForwardIcon: icon {{ "chat/input_forward", historyReplyIconFg }};
|
||||||
|
historyEditIcon: icon {{ "chat/input_edit", historyReplyIconFg }};
|
||||||
|
historyReplyCancel: IconButton {
|
||||||
|
width: 49px;
|
||||||
|
height: 49px;
|
||||||
|
|
||||||
|
icon: historyReplyCancelIcon;
|
||||||
|
iconOver: historyReplyCancelIconOver;
|
||||||
|
iconPosition: point(-1px, -1px);
|
||||||
|
|
||||||
|
rippleAreaPosition: point(4px, 4px);
|
||||||
|
rippleAreaSize: 40px;
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: windowBgOver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
historyPinnedShowAll: IconButton(historyReplyCancel) {
|
||||||
|
icon: icon {{ "pinned_show_all", historyReplyCancelFg }};
|
||||||
|
iconOver: icon {{ "pinned_show_all", historyReplyCancelFgOver }};
|
||||||
|
}
|
||||||
|
historyPinnedBotButton: RoundButton(defaultActiveButton) {
|
||||||
|
width: -34px;
|
||||||
|
height: 30px;
|
||||||
|
textTop: 6px;
|
||||||
|
padding: margins(2px, 10px, 10px, 9px);
|
||||||
|
}
|
||||||
|
historyPinnedBotButtonMaxWidth: 150px;
|
||||||
|
|
||||||
|
historyToDownPosition: point(12px, 10px);
|
||||||
|
historyToDownAbove: icon {{ "history_down_arrow", historyToDownFg }};
|
||||||
|
historyToDownAboveOver: icon {{ "history_down_arrow", historyToDownFgOver }};
|
||||||
|
historyToDownPaddingTop: 10px;
|
||||||
|
historyToDownBelow: icon {
|
||||||
|
{ "history_down_shadow", historyToDownShadow },
|
||||||
|
{ "history_down_circle", historyToDownBg },
|
||||||
|
};
|
||||||
|
historyToDownBelowOver: icon {
|
||||||
|
{ "history_down_shadow", historyToDownShadow },
|
||||||
|
{ "history_down_circle", historyToDownBgOver },
|
||||||
|
};
|
||||||
|
historyToDown: TwoIconButton {
|
||||||
|
width: 52px;
|
||||||
|
height: 62px;
|
||||||
|
|
||||||
|
iconBelow: historyToDownBelow;
|
||||||
|
iconBelowOver: historyToDownBelowOver;
|
||||||
|
iconAbove: historyToDownAbove;
|
||||||
|
iconAboveOver: historyToDownAboveOver;
|
||||||
|
iconPosition: point(0px, historyToDownPaddingTop);
|
||||||
|
|
||||||
|
rippleAreaPosition: point(5px, 15px);
|
||||||
|
rippleAreaSize: 42px;
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: historyToDownBgRipple;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
historyToDownBadgeFont: semiboldFont;
|
||||||
|
historyToDownBadgeSize: 22px;
|
||||||
|
|
||||||
|
historyToDownShownAfter: 480px;
|
||||||
|
historyToDownDuration: 150;
|
||||||
|
|
||||||
|
dialogsToUpAbove: icon {{ "history_down_arrow-flip_vertical", historyToDownFg, point(0px, 1px) }};
|
||||||
|
dialogsToUpAboveOver: icon {{ "history_down_arrow-flip_vertical", historyToDownFgOver, point(0px, 1px) }};
|
||||||
|
|
||||||
|
dialogsToUp: TwoIconButton(historyToDown) {
|
||||||
|
iconAbove: dialogsToUpAbove;
|
||||||
|
iconAboveOver: dialogsToUpAboveOver;
|
||||||
|
}
|
||||||
|
|
||||||
|
historyUnreadMentions: TwoIconButton(historyToDown) {
|
||||||
|
iconAbove: icon {{ "history_unread_mention", historyToDownFg }};
|
||||||
|
iconAboveOver: icon {{ "history_unread_mention", historyToDownFgOver }};
|
||||||
|
}
|
||||||
|
historyUnreadReactions: TwoIconButton(historyToDown) {
|
||||||
|
iconAbove: icon {{ "history_unread_reaction", historyToDownFg }};
|
||||||
|
iconAboveOver: icon {{ "history_unread_reaction", historyToDownFgOver }};
|
||||||
|
}
|
||||||
|
historyUnreadThingsSkip: 4px;
|
||||||
|
|
||||||
|
historyComposeField: InputField(defaultInputField) {
|
||||||
|
font: normalFont;
|
||||||
|
textMargins: margins(0px, 0px, 0px, 0px);
|
||||||
|
textAlign: align(left);
|
||||||
|
textFg: historyComposeAreaFg;
|
||||||
|
textBg: historyComposeAreaBg;
|
||||||
|
heightMin: 36px;
|
||||||
|
heightMax: 72px;
|
||||||
|
placeholderFg: placeholderFg;
|
||||||
|
placeholderFgActive: placeholderFgActive;
|
||||||
|
placeholderFgError: placeholderFgActive;
|
||||||
|
placeholderMargins: margins(7px, 5px, 7px, 5px);
|
||||||
|
placeholderAlign: align(topleft);
|
||||||
|
placeholderScale: 0.;
|
||||||
|
placeholderFont: normalFont;
|
||||||
|
placeholderShift: -50px;
|
||||||
|
border: 0px;
|
||||||
|
borderActive: 0px;
|
||||||
|
duration: 100;
|
||||||
|
}
|
||||||
|
historyComposeFieldMaxHeight: 224px;
|
||||||
|
// historyMinHeight: 56px;
|
||||||
|
|
||||||
|
historyAttach: IconButton(defaultIconButton) {
|
||||||
|
width: 44px;
|
||||||
|
height: 46px;
|
||||||
|
|
||||||
|
icon: icon {{ "chat/input_attach", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_attach", historyComposeIconFgOver }};
|
||||||
|
|
||||||
|
rippleAreaPosition: point(2px, 3px);
|
||||||
|
rippleAreaSize: 40px;
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: windowBgOver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
historyMessagesTTL: IconButtonWithText {
|
||||||
|
iconButton: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_autodelete", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_autodelete", historyComposeIconFgOver }};
|
||||||
|
}
|
||||||
|
textFg: historyComposeIconFg;
|
||||||
|
textFgOver: historyComposeIconFgOver;
|
||||||
|
textPadding: margins(21px, 20px, 3px, 7px);
|
||||||
|
textAlign: align(left);
|
||||||
|
|
||||||
|
font: font(10px semibold);
|
||||||
|
}
|
||||||
|
historyReplaceMedia: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_replace", windowBgActive }};
|
||||||
|
iconOver: icon {{ "chat/input_replace", windowBgActive }};
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: lightButtonBgOver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
historyAttachEmojiActive: icon {{ "chat/input_smile_face", windowBgActive }};
|
||||||
|
historyEmojiCircle: size(20px, 20px);
|
||||||
|
historyEmojiCircleLine: 1.5;
|
||||||
|
historyEmojiCircleFg: historyComposeIconFg;
|
||||||
|
historyEmojiCircleFgOver: historyComposeIconFgOver;
|
||||||
|
historyBotKeyboardShow: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_bot_keyboard", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_bot_keyboard", historyComposeIconFgOver }};
|
||||||
|
}
|
||||||
|
historyBotKeyboardHide: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_bot_keyboard_hide", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_bot_keyboard_hide", historyComposeIconFgOver }};
|
||||||
|
}
|
||||||
|
historyBotCommandStart: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_bot_command", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_bot_command", historyComposeIconFgOver }};
|
||||||
|
}
|
||||||
|
historyScheduledToggle: IconButton(historyAttach) {
|
||||||
|
icon: icon {
|
||||||
|
{ "chat/input_scheduled", historyComposeIconFg },
|
||||||
|
{ "chat/input_scheduled_dot", attentionButtonFg }
|
||||||
|
};
|
||||||
|
iconOver: icon {
|
||||||
|
{ "chat/input_scheduled", historyComposeIconFgOver },
|
||||||
|
{ "chat/input_scheduled_dot", attentionButtonFg }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
historyAttachEmojiInner: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_smile_face", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_smile_face", historyComposeIconFgOver }};
|
||||||
|
}
|
||||||
|
historyAttachEmoji: EmojiButton {
|
||||||
|
inner: historyAttachEmojiInner;
|
||||||
|
bg: historyComposeAreaBg;
|
||||||
|
lineFg: historyEmojiCircleFg;
|
||||||
|
lineFgOver: historyEmojiCircleFgOver;
|
||||||
|
}
|
||||||
|
boxAttachEmoji: EmojiButton(historyAttachEmoji) {
|
||||||
|
inner: IconButton(historyAttachEmojiInner) {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
rippleAreaSize: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boxAttachEmojiTop: 20px;
|
||||||
|
|
||||||
|
historySendIcon: icon {{ "chat/input_send", historySendIconFg }};
|
||||||
|
historySendIconOver: icon {{ "chat/input_send", historySendIconFgOver }};
|
||||||
|
historySendIconPosition: point(10px, 11px);
|
||||||
|
historySendSize: size(44px, 46px);
|
||||||
|
historyScheduleIcon: icon {{ "chat/input_schedule", historyComposeAreaBg }};
|
||||||
|
historyScheduleIconPosition: point(7px, 8px);
|
||||||
|
historyEditSaveIcon: icon {{ "chat/input_save", historySendIconFg }};
|
||||||
|
historyEditSaveIconOver: icon {{ "chat/input_save", historySendIconFgOver }};
|
||||||
|
|
||||||
|
historyEditMediaBg: videoPlayIconBg;
|
||||||
|
historyEditMedia: icon{{ "chat/input_draw", videoPlayIconFg }};
|
||||||
|
historyMessagesTTLPickerHeight: 200px;
|
||||||
|
historyMessagesTTLPickerItemHeight: 40px;
|
||||||
|
historyMessagesTTLLabel: FlatLabel(defaultFlatLabel) {
|
||||||
|
minWidth: 200px;
|
||||||
|
align: align(topleft);
|
||||||
|
textFg: windowSubTextFg;
|
||||||
|
}
|
||||||
|
|
||||||
|
historyRecordVoiceFg: historyComposeIconFg;
|
||||||
|
historyRecordVoiceFgOver: historyComposeIconFgOver;
|
||||||
|
historyRecordVoiceFgInactive: attentionButtonFg;
|
||||||
|
historyRecordVoiceFgActive: windowBgActive;
|
||||||
|
historyRecordVoiceFgActiveIcon: windowFgActive;
|
||||||
|
historyRecordVoiceShowDuration: 120;
|
||||||
|
historyRecordVoiceDuration: 120;
|
||||||
|
historyRecordVoice: icon {{ "chat/input_record", historyRecordVoiceFg }};
|
||||||
|
historyRecordVoiceOver: icon {{ "chat/input_record", historyRecordVoiceFgOver }};
|
||||||
|
historyRecordVoiceActive: icon {{ "chat/input_record_filled", historyRecordVoiceFgActiveIcon }};
|
||||||
|
historyRecordSendIconPosition: point(2px, 0px);
|
||||||
|
historyRecordVoiceRippleBgActive: lightButtonBgOver;
|
||||||
|
historyRecordSignalRadius: 5px;
|
||||||
|
historyRecordCancel: windowSubTextFg;
|
||||||
|
historyRecordCancelActive: windowActiveTextFg;
|
||||||
|
historyRecordFont: font(13px);
|
||||||
|
historyRecordDurationSkip: 12px;
|
||||||
|
historyRecordDurationFg: historyComposeAreaFg;
|
||||||
|
|
||||||
|
historyRecordMainBlobMinRadius: 23px;
|
||||||
|
historyRecordMainBlobMaxRadius: 37px;
|
||||||
|
historyRecordMinorBlobMinRadius: 40px;
|
||||||
|
historyRecordMinorBlobMaxRadius: 47px;
|
||||||
|
historyRecordMajorBlobMinRadius: 43px;
|
||||||
|
historyRecordMajorBlobMaxRadius: 50px;
|
||||||
|
|
||||||
|
historyRecordTextStyle: TextStyle(defaultTextStyle) {
|
||||||
|
font: historyRecordFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
historyRecordTextWidthForWrap: 210px;
|
||||||
|
historyRecordTextLeft: 15px;
|
||||||
|
historyRecordTextRight: 25px;
|
||||||
|
|
||||||
|
historyRecordLockShowDuration: historyToDownDuration;
|
||||||
|
historyRecordLockSize: size(75px, 133px);
|
||||||
|
|
||||||
|
historyRecordLockIconFg: historyToDownFg;
|
||||||
|
historyRecordLockIconSize: size(14px, 17px);
|
||||||
|
historyRecordLockIconBottomHeight: 9px;
|
||||||
|
historyRecordLockIconLineHeight: 2px;
|
||||||
|
historyRecordLockIconLineSkip: 3px;
|
||||||
|
historyRecordLockIconLineWidth: 2px;
|
||||||
|
historyRecordLockIconArcHeight: 4px;
|
||||||
|
historyRecordStopIconWidth: 12px;
|
||||||
|
|
||||||
|
historyRecordLockTopShadow: icon {{ "voice_lock/record_lock_top_shadow", historyToDownShadow }};
|
||||||
|
historyRecordLockTop: icon {{ "voice_lock/record_lock_top", historyToDownBg }};
|
||||||
|
historyRecordLockBottomShadow: icon {{ "voice_lock/record_lock_bottom_shadow", historyToDownShadow }};
|
||||||
|
historyRecordLockBottom: icon {{ "voice_lock/record_lock_bottom", historyToDownBg }};
|
||||||
|
historyRecordLockBodyShadow: icon {{ "voice_lock/record_lock_body_shadow", historyToDownShadow }};
|
||||||
|
historyRecordLockBody: icon {{ "voice_lock/record_lock_body", historyToDownBg }};
|
||||||
|
historyRecordLockMargin: margins(4px, 4px, 4px, 4px);
|
||||||
|
historyRecordLockArrow: icon {{ "voice_lock/voice_arrow", historyToDownFg }};
|
||||||
|
historyRecordLockRippleMargin: margins(6px, 6px, 6px, 6px);
|
||||||
|
|
||||||
|
historyRecordDelete: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "info/info_media_delete", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "info/info_media_delete", historyComposeIconFgOver }};
|
||||||
|
iconPosition: point(10px, 11px);
|
||||||
|
}
|
||||||
|
historyRecordWaveformRightSkip: 10px;
|
||||||
|
historyRecordWaveformBgMargins: margins(5px, 7px, 5px, 7px);
|
||||||
|
|
||||||
|
historyRecordWaveformBar: 3px;
|
||||||
|
|
||||||
|
historyRecordLockPosition: point(1px, 35px);
|
||||||
|
|
||||||
|
historyRecordCancelButtonWidth: 100px;
|
||||||
|
historyRecordCancelButtonFg: lightButtonFg;
|
||||||
|
|
||||||
|
historySilentToggle: IconButton(historyBotKeyboardShow) {
|
||||||
|
icon: icon {{ "chat/input_silent", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "chat/input_silent", historyComposeIconFgOver }};
|
||||||
|
}
|
||||||
|
historySilentToggleOn: icon {{ "chat/input_silent_on", historyComposeIconFg }};
|
||||||
|
historySilentToggleOnOver: icon {{ "chat/input_silent_on", historyComposeIconFgOver }};
|
||||||
|
|
||||||
|
historySend: SendButton {
|
||||||
|
inner: IconButton(historyAttach) {
|
||||||
|
icon: historySendIcon;
|
||||||
|
iconOver: historySendIconOver;
|
||||||
|
}
|
||||||
|
record: historyRecordVoice;
|
||||||
|
recordOver: historyRecordVoiceOver;
|
||||||
|
sendDisabledFg: historyComposeIconFg;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultComposeControls: ComposeControls {
|
||||||
|
bg: historyComposeAreaBg;
|
||||||
|
radius: 0px;
|
||||||
|
|
||||||
|
field: historyComposeField;
|
||||||
|
send: historySend;
|
||||||
|
attach: historyAttach;
|
||||||
|
emoji: historyAttachEmoji;
|
||||||
|
tabbed: defaultEmojiPan;
|
||||||
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ using Core::RecentEmojiDocument;
|
||||||
|
|
||||||
class EmojiColorPicker final : public Ui::RpWidget {
|
class EmojiColorPicker final : public Ui::RpWidget {
|
||||||
public:
|
public:
|
||||||
EmojiColorPicker(QWidget *parent);
|
EmojiColorPicker(QWidget *parent, const style::EmojiPan &st);
|
||||||
|
|
||||||
void showEmoji(EmojiPtr emoji);
|
void showEmoji(EmojiPtr emoji);
|
||||||
|
|
||||||
|
@ -87,6 +87,8 @@ private:
|
||||||
void updateSelected();
|
void updateSelected();
|
||||||
void setSelected(int newSelected);
|
void setSelected(int newSelected);
|
||||||
|
|
||||||
|
const style::EmojiPan &_st;
|
||||||
|
|
||||||
bool _ignoreShow = false;
|
bool _ignoreShow = false;
|
||||||
|
|
||||||
QVector<EmojiPtr> _variants;
|
QVector<EmojiPtr> _variants;
|
||||||
|
@ -118,9 +120,12 @@ struct EmojiListWidget::RecentOne {
|
||||||
RecentEmojiId id;
|
RecentEmojiId id;
|
||||||
};
|
};
|
||||||
|
|
||||||
EmojiColorPicker::EmojiColorPicker(QWidget *parent)
|
EmojiColorPicker::EmojiColorPicker(
|
||||||
|
QWidget *parent,
|
||||||
|
const style::EmojiPan &st)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _overBg(st::emojiPanRadius, st::emojiPanHover) {
|
, _st(st)
|
||||||
|
, _overBg(st::emojiPanRadius, _st.overBg) {
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +403,7 @@ EmojiListWidget::EmojiListWidget(
|
||||||
, _customRecentFactory(std::move(descriptor.customRecentFactory))
|
, _customRecentFactory(std::move(descriptor.customRecentFactory))
|
||||||
, _overBg(st::emojiPanRadius, st().overBg)
|
, _overBg(st::emojiPanRadius, st().overBg)
|
||||||
, _collapsedBg(st::emojiPanExpand.height / 2, st::emojiPanHeaderFg)
|
, _collapsedBg(st::emojiPanExpand.height / 2, st::emojiPanHeaderFg)
|
||||||
, _picker(this)
|
, _picker(this, st())
|
||||||
, _showPickerTimer([=] { showPicker(); }) {
|
, _showPickerTimer([=] { showPicker(); }) {
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
if (st().bg->c.alpha() > 0) {
|
if (st().bg->c.alpha() > 0) {
|
||||||
|
@ -1006,7 +1011,7 @@ void EmojiListWidget::validateEmojiPaintContext(
|
||||||
st::stickerPanPremium1,
|
st::stickerPanPremium1,
|
||||||
st::stickerPanPremium2,
|
st::stickerPanPremium2,
|
||||||
0.5)
|
0.5)
|
||||||
: st::windowFg->c),
|
: st().textFg->c),
|
||||||
.size = QSize(_customSingleSize, _customSingleSize),
|
.size = QSize(_customSingleSize, _customSingleSize),
|
||||||
.now = crl::now(),
|
.now = crl::now(),
|
||||||
.scale = context.progress,
|
.scale = context.progress,
|
||||||
|
@ -1178,7 +1183,7 @@ void EmojiListWidget::drawCollapsedBadge(
|
||||||
const auto buttonx = position.x() + (_singleSize.width() - buttonw) / 2;
|
const auto buttonx = position.x() + (_singleSize.width() - buttonw) / 2;
|
||||||
const auto buttony = position.y() + (_singleSize.height() - buttonh) / 2;
|
const auto buttony = position.y() + (_singleSize.height() - buttonh) / 2;
|
||||||
_collapsedBg.paint(p, QRect(buttonx, buttony, buttonw, buttonh));
|
_collapsedBg.paint(p, QRect(buttonx, buttony, buttonw, buttonh));
|
||||||
p.setPen(st::emojiPanBg);
|
p.setPen(this->st().bg);
|
||||||
p.setFont(st.font);
|
p.setFont(st.font);
|
||||||
p.drawText(
|
p.drawText(
|
||||||
buttonx + (buttonw - textWidth) / 2,
|
buttonx + (buttonw - textWidth) / 2,
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
|
|
||||||
Inner(
|
Inner(
|
||||||
std::shared_ptr<ChatHelpers::Show> show,
|
std::shared_ptr<ChatHelpers::Show> show,
|
||||||
|
const style::EmojiPan &st,
|
||||||
not_null<FieldAutocomplete*> parent,
|
not_null<FieldAutocomplete*> parent,
|
||||||
not_null<MentionRows*> mrows,
|
not_null<MentionRows*> mrows,
|
||||||
not_null<HashtagRows*> hrows,
|
not_null<HashtagRows*> hrows,
|
||||||
|
@ -126,11 +127,13 @@ private:
|
||||||
|
|
||||||
const std::shared_ptr<ChatHelpers::Show> _show;
|
const std::shared_ptr<ChatHelpers::Show> _show;
|
||||||
const not_null<Main::Session*> _session;
|
const not_null<Main::Session*> _session;
|
||||||
|
const style::EmojiPan &_st;
|
||||||
const not_null<FieldAutocomplete*> _parent;
|
const not_null<FieldAutocomplete*> _parent;
|
||||||
const not_null<MentionRows*> _mrows;
|
const not_null<MentionRows*> _mrows;
|
||||||
const not_null<HashtagRows*> _hrows;
|
const not_null<HashtagRows*> _hrows;
|
||||||
const not_null<BotCommandRows*> _brows;
|
const not_null<BotCommandRows*> _brows;
|
||||||
const not_null<StickerRows*> _srows;
|
const not_null<StickerRows*> _srows;
|
||||||
|
Ui::RoundRect _overBg;
|
||||||
rpl::lifetime _stickersLifetime;
|
rpl::lifetime _stickersLifetime;
|
||||||
std::weak_ptr<Lottie::FrameRenderer> _lottieRenderer;
|
std::weak_ptr<Lottie::FrameRenderer> _lottieRenderer;
|
||||||
base::unique_qptr<Ui::PopupMenu> _menu;
|
base::unique_qptr<Ui::PopupMenu> _menu;
|
||||||
|
@ -192,10 +195,12 @@ FieldAutocomplete::FieldAutocomplete(
|
||||||
|
|
||||||
FieldAutocomplete::FieldAutocomplete(
|
FieldAutocomplete::FieldAutocomplete(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
std::shared_ptr<ChatHelpers::Show> show)
|
std::shared_ptr<ChatHelpers::Show> show,
|
||||||
|
const style::EmojiPan *stOverride)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _show(std::move(show))
|
, _show(std::move(show))
|
||||||
, _session(&_show->session())
|
, _session(&_show->session())
|
||||||
|
, _st(stOverride ? *stOverride : st::defaultEmojiPan)
|
||||||
, _scroll(this) {
|
, _scroll(this) {
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
|
@ -204,6 +209,7 @@ FieldAutocomplete::FieldAutocomplete(
|
||||||
_inner = _scroll->setOwnedWidget(
|
_inner = _scroll->setOwnedWidget(
|
||||||
object_ptr<Inner>(
|
object_ptr<Inner>(
|
||||||
_show,
|
_show,
|
||||||
|
_st,
|
||||||
this,
|
this,
|
||||||
&_mrows,
|
&_mrows,
|
||||||
&_hrows,
|
&_hrows,
|
||||||
|
@ -285,7 +291,7 @@ void FieldAutocomplete::paintEvent(QPaintEvent *e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.fillRect(rect(), st::mentionBg);
|
p.fillRect(rect(), _st.bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FieldAutocomplete::showFiltered(
|
void FieldAutocomplete::showFiltered(
|
||||||
|
@ -817,6 +823,7 @@ bool FieldAutocomplete::eventFilter(QObject *obj, QEvent *e) {
|
||||||
|
|
||||||
FieldAutocomplete::Inner::Inner(
|
FieldAutocomplete::Inner::Inner(
|
||||||
std::shared_ptr<ChatHelpers::Show> show,
|
std::shared_ptr<ChatHelpers::Show> show,
|
||||||
|
const style::EmojiPan &st,
|
||||||
not_null<FieldAutocomplete*> parent,
|
not_null<FieldAutocomplete*> parent,
|
||||||
not_null<MentionRows*> mrows,
|
not_null<MentionRows*> mrows,
|
||||||
not_null<HashtagRows*> hrows,
|
not_null<HashtagRows*> hrows,
|
||||||
|
@ -824,14 +831,16 @@ FieldAutocomplete::Inner::Inner(
|
||||||
not_null<StickerRows*> srows)
|
not_null<StickerRows*> srows)
|
||||||
: _show(std::move(show))
|
: _show(std::move(show))
|
||||||
, _session(&_show->session())
|
, _session(&_show->session())
|
||||||
|
, _st(st)
|
||||||
, _parent(parent)
|
, _parent(parent)
|
||||||
, _mrows(mrows)
|
, _mrows(mrows)
|
||||||
, _hrows(hrows)
|
, _hrows(hrows)
|
||||||
, _brows(brows)
|
, _brows(brows)
|
||||||
, _srows(srows)
|
, _srows(srows)
|
||||||
|
, _overBg(st::roundRadiusSmall, _st.overBg)
|
||||||
, _pathGradient(std::make_unique<Ui::PathShiftGradient>(
|
, _pathGradient(std::make_unique<Ui::PathShiftGradient>(
|
||||||
st::windowBgRipple,
|
_st.pathBg,
|
||||||
st::windowBgOver,
|
_st.pathFg,
|
||||||
[=] { update(); }))
|
[=] { update(); }))
|
||||||
, _premiumMark(_session)
|
, _premiumMark(_session)
|
||||||
, _previewTimer([=] { showPreview(); }) {
|
, _previewTimer([=] { showPreview(); }) {
|
||||||
|
@ -900,7 +909,7 @@ void FieldAutocomplete::Inner::paintEvent(QPaintEvent *e) {
|
||||||
if (_sel == index) {
|
if (_sel == index) {
|
||||||
QPoint tl(pos);
|
QPoint tl(pos);
|
||||||
if (rtl()) tl.setX(width() - tl.x() - st::stickerPanSize.width());
|
if (rtl()) tl.setX(width() - tl.x() - st::stickerPanSize.width());
|
||||||
Ui::FillRoundRect(p, QRect(tl, st::stickerPanSize), st::emojiPanHover, Ui::StickerHoverCorners);
|
_overBg.paint(p, QRect(tl, st::stickerPanSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
media->checkStickerSmall();
|
media->checkStickerSmall();
|
||||||
|
|
|
@ -14,6 +14,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
#include "base/object_ptr.h"
|
#include "base/object_ptr.h"
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct EmojiPan;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PopupMenu;
|
class PopupMenu;
|
||||||
class ScrollArea;
|
class ScrollArea;
|
||||||
|
@ -53,7 +57,8 @@ public:
|
||||||
not_null<Window::SessionController*> controller);
|
not_null<Window::SessionController*> controller);
|
||||||
FieldAutocomplete(
|
FieldAutocomplete(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
std::shared_ptr<ChatHelpers::Show> show);
|
std::shared_ptr<ChatHelpers::Show> show,
|
||||||
|
const style::EmojiPan *stOverride = nullptr);
|
||||||
~FieldAutocomplete();
|
~FieldAutocomplete();
|
||||||
|
|
||||||
[[nodiscard]] std::shared_ptr<ChatHelpers::Show> uiShow() const;
|
[[nodiscard]] std::shared_ptr<ChatHelpers::Show> uiShow() const;
|
||||||
|
@ -153,6 +158,7 @@ private:
|
||||||
|
|
||||||
const std::shared_ptr<ChatHelpers::Show> _show;
|
const std::shared_ptr<ChatHelpers::Show> _show;
|
||||||
const not_null<Main::Session*> _session;
|
const not_null<Main::Session*> _session;
|
||||||
|
const style::EmojiPan &_st;
|
||||||
QPixmap _cache;
|
QPixmap _cache;
|
||||||
MentionRows _mrows;
|
MentionRows _mrows;
|
||||||
HashtagRows _hrows;
|
HashtagRows _hrows;
|
||||||
|
|
|
@ -98,7 +98,7 @@ GifsListWidget::GifsListWidget(
|
||||||
GifsListDescriptor &&descriptor)
|
GifsListDescriptor &&descriptor)
|
||||||
: Inner(
|
: Inner(
|
||||||
parent,
|
parent,
|
||||||
st::defaultEmojiPan,
|
descriptor.st ? *descriptor.st : st::defaultEmojiPan,
|
||||||
descriptor.show,
|
descriptor.show,
|
||||||
descriptor.paused)
|
descriptor.paused)
|
||||||
, _show(std::move(descriptor.show))
|
, _show(std::move(descriptor.show))
|
||||||
|
@ -332,7 +332,7 @@ void GifsListWidget::inlineResultsDone(const MTPmessages_BotResults &result) {
|
||||||
void GifsListWidget::paintEvent(QPaintEvent *e) {
|
void GifsListWidget::paintEvent(QPaintEvent *e) {
|
||||||
Painter p(this);
|
Painter p(this);
|
||||||
auto clip = e->rect();
|
auto clip = e->rect();
|
||||||
p.fillRect(clip, st::emojiPanBg);
|
p.fillRect(clip, st().bg);
|
||||||
|
|
||||||
paintInlineItems(p, clip);
|
paintInlineItems(p, clip);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_layers.h"
|
#include "styles/style_layers.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "base/qt/qt_common_adapters.h"
|
#include "base/qt/qt_common_adapters.h"
|
||||||
|
|
||||||
#include <QtCore/QMimeData>
|
#include <QtCore/QMimeData>
|
||||||
|
|
|
@ -1351,7 +1351,7 @@ void StickersListFooter::paintSetIconToCache(
|
||||||
const auto y = (st().footer - icon.pixh) / 2;
|
const auto y = (st().footer - icon.pixh) / 2;
|
||||||
if (icon.custom) {
|
if (icon.custom) {
|
||||||
icon.custom->paint(p, Ui::Text::CustomEmoji::Context{
|
icon.custom->paint(p, Ui::Text::CustomEmoji::Context{
|
||||||
.textColor = st::windowFg->c,
|
.textColor = st().textFg->c,
|
||||||
.size = QSize(icon.pixw, icon.pixh),
|
.size = QSize(icon.pixw, icon.pixh),
|
||||||
.now = now,
|
.now = now,
|
||||||
.scale = context.progress,
|
.scale = context.progress,
|
||||||
|
|
|
@ -179,15 +179,17 @@ StickersListWidget::StickersListWidget(
|
||||||
StickersListDescriptor &&descriptor)
|
StickersListDescriptor &&descriptor)
|
||||||
: Inner(
|
: Inner(
|
||||||
parent,
|
parent,
|
||||||
st::defaultEmojiPan,
|
descriptor.st ? *descriptor.st : st::defaultEmojiPan,
|
||||||
descriptor.show,
|
descriptor.show,
|
||||||
descriptor.paused)
|
descriptor.paused)
|
||||||
, _mode(descriptor.mode)
|
, _mode(descriptor.mode)
|
||||||
, _show(std::move(descriptor.show))
|
, _show(std::move(descriptor.show))
|
||||||
|
, _overBg(st::roundRadiusSmall, st().overBg)
|
||||||
, _api(&session().mtp())
|
, _api(&session().mtp())
|
||||||
, _localSetsManager(std::make_unique<LocalStickersManager>(&session()))
|
, _localSetsManager(std::make_unique<LocalStickersManager>(&session()))
|
||||||
, _section(Section::Stickers)
|
, _section(Section::Stickers)
|
||||||
, _isMasks(_mode == Mode::Masks)
|
, _isMasks(_mode == Mode::Masks)
|
||||||
|
, _settingsHidden(descriptor.settingsHidden)
|
||||||
, _updateItemsTimer([=] { updateItems(); })
|
, _updateItemsTimer([=] { updateItems(); })
|
||||||
, _updateSetsTimer([=] { updateSets(); })
|
, _updateSetsTimer([=] { updateSets(); })
|
||||||
, _trendingAddBgOver(
|
, _trendingAddBgOver(
|
||||||
|
@ -201,8 +203,8 @@ StickersListWidget::StickersListWidget(
|
||||||
ImageRoundRadius::Small,
|
ImageRoundRadius::Small,
|
||||||
st::stickerGroupCategoryAdd.textBg)
|
st::stickerGroupCategoryAdd.textBg)
|
||||||
, _pathGradient(std::make_unique<Ui::PathShiftGradient>(
|
, _pathGradient(std::make_unique<Ui::PathShiftGradient>(
|
||||||
st::windowBgRipple,
|
st().pathBg,
|
||||||
st::windowBgOver,
|
st().pathFg,
|
||||||
[=] { update(); }))
|
[=] { update(); }))
|
||||||
, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st().headerLeft)
|
, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st().headerLeft)
|
||||||
, _addText(tr::lng_stickers_featured_add(tr::now).toUpper())
|
, _addText(tr::lng_stickers_featured_add(tr::now).toUpper())
|
||||||
|
@ -284,7 +286,8 @@ object_ptr<TabbedSelector::InnerFooter> StickersListWidget::createFooter() {
|
||||||
.session = &session(),
|
.session = &session(),
|
||||||
.paused = footerPaused,
|
.paused = footerPaused,
|
||||||
.parent = this,
|
.parent = this,
|
||||||
.settingsButtonVisible = true,
|
.settingsButtonVisible = !_settingsHidden,
|
||||||
|
.st = &st(),
|
||||||
});
|
});
|
||||||
_footer = result;
|
_footer = result;
|
||||||
|
|
||||||
|
@ -844,7 +847,7 @@ QRect StickersListWidget::stickerRect(int section, int sel) {
|
||||||
void StickersListWidget::paintEvent(QPaintEvent *e) {
|
void StickersListWidget::paintEvent(QPaintEvent *e) {
|
||||||
Painter p(this);
|
Painter p(this);
|
||||||
auto clip = e->rect();
|
auto clip = e->rect();
|
||||||
p.fillRect(clip, st::emojiPanBg);
|
p.fillRect(clip, st().bg);
|
||||||
|
|
||||||
paintStickers(p, clip);
|
paintStickers(p, clip);
|
||||||
}
|
}
|
||||||
|
@ -1342,7 +1345,7 @@ void StickersListWidget::paintSticker(
|
||||||
if (selected) {
|
if (selected) {
|
||||||
auto tl = pos;
|
auto tl = pos;
|
||||||
if (rtl()) tl.setX(width() - tl.x() - _singleSize.width());
|
if (rtl()) tl.setX(width() - tl.x() - _singleSize.width());
|
||||||
Ui::FillRoundRect(p, QRect(tl, _singleSize), st::emojiPanHover, Ui::StickerHoverCorners);
|
_overBg.paint(p, QRect(tl, _singleSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
media->checkStickerSmall();
|
media->checkStickerSmall();
|
||||||
|
|
|
@ -70,6 +70,7 @@ struct StickersListDescriptor {
|
||||||
StickersListMode mode = StickersListMode::Full;
|
StickersListMode mode = StickersListMode::Full;
|
||||||
Fn<bool()> paused;
|
Fn<bool()> paused;
|
||||||
const style::EmojiPan *st = nullptr;
|
const style::EmojiPan *st = nullptr;
|
||||||
|
bool settingsHidden = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StickersListWidget final : public TabbedSelector::Inner {
|
class StickersListWidget final : public TabbedSelector::Inner {
|
||||||
|
@ -351,6 +352,7 @@ private:
|
||||||
|
|
||||||
const Mode _mode;
|
const Mode _mode;
|
||||||
const std::shared_ptr<Show> _show;
|
const std::shared_ptr<Show> _show;
|
||||||
|
Ui::RoundRect _overBg;
|
||||||
std::unique_ptr<Ui::TabbedSearch> _search;
|
std::unique_ptr<Ui::TabbedSearch> _search;
|
||||||
MTP::Sender _api;
|
MTP::Sender _api;
|
||||||
std::unique_ptr<LocalStickersManager> _localSetsManager;
|
std::unique_ptr<LocalStickersManager> _localSetsManager;
|
||||||
|
@ -373,6 +375,7 @@ private:
|
||||||
|
|
||||||
Section _section = Section::Stickers;
|
Section _section = Section::Stickers;
|
||||||
const bool _isMasks;
|
const bool _isMasks;
|
||||||
|
bool _settingsHidden = false;
|
||||||
|
|
||||||
base::Timer _updateItemsTimer;
|
base::Timer _updateItemsTimer;
|
||||||
base::Timer _updateSetsTimer;
|
base::Timer _updateSetsTimer;
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
void setFinalImages(Direction direction, QImage &&left, QImage &&right, QRect inner, bool wasSectionIcons);
|
void setFinalImages(Direction direction, QImage &&left, QImage &&right, QRect inner, bool wasSectionIcons);
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void paintFrame(QPainter &p, float64 dt, float64 opacity);
|
void paintFrame(QPainter &p, const style::EmojiPan &st, float64 dt, float64 opacity);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Direction _direction = Direction::LeftToRight;
|
Direction _direction = Direction::LeftToRight;
|
||||||
|
@ -131,7 +131,11 @@ void TabbedSelector::SlideAnimation::start() {
|
||||||
_frameIntsPerLineAdd = (_width - _innerWidth) + _frameIntsPerLineAdded;
|
_frameIntsPerLineAdd = (_width - _innerWidth) + _frameIntsPerLineAdded;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64 opacity) {
|
void TabbedSelector::SlideAnimation::paintFrame(
|
||||||
|
QPainter &p,
|
||||||
|
const style::EmojiPan &st,
|
||||||
|
float64 dt,
|
||||||
|
float64 opacity) {
|
||||||
Expects(started());
|
Expects(started());
|
||||||
Expects(dt >= 0.);
|
Expects(dt >= 0.);
|
||||||
|
|
||||||
|
@ -168,8 +172,8 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64
|
||||||
{
|
{
|
||||||
auto p = QPainter(&_frame);
|
auto p = QPainter(&_frame);
|
||||||
p.setOpacity(opacity);
|
p.setOpacity(opacity);
|
||||||
p.fillRect(_painterInnerLeft, _painterInnerTop, _painterInnerWidth, _painterCategoriesTop - _painterInnerTop, st::emojiPanBg);
|
p.fillRect(_painterInnerLeft, _painterInnerTop, _painterInnerWidth, _painterCategoriesTop - _painterInnerTop, st.bg);
|
||||||
p.fillRect(_painterInnerLeft, _painterCategoriesTop, _painterInnerWidth, _painterInnerBottom - _painterCategoriesTop, _wasSectionIcons ? st::emojiPanCategories : st::emojiPanBg);
|
p.fillRect(_painterInnerLeft, _painterCategoriesTop, _painterInnerWidth, _painterInnerBottom - _painterCategoriesTop, _wasSectionIcons ? st.categoriesBg : st.bg);
|
||||||
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
||||||
if (leftTo > _innerLeft) {
|
if (leftTo > _innerLeft) {
|
||||||
p.setOpacity(opacity * leftAlpha);
|
p.setOpacity(opacity * leftAlpha);
|
||||||
|
@ -325,11 +329,24 @@ TabbedSelector::TabbedSelector(
|
||||||
std::shared_ptr<Show> show,
|
std::shared_ptr<Show> show,
|
||||||
PauseReason level,
|
PauseReason level,
|
||||||
Mode mode)
|
Mode mode)
|
||||||
|
: TabbedSelector(parent, {
|
||||||
|
.show = std::move(show),
|
||||||
|
.st = (mode == Mode::EmojiStatus
|
||||||
|
? st::statusEmojiPan
|
||||||
|
: st::defaultEmojiPan),
|
||||||
|
.level = level,
|
||||||
|
.mode = mode,
|
||||||
|
}) {
|
||||||
|
}
|
||||||
|
|
||||||
|
TabbedSelector::TabbedSelector(
|
||||||
|
QWidget *parent,
|
||||||
|
TabbedSelectorDescriptor &&descriptor)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _st((mode == Mode::EmojiStatus) ? st::statusEmojiPan : st::defaultEmojiPan)
|
, _st(descriptor.st)
|
||||||
, _show(std::move(show))
|
, _show(std::move(descriptor.show))
|
||||||
, _level(level)
|
, _level(descriptor.level)
|
||||||
, _mode(mode)
|
, _mode(descriptor.mode)
|
||||||
, _panelRounding(Ui::PrepareCornerPixmaps(st::emojiPanRadius, _st.bg))
|
, _panelRounding(Ui::PrepareCornerPixmaps(st::emojiPanRadius, _st.bg))
|
||||||
, _categoriesRounding(
|
, _categoriesRounding(
|
||||||
Ui::PrepareCornerPixmaps(st::emojiPanRadius, _st.categoriesBg))
|
Ui::PrepareCornerPixmaps(st::emojiPanRadius, _st.categoriesBg))
|
||||||
|
@ -360,6 +377,7 @@ TabbedSelector::TabbedSelector(
|
||||||
: SelectorTab::Emoji)
|
: SelectorTab::Emoji)
|
||||||
, _hasEmojiTab(ranges::contains(_tabs, SelectorTab::Emoji, &Tab::type))
|
, _hasEmojiTab(ranges::contains(_tabs, SelectorTab::Emoji, &Tab::type))
|
||||||
, _hasStickersTab(ranges::contains(_tabs, SelectorTab::Stickers, &Tab::type))
|
, _hasStickersTab(ranges::contains(_tabs, SelectorTab::Stickers, &Tab::type))
|
||||||
|
, _stickersSettingsHidden(descriptor.stickersSettingsHidden)
|
||||||
, _hasGifsTab(ranges::contains(_tabs, SelectorTab::Gifs, &Tab::type))
|
, _hasGifsTab(ranges::contains(_tabs, SelectorTab::Gifs, &Tab::type))
|
||||||
, _hasMasksTab(ranges::contains(_tabs, SelectorTab::Masks, &Tab::type))
|
, _hasMasksTab(ranges::contains(_tabs, SelectorTab::Masks, &Tab::type))
|
||||||
, _tabbed(_tabs.size() > 1) {
|
, _tabbed(_tabs.size() > 1) {
|
||||||
|
@ -445,10 +463,10 @@ TabbedSelector::TabbedSelector(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
_panelRounding = Ui::PrepareCornerPixmaps(
|
_panelRounding = Ui::PrepareCornerPixmaps(
|
||||||
st::emojiPanRadius,
|
st::emojiPanRadius,
|
||||||
st::emojiPanBg);
|
_st.bg);
|
||||||
_categoriesRounding = Ui::PrepareCornerPixmaps(
|
_categoriesRounding = Ui::PrepareCornerPixmaps(
|
||||||
st::emojiPanRadius,
|
st::emojiPanRadius,
|
||||||
st::emojiPanCategories);
|
_st.categoriesBg);
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
if (hasEmojiTab()) {
|
if (hasEmojiTab()) {
|
||||||
|
@ -503,6 +521,7 @@ TabbedSelector::Tab TabbedSelector::createTab(SelectorTab type, int index) {
|
||||||
.mode = StickersMode::Full,
|
.mode = StickersMode::Full,
|
||||||
.paused = paused,
|
.paused = paused,
|
||||||
.st = &_st,
|
.st = &_st,
|
||||||
|
.settingsHidden = _stickersSettingsHidden,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
case SelectorTab::Gifs: {
|
case SelectorTab::Gifs: {
|
||||||
|
@ -704,10 +723,10 @@ void TabbedSelector::paintSlideFrame(QPainter &p) {
|
||||||
if (_roundRadius > 0) {
|
if (_roundRadius > 0) {
|
||||||
paintBgRoundedPart(p);
|
paintBgRoundedPart(p);
|
||||||
} else if (_tabsSlider) {
|
} else if (_tabsSlider) {
|
||||||
p.fillRect(0, 0, width(), _tabsSlider->height(), st::emojiPanBg);
|
p.fillRect(0, 0, width(), _tabsSlider->height(), _st.bg);
|
||||||
}
|
}
|
||||||
auto slideDt = _a_slide.value(1.);
|
auto slideDt = _a_slide.value(1.);
|
||||||
_slideAnimation->paintFrame(p, slideDt, 1.);
|
_slideAnimation->paintFrame(p, _st, slideDt, 1.);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabbedSelector::paintBgRoundedPart(QPainter &p) {
|
void TabbedSelector::paintBgRoundedPart(QPainter &p) {
|
||||||
|
@ -716,7 +735,7 @@ void TabbedSelector::paintBgRoundedPart(QPainter &p) {
|
||||||
: _tabsSlider
|
: _tabsSlider
|
||||||
? QRect(0, 0, width(), _tabsSlider->height())
|
? QRect(0, 0, width(), _tabsSlider->height())
|
||||||
: QRect(0, 0, width(), _roundRadius);
|
: QRect(0, 0, width(), _roundRadius);
|
||||||
Ui::FillRoundRect(p, fill, st::emojiPanBg, {
|
Ui::FillRoundRect(p, fill, _st.bg, {
|
||||||
.p = {
|
.p = {
|
||||||
_dropDown ? QPixmap() : _panelRounding.p[0],
|
_dropDown ? QPixmap() : _panelRounding.p[0],
|
||||||
_dropDown ? QPixmap() : _panelRounding.p[1],
|
_dropDown ? QPixmap() : _panelRounding.p[1],
|
||||||
|
@ -765,10 +784,10 @@ void TabbedSelector::paintContent(QPainter &p) {
|
||||||
sidesTop,
|
sidesTop,
|
||||||
st::emojiScroll.width,
|
st::emojiScroll.width,
|
||||||
sidesHeight),
|
sidesHeight),
|
||||||
st::emojiPanBg);
|
_st.bg);
|
||||||
p.fillRect(
|
p.fillRect(
|
||||||
myrtlrect(0, sidesTop, st::emojiPanRadius, sidesHeight),
|
myrtlrect(0, sidesTop, st::emojiPanRadius, sidesHeight),
|
||||||
st::emojiPanBg);
|
_st.bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,7 +1049,7 @@ void TabbedSelector::setAllowEmojiWithoutPremium(bool allow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabbedSelector::createTabsSlider() {
|
void TabbedSelector::createTabsSlider() {
|
||||||
_tabsSlider.create(this, st::emojiTabs);
|
_tabsSlider.create(this, _st.tabs);
|
||||||
|
|
||||||
fillTabsSliderSections();
|
fillTabsSliderSections();
|
||||||
|
|
||||||
|
@ -1324,7 +1343,7 @@ void TabbedSelector::Inner::paintEmptySearchResults(
|
||||||
iconTop + icon.height() - st::normalFont->height,
|
iconTop + icon.height() - st::normalFont->height,
|
||||||
height() - 2 * st::normalFont->height);
|
height() - 2 * st::normalFont->height);
|
||||||
p.setFont(st::normalFont);
|
p.setFont(st::normalFont);
|
||||||
p.setPen(st::windowSubTextFg);
|
p.setPen(_st.tabs.labelFg);
|
||||||
p.drawTextLeft(
|
p.drawTextLeft(
|
||||||
(width() - textWidth) / 2,
|
(width() - textWidth) / 2,
|
||||||
textTop,
|
textTop,
|
||||||
|
|
|
@ -75,6 +75,21 @@ struct EmojiChosen {
|
||||||
|
|
||||||
using InlineChosen = InlineBots::ResultSelected;
|
using InlineChosen = InlineBots::ResultSelected;
|
||||||
|
|
||||||
|
enum class TabbedSelectorMode {
|
||||||
|
Full,
|
||||||
|
EmojiOnly,
|
||||||
|
MediaEditor,
|
||||||
|
EmojiStatus,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TabbedSelectorDescriptor {
|
||||||
|
std::shared_ptr<Show> show;
|
||||||
|
const style::EmojiPan &st;
|
||||||
|
PauseReason level = {};
|
||||||
|
TabbedSelectorMode mode = TabbedSelectorMode::Full;
|
||||||
|
bool stickersSettingsHidden = false;
|
||||||
|
};
|
||||||
|
|
||||||
[[nodiscard]] std::unique_ptr<Ui::TabbedSearch> MakeSearch(
|
[[nodiscard]] std::unique_ptr<Ui::TabbedSearch> MakeSearch(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
const style::EmojiPan &st,
|
const style::EmojiPan &st,
|
||||||
|
@ -86,12 +101,7 @@ using InlineChosen = InlineBots::ResultSelected;
|
||||||
class TabbedSelector : public Ui::RpWidget {
|
class TabbedSelector : public Ui::RpWidget {
|
||||||
public:
|
public:
|
||||||
static constexpr auto kPickCustomTimeId = -1;
|
static constexpr auto kPickCustomTimeId = -1;
|
||||||
enum class Mode {
|
using Mode = TabbedSelectorMode;
|
||||||
Full,
|
|
||||||
EmojiOnly,
|
|
||||||
MediaEditor,
|
|
||||||
EmojiStatus,
|
|
||||||
};
|
|
||||||
enum class Action {
|
enum class Action {
|
||||||
Update,
|
Update,
|
||||||
Cancel,
|
Cancel,
|
||||||
|
@ -102,6 +112,9 @@ public:
|
||||||
std::shared_ptr<Show> show,
|
std::shared_ptr<Show> show,
|
||||||
PauseReason level,
|
PauseReason level,
|
||||||
Mode mode = Mode::Full);
|
Mode mode = Mode::Full);
|
||||||
|
TabbedSelector(
|
||||||
|
QWidget *parent,
|
||||||
|
TabbedSelectorDescriptor &&descriptor);
|
||||||
~TabbedSelector();
|
~TabbedSelector();
|
||||||
|
|
||||||
[[nodiscard]] Main::Session &session() const;
|
[[nodiscard]] Main::Session &session() const;
|
||||||
|
@ -278,6 +291,7 @@ private:
|
||||||
|
|
||||||
const bool _hasEmojiTab;
|
const bool _hasEmojiTab;
|
||||||
const bool _hasStickersTab;
|
const bool _hasStickersTab;
|
||||||
|
const bool _stickersSettingsHidden;
|
||||||
const bool _hasGifsTab;
|
const bool _hasGifsTab;
|
||||||
const bool _hasMasksTab;
|
const bool _hasMasksTab;
|
||||||
const bool _tabbed;
|
const bool _tabbed;
|
||||||
|
|
|
@ -229,7 +229,7 @@ HistoryWidget::HistoryWidget(
|
||||||
, _supportAutocomplete(session().supportMode()
|
, _supportAutocomplete(session().supportMode()
|
||||||
? object_ptr<Support::Autocomplete>(this, &session())
|
? object_ptr<Support::Autocomplete>(this, &session())
|
||||||
: nullptr)
|
: nullptr)
|
||||||
, _send(std::make_shared<Ui::SendButton>(this))
|
, _send(std::make_shared<Ui::SendButton>(this, st::historySend))
|
||||||
, _unblock(this, tr::lng_unblock_button(tr::now).toUpper(), st::historyUnblock)
|
, _unblock(this, tr::lng_unblock_button(tr::now).toUpper(), st::historyUnblock)
|
||||||
, _botStart(this, tr::lng_bot_start(tr::now).toUpper(), st::historyComposeButton)
|
, _botStart(this, tr::lng_bot_start(tr::now).toUpper(), st::historyComposeButton)
|
||||||
, _joinChannel(
|
, _joinChannel(
|
||||||
|
|
|
@ -58,7 +58,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "main/session/send_as_peers.h"
|
#include "main/session/send_as_peers.h"
|
||||||
#include "media/audio/media_audio_capture.h"
|
#include "media/audio/media_audio_capture.h"
|
||||||
#include "media/audio/media_audio.h"
|
#include "media/audio/media_audio.h"
|
||||||
#include "styles/style_chat.h"
|
|
||||||
#include "ui/text/text_options.h"
|
#include "ui/text/text_options.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
|
@ -72,6 +71,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/window_adaptive.h"
|
#include "window/window_adaptive.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -938,7 +939,11 @@ ComposeControls::ComposeControls(
|
||||||
ComposeControls::ComposeControls(
|
ComposeControls::ComposeControls(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
ComposeControlsDescriptor descriptor)
|
ComposeControlsDescriptor descriptor)
|
||||||
: _parent(parent)
|
: _st(descriptor.stOverride
|
||||||
|
? *descriptor.stOverride
|
||||||
|
: st::defaultComposeControls)
|
||||||
|
, _features(descriptor.features)
|
||||||
|
, _parent(parent)
|
||||||
, _show(std::move(descriptor.show))
|
, _show(std::move(descriptor.show))
|
||||||
, _session(&_show->session())
|
, _session(&_show->session())
|
||||||
, _regularWindow(descriptor.regularWindow)
|
, _regularWindow(descriptor.regularWindow)
|
||||||
|
@ -946,30 +951,37 @@ ComposeControls::ComposeControls(
|
||||||
? nullptr
|
? nullptr
|
||||||
: std::make_unique<ChatHelpers::TabbedSelector>(
|
: std::make_unique<ChatHelpers::TabbedSelector>(
|
||||||
_parent,
|
_parent,
|
||||||
_show,
|
ChatHelpers::TabbedSelectorDescriptor{
|
||||||
Window::GifPauseReason::TabbedPanel))
|
.show = _show,
|
||||||
|
.st = _st.tabbed,
|
||||||
|
.level = Window::GifPauseReason::TabbedPanel,
|
||||||
|
.mode = ChatHelpers::TabbedSelector::Mode::Full,
|
||||||
|
.stickersSettingsHidden = !_features.stickersSettings,
|
||||||
|
}))
|
||||||
, _selector(_regularWindow
|
, _selector(_regularWindow
|
||||||
? _regularWindow->tabbedSelector()
|
? _regularWindow->tabbedSelector()
|
||||||
: not_null(_ownedSelector.get()))
|
: not_null(_ownedSelector.get()))
|
||||||
, _mode(descriptor.mode)
|
, _mode(descriptor.mode)
|
||||||
, _wrap(std::make_unique<Ui::RpWidget>(parent))
|
, _wrap(std::make_unique<Ui::RpWidget>(parent))
|
||||||
, _writeRestricted(std::make_unique<Ui::RpWidget>(parent))
|
, _writeRestricted(std::make_unique<Ui::RpWidget>(parent))
|
||||||
, _send(std::make_shared<Ui::SendButton>(_wrap.get()))
|
, _send(std::make_shared<Ui::SendButton>(_wrap.get(), _st.send))
|
||||||
, _attachToggle(Ui::CreateChild<Ui::IconButton>(
|
, _attachToggle(Ui::CreateChild<Ui::IconButton>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
st::historyAttach))
|
_st.attach))
|
||||||
, _tabbedSelectorToggle(Ui::CreateChild<Ui::EmojiButton>(
|
, _tabbedSelectorToggle(Ui::CreateChild<Ui::EmojiButton>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
st::historyAttachEmoji))
|
_st.emoji))
|
||||||
, _field(
|
, _field(
|
||||||
Ui::CreateChild<Ui::InputField>(
|
Ui::CreateChild<Ui::InputField>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
st::historyComposeField,
|
_st.field,
|
||||||
Ui::InputField::Mode::MultiLine,
|
Ui::InputField::Mode::MultiLine,
|
||||||
tr::lng_message_ph()))
|
tr::lng_message_ph()))
|
||||||
, _botCommandStart(Ui::CreateChild<Ui::IconButton>(
|
, _botCommandStart(_features.botCommandSend
|
||||||
|
? Ui::CreateChild<Ui::IconButton>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
st::historyBotCommandStart))
|
st::historyBotCommandStart)
|
||||||
|
: nullptr)
|
||||||
, _autocomplete(std::make_unique<FieldAutocomplete>(parent, _show))
|
, _autocomplete(std::make_unique<FieldAutocomplete>(parent, _show))
|
||||||
, _header(std::make_unique<FieldHeader>(_wrap.get(), _show))
|
, _header(std::make_unique<FieldHeader>(_wrap.get(), _show))
|
||||||
, _voiceRecordBar(std::make_unique<VoiceRecordBar>(
|
, _voiceRecordBar(std::make_unique<VoiceRecordBar>(
|
||||||
|
@ -982,6 +994,9 @@ ComposeControls::ComposeControls(
|
||||||
, _unavailableEmojiPasted(std::move(descriptor.unavailableEmojiPasted))
|
, _unavailableEmojiPasted(std::move(descriptor.unavailableEmojiPasted))
|
||||||
, _saveDraftTimer([=] { saveDraft(); })
|
, _saveDraftTimer([=] { saveDraft(); })
|
||||||
, _saveCloudDraftTimer([=] { saveCloudDraft(); }) {
|
, _saveCloudDraftTimer([=] { saveCloudDraft(); }) {
|
||||||
|
if (_st.radius > 0) {
|
||||||
|
_backgroundRect.emplace(_st.radius, _st.bg);
|
||||||
|
}
|
||||||
if (descriptor.stickerOrEmojiChosen) {
|
if (descriptor.stickerOrEmojiChosen) {
|
||||||
std::move(
|
std::move(
|
||||||
descriptor.stickerOrEmojiChosen
|
descriptor.stickerOrEmojiChosen
|
||||||
|
@ -1421,7 +1436,9 @@ void ComposeControls::init() {
|
||||||
updateWrappingVisibility();
|
updateWrappingVisibility();
|
||||||
}, _wrap->lifetime());
|
}, _wrap->lifetime());
|
||||||
|
|
||||||
|
if (_botCommandStart) {
|
||||||
_botCommandStart->setClickedCallback([=] { setText({ "/" }); });
|
_botCommandStart->setClickedCallback([=] { setText({ "/" }); });
|
||||||
|
}
|
||||||
|
|
||||||
_wrap->sizeValue(
|
_wrap->sizeValue(
|
||||||
) | rpl::start_with_next([=](QSize size) {
|
) | rpl::start_with_next([=](QSize size) {
|
||||||
|
@ -2382,10 +2399,12 @@ void ComposeControls::updateControlsGeometry(QSize size) {
|
||||||
right += _send->width();
|
right += _send->width();
|
||||||
_tabbedSelectorToggle->moveToRight(right, buttonsTop);
|
_tabbedSelectorToggle->moveToRight(right, buttonsTop);
|
||||||
right += _tabbedSelectorToggle->width();
|
right += _tabbedSelectorToggle->width();
|
||||||
|
if (_botCommandStart) {
|
||||||
_botCommandStart->moveToRight(right, buttonsTop);
|
_botCommandStart->moveToRight(right, buttonsTop);
|
||||||
if (_botCommandShown) {
|
if (_botCommandShown) {
|
||||||
right += _botCommandStart->width();
|
right += _botCommandStart->width();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (_silent) {
|
if (_silent) {
|
||||||
_silent->moveToRight(right, buttonsTop);
|
_silent->moveToRight(right, buttonsTop);
|
||||||
right += _silent->width();
|
right += _silent->width();
|
||||||
|
@ -2401,7 +2420,9 @@ void ComposeControls::updateControlsGeometry(QSize size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::updateControlsVisibility() {
|
void ComposeControls::updateControlsVisibility() {
|
||||||
|
if (_botCommandStart) {
|
||||||
_botCommandStart->setVisible(_botCommandShown);
|
_botCommandStart->setVisible(_botCommandShown);
|
||||||
|
}
|
||||||
if (_ttlInfo) {
|
if (_ttlInfo) {
|
||||||
_ttlInfo->show();
|
_ttlInfo->show();
|
||||||
}
|
}
|
||||||
|
@ -2419,7 +2440,8 @@ void ComposeControls::updateControlsVisibility() {
|
||||||
bool ComposeControls::updateBotCommandShown() {
|
bool ComposeControls::updateBotCommandShown() {
|
||||||
auto shown = false;
|
auto shown = false;
|
||||||
const auto peer = _history ? _history->peer.get() : nullptr;
|
const auto peer = _history ? _history->peer.get() : nullptr;
|
||||||
if (peer
|
if (_botCommandStart
|
||||||
|
&& peer
|
||||||
&& ((peer->isChat() && peer->asChat()->botStatus > 0)
|
&& ((peer->isChat() && peer->asChat()->botStatus > 0)
|
||||||
|| (peer->isMegagroup() && peer->asChannel()->mgInfo->botStatus > 0)
|
|| (peer->isMegagroup() && peer->asChannel()->mgInfo->botStatus > 0)
|
||||||
|| (peer->isUser() && peer->asUser()->isBot()))) {
|
|| (peer->isUser() && peer->asUser()->isBot()))) {
|
||||||
|
@ -2449,7 +2471,9 @@ void ComposeControls::updateOuterGeometry(QRect rect) {
|
||||||
|
|
||||||
void ComposeControls::updateMessagesTTLShown() {
|
void ComposeControls::updateMessagesTTLShown() {
|
||||||
const auto peer = _history ? _history->peer.get() : nullptr;
|
const auto peer = _history ? _history->peer.get() : nullptr;
|
||||||
const auto shown = peer && (peer->messagesTTL() > 0);
|
const auto shown = _features.ttlInfo
|
||||||
|
&& peer
|
||||||
|
&& (peer->messagesTTL() > 0);
|
||||||
if (!shown && _ttlInfo) {
|
if (!shown && _ttlInfo) {
|
||||||
_ttlInfo = nullptr;
|
_ttlInfo = nullptr;
|
||||||
updateControlsVisibility();
|
updateControlsVisibility();
|
||||||
|
@ -2467,7 +2491,8 @@ void ComposeControls::updateMessagesTTLShown() {
|
||||||
|
|
||||||
bool ComposeControls::updateSendAsButton() {
|
bool ComposeControls::updateSendAsButton() {
|
||||||
const auto peer = _history ? _history->peer.get() : nullptr;
|
const auto peer = _history ? _history->peer.get() : nullptr;
|
||||||
if (!peer
|
if (!_features.sendAs
|
||||||
|
|| !peer
|
||||||
|| !_regularWindow
|
|| !_regularWindow
|
||||||
|| isEditingMessage()
|
|| isEditingMessage()
|
||||||
|| !session().sendAsPeers().shouldChoose(peer)) {
|
|| !session().sendAsPeers().shouldChoose(peer)) {
|
||||||
|
@ -2491,7 +2516,10 @@ bool ComposeControls::updateSendAsButton() {
|
||||||
|
|
||||||
void ComposeControls::updateAttachBotsMenu() {
|
void ComposeControls::updateAttachBotsMenu() {
|
||||||
_attachBotsMenu = nullptr;
|
_attachBotsMenu = nullptr;
|
||||||
if (!_history || !_sendActionFactory || !_regularWindow) {
|
if (!_features.attachBotsMenu
|
||||||
|
|| !_history
|
||||||
|
|| !_sendActionFactory
|
||||||
|
|| !_regularWindow) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_attachBotsMenu = InlineBots::MakeAttachBotsMenu(
|
_attachBotsMenu = InlineBots::MakeAttachBotsMenu(
|
||||||
|
@ -2515,7 +2543,18 @@ void ComposeControls::updateAttachBotsMenu() {
|
||||||
void ComposeControls::paintBackground(QRect clip) {
|
void ComposeControls::paintBackground(QRect clip) {
|
||||||
Painter p(_wrap.get());
|
Painter p(_wrap.get());
|
||||||
|
|
||||||
p.fillRect(clip, st::historyComposeAreaBg);
|
if (_backgroundRect) {
|
||||||
|
//p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
|
//p.fillRect(clip, Qt::transparent);
|
||||||
|
//p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
||||||
|
//_backgroundRect->paint(p, _wrap->rect());
|
||||||
|
auto hq = PainterHighQualityEnabler(p);
|
||||||
|
p.setBrush(_st.bg);
|
||||||
|
p.setPen(Qt::NoPen);
|
||||||
|
p.drawRoundedRect(_wrap->rect(), _st.radius, _st.radius);
|
||||||
|
} else {
|
||||||
|
p.fillRect(clip, _st.bg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::escape() {
|
void ComposeControls::escape() {
|
||||||
|
@ -2913,7 +2952,7 @@ bool ComposeControls::preventsClose(Fn<void()> &&continueCallback) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ComposeControls::hasSilentBroadcastToggle() const {
|
bool ComposeControls::hasSilentBroadcastToggle() const {
|
||||||
if (!_history) {
|
if (!_features.silentBroadcastToggle || !_history) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const auto &peer = _history->peer;
|
const auto &peer = _history->peer;
|
||||||
|
|
|
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
#include "dialogs/dialogs_key.h"
|
#include "dialogs/dialogs_key.h"
|
||||||
#include "history/view/controls/compose_controls_common.h"
|
#include "history/view/controls/compose_controls_common.h"
|
||||||
|
#include "ui/round_rect.h"
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
#include "ui/effects/animations.h"
|
#include "ui/effects/animations.h"
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
|
@ -21,6 +22,10 @@ class History;
|
||||||
class DocumentData;
|
class DocumentData;
|
||||||
class FieldAutocomplete;
|
class FieldAutocomplete;
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct ComposeControls;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
namespace SendMenu {
|
namespace SendMenu {
|
||||||
enum class Type;
|
enum class Type;
|
||||||
} // namespace SendMenu
|
} // namespace SendMenu
|
||||||
|
@ -88,13 +93,25 @@ enum class ComposeControlsMode {
|
||||||
Scheduled,
|
Scheduled,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ComposeControlsFeatures {
|
||||||
|
bool sendAs = true;
|
||||||
|
bool ttlInfo = true;
|
||||||
|
bool botCommandSend = true;
|
||||||
|
bool silentBroadcastToggle = true;
|
||||||
|
bool attachBotsMenu = true;
|
||||||
|
bool inlineBots = true;
|
||||||
|
bool stickersSettings = true;
|
||||||
|
};
|
||||||
|
|
||||||
struct ComposeControlsDescriptor {
|
struct ComposeControlsDescriptor {
|
||||||
|
const style::ComposeControls *stOverride = nullptr;
|
||||||
std::shared_ptr<ChatHelpers::Show> show;
|
std::shared_ptr<ChatHelpers::Show> show;
|
||||||
Fn<void(not_null<DocumentData*>)> unavailableEmojiPasted;
|
Fn<void(not_null<DocumentData*>)> unavailableEmojiPasted;
|
||||||
ComposeControlsMode mode = ComposeControlsMode::Normal;
|
ComposeControlsMode mode = ComposeControlsMode::Normal;
|
||||||
SendMenu::Type sendMenuType = {};
|
SendMenu::Type sendMenuType = {};
|
||||||
Window::SessionController *regularWindow = nullptr;
|
Window::SessionController *regularWindow = nullptr;
|
||||||
rpl::producer<ChatHelpers::FileChosen> stickerOrEmojiChosen;
|
rpl::producer<ChatHelpers::FileChosen> stickerOrEmojiChosen;
|
||||||
|
ComposeControlsFeatures features;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ComposeControls final {
|
class ComposeControls final {
|
||||||
|
@ -311,6 +328,8 @@ private:
|
||||||
void registerDraftSource();
|
void registerDraftSource();
|
||||||
void changeFocusedControl();
|
void changeFocusedControl();
|
||||||
|
|
||||||
|
const style::ComposeControls &_st;
|
||||||
|
const ComposeControlsFeatures _features;
|
||||||
const not_null<QWidget*> _parent;
|
const not_null<QWidget*> _parent;
|
||||||
const std::shared_ptr<ChatHelpers::Show> _show;
|
const std::shared_ptr<ChatHelpers::Show> _show;
|
||||||
const not_null<Main::Session*> _session;
|
const not_null<Main::Session*> _session;
|
||||||
|
@ -332,12 +351,14 @@ private:
|
||||||
const std::unique_ptr<Ui::RpWidget> _wrap;
|
const std::unique_ptr<Ui::RpWidget> _wrap;
|
||||||
const std::unique_ptr<Ui::RpWidget> _writeRestricted;
|
const std::unique_ptr<Ui::RpWidget> _writeRestricted;
|
||||||
|
|
||||||
|
std::optional<Ui::RoundRect> _backgroundRect;
|
||||||
|
|
||||||
const std::shared_ptr<Ui::SendButton> _send;
|
const std::shared_ptr<Ui::SendButton> _send;
|
||||||
const not_null<Ui::IconButton*> _attachToggle;
|
const not_null<Ui::IconButton*> _attachToggle;
|
||||||
std::unique_ptr<Ui::IconButton> _replaceMedia;
|
std::unique_ptr<Ui::IconButton> _replaceMedia;
|
||||||
const not_null<Ui::EmojiButton*> _tabbedSelectorToggle;
|
const not_null<Ui::EmojiButton*> _tabbedSelectorToggle;
|
||||||
const not_null<Ui::InputField*> _field;
|
const not_null<Ui::InputField*> _field;
|
||||||
const not_null<Ui::IconButton*> _botCommandStart;
|
Ui::IconButton * const _botCommandStart = nullptr;
|
||||||
std::unique_ptr<Ui::SendAsButton> _sendAs;
|
std::unique_ptr<Ui::SendAsButton> _sendAs;
|
||||||
std::unique_ptr<Ui::SilentToggle> _silent;
|
std::unique_ptr<Ui::SilentToggle> _silent;
|
||||||
std::unique_ptr<Controls::TTLButton> _ttlInfo;
|
std::unique_ptr<Controls::TTLButton> _ttlInfo;
|
||||||
|
|
|
@ -26,6 +26,7 @@ ReplyArea::ReplyArea(not_null<Controller*> controller)
|
||||||
, _controls(std::make_unique<HistoryView::ComposeControls>(
|
, _controls(std::make_unique<HistoryView::ComposeControls>(
|
||||||
_controller->wrap(),
|
_controller->wrap(),
|
||||||
HistoryView::ComposeControlsDescriptor{
|
HistoryView::ComposeControlsDescriptor{
|
||||||
|
.stOverride = &st::storiesComposeControls,
|
||||||
.show = _controller->uiShow(),
|
.show = _controller->uiShow(),
|
||||||
.unavailableEmojiPasted = [=](not_null<DocumentData*> emoji) {
|
.unavailableEmojiPasted = [=](not_null<DocumentData*> emoji) {
|
||||||
showPremiumToast(emoji);
|
showPremiumToast(emoji);
|
||||||
|
@ -33,6 +34,14 @@ ReplyArea::ReplyArea(not_null<Controller*> controller)
|
||||||
.mode = HistoryView::ComposeControlsMode::Normal,
|
.mode = HistoryView::ComposeControlsMode::Normal,
|
||||||
.sendMenuType = SendMenu::Type::SilentOnly,
|
.sendMenuType = SendMenu::Type::SilentOnly,
|
||||||
.stickerOrEmojiChosen = _controller->stickerOrEmojiChosen(),
|
.stickerOrEmojiChosen = _controller->stickerOrEmojiChosen(),
|
||||||
|
.features = {
|
||||||
|
.sendAs = false,
|
||||||
|
.ttlInfo = false,
|
||||||
|
.botCommandSend = false,
|
||||||
|
.silentBroadcastToggle = false,
|
||||||
|
.attachBotsMenu = false,
|
||||||
|
.inlineBots = false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)) {
|
)) {
|
||||||
initGeometry();
|
initGeometry();
|
||||||
|
|
|
@ -11,6 +11,7 @@ using "ui/widgets/widgets.style";
|
||||||
using "ui/menu_icons.style";
|
using "ui/menu_icons.style";
|
||||||
using "media/player/media_player.style";
|
using "media/player/media_player.style";
|
||||||
using "boxes/boxes.style";
|
using "boxes/boxes.style";
|
||||||
|
using "chat_helpers/chat_helpers.style";
|
||||||
|
|
||||||
mediaviewOverDuration: 150;
|
mediaviewOverDuration: 150;
|
||||||
|
|
||||||
|
@ -434,22 +435,106 @@ storiesShadowTop: icon{{ "mediaview/shadow_bottom-flip_vertical", windowShadowFg
|
||||||
storiesShadowBottom: mediaviewShadowBottom;
|
storiesShadowBottom: mediaviewShadowBottom;
|
||||||
storiesControlsMinWidth: 200px;
|
storiesControlsMinWidth: 200px;
|
||||||
storiesFieldMargin: margins(0px, 14px, 0px, 16px);
|
storiesFieldMargin: margins(0px, 14px, 0px, 16px);
|
||||||
storiesAttach: IconButton(defaultIconButton) {
|
|
||||||
width: 44px;
|
|
||||||
height: 46px;
|
|
||||||
|
|
||||||
icon: icon {{ "chat/input_attach", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_attach", historyComposeIconFgOver }};
|
|
||||||
|
|
||||||
rippleAreaPosition: point(2px, 3px);
|
|
||||||
rippleAreaSize: 40px;
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: windowBgOver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
storiesSideSkip: 145px;
|
storiesSideSkip: 145px;
|
||||||
storiesCaptionFull: FlatLabel(defaultFlatLabel) {
|
storiesCaptionFull: FlatLabel(defaultFlatLabel) {
|
||||||
style: mediaviewCaptionStyle;
|
style: mediaviewCaptionStyle;
|
||||||
textFg: mediaviewCaptionFg;
|
textFg: mediaviewCaptionFg;
|
||||||
minWidth: 360px;
|
minWidth: 360px;
|
||||||
}
|
}
|
||||||
|
storiesComposeBg: groupCallMembersBg;
|
||||||
|
storiesComposeBgOver: groupCallMembersBgOver;
|
||||||
|
storiesComposeBgRipple: groupCallMembersBgRipple;
|
||||||
|
storiesComposeWhiteText: groupCallMembersFg;
|
||||||
|
storiesComposeGrayText: groupCallMemberNotJoinedStatus;
|
||||||
|
storiesComposeGrayIcon: groupCallMemberInactiveIcon;
|
||||||
|
storiesComposeBlue: groupCallActiveFg;
|
||||||
|
storiesComposeRipple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: groupCallMembersBgRipple;
|
||||||
|
}
|
||||||
|
storiesAttach: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "chat/input_attach", storiesComposeGrayIcon }};
|
||||||
|
iconOver: icon {{ "chat/input_attach", storiesComposeGrayIcon }};
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: storiesComposeBgOver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storiesRecordVoice: icon {{ "chat/input_record", storiesComposeGrayIcon }};
|
||||||
|
storiesRecordVoiceOver: icon {{ "chat/input_record", storiesComposeGrayIcon }};
|
||||||
|
storiesComposeControls: ComposeControls(defaultComposeControls) {
|
||||||
|
bg: storiesComposeBg;
|
||||||
|
radius: storiesRadius;
|
||||||
|
field: InputField(historyComposeField) {
|
||||||
|
textFg: storiesComposeWhiteText;
|
||||||
|
textBg: storiesComposeBg;
|
||||||
|
placeholderFg: storiesComposeGrayText;
|
||||||
|
placeholderFgActive: storiesComposeGrayText;
|
||||||
|
placeholderFgError: storiesComposeGrayText;
|
||||||
|
}
|
||||||
|
send: SendButton(historySend) {
|
||||||
|
inner: IconButton(storiesAttach) {
|
||||||
|
icon: icon {{ "chat/input_send", storiesComposeBlue }};
|
||||||
|
iconOver: icon {{ "chat/input_send", storiesComposeBlue }};
|
||||||
|
}
|
||||||
|
record: storiesRecordVoice;
|
||||||
|
recordOver: storiesRecordVoiceOver;
|
||||||
|
sendDisabledFg: storiesComposeGrayText;
|
||||||
|
}
|
||||||
|
attach: storiesAttach;
|
||||||
|
emoji: EmojiButton(historyAttachEmoji) {
|
||||||
|
inner: IconButton(storiesAttach) {
|
||||||
|
icon: icon {{ "chat/input_smile_face", storiesComposeGrayIcon }};
|
||||||
|
iconOver: icon {{ "chat/input_smile_face", storiesComposeGrayIcon }};
|
||||||
|
}
|
||||||
|
bg: storiesComposeBg;
|
||||||
|
lineFg: storiesComposeGrayIcon;
|
||||||
|
lineFgOver: storiesComposeGrayIcon;
|
||||||
|
}
|
||||||
|
tabbed: EmojiPan(defaultEmojiPan) {
|
||||||
|
bg: storiesComposeBg;
|
||||||
|
overBg: storiesComposeBgOver;
|
||||||
|
expandBg: storiesComposeGrayText;
|
||||||
|
pathBg: storiesComposeBgRipple;
|
||||||
|
pathFg: storiesComposeBgOver;
|
||||||
|
textFg: storiesComposeWhiteText;
|
||||||
|
categoriesBg: storiesComposeBg;
|
||||||
|
categoriesBgOver: storiesComposeBgOver;
|
||||||
|
fadeLeft: icon {{ "fade_horizontal-flip_horizontal", storiesComposeBg }};
|
||||||
|
fadeRight: icon {{ "fade_horizontal", storiesComposeBg }};
|
||||||
|
tabs: SettingsSlider(emojiTabs) {
|
||||||
|
barFgActive: storiesComposeBlue;
|
||||||
|
labelFg: storiesComposeGrayText;
|
||||||
|
labelFgActive: storiesComposeBlue;
|
||||||
|
rippleBg: storiesComposeBgOver;
|
||||||
|
rippleBgActive: storiesComposeBgOver;
|
||||||
|
}
|
||||||
|
search: TabbedSearch(defaultTabbedSearch) {
|
||||||
|
outer: storiesComposeBg;
|
||||||
|
bg: storiesComposeBgOver;
|
||||||
|
bgActive: storiesComposeBgRipple;
|
||||||
|
fg: storiesComposeGrayIcon;
|
||||||
|
fgActive: storiesComposeWhiteText;
|
||||||
|
fadeLeft: icon {{ "fade_horizontal-flip_horizontal", storiesComposeBgOver }};
|
||||||
|
fadeRight: icon {{ "fade_horizontal", storiesComposeBgOver }};
|
||||||
|
field: InputField(defaultTabbedSearchField) {
|
||||||
|
placeholderFg: storiesComposeGrayText;
|
||||||
|
placeholderFgActive: storiesComposeGrayText;
|
||||||
|
placeholderFgError: storiesComposeGrayText;
|
||||||
|
}
|
||||||
|
search: IconButton(defaultTabbedSearchButton) {
|
||||||
|
icon: icon{{ "emoji/emoji_search_input", storiesComposeGrayIcon }};
|
||||||
|
iconOver: icon{{ "emoji/emoji_search_input", storiesComposeGrayIcon }};
|
||||||
|
ripple: storiesComposeRipple;
|
||||||
|
}
|
||||||
|
back: IconButton(defaultTabbedSearchBack) {
|
||||||
|
icon: icon{{ "emoji/emoji_back", storiesComposeGrayIcon }};
|
||||||
|
iconOver: icon{{ "emoji/emoji_back", storiesComposeGrayIcon }};
|
||||||
|
ripple: storiesComposeRipple;
|
||||||
|
}
|
||||||
|
cancel: CrossButton(defaultTabbedSearchCancel) {
|
||||||
|
crossFg: storiesComposeGrayIcon;
|
||||||
|
crossFgOver: storiesComposeGrayIcon;
|
||||||
|
ripple: emptyRippleAnimation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "storage/storage_account.h"
|
#include "storage/storage_account.h"
|
||||||
#include "calls/calls_instance.h"
|
#include "calls/calls_instance.h"
|
||||||
#include "styles/style_media_view.h"
|
#include "styles/style_media_view.h"
|
||||||
|
#include "styles/style_calls.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
#include "styles/style_menu_icons.h"
|
#include "styles/style_menu_icons.h"
|
||||||
|
|
||||||
|
@ -336,6 +337,8 @@ OverlayWidget::OverlayWidget()
|
||||||
, _lastAction(-st::mediaviewDeltaFromLastAction, -st::mediaviewDeltaFromLastAction)
|
, _lastAction(-st::mediaviewDeltaFromLastAction, -st::mediaviewDeltaFromLastAction)
|
||||||
, _stateAnimation([=](crl::time now) { return stateAnimationCallback(now); })
|
, _stateAnimation([=](crl::time now) { return stateAnimationCallback(now); })
|
||||||
, _dropdown(_body, st::mediaviewDropdownMenu) {
|
, _dropdown(_body, st::mediaviewDropdownMenu) {
|
||||||
|
_layerBg->setStyleOverrides(&st::groupCallBox, &st::groupCallLayerBox);
|
||||||
|
|
||||||
CrashReports::SetAnnotation("OpenGL Renderer", "[not-initialized]");
|
CrashReports::SetAnnotation("OpenGL Renderer", "[not-initialized]");
|
||||||
|
|
||||||
Lang::Updated(
|
Lang::Updated(
|
||||||
|
|
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/effects/animation_value.h"
|
#include "ui/effects/animation_value.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "ui/widgets/vertical_drum_picker.h"
|
#include "ui/widgets/vertical_drum_picker.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_layers.h"
|
#include "styles/style_layers.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
|
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "base/timer_rpl.h"
|
#include "base/timer_rpl.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/power_saving.h"
|
#include "ui/power_saving.h"
|
||||||
#include "base/call_delayed.h"
|
#include "base/call_delayed.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
|
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
|
|
@ -9,22 +9,7 @@ using "ui/basic.style";
|
||||||
using "dialogs/dialogs.style";
|
using "dialogs/dialogs.style";
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
using "ui/menu_icons.style";
|
using "ui/menu_icons.style";
|
||||||
|
using "chat_helpers/chat_helpers.style"; // GroupCallUserpics
|
||||||
MessageBar {
|
|
||||||
title: TextStyle;
|
|
||||||
titleFg: color;
|
|
||||||
text: TextStyle;
|
|
||||||
textFg: color;
|
|
||||||
textPalette: TextPalette;
|
|
||||||
duration: int;
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupCallUserpics {
|
|
||||||
size: pixels;
|
|
||||||
shift: pixels;
|
|
||||||
stroke: pixels;
|
|
||||||
align: align;
|
|
||||||
}
|
|
||||||
|
|
||||||
msgMaxWidth: 430px;
|
msgMaxWidth: 430px;
|
||||||
msgFont: font(fsize);
|
msgFont: font(fsize);
|
||||||
|
@ -145,9 +130,6 @@ outSemiboldPalette: TextPalette(outTextPalette) {
|
||||||
selectFg: msgOutServiceFgSelected;
|
selectFg: msgOutServiceFgSelected;
|
||||||
selectLinkFg: msgOutServiceFgSelected;
|
selectLinkFg: msgOutServiceFgSelected;
|
||||||
}
|
}
|
||||||
historyComposeAreaPalette: TextPalette(defaultTextPalette) {
|
|
||||||
linkFg: historyComposeAreaFgService;
|
|
||||||
}
|
|
||||||
|
|
||||||
mediaCaptionSkip: 5px;
|
mediaCaptionSkip: 5px;
|
||||||
mediaInBubbleSkip: 5px;
|
mediaInBubbleSkip: 5px;
|
||||||
|
@ -162,15 +144,6 @@ mediaInPaletteSelected: TextPalette(defaultTextPalette) {
|
||||||
linkFg: mediaInFgSelected;
|
linkFg: mediaInFgSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultMessageBar: MessageBar {
|
|
||||||
title: semiboldTextStyle;
|
|
||||||
titleFg: windowActiveTextFg;
|
|
||||||
text: messageTextStyle;
|
|
||||||
textFg: historyComposeAreaFg;
|
|
||||||
textPalette: historyComposeAreaPalette;
|
|
||||||
duration: 160;
|
|
||||||
}
|
|
||||||
|
|
||||||
minPhotoSize: 100px;
|
minPhotoSize: 100px;
|
||||||
maxMediaSize: 430px;
|
maxMediaSize: 430px;
|
||||||
maxStickerSize: 224px;
|
maxStickerSize: 224px;
|
||||||
|
@ -229,58 +202,6 @@ historyPremiumViewSet: RoundButton(defaultActiveButton) {
|
||||||
ripple: emptyRippleAnimation;
|
ripple: emptyRippleAnimation;
|
||||||
}
|
}
|
||||||
|
|
||||||
historyToDownPosition: point(12px, 10px);
|
|
||||||
historyToDownAbove: icon {{ "history_down_arrow", historyToDownFg }};
|
|
||||||
historyToDownAboveOver: icon {{ "history_down_arrow", historyToDownFgOver }};
|
|
||||||
historyToDownPaddingTop: 10px;
|
|
||||||
historyToDownBelow: icon {
|
|
||||||
{ "history_down_shadow", historyToDownShadow },
|
|
||||||
{ "history_down_circle", historyToDownBg },
|
|
||||||
};
|
|
||||||
historyToDownBelowOver: icon {
|
|
||||||
{ "history_down_shadow", historyToDownShadow },
|
|
||||||
{ "history_down_circle", historyToDownBgOver },
|
|
||||||
};
|
|
||||||
historyToDown: TwoIconButton {
|
|
||||||
width: 52px;
|
|
||||||
height: 62px;
|
|
||||||
|
|
||||||
iconBelow: historyToDownBelow;
|
|
||||||
iconBelowOver: historyToDownBelowOver;
|
|
||||||
iconAbove: historyToDownAbove;
|
|
||||||
iconAboveOver: historyToDownAboveOver;
|
|
||||||
iconPosition: point(0px, historyToDownPaddingTop);
|
|
||||||
|
|
||||||
rippleAreaPosition: point(5px, 15px);
|
|
||||||
rippleAreaSize: 42px;
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: historyToDownBgRipple;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
historyToDownBadgeFont: semiboldFont;
|
|
||||||
historyToDownBadgeSize: 22px;
|
|
||||||
|
|
||||||
historyToDownShownAfter: 480px;
|
|
||||||
historyToDownDuration: 150;
|
|
||||||
|
|
||||||
dialogsToUpAbove: icon {{ "history_down_arrow-flip_vertical", historyToDownFg, point(0px, 1px) }};
|
|
||||||
dialogsToUpAboveOver: icon {{ "history_down_arrow-flip_vertical", historyToDownFgOver, point(0px, 1px) }};
|
|
||||||
|
|
||||||
dialogsToUp: TwoIconButton(historyToDown) {
|
|
||||||
iconAbove: dialogsToUpAbove;
|
|
||||||
iconAboveOver: dialogsToUpAboveOver;
|
|
||||||
}
|
|
||||||
|
|
||||||
historyUnreadMentions: TwoIconButton(historyToDown) {
|
|
||||||
iconAbove: icon {{ "history_unread_mention", historyToDownFg }};
|
|
||||||
iconAboveOver: icon {{ "history_unread_mention", historyToDownFgOver }};
|
|
||||||
}
|
|
||||||
historyUnreadReactions: TwoIconButton(historyToDown) {
|
|
||||||
iconAbove: icon {{ "history_unread_reaction", historyToDownFg }};
|
|
||||||
iconAboveOver: icon {{ "history_unread_reaction", historyToDownFgOver }};
|
|
||||||
}
|
|
||||||
historyUnreadThingsSkip: 4px;
|
|
||||||
|
|
||||||
membersInnerWidth: 310px;
|
membersInnerWidth: 310px;
|
||||||
membersInnerHeightMax: 360px;
|
membersInnerHeightMax: 360px;
|
||||||
membersInnerDropdown: InnerDropdown(defaultInnerDropdown) {
|
membersInnerDropdown: InnerDropdown(defaultInnerDropdown) {
|
||||||
|
@ -366,29 +287,6 @@ historyPinOutIcon: icon {{ "history_pin", historyOutIconFg }};
|
||||||
historyPinOutSelectedIcon: icon {{ "history_pin", historyOutIconFgSelected }};
|
historyPinOutSelectedIcon: icon {{ "history_pin", historyOutIconFgSelected }};
|
||||||
historyPinInvertedIcon: icon {{ "history_pin", historySendingInvertedIconFg }};
|
historyPinInvertedIcon: icon {{ "history_pin", historySendingInvertedIconFg }};
|
||||||
|
|
||||||
historyComposeField: InputField(defaultInputField) {
|
|
||||||
font: msgFont;
|
|
||||||
textMargins: margins(0px, 0px, 0px, 0px);
|
|
||||||
textAlign: align(left);
|
|
||||||
textFg: historyComposeAreaFg;
|
|
||||||
textBg: historyComposeAreaBg;
|
|
||||||
heightMin: 36px;
|
|
||||||
heightMax: 72px;
|
|
||||||
placeholderFg: placeholderFg;
|
|
||||||
placeholderFgActive: placeholderFgActive;
|
|
||||||
placeholderFgError: placeholderFgActive;
|
|
||||||
placeholderMargins: margins(7px, 5px, 7px, 5px);
|
|
||||||
placeholderAlign: align(topleft);
|
|
||||||
placeholderScale: 0.;
|
|
||||||
placeholderFont: normalFont;
|
|
||||||
placeholderShift: -50px;
|
|
||||||
border: 0px;
|
|
||||||
borderActive: 0px;
|
|
||||||
duration: 100;
|
|
||||||
}
|
|
||||||
historyComposeFieldMaxHeight: 224px;
|
|
||||||
// historyMinHeight: 56px;
|
|
||||||
|
|
||||||
historySendPadding: 9px;
|
historySendPadding: 9px;
|
||||||
historySendRight: 2px;
|
historySendRight: 2px;
|
||||||
historyBotMenuSkip: 8px;
|
historyBotMenuSkip: 8px;
|
||||||
|
@ -399,245 +297,6 @@ historyBotMenuButton: RoundButton(defaultActiveButton) {
|
||||||
textTop: 6px;
|
textTop: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
historyComposeButton: FlatButton {
|
|
||||||
color: windowActiveTextFg;
|
|
||||||
overColor: windowActiveTextFg;
|
|
||||||
|
|
||||||
bgColor: historyComposeButtonBg;
|
|
||||||
overBgColor: historyComposeButtonBgOver;
|
|
||||||
|
|
||||||
width: -32px;
|
|
||||||
height: 46px;
|
|
||||||
|
|
||||||
textTop: 14px;
|
|
||||||
|
|
||||||
font: semiboldFont;
|
|
||||||
overFont: semiboldFont;
|
|
||||||
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: historyComposeButtonBgRipple;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
historyUnblock: FlatButton(historyComposeButton) {
|
|
||||||
color: attentionButtonFg;
|
|
||||||
overColor: attentionButtonFgOver;
|
|
||||||
}
|
|
||||||
historyContactStatusButton: FlatButton(historyComposeButton) {
|
|
||||||
height: 49px;
|
|
||||||
textTop: 16px;
|
|
||||||
overBgColor: historyComposeButtonBg;
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: historyComposeButtonBgOver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
historyContactStatusBlock: FlatButton(historyContactStatusButton) {
|
|
||||||
color: attentionButtonFg;
|
|
||||||
overColor: attentionButtonFg;
|
|
||||||
}
|
|
||||||
historyContactStatusLabel: FlatLabel(defaultFlatLabel) {
|
|
||||||
minWidth: 240px;
|
|
||||||
}
|
|
||||||
historyEmojiStatusInfoLabel: FlatLabel(historyContactStatusLabel) {
|
|
||||||
align: align(top);
|
|
||||||
textFg: windowSubTextFg;
|
|
||||||
}
|
|
||||||
historyContactStatusMinSkip: 16px;
|
|
||||||
|
|
||||||
historySendIcon: icon {{ "chat/input_send", historySendIconFg }};
|
|
||||||
historySendIconOver: icon {{ "chat/input_send", historySendIconFgOver }};
|
|
||||||
historySendIconPosition: point(10px, 11px);
|
|
||||||
historySendSize: size(44px, 46px);
|
|
||||||
historyScheduleIcon: icon {{ "chat/input_schedule", historyComposeAreaBg }};
|
|
||||||
historyScheduleIconPosition: point(7px, 8px);
|
|
||||||
historyEditSaveIcon: icon {{ "chat/input_save", historySendIconFg }};
|
|
||||||
historyEditSaveIconOver: icon {{ "chat/input_save", historySendIconFgOver }};
|
|
||||||
|
|
||||||
historyAttach: IconButton(defaultIconButton) {
|
|
||||||
width: 44px;
|
|
||||||
height: 46px;
|
|
||||||
|
|
||||||
icon: icon {{ "chat/input_attach", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_attach", historyComposeIconFgOver }};
|
|
||||||
|
|
||||||
rippleAreaPosition: point(2px, 3px);
|
|
||||||
rippleAreaSize: 40px;
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: windowBgOver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
historyAttachEmoji: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "chat/input_smile_face", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_smile_face", historyComposeIconFgOver }};
|
|
||||||
}
|
|
||||||
historyMessagesTTL: IconButtonWithText {
|
|
||||||
iconButton: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "chat/input_autodelete", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_autodelete", historyComposeIconFgOver }};
|
|
||||||
}
|
|
||||||
textFg: historyComposeIconFg;
|
|
||||||
textFgOver: historyComposeIconFgOver;
|
|
||||||
textPadding: margins(21px, 20px, 3px, 7px);
|
|
||||||
textAlign: align(left);
|
|
||||||
|
|
||||||
font: font(10px semibold);
|
|
||||||
}
|
|
||||||
historyReplaceMedia: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "chat/input_replace", windowBgActive }};
|
|
||||||
iconOver: icon {{ "chat/input_replace", windowBgActive }};
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: lightButtonBgOver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
historyEditMediaBg: videoPlayIconBg;
|
|
||||||
historyEditMedia: icon{{ "chat/input_draw", videoPlayIconFg }};
|
|
||||||
historyMessagesTTLPickerHeight: 200px;
|
|
||||||
historyMessagesTTLPickerItemHeight: 40px;
|
|
||||||
historyMessagesTTLLabel: FlatLabel(defaultFlatLabel) {
|
|
||||||
minWidth: 200px;
|
|
||||||
align: align(topleft);
|
|
||||||
textFg: windowSubTextFg;
|
|
||||||
}
|
|
||||||
|
|
||||||
historyAttachEmojiActive: icon {{ "chat/input_smile_face", windowBgActive }};
|
|
||||||
historyEmojiCircle: size(20px, 20px);
|
|
||||||
historyEmojiCircleLine: 1.5;
|
|
||||||
historyEmojiCircleFg: historyComposeIconFg;
|
|
||||||
historyEmojiCircleFgOver: historyComposeIconFgOver;
|
|
||||||
historyBotKeyboardShow: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "chat/input_bot_keyboard", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_bot_keyboard", historyComposeIconFgOver }};
|
|
||||||
}
|
|
||||||
historyBotKeyboardHide: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "chat/input_bot_keyboard_hide", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_bot_keyboard_hide", historyComposeIconFgOver }};
|
|
||||||
}
|
|
||||||
historyBotCommandStart: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "chat/input_bot_command", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_bot_command", historyComposeIconFgOver }};
|
|
||||||
}
|
|
||||||
historyScheduledToggle: IconButton(historyAttach) {
|
|
||||||
icon: icon {
|
|
||||||
{ "chat/input_scheduled", historyComposeIconFg },
|
|
||||||
{ "chat/input_scheduled_dot", attentionButtonFg }
|
|
||||||
};
|
|
||||||
iconOver: icon {
|
|
||||||
{ "chat/input_scheduled", historyComposeIconFgOver },
|
|
||||||
{ "chat/input_scheduled_dot", attentionButtonFg }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
historyRecordVoiceFg: historyComposeIconFg;
|
|
||||||
historyRecordVoiceFgOver: historyComposeIconFgOver;
|
|
||||||
historyRecordVoiceFgInactive: attentionButtonFg;
|
|
||||||
historyRecordVoiceFgActive: windowBgActive;
|
|
||||||
historyRecordVoiceFgActiveIcon: windowFgActive;
|
|
||||||
historyRecordVoiceShowDuration: 120;
|
|
||||||
historyRecordVoiceDuration: 120;
|
|
||||||
historyRecordVoice: icon {{ "chat/input_record", historyRecordVoiceFg }};
|
|
||||||
historyRecordVoiceOver: icon {{ "chat/input_record", historyRecordVoiceFgOver }};
|
|
||||||
historyRecordVoiceActive: icon {{ "chat/input_record_filled", historyRecordVoiceFgActiveIcon }};
|
|
||||||
historyRecordSendIconPosition: point(2px, 0px);
|
|
||||||
historyRecordVoiceRippleBgActive: lightButtonBgOver;
|
|
||||||
historyRecordSignalRadius: 5px;
|
|
||||||
historyRecordCancel: windowSubTextFg;
|
|
||||||
historyRecordCancelActive: windowActiveTextFg;
|
|
||||||
historyRecordFont: font(13px);
|
|
||||||
historyRecordDurationSkip: 12px;
|
|
||||||
historyRecordDurationFg: historyComposeAreaFg;
|
|
||||||
|
|
||||||
historyRecordMainBlobMinRadius: 23px;
|
|
||||||
historyRecordMainBlobMaxRadius: 37px;
|
|
||||||
historyRecordMinorBlobMinRadius: 40px;
|
|
||||||
historyRecordMinorBlobMaxRadius: 47px;
|
|
||||||
historyRecordMajorBlobMinRadius: 43px;
|
|
||||||
historyRecordMajorBlobMaxRadius: 50px;
|
|
||||||
|
|
||||||
historyRecordTextStyle: TextStyle(defaultTextStyle) {
|
|
||||||
font: historyRecordFont;
|
|
||||||
}
|
|
||||||
|
|
||||||
historyRecordTextWidthForWrap: 210px;
|
|
||||||
historyRecordTextLeft: 15px;
|
|
||||||
historyRecordTextRight: 25px;
|
|
||||||
|
|
||||||
historyRecordLockShowDuration: historyToDownDuration;
|
|
||||||
historyRecordLockSize: size(75px, 133px);
|
|
||||||
|
|
||||||
historyRecordLockIconFg: historyToDownFg;
|
|
||||||
historyRecordLockIconSize: size(14px, 17px);
|
|
||||||
historyRecordLockIconBottomHeight: 9px;
|
|
||||||
historyRecordLockIconLineHeight: 2px;
|
|
||||||
historyRecordLockIconLineSkip: 3px;
|
|
||||||
historyRecordLockIconLineWidth: 2px;
|
|
||||||
historyRecordLockIconArcHeight: 4px;
|
|
||||||
historyRecordStopIconWidth: 12px;
|
|
||||||
|
|
||||||
historyRecordLockTopShadow: icon {{ "voice_lock/record_lock_top_shadow", historyToDownShadow }};
|
|
||||||
historyRecordLockTop: icon {{ "voice_lock/record_lock_top", historyToDownBg }};
|
|
||||||
historyRecordLockBottomShadow: icon {{ "voice_lock/record_lock_bottom_shadow", historyToDownShadow }};
|
|
||||||
historyRecordLockBottom: icon {{ "voice_lock/record_lock_bottom", historyToDownBg }};
|
|
||||||
historyRecordLockBodyShadow: icon {{ "voice_lock/record_lock_body_shadow", historyToDownShadow }};
|
|
||||||
historyRecordLockBody: icon {{ "voice_lock/record_lock_body", historyToDownBg }};
|
|
||||||
historyRecordLockMargin: margins(4px, 4px, 4px, 4px);
|
|
||||||
historyRecordLockArrow: icon {{ "voice_lock/voice_arrow", historyToDownFg }};
|
|
||||||
historyRecordLockRippleMargin: margins(6px, 6px, 6px, 6px);
|
|
||||||
|
|
||||||
historyRecordDelete: IconButton(historyAttach) {
|
|
||||||
icon: icon {{ "info/info_media_delete", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "info/info_media_delete", historyComposeIconFgOver }};
|
|
||||||
iconPosition: point(10px, 11px);
|
|
||||||
}
|
|
||||||
historyRecordWaveformRightSkip: 10px;
|
|
||||||
historyRecordWaveformBgMargins: margins(5px, 7px, 5px, 7px);
|
|
||||||
|
|
||||||
historyRecordWaveformBar: 3px;
|
|
||||||
|
|
||||||
historyRecordLockPosition: point(1px, 35px);
|
|
||||||
|
|
||||||
historyRecordCancelButtonWidth: 100px;
|
|
||||||
historyRecordCancelButtonFg: lightButtonFg;
|
|
||||||
|
|
||||||
historySilentToggle: IconButton(historyBotKeyboardShow) {
|
|
||||||
icon: icon {{ "chat/input_silent", historyComposeIconFg }};
|
|
||||||
iconOver: icon {{ "chat/input_silent", historyComposeIconFgOver }};
|
|
||||||
}
|
|
||||||
historySilentToggleOn: icon {{ "chat/input_silent_on", historyComposeIconFg }};
|
|
||||||
historySilentToggleOnOver: icon {{ "chat/input_silent_on", historyComposeIconFgOver }};
|
|
||||||
|
|
||||||
historyReplySkip: 51px;
|
|
||||||
historyReplyNameFg: windowActiveTextFg;
|
|
||||||
historyReplyHeight: 49px;
|
|
||||||
historyReplyIconPosition: point(5px, 5px);
|
|
||||||
historyReplyIcon: icon {{ "chat/input_reply", historyReplyIconFg }};
|
|
||||||
historyForwardIcon: icon {{ "chat/input_forward", historyReplyIconFg }};
|
|
||||||
historyEditIcon: icon {{ "chat/input_edit", historyReplyIconFg }};
|
|
||||||
historyReplyCancel: IconButton {
|
|
||||||
width: 49px;
|
|
||||||
height: 49px;
|
|
||||||
|
|
||||||
icon: historyReplyCancelIcon;
|
|
||||||
iconOver: historyReplyCancelIconOver;
|
|
||||||
iconPosition: point(-1px, -1px);
|
|
||||||
|
|
||||||
rippleAreaPosition: point(4px, 4px);
|
|
||||||
rippleAreaSize: 40px;
|
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
|
||||||
color: windowBgOver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
historyPinnedShowAll: IconButton(historyReplyCancel) {
|
|
||||||
icon: icon {{ "pinned_show_all", historyReplyCancelFg }};
|
|
||||||
iconOver: icon {{ "pinned_show_all", historyReplyCancelFgOver }};
|
|
||||||
}
|
|
||||||
historyPinnedBotButton: RoundButton(defaultActiveButton) {
|
|
||||||
width: -34px;
|
|
||||||
height: 30px;
|
|
||||||
textTop: 6px;
|
|
||||||
padding: margins(2px, 10px, 10px, 9px);
|
|
||||||
}
|
|
||||||
historyPinnedBotButtonMaxWidth: 150px;
|
|
||||||
|
|
||||||
topicButtonSkip: 3px;
|
topicButtonSkip: 3px;
|
||||||
topicButtonPadding: margins(6px, 3px, 8px, 3px);
|
topicButtonPadding: margins(6px, 3px, 8px, 3px);
|
||||||
topicButtonArrowSkip: 8px;
|
topicButtonArrowSkip: 8px;
|
||||||
|
@ -960,13 +619,6 @@ historyCommentsUserpics: GroupCallUserpics {
|
||||||
align: align(left);
|
align: align(left);
|
||||||
}
|
}
|
||||||
|
|
||||||
boxAttachEmoji: IconButton(historyAttachEmoji) {
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
rippleAreaSize: 0px;
|
|
||||||
}
|
|
||||||
boxAttachEmojiTop: 20px;
|
|
||||||
|
|
||||||
historyGroupAboutMargin: 16px;
|
historyGroupAboutMargin: 16px;
|
||||||
historyGroupAboutPadding: margins(24px, 16px, 24px, 16px);
|
historyGroupAboutPadding: margins(24px, 16px, 24px, 16px);
|
||||||
historyGroupAboutBulletSkip: 16px;
|
historyGroupAboutBulletSkip: 16px;
|
||||||
|
@ -1012,8 +664,6 @@ historyCommentsOpenInSelected: icon {{ "history_comments_open", msgFileThumbLink
|
||||||
historyCommentsOpenOut: icon {{ "history_comments_open", msgFileThumbLinkOutFg }};
|
historyCommentsOpenOut: icon {{ "history_comments_open", msgFileThumbLinkOutFg }};
|
||||||
historyCommentsOpenOutSelected: icon {{ "history_comments_open", msgFileThumbLinkOutFgSelected }};
|
historyCommentsOpenOutSelected: icon {{ "history_comments_open", msgFileThumbLinkOutFgSelected }};
|
||||||
|
|
||||||
historySlowmodeCounterMargins: margins(0px, 0px, 10px, 0px);
|
|
||||||
|
|
||||||
historyGroupCallUserpics: GroupCallUserpics {
|
historyGroupCallUserpics: GroupCallUserpics {
|
||||||
size: 32px;
|
size: 32px;
|
||||||
shift: 12px;
|
shift: 12px;
|
||||||
|
@ -1137,13 +787,6 @@ reactionsTabs: MultiSelect(defaultMultiSelect) {
|
||||||
padding: margins(12px, 10px, 12px, 10px);
|
padding: margins(12px, 10px, 12px, 10px);
|
||||||
}
|
}
|
||||||
reactionsTabIconSkip: 3px;
|
reactionsTabIconSkip: 3px;
|
||||||
historyRequestsUserpics: GroupCallUserpics {
|
|
||||||
size: 22px;
|
|
||||||
shift: 8px;
|
|
||||||
stroke: 4px;
|
|
||||||
align: align(left);
|
|
||||||
}
|
|
||||||
historyRequestsHeight: 33px;
|
|
||||||
|
|
||||||
SendAsButton {
|
SendAsButton {
|
||||||
width: pixels;
|
width: pixels;
|
||||||
|
|
|
@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "ui/power_saving.h"
|
#include "ui/power_saving.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/palette.h"
|
#include "styles/palette.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
|
@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/wrap/fade_wrap.h"
|
#include "ui/wrap/fade_wrap.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/palette.h"
|
#include "styles/palette.h"
|
||||||
|
|
||||||
#include <QtGui/QtEvents>
|
#include <QtGui/QtEvents>
|
||||||
|
|
|
@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/text/text_options.h"
|
#include "ui/text/text_options.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_calls.h"
|
#include "styles/style_calls.h"
|
||||||
#include "styles/style_info.h" // st::topBarArrowPadding, like TopBarWidget.
|
#include "styles/style_info.h" // st::topBarArrowPadding, like TopBarWidget.
|
||||||
#include "styles/style_window.h" // st::columnMinimalWidthLeft
|
#include "styles/style_window.h" // st::columnMinimalWidthLeft
|
||||||
|
@ -145,7 +145,7 @@ void RequestsBar::paint(Painter &p) {
|
||||||
const auto userpicsLeft = userpicsTop * 2;
|
const auto userpicsLeft = userpicsTop * 2;
|
||||||
const auto textTop = st::lineWidth + (st::historyRequestsHeight
|
const auto textTop = st::lineWidth + (st::historyRequestsHeight
|
||||||
- st::lineWidth
|
- st::lineWidth
|
||||||
- st::msgServiceNameFont->height) / 2;
|
- st::semiboldFont->height) / 2;
|
||||||
const auto width = _inner->width();
|
const auto width = _inner->width();
|
||||||
const auto &font = st::defaultMessageBar.title.font;
|
const auto &font = st::defaultMessageBar.title.font;
|
||||||
p.setPen(st::defaultMessageBar.titleFg);
|
p.setPen(st::defaultMessageBar.titleFg);
|
||||||
|
|
|
@ -10,29 +10,30 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/effects/radial_animation.h"
|
#include "ui/effects/radial_animation.h"
|
||||||
#include "ui/effects/ripple_animation.h"
|
#include "ui/effects/ripple_animation.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
EmojiButton::EmojiButton(QWidget *parent, const style::IconButton &st)
|
EmojiButton::EmojiButton(QWidget *parent, const style::EmojiButton &st)
|
||||||
: RippleButton(parent, st.ripple)
|
: RippleButton(parent, st.inner.ripple)
|
||||||
, _st(st) {
|
, _st(st) {
|
||||||
resize(_st.width, _st.height);
|
resize(_st.inner.width, _st.inner.height);
|
||||||
setCursor(style::cur_pointer);
|
setCursor(style::cur_pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiButton::paintEvent(QPaintEvent *e) {
|
void EmojiButton::paintEvent(QPaintEvent *e) {
|
||||||
auto p = QPainter(this);
|
auto p = QPainter(this);
|
||||||
|
|
||||||
p.fillRect(e->rect(), st::historyComposeAreaBg);
|
p.fillRect(e->rect(), _st.bg);
|
||||||
paintRipple(p, _st.rippleAreaPosition.x(), _st.rippleAreaPosition.y(), _rippleOverride ? &(*_rippleOverride)->c : nullptr);
|
const auto &st = _st.inner;
|
||||||
|
paintRipple(p, st.rippleAreaPosition.x(), st.rippleAreaPosition.y(), _rippleOverride ? &(*_rippleOverride)->c : nullptr);
|
||||||
|
|
||||||
const auto over = isOver();
|
const auto over = isOver();
|
||||||
const auto loadingState = _loading
|
const auto loadingState = _loading
|
||||||
? _loading->computeState()
|
? _loading->computeState()
|
||||||
: RadialState{ 0., 0, RadialState::kFull };
|
: RadialState{ 0., 0, RadialState::kFull };
|
||||||
const auto icon = _iconOverride ? _iconOverride : &(over ? _st.iconOver : _st.icon);
|
const auto icon = _iconOverride ? _iconOverride : &(over ? st.iconOver : st.icon);
|
||||||
auto position = _st.iconPosition;
|
auto position = st.iconPosition;
|
||||||
if (position.x() < 0) {
|
if (position.x() < 0) {
|
||||||
position.setX((width() - icon->width()) / 2);
|
position.setX((width() - icon->width()) / 2);
|
||||||
}
|
}
|
||||||
|
@ -53,9 +54,7 @@ void EmojiButton::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
const auto color = (_colorOverride
|
const auto color = (_colorOverride
|
||||||
? *_colorOverride
|
? *_colorOverride
|
||||||
: (over
|
: (over ? _st.lineFgOver : _st.lineFg));
|
||||||
? st::historyEmojiCircleFgOver
|
|
||||||
: st::historyEmojiCircleFg));
|
|
||||||
const auto line = style::ConvertScaleExact(st::historyEmojiCircleLine);
|
const auto line = style::ConvertScaleExact(st::historyEmojiCircleLine);
|
||||||
if (anim::Disabled() && _loading && _loading->animating()) {
|
if (anim::Disabled() && _loading && _loading->animating()) {
|
||||||
anim::DrawStaticLoading(p, inner, line, color);
|
anim::DrawStaticLoading(p, inner, line, color);
|
||||||
|
@ -112,14 +111,15 @@ void EmojiButton::onStateChanged(State was, StateChangeSource source) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint EmojiButton::prepareRippleStartPosition() const {
|
QPoint EmojiButton::prepareRippleStartPosition() const {
|
||||||
if (!_st.rippleAreaSize) {
|
if (!_st.inner.rippleAreaSize) {
|
||||||
return DisabledRippleStartPosition();
|
return DisabledRippleStartPosition();
|
||||||
}
|
}
|
||||||
return mapFromGlobal(QCursor::pos()) - _st.rippleAreaPosition;
|
return mapFromGlobal(QCursor::pos()) - _st.inner.rippleAreaPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage EmojiButton::prepareRippleMask() const {
|
QImage EmojiButton::prepareRippleMask() const {
|
||||||
return RippleAnimation::EllipseMask(QSize(_st.rippleAreaSize, _st.rippleAreaSize));
|
const auto size = _st.inner.rippleAreaSize;
|
||||||
|
return RippleAnimation::EllipseMask(QSize(size, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
|
@ -9,13 +9,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct EmojiButton;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
class InfiniteRadialAnimation;
|
class InfiniteRadialAnimation;
|
||||||
|
|
||||||
class EmojiButton final : public RippleButton {
|
class EmojiButton final : public RippleButton {
|
||||||
public:
|
public:
|
||||||
EmojiButton(QWidget *parent, const style::IconButton &st);
|
EmojiButton(QWidget *parent, const style::EmojiButton &st);
|
||||||
|
|
||||||
void setLoading(bool loading);
|
void setLoading(bool loading);
|
||||||
void setColorOverrides(
|
void setColorOverrides(
|
||||||
|
@ -33,7 +37,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
void loadingAnimationCallback();
|
void loadingAnimationCallback();
|
||||||
|
|
||||||
const style::IconButton &_st;
|
const style::EmojiButton &_st;
|
||||||
|
|
||||||
std::unique_ptr<Ui::InfiniteRadialAnimation> _loading;
|
std::unique_ptr<Ui::InfiniteRadialAnimation> _loading;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "ui/effects/ripple_animation.h"
|
#include "ui/effects/ripple_animation.h"
|
||||||
#include "ui/unread_badge_paint.h"
|
#include "ui/unread_badge_paint.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "ui/effects/ripple_animation.h"
|
#include "ui/effects/ripple_animation.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -18,9 +18,10 @@ constexpr int kWideScale = 5;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
SendButton::SendButton(QWidget *parent)
|
SendButton::SendButton(QWidget *parent, const style::SendButton &st)
|
||||||
: RippleButton(parent, st::historyReplyCancel.ripple) {
|
: RippleButton(parent, st.inner.ripple)
|
||||||
resize(st::historySendSize);
|
, _st(st) {
|
||||||
|
resize(_st.inner.width, _st.inner.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendButton::setType(Type type) {
|
void SendButton::setType(Type type) {
|
||||||
|
@ -93,35 +94,17 @@ void SendButton::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendButton::paintRecord(QPainter &p, bool over) {
|
void SendButton::paintRecord(QPainter &p, bool over) {
|
||||||
const auto recordActive = 0.;
|
|
||||||
if (!isDisabled()) {
|
if (!isDisabled()) {
|
||||||
auto rippleColor = anim::color(
|
|
||||||
st::historyAttachEmoji.ripple.color,
|
|
||||||
st::historyRecordVoiceRippleBgActive,
|
|
||||||
recordActive);
|
|
||||||
paintRipple(
|
paintRipple(
|
||||||
p,
|
p,
|
||||||
(width() - st::historyAttachEmoji.rippleAreaSize) / 2,
|
(width() - _st.inner.rippleAreaSize) / 2,
|
||||||
st::historyAttachEmoji.rippleAreaPosition.y(),
|
_st.inner.rippleAreaPosition.y());
|
||||||
&rippleColor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fastIcon = [&] {
|
const auto &icon = (isDisabled() || !over)
|
||||||
if (isDisabled()) {
|
? _st.record
|
||||||
return &st::historyRecordVoice;
|
: _st.recordOver;
|
||||||
} else if (recordActive == 1.) {
|
icon.paintInCenter(p, rect());
|
||||||
return &st::historyRecordVoiceActive;
|
|
||||||
} else if (over) {
|
|
||||||
return &st::historyRecordVoiceOver;
|
|
||||||
}
|
|
||||||
return &st::historyRecordVoice;
|
|
||||||
};
|
|
||||||
fastIcon()->paintInCenter(p, rect());
|
|
||||||
if (!isDisabled() && recordActive > 0. && recordActive < 1.) {
|
|
||||||
p.setOpacity(recordActive);
|
|
||||||
st::historyRecordVoiceActive.paintInCenter(p, rect());
|
|
||||||
p.setOpacity(1.);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendButton::paintSave(QPainter &p, bool over) {
|
void SendButton::paintSave(QPainter &p, bool over) {
|
||||||
|
@ -132,7 +115,10 @@ void SendButton::paintSave(QPainter &p, bool over) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendButton::paintCancel(QPainter &p, bool over) {
|
void SendButton::paintCancel(QPainter &p, bool over) {
|
||||||
paintRipple(p, (width() - st::historyAttachEmoji.rippleAreaSize) / 2, st::historyAttachEmoji.rippleAreaPosition.y());
|
paintRipple(
|
||||||
|
p,
|
||||||
|
(width() - _st.inner.rippleAreaSize) / 2,
|
||||||
|
_st.inner.rippleAreaPosition.y());
|
||||||
|
|
||||||
const auto &cancelIcon = over
|
const auto &cancelIcon = over
|
||||||
? st::historyReplyCancelIconOver
|
? st::historyReplyCancelIconOver
|
||||||
|
@ -141,9 +127,7 @@ void SendButton::paintCancel(QPainter &p, bool over) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendButton::paintSend(QPainter &p, bool over) {
|
void SendButton::paintSend(QPainter &p, bool over) {
|
||||||
const auto &sendIcon = over
|
const auto &sendIcon = over ? _st.inner.iconOver : _st.inner.icon;
|
||||||
? st::historySendIconOver
|
|
||||||
: st::historySendIcon;
|
|
||||||
if (isDisabled()) {
|
if (isDisabled()) {
|
||||||
const auto color = st::historyRecordVoiceFg->c;
|
const auto color = st::historyRecordVoiceFg->c;
|
||||||
sendIcon.paint(p, st::historySendIconPosition, width(), color);
|
sendIcon.paint(p, st::historySendIconPosition, width(), color);
|
||||||
|
@ -199,20 +183,14 @@ QPixmap SendButton::grabContent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage SendButton::prepareRippleMask() const {
|
QImage SendButton::prepareRippleMask() const {
|
||||||
auto size = (_type == Type::Record)
|
const auto size = _st.inner.rippleAreaSize;
|
||||||
? st::historyAttachEmoji.rippleAreaSize
|
|
||||||
: st::historyReplyCancel.rippleAreaSize;
|
|
||||||
return RippleAnimation::EllipseMask(QSize(size, size));
|
return RippleAnimation::EllipseMask(QSize(size, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint SendButton::prepareRippleStartPosition() const {
|
QPoint SendButton::prepareRippleStartPosition() const {
|
||||||
auto real = mapFromGlobal(QCursor::pos());
|
const auto real = mapFromGlobal(QCursor::pos());
|
||||||
auto size = (_type == Type::Record)
|
const auto size = _st.inner.rippleAreaSize;
|
||||||
? st::historyAttachEmoji.rippleAreaSize
|
const auto y = (height() - _st.inner.rippleAreaSize) / 2;
|
||||||
: st::historyReplyCancel.rippleAreaSize;
|
|
||||||
auto y = (_type == Type::Record)
|
|
||||||
? st::historyAttachEmoji.rippleAreaPosition.y()
|
|
||||||
: (height() - st::historyReplyCancel.rippleAreaSize) / 2;
|
|
||||||
return real - QPoint((width() - size) / 2, y);
|
return real - QPoint((width() - size) / 2, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct SendButton;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
class SendButton final : public RippleButton {
|
class SendButton final : public RippleButton {
|
||||||
public:
|
public:
|
||||||
explicit SendButton(QWidget *parent);
|
SendButton(QWidget *parent, const style::SendButton &st);
|
||||||
|
|
||||||
static constexpr auto kSlowmodeDelayLimit = 100 * 60;
|
static constexpr auto kSlowmodeDelayLimit = 100 * 60;
|
||||||
|
|
||||||
|
@ -49,6 +53,8 @@ private:
|
||||||
void paintSchedule(QPainter &p, bool over);
|
void paintSchedule(QPainter &p, bool over);
|
||||||
void paintSlowmode(QPainter &p);
|
void paintSlowmode(QPainter &p);
|
||||||
|
|
||||||
|
const style::SendButton &_st;
|
||||||
|
|
||||||
Type _type = Type::Send;
|
Type _type = Type::Send;
|
||||||
Type _afterSlowmodeType = Type::Send;
|
Type _afterSlowmodeType = Type::Send;
|
||||||
QPixmap _contentFrom, _contentTo;
|
QPixmap _contentFrom, _contentTo;
|
||||||
|
|
|
@ -181,7 +181,7 @@ void GroupsStrip::paintEvent(QPaintEvent *e) {
|
||||||
const auto size = SearchWithGroups::IconSizeOverride();
|
const auto size = SearchWithGroups::IconSizeOverride();
|
||||||
if (_chosen == index) {
|
if (_chosen == index) {
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(st::windowBgRipple);
|
p.setBrush(_st.bgActive);
|
||||||
p.drawEllipse(
|
p.drawEllipse(
|
||||||
left + skip,
|
left + skip,
|
||||||
top + (height - single) / 2 + skip,
|
top + (height - single) / 2 + skip,
|
||||||
|
|
|
@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_window.h"
|
#include "styles/style_window.h"
|
||||||
#include "styles/style_media_view.h"
|
#include "styles/style_media_view.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
|
|
||||||
|
@ -561,16 +562,17 @@ void Generator::paintComposeArea() {
|
||||||
auto right = st::historySendRight + st::historySendSize.width();
|
auto right = st::historySendRight + st::historySendSize.width();
|
||||||
st::historyRecordVoice[_palette].paintInCenter(*_p, QRect(_composeArea.x() + _composeArea.width() - right, controlsTop, st::historySendSize.width(), st::historySendSize.height()));
|
st::historyRecordVoice[_palette].paintInCenter(*_p, QRect(_composeArea.x() + _composeArea.width() - right, controlsTop, st::historySendSize.width(), st::historySendSize.height()));
|
||||||
|
|
||||||
const auto emojiIconLeft = (st::historyAttachEmoji.iconPosition.x() < 0)
|
const auto &emojiButton = st::historyAttachEmoji.inner;
|
||||||
? ((st::historyAttachEmoji.width - st::historyAttachEmoji.icon.width()) / 2)
|
const auto emojiIconLeft = (emojiButton.iconPosition.x() < 0)
|
||||||
: st::historyAttachEmoji.iconPosition.x();
|
? ((emojiButton.width - emojiButton.icon.width()) / 2)
|
||||||
const auto emojiIconTop = (st::historyAttachEmoji.iconPosition.y() < 0)
|
: emojiButton.iconPosition.x();
|
||||||
? ((st::historyAttachEmoji.height - st::historyAttachEmoji.icon.height()) / 2)
|
const auto emojiIconTop = (emojiButton.iconPosition.y() < 0)
|
||||||
: st::historyAttachEmoji.iconPosition.y();
|
? ((emojiButton.height - emojiButton.icon.height()) / 2)
|
||||||
const auto &emojiIcon = st::historyAttachEmoji.icon[_palette];
|
: emojiButton.iconPosition.y();
|
||||||
right += st::historyAttachEmoji.width;
|
const auto &emojiIcon = emojiButton.icon[_palette];
|
||||||
|
right += emojiButton.width;
|
||||||
auto attachEmojiLeft = _composeArea.x() + _composeArea.width() - right;
|
auto attachEmojiLeft = _composeArea.x() + _composeArea.width() - right;
|
||||||
_p->fillRect(attachEmojiLeft, controlsTop, st::historyAttachEmoji.width, st::historyAttachEmoji.height, st::historyComposeAreaBg[_palette]);
|
_p->fillRect(attachEmojiLeft, controlsTop, emojiButton.width, emojiButton.height, st::historyComposeAreaBg[_palette]);
|
||||||
emojiIcon.paint(*_p, attachEmojiLeft + emojiIconLeft, controlsTop + emojiIconTop, _rect.width());
|
emojiIcon.paint(*_p, attachEmojiLeft + emojiIconLeft, controlsTop + emojiIconTop, _rect.width());
|
||||||
|
|
||||||
auto pen = st::historyEmojiCircleFg[_palette]->p;
|
auto pen = st::historyEmojiCircleFg[_palette]->p;
|
||||||
|
@ -591,7 +593,7 @@ void Generator::paintComposeArea() {
|
||||||
|
|
||||||
auto fieldLeft = _composeArea.x() + st::historyAttach.width;
|
auto fieldLeft = _composeArea.x() + st::historyAttach.width;
|
||||||
auto fieldTop = _composeArea.y() + _composeArea.height() - st::historyAttach.height + st::historySendPadding;
|
auto fieldTop = _composeArea.y() + _composeArea.height() - st::historyAttach.height + st::historySendPadding;
|
||||||
auto fieldWidth = _composeArea.width() - st::historyAttach.width - st::historySendSize.width() - st::historySendRight - st::historyAttachEmoji.width;
|
auto fieldWidth = _composeArea.width() - st::historyAttach.width - st::historySendSize.width() - st::historySendRight - emojiButton.width;
|
||||||
auto fieldHeight = st::historySendSize.height() - 2 * st::historySendPadding;
|
auto fieldHeight = st::historySendSize.height() - 2 * st::historySendPadding;
|
||||||
auto field = QRect(fieldLeft, fieldTop, fieldWidth, fieldHeight);
|
auto field = QRect(fieldLeft, fieldTop, fieldWidth, fieldHeight);
|
||||||
_p->fillRect(field, st::historyComposeField.textBg[_palette]);
|
_p->fillRect(field, st::historyComposeField.textBg[_palette]);
|
||||||
|
|
|
@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
using "ui/basic.style";
|
using "ui/basic.style";
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
using "ui/chat/chat.style";
|
using "chat_helpers/chat_helpers.style";
|
||||||
using "boxes/boxes.style"; // UserpicButton
|
using "boxes/boxes.style"; // UserpicButton
|
||||||
|
|
||||||
windowMinWidth: 380px;
|
windowMinWidth: 380px;
|
||||||
|
|
Loading…
Add table
Reference in a new issue