mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improved ripple animation colors and styles for different buttons.
Also moved FlatLabel and LabelSimple to ui/widgets/labels module. Also moved ScrollArea to ui/widgets/scroll_area module.
This commit is contained in:
parent
3186e1e495
commit
7fa274a68e
115 changed files with 1435 additions and 1478 deletions
|
@ -27,6 +27,8 @@ semibold: "Open Sans Semibold";
|
||||||
fsize: 13px;
|
fsize: 13px;
|
||||||
normalFont: font(fsize);
|
normalFont: font(fsize);
|
||||||
semiboldFont: font(fsize semibold);
|
semiboldFont: font(fsize semibold);
|
||||||
|
boxFontSize: 14px;
|
||||||
|
boxTextFont: font(boxFontSize);
|
||||||
|
|
||||||
emojiImgSize: 18px; // exceptional value for retina
|
emojiImgSize: 18px; // exceptional value for retina
|
||||||
emojiSize: 18px;
|
emojiSize: 18px;
|
||||||
|
@ -34,56 +36,6 @@ emojiPadding: 1px;
|
||||||
|
|
||||||
lineWidth: 1px;
|
lineWidth: 1px;
|
||||||
|
|
||||||
labelDefFlat: flatLabel {
|
|
||||||
font: font(fsize);
|
|
||||||
width: 0px;
|
|
||||||
maxHeight: 0px;
|
|
||||||
align: align(left);
|
|
||||||
textFg: windowTextFg;
|
|
||||||
}
|
|
||||||
|
|
||||||
boxVerticalMargin: 10px;
|
|
||||||
boxWidth: 320px;
|
|
||||||
boxWideWidth: 364px;
|
|
||||||
boxPadding: margins(26px, 30px, 34px, 8px);
|
|
||||||
boxMaxListHeight: 600px;
|
|
||||||
boxFontSize: 14px;
|
|
||||||
boxTextFont: font(boxFontSize);
|
|
||||||
boxLittleSkip: 10px;
|
|
||||||
boxMediumSkip: 20px;
|
|
||||||
|
|
||||||
boxTitleFont: font(boxFontSize bold);
|
|
||||||
boxTitlePosition: point(26px, 28px);
|
|
||||||
boxTitleHeight: 54px;
|
|
||||||
|
|
||||||
boxButtonFont: font(boxFontSize semibold);
|
|
||||||
boxButtonPadding: margins(12px, 16px, 22px, 16px);
|
|
||||||
boxLabel: flatLabel(labelDefFlat) {
|
|
||||||
font: font(boxFontSize);
|
|
||||||
align: align(topleft);
|
|
||||||
}
|
|
||||||
|
|
||||||
solidScroll: flatScroll {
|
|
||||||
barColor: #3f729734;
|
|
||||||
bgColor: #214f751a;
|
|
||||||
barOverColor: #3f729734;
|
|
||||||
bgOverColor: #214f751a;
|
|
||||||
|
|
||||||
minHeight: 20px;
|
|
||||||
|
|
||||||
round: 2px;
|
|
||||||
deltax: 5px;
|
|
||||||
width: 14px;
|
|
||||||
deltat: 6px;
|
|
||||||
deltab: 6px;
|
|
||||||
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: 0px;
|
|
||||||
shColor: #00000012;
|
|
||||||
|
|
||||||
duration: 150;
|
|
||||||
hiding: 0;
|
|
||||||
}
|
|
||||||
defaultDropdownDuration: 150;
|
defaultDropdownDuration: 150;
|
||||||
defaultDropdownPadding: margins(10px, 10px, 10px, 10px);
|
defaultDropdownPadding: margins(10px, 10px, 10px, 10px);
|
||||||
defaultDropdownShadow: icon {{ "dropdown_shadow", windowShadowFg }};
|
defaultDropdownShadow: icon {{ "dropdown_shadow", windowShadowFg }};
|
||||||
|
@ -103,14 +55,6 @@ defaultTooltip: Tooltip {
|
||||||
linesMax: 12;
|
linesMax: 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
boxScroll: flatScroll(solidScroll) {
|
|
||||||
round: 3px;
|
|
||||||
width: 18px;
|
|
||||||
deltax: 6px;
|
|
||||||
}
|
|
||||||
boxScrollSkip: 6px;
|
|
||||||
boxScrollShadowBg: #00000012;
|
|
||||||
|
|
||||||
statusFont: font(fsize);
|
statusFont: font(fsize);
|
||||||
statusFg: #999999;
|
statusFg: #999999;
|
||||||
statusFgActive: #0080c0;
|
statusFgActive: #0080c0;
|
||||||
|
@ -135,63 +79,12 @@ linkCropLimit: 360px;
|
||||||
linkFont: normalFont;
|
linkFont: normalFont;
|
||||||
linkOverFont: font(fsize underline);
|
linkOverFont: font(fsize underline);
|
||||||
|
|
||||||
scrollDef: flatScroll {
|
|
||||||
barColor: #00000053;
|
|
||||||
bgColor: #0000001a;
|
|
||||||
barOverColor: #0000007a;
|
|
||||||
bgOverColor: #0000002c;
|
|
||||||
|
|
||||||
round: 2px;
|
|
||||||
|
|
||||||
width: 10px;
|
|
||||||
minHeight: 20px;
|
|
||||||
deltax: 3px;
|
|
||||||
deltat: 3px;
|
|
||||||
deltab: 3px;
|
|
||||||
|
|
||||||
topsh: 2px;
|
|
||||||
bottomsh: 2px;
|
|
||||||
shColor: #00000012;
|
|
||||||
|
|
||||||
duration: 150;
|
|
||||||
hiding: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
dateRadius: 10px;
|
dateRadius: 10px;
|
||||||
buttonRadius: 3px;
|
buttonRadius: 3px;
|
||||||
|
|
||||||
scrollCountries: flatScroll(scrollDef) {
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
lnkText: #0f7dc7;
|
lnkText: #0f7dc7;
|
||||||
|
|
||||||
boxShadow: icon {{ "box_shadow", windowShadowFg }};
|
|
||||||
boxShadowShift: 2px;
|
|
||||||
|
|
||||||
btnSelectSep: #e0e0e0;
|
|
||||||
|
|
||||||
countryRowHeight: 36px;
|
|
||||||
countryRowNameFont: semiboldFont;
|
|
||||||
countryRowNameFg: boxTextFg;
|
|
||||||
countryRowPadding: margins(22px, 9px, 8px, 0px);
|
|
||||||
countryRowCodeFont: font(fsize);
|
|
||||||
countryRowBg: windowBg;
|
|
||||||
countryRowBgOver: windowOverBg;
|
|
||||||
countryRowCodeFg: windowSubTextFg;
|
|
||||||
countryRowCodeFgOver: windowSubTextFgOver;
|
|
||||||
countriesSkip: 12px;
|
|
||||||
countriesScroll: flatScroll(boxScroll) {
|
|
||||||
deltat: 9px;
|
|
||||||
deltab: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
setLittleSkip: 9px;
|
setLittleSkip: 9px;
|
||||||
setScroll: flatScroll(scrollDef) {
|
|
||||||
bottomsh: 0px;
|
|
||||||
topsh: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
noContactsHeight: 100px;
|
noContactsHeight: 100px;
|
||||||
noContactsFont: font(fsize);
|
noContactsFont: font(fsize);
|
||||||
|
@ -245,20 +138,6 @@ msgOutReplyBarColor: historyOutIconFg;
|
||||||
msgOutReplyBarSelColor: historyOutIconFgSelected;
|
msgOutReplyBarSelColor: historyOutIconFgSelected;
|
||||||
msgImgReplyBarColor: #ffffff;
|
msgImgReplyBarColor: #ffffff;
|
||||||
|
|
||||||
msgBotKbDuration: 200;
|
|
||||||
msgBotKbFont: semiboldFont;
|
|
||||||
msgBotKbOverBg: #ffffff1a;
|
|
||||||
msgBotKbIconPadding: 2px;
|
|
||||||
msgBotKbUrlIcon: icon {{ "inline_button_url", #ffffff }};
|
|
||||||
msgBotKbSwitchPmIcon: icon {{ "inline_button_switch", #ffffff }};
|
|
||||||
msgBotKbButton: botKeyboardButton {
|
|
||||||
margin: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
height: 36px;
|
|
||||||
textTop: 8px;
|
|
||||||
downTextTop: 9px;
|
|
||||||
}
|
|
||||||
|
|
||||||
msgServiceBg: #89a0b47f;
|
msgServiceBg: #89a0b47f;
|
||||||
msgServiceSelectBg: #bbc8d4a2;
|
msgServiceSelectBg: #bbc8d4a2;
|
||||||
msgServiceColor: #ffffff;
|
msgServiceColor: #ffffff;
|
||||||
|
@ -283,7 +162,7 @@ msgDateImgBgSelected: #1c4a7187;
|
||||||
msgDateImgPadding: point(8px, 2px);
|
msgDateImgPadding: point(8px, 2px);
|
||||||
msgDateImgCheckSpace: 4px;
|
msgDateImgCheckSpace: 4px;
|
||||||
|
|
||||||
defaultTextStyle: textStyle {
|
defaultTextStyle: TextStyle {
|
||||||
linkFlags: font(fsize);
|
linkFlags: font(fsize);
|
||||||
linkFlagsOver: font(fsize underline);
|
linkFlagsOver: font(fsize underline);
|
||||||
linkFg: btnYesColor;
|
linkFg: btnYesColor;
|
||||||
|
@ -293,10 +172,7 @@ defaultTextStyle: textStyle {
|
||||||
selectOverlay: msgSelectOverlay;
|
selectOverlay: msgSelectOverlay;
|
||||||
lineHeight: 0px;
|
lineHeight: 0px;
|
||||||
}
|
}
|
||||||
boxTextStyle: textStyle(defaultTextStyle) {
|
serviceTextStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 22px;
|
|
||||||
}
|
|
||||||
serviceTextStyle: textStyle(defaultTextStyle) {
|
|
||||||
linkFlags: msgServiceFont;
|
linkFlags: msgServiceFont;
|
||||||
linkFlagsOver: font(fsize semibold underline);
|
linkFlagsOver: font(fsize semibold underline);
|
||||||
linkFg: msgServiceColor;
|
linkFg: msgServiceColor;
|
||||||
|
@ -305,35 +181,35 @@ serviceTextStyle: textStyle(defaultTextStyle) {
|
||||||
selectBg: msgServiceSelectBg;
|
selectBg: msgServiceSelectBg;
|
||||||
selectOverlay: msgServiceSelectBg;
|
selectOverlay: msgServiceSelectBg;
|
||||||
}
|
}
|
||||||
inTextStyle: textStyle(defaultTextStyle) {
|
inTextStyle: TextStyle(defaultTextStyle) {
|
||||||
monoFg: #4e7391;
|
monoFg: #4e7391;
|
||||||
selectBg: msgInBgSelected;
|
selectBg: msgInBgSelected;
|
||||||
selectOverlay: msgSelectOverlay;
|
selectOverlay: msgSelectOverlay;
|
||||||
}
|
}
|
||||||
outTextStyle: textStyle(defaultTextStyle) {
|
outTextStyle: TextStyle(defaultTextStyle) {
|
||||||
monoFg: #469165;
|
monoFg: #469165;
|
||||||
selectBg: msgOutBgSelected;
|
selectBg: msgOutBgSelected;
|
||||||
selectOverlay: msgSelectOverlay;
|
selectOverlay: msgSelectOverlay;
|
||||||
}
|
}
|
||||||
inFwdTextStyle: textStyle(defaultTextStyle) {
|
inFwdTextStyle: TextStyle(defaultTextStyle) {
|
||||||
linkFlags: semiboldFont;
|
linkFlags: semiboldFont;
|
||||||
linkFlagsOver: semiboldFont;
|
linkFlagsOver: semiboldFont;
|
||||||
linkFg: msgInServiceFg;
|
linkFg: msgInServiceFg;
|
||||||
linkFgDown: msgInServiceFg;
|
linkFgDown: msgInServiceFg;
|
||||||
}
|
}
|
||||||
outFwdTextStyle: textStyle(inFwdTextStyle) {
|
outFwdTextStyle: TextStyle(inFwdTextStyle) {
|
||||||
linkFg: msgOutServiceFg;
|
linkFg: msgOutServiceFg;
|
||||||
linkFgDown: msgOutServiceFg;
|
linkFgDown: msgOutServiceFg;
|
||||||
}
|
}
|
||||||
inFwdTextStyleSelected: textStyle(inFwdTextStyle) {
|
inFwdTextStyleSelected: TextStyle(inFwdTextStyle) {
|
||||||
linkFg: msgInServiceFgSelected;
|
linkFg: msgInServiceFgSelected;
|
||||||
linkFgDown: msgInServiceFgSelected;
|
linkFgDown: msgInServiceFgSelected;
|
||||||
}
|
}
|
||||||
outFwdTextStyleSelected: textStyle(inFwdTextStyle) {
|
outFwdTextStyleSelected: TextStyle(inFwdTextStyle) {
|
||||||
linkFg: msgOutServiceFgSelected;
|
linkFg: msgOutServiceFgSelected;
|
||||||
linkFgDown: msgOutServiceFgSelected;
|
linkFgDown: msgOutServiceFgSelected;
|
||||||
}
|
}
|
||||||
medviewSaveAsTextStyle: textStyle(defaultTextStyle) {
|
medviewSaveAsTextStyle: TextStyle(defaultTextStyle) {
|
||||||
linkFg: #91d9ff;
|
linkFg: #91d9ff;
|
||||||
linkFgDown: #91d9ff;
|
linkFgDown: #91d9ff;
|
||||||
}
|
}
|
||||||
|
@ -356,11 +232,11 @@ mediaUnreadSize: 7px;
|
||||||
mediaUnreadSkip: 5px;
|
mediaUnreadSkip: 5px;
|
||||||
mediaUnreadTop: 6px;
|
mediaUnreadTop: 6px;
|
||||||
|
|
||||||
mediaInStyle: textStyle(defaultTextStyle) {
|
mediaInStyle: TextStyle(defaultTextStyle) {
|
||||||
linkFg: mediaInFg;
|
linkFg: mediaInFg;
|
||||||
linkFgDown: mediaInFg;
|
linkFgDown: mediaInFg;
|
||||||
}
|
}
|
||||||
mediaInStyleSelected: textStyle(defaultTextStyle) {
|
mediaInStyleSelected: TextStyle(defaultTextStyle) {
|
||||||
linkFg: mediaInFgSelected;
|
linkFg: mediaInFgSelected;
|
||||||
linkFgDown: mediaInFgSelected;
|
linkFgDown: mediaInFgSelected;
|
||||||
}
|
}
|
||||||
|
@ -397,7 +273,7 @@ msgFileThumbLinkOutFgSelected: #31a298;
|
||||||
msgFileNameTop: 16px;
|
msgFileNameTop: 16px;
|
||||||
msgFileStatusTop: 37px;
|
msgFileStatusTop: 37px;
|
||||||
msgFileMinWidth: 294px;
|
msgFileMinWidth: 294px;
|
||||||
msgFileInBg: windowActiveBg;
|
msgFileInBg: windowBgActive;
|
||||||
msgFileInBgOver: #4eade3;
|
msgFileInBgOver: #4eade3;
|
||||||
msgFileInBgSelected: #51a3d3;
|
msgFileInBgSelected: #51a3d3;
|
||||||
msgFileOutBg: #78c67f;
|
msgFileOutBg: #78c67f;
|
||||||
|
@ -413,7 +289,7 @@ msgWaveformBar: 2px;
|
||||||
msgWaveformSkip: 1px;
|
msgWaveformSkip: 1px;
|
||||||
msgWaveformMin: 2px;
|
msgWaveformMin: 2px;
|
||||||
msgWaveformMax: 20px;
|
msgWaveformMax: 20px;
|
||||||
msgWaveformInActive: windowActiveBg;
|
msgWaveformInActive: windowBgActive;
|
||||||
msgWaveformInActiveSelected: #51a3d3;
|
msgWaveformInActiveSelected: #51a3d3;
|
||||||
msgWaveformInInactive: #d4dee6;
|
msgWaveformInInactive: #d4dee6;
|
||||||
msgWaveformInInactiveSelected: #9cc1e1;
|
msgWaveformInInactiveSelected: #9cc1e1;
|
||||||
|
@ -422,22 +298,6 @@ msgWaveformOutActiveSelected: #6badad;
|
||||||
msgWaveformOutInactive: #b3e2b4;
|
msgWaveformOutInactive: #b3e2b4;
|
||||||
msgWaveformOutInactiveSelected: #91c3c3;
|
msgWaveformOutInactiveSelected: #91c3c3;
|
||||||
|
|
||||||
historyScroll: flatScroll(scrollDef) {
|
|
||||||
barColor: #89a0b47a;
|
|
||||||
bgColor: #89a0b44c;
|
|
||||||
barOverColor: #89a0b4bc;
|
|
||||||
bgOverColor: #89a0b46b;
|
|
||||||
|
|
||||||
round: 3px;
|
|
||||||
|
|
||||||
width: 12px;
|
|
||||||
deltax: 3px;
|
|
||||||
deltat: 3px;
|
|
||||||
deltab: 3px;
|
|
||||||
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: -1px;
|
|
||||||
}
|
|
||||||
textRectMargins: margins(-2px, -1px, -2px, -1px);
|
textRectMargins: margins(-2px, -1px, -2px, -1px);
|
||||||
|
|
||||||
newMsgSound: ":/gui/art/newmsg.wav";
|
newMsgSound: ":/gui/art/newmsg.wav";
|
||||||
|
@ -463,13 +323,6 @@ simpleCloseIcon: icon {{ "simple_close", #c7c7c7 }};
|
||||||
simpleCloseIconOver: icon {{ "simple_close", #a3a3a3 }};
|
simpleCloseIconOver: icon {{ "simple_close", #a3a3a3 }};
|
||||||
dialogsForwardCancelIcon: icon {{ "simple_close", dialogsForwardFg }};
|
dialogsForwardCancelIcon: icon {{ "simple_close", dialogsForwardFg }};
|
||||||
|
|
||||||
boxPhotoPadding: margins(28px, 28px, 28px, 18px);
|
|
||||||
boxPhotoCompressedPadding: margins(0px, 2px, 0px, 22px);
|
|
||||||
boxPhotoTextFg: #808080;
|
|
||||||
cropPointSize: 10px;
|
|
||||||
cropSkip: 13px;
|
|
||||||
cropMinSize: 20px;
|
|
||||||
|
|
||||||
profileMaxWidth: 410px;
|
profileMaxWidth: 410px;
|
||||||
profilePadding: margins(28px, 30px, 28px, 0px);
|
profilePadding: margins(28px, 30px, 28px, 0px);
|
||||||
|
|
||||||
|
@ -504,31 +357,6 @@ dragPadding: margins(20px, 10px, 20px, 10px);
|
||||||
|
|
||||||
dragHeight: 72px;
|
dragHeight: 72px;
|
||||||
|
|
||||||
botKbDuration: 200;
|
|
||||||
botKbBg: #edf1f5;
|
|
||||||
botKbOverBg: #d8e2ec;
|
|
||||||
botKbDownBg: #d8e2ec;
|
|
||||||
botKbColor: #4b565f;
|
|
||||||
botKbFont: font(15px semibold);
|
|
||||||
botKbButton: botKeyboardButton {
|
|
||||||
margin: 10px;
|
|
||||||
padding: 10px;
|
|
||||||
height: 38px;
|
|
||||||
textTop: 9px;
|
|
||||||
downTextTop: 9px;
|
|
||||||
}
|
|
||||||
botKbTinyButton: botKeyboardButton {
|
|
||||||
margin: 4px;
|
|
||||||
padding: 3px;
|
|
||||||
height: 25px;
|
|
||||||
textTop: 2px;
|
|
||||||
downTextTop: 2px;
|
|
||||||
}
|
|
||||||
botKbScroll: flatScroll(solidScroll) {
|
|
||||||
deltax: 3px;
|
|
||||||
width: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
minPhotoSize: 100px;
|
minPhotoSize: 100px;
|
||||||
maxMediaSize: 420px;
|
maxMediaSize: 420px;
|
||||||
maxStickerSize: 256px;
|
maxStickerSize: 256px;
|
||||||
|
@ -590,7 +418,7 @@ downloadPathSkip: 10px;
|
||||||
|
|
||||||
usernamePadding: margins(23px, 22px, 21px, 12px);
|
usernamePadding: margins(23px, 22px, 21px, 12px);
|
||||||
usernameSkip: 49px;
|
usernameSkip: 49px;
|
||||||
usernameTextStyle: textStyle(defaultTextStyle) {
|
usernameTextStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 20px;
|
lineHeight: 20px;
|
||||||
}
|
}
|
||||||
usernameDefaultFg: #777777;
|
usernameDefaultFg: #777777;
|
||||||
|
@ -605,23 +433,6 @@ videoIcon: icon {
|
||||||
};
|
};
|
||||||
locationSize: size(320px, 240px);
|
locationSize: size(320px, 240px);
|
||||||
|
|
||||||
mentionHeight: 40px;
|
|
||||||
mentionScroll: flatScroll(scrollDef) {
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: 0px;
|
|
||||||
}
|
|
||||||
mentionPadding: margins(8px, 5px, 8px, 5px);
|
|
||||||
mentionTop: 11px;
|
|
||||||
mentionFont: linkFont;
|
|
||||||
mentionNameFg: windowTextFg;
|
|
||||||
mentionPhotoSize: msgPhotoSize;
|
|
||||||
mentionBg: #ffffff;
|
|
||||||
mentionBgOver: #f5f5f5;
|
|
||||||
mentionFg: #777777;
|
|
||||||
mentionFgOver: #707070;
|
|
||||||
mentionFgActive: #0080c0;
|
|
||||||
mentionFgOverActive: #0077b3;
|
|
||||||
|
|
||||||
webPageLeft: 10px;
|
webPageLeft: 10px;
|
||||||
webPageBar: 2px;
|
webPageBar: 2px;
|
||||||
webPageTitleFont: semiboldFont;
|
webPageTitleFont: semiboldFont;
|
||||||
|
@ -645,7 +456,7 @@ inlineResultsSkip: 3px;
|
||||||
inlineMediaHeight: 96px;
|
inlineMediaHeight: 96px;
|
||||||
inlineThumbSize: 64px;
|
inlineThumbSize: 64px;
|
||||||
inlineThumbSkip: 10px;
|
inlineThumbSkip: 10px;
|
||||||
inlineTitleFg: windowTextFg;
|
inlineTitleFg: windowFg;
|
||||||
inlineDescriptionFg: windowSubTextFg;
|
inlineDescriptionFg: windowSubTextFg;
|
||||||
inlineRowMargin: 6px;
|
inlineRowMargin: 6px;
|
||||||
inlineRowBorder: 1px;
|
inlineRowBorder: 1px;
|
||||||
|
|
|
@ -19,7 +19,7 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
textStyle {
|
TextStyle {
|
||||||
linkFlags: font;
|
linkFlags: font;
|
||||||
linkFlagsOver: font;
|
linkFlagsOver: font;
|
||||||
linkFg: color;
|
linkFg: color;
|
||||||
|
@ -30,37 +30,6 @@ textStyle {
|
||||||
lineHeight: pixels;
|
lineHeight: pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
flatScroll {
|
|
||||||
barColor: color;
|
|
||||||
bgColor: color;
|
|
||||||
barOverColor: color;
|
|
||||||
bgOverColor: color;
|
|
||||||
|
|
||||||
round: pixels;
|
|
||||||
|
|
||||||
width: pixels;
|
|
||||||
minHeight: pixels;
|
|
||||||
deltax: pixels;
|
|
||||||
deltat: pixels;
|
|
||||||
deltab: pixels;
|
|
||||||
|
|
||||||
topsh: pixels;
|
|
||||||
bottomsh: pixels;
|
|
||||||
shColor: color;
|
|
||||||
|
|
||||||
duration: int;
|
|
||||||
hiding: int;
|
|
||||||
}
|
|
||||||
|
|
||||||
flatLabel {
|
|
||||||
font: font;
|
|
||||||
margin: margins;
|
|
||||||
width: pixels;
|
|
||||||
align: align;
|
|
||||||
textFg: color;
|
|
||||||
maxHeight: pixels;
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip {
|
Tooltip {
|
||||||
textBg: color;
|
textBg: color;
|
||||||
textFg: color;
|
textFg: color;
|
||||||
|
@ -74,11 +43,3 @@ Tooltip {
|
||||||
widthMax: pixels;
|
widthMax: pixels;
|
||||||
linesMax: int;
|
linesMax: int;
|
||||||
}
|
}
|
||||||
|
|
||||||
botKeyboardButton {
|
|
||||||
margin: pixels;
|
|
||||||
padding: pixels;
|
|
||||||
height: pixels;
|
|
||||||
textTop: pixels;
|
|
||||||
downTextTop: pixels;
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,12 +21,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
// basic
|
// basic
|
||||||
windowBg: #ffffff; // white: fallback for background
|
windowBg: #ffffff; // white: fallback for background
|
||||||
windowTextFg: #000000; // black: fallback for text color
|
windowFg: #000000; // black: fallback for text color
|
||||||
|
windowBgOver: #f1f1f1; // light gray: fallback for over background
|
||||||
|
windowBgRipple: #e5e5e5; // darker gray: fallback for ripple effect
|
||||||
|
windowFgOver: windowFg; // black: fallback for over text color
|
||||||
windowSubTextFg: #999999; // gray: fallback for subtext color
|
windowSubTextFg: #999999; // gray: fallback for subtext color
|
||||||
windowActiveBg: #40ace3; // bright blue: fallback for blue filled active areas
|
windowSubTextFgOver: #919191; // gray over light blue: fallback for subtext over color
|
||||||
windowActiveFg: #ffffff; // text on bright blue: fallback for text on active areas
|
windowBoldFg: #222222; // dark gray: fallback for bold text color
|
||||||
windowOverBg: #f0f0f0; // light gray: fallback for over background
|
windowBoldFgOver: #222222; // dark gray: fallback for over bold text color
|
||||||
windowSubTextFgOver: #7c99b2; // gray over light blue: fallback for subtext over color
|
windowBgActive: #40ace3; // bright blue: fallback for blue filled active areas
|
||||||
|
windowFgActive: #ffffff; // text on bright blue: fallback for text on active areas
|
||||||
windowActiveTextFg: #2687bf; // online blue: fallback for active color
|
windowActiveTextFg: #2687bf; // online blue: fallback for active color
|
||||||
windowShadowFg: #000000; // black: fallback for shadow color
|
windowShadowFg: #000000; // black: fallback for shadow color
|
||||||
windowShadowFgFallback: #cdcdcd; // gray: fallback for shadow without
|
windowShadowFgFallback: #cdcdcd; // gray: fallback for shadow without
|
||||||
|
@ -35,27 +39,28 @@ imageBg: #000000;
|
||||||
imageBgTransparent: #ffffff;
|
imageBgTransparent: #ffffff;
|
||||||
|
|
||||||
// widgets
|
// widgets
|
||||||
activeButtonBg: windowActiveBg;
|
activeButtonBg: windowBgActive;
|
||||||
activeButtonBgOver: #46b4eb;
|
activeButtonBgOver: #39a5db;
|
||||||
activeButtonBgRipple: #177eb2;
|
activeButtonBgRipple: #2095d0;
|
||||||
activeButtonFg: windowActiveFg;
|
activeButtonFg: windowFgActive;
|
||||||
activeButtonFgOver: activeButtonFg;
|
activeButtonFgOver: activeButtonFg;
|
||||||
activeButtonSecondaryFg: #cceeff;
|
activeButtonSecondaryFg: #cceeff;
|
||||||
activeButtonSecondaryFgOver: activeButtonSecondaryFg;
|
activeButtonSecondaryFgOver: activeButtonSecondaryFg;
|
||||||
|
|
||||||
lightButtonBg: windowBg;
|
lightButtonBg: windowBg;
|
||||||
lightButtonBgOver: #edf7ff;
|
lightButtonBgOver: #e3f1fa;
|
||||||
lightButtonBgRipple: #c7e1f6;
|
lightButtonBgRipple: #c9e4f6;
|
||||||
lightButtonFg: #2b99d5;
|
lightButtonFg: #2b99d5;
|
||||||
lightButtonFgOver: lightButtonFg;
|
lightButtonFgOver: lightButtonFg;
|
||||||
|
|
||||||
menuBg: windowBg;
|
menuBg: windowBg;
|
||||||
menuBgOver: windowOverBg;
|
menuBgOver: windowBgOver;
|
||||||
|
menuBgRipple: windowBgRipple;
|
||||||
menuIconFg: #a8a8a8;
|
menuIconFg: #a8a8a8;
|
||||||
menuIconFgOver: #999999;
|
menuIconFgOver: #999999;
|
||||||
|
|
||||||
// custom title bar for Windows and macOS
|
// custom title bar for Windows and macOS
|
||||||
titleBg: windowOverBg;
|
titleBg: windowBgOver;
|
||||||
titleShadow: #00000003;
|
titleShadow: #00000003;
|
||||||
titleButtonFg: #ababab;
|
titleButtonFg: #ababab;
|
||||||
titleButtonBgOver: #e5e5e5;
|
titleButtonBgOver: #e5e5e5;
|
||||||
|
@ -80,7 +85,7 @@ cancelIconFgOver: #808080;
|
||||||
|
|
||||||
// boxes
|
// boxes
|
||||||
boxBg: windowBg;
|
boxBg: windowBg;
|
||||||
boxTextFg: windowTextFg;
|
boxTextFg: windowFg;
|
||||||
boxTextFgGood: #4ab44a;
|
boxTextFgGood: #4ab44a;
|
||||||
boxTextFgError: #d84d4d;
|
boxTextFgError: #d84d4d;
|
||||||
boxTitleFg: #404040;
|
boxTitleFg: #404040;
|
||||||
|
@ -94,41 +99,41 @@ boxBlockTitleAdditionalFg: #808080;
|
||||||
boxBlockTitleCloseFg: cancelIconFg;
|
boxBlockTitleCloseFg: cancelIconFg;
|
||||||
boxBlockTitleCloseFgOver: cancelIconFgOver;
|
boxBlockTitleCloseFgOver: cancelIconFgOver;
|
||||||
|
|
||||||
attentionBoxButtonFg: #ea4b2f;
|
attentionBoxButtonFg: #d14e4e;
|
||||||
attentionBoxButtonFgOver: #ea4b2f;
|
attentionBoxButtonFgOver: #d14e4e;
|
||||||
attentionBoxButtonBgOver: #fff0ed;
|
attentionBoxButtonBgOver: #fcdfde;
|
||||||
attentionBoxButtonBgRipple: #efbcb2;
|
attentionBoxButtonBgRipple: #f4c3c2;
|
||||||
|
|
||||||
membersAboutLimitFg: windowSubTextFg;
|
membersAboutLimitFg: windowSubTextFgOver;
|
||||||
|
|
||||||
contactsBg: windowBg;
|
contactsBg: windowBg;
|
||||||
contactsBgOver: windowOverBg;
|
contactsBgOver: windowBgOver;
|
||||||
contactsNameFg: boxTextFg;
|
contactsNameFg: boxTextFg;
|
||||||
contactsStatusFg: windowSubTextFg;
|
contactsStatusFg: windowSubTextFg;
|
||||||
contactsStatusFgOver: contactsStatusFg;
|
contactsStatusFgOver: windowSubTextFgOver;
|
||||||
contactsStatusFgOnline: #3b8dcc;
|
contactsStatusFgOnline: windowActiveTextFg;
|
||||||
|
|
||||||
photoCropFadeBg: #0000007f;
|
photoCropFadeBg: #0000007f;
|
||||||
photoCropPointFg: #ffffff7f;
|
photoCropPointFg: #ffffff7f;
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
notificationsBoxMonitorFg: windowTextFg;
|
notificationsBoxMonitorFg: windowFg;
|
||||||
|
|
||||||
notificationSampleUserpicFg: windowActiveBg;
|
notificationSampleUserpicFg: windowBgActive;
|
||||||
notificationSampleCloseFg: #d7d7d7 | windowSubTextFg;
|
notificationSampleCloseFg: #d7d7d7 | windowSubTextFg;
|
||||||
notificationSampleTextFg: #d7d7d7 | windowSubTextFg;
|
notificationSampleTextFg: #d7d7d7 | windowSubTextFg;
|
||||||
notificationSampleNameFg: #939393 | windowSubTextFg;
|
notificationSampleNameFg: #939393 | windowSubTextFg;
|
||||||
|
|
||||||
// intro
|
// intro
|
||||||
introHeaderFg: windowTextFg;
|
introHeaderFg: windowFg;
|
||||||
introErrorFg: windowTextFg;
|
introErrorFg: windowFg;
|
||||||
|
|
||||||
// dialogs
|
// dialogs
|
||||||
dialogsMenuIconFg: menuIconFg;
|
dialogsMenuIconFg: menuIconFg;
|
||||||
dialogsMenuIconFgOver: menuIconFgOver;
|
dialogsMenuIconFgOver: menuIconFgOver;
|
||||||
|
|
||||||
dialogsBg: windowBg;
|
dialogsBg: windowBg;
|
||||||
dialogsNameFg: #373737;
|
dialogsNameFg: windowBoldFg;
|
||||||
dialogsChatIconFg: dialogsNameFg;
|
dialogsChatIconFg: dialogsNameFg;
|
||||||
dialogsDateFg: windowSubTextFg;
|
dialogsDateFg: windowSubTextFg;
|
||||||
dialogsTextFg: windowSubTextFg;
|
dialogsTextFg: windowSubTextFg;
|
||||||
|
@ -138,15 +143,15 @@ dialogsVerifiedIconBg: #4abcf1;
|
||||||
dialogsVerifiedIconFg: #ffffff;
|
dialogsVerifiedIconFg: #ffffff;
|
||||||
dialogsSendingIconFg: #c1c1c1;
|
dialogsSendingIconFg: #c1c1c1;
|
||||||
dialogsSentIconFg: #5dc452;
|
dialogsSentIconFg: #5dc452;
|
||||||
dialogsUnreadBg: windowActiveBg;
|
dialogsUnreadBg: windowBgActive;
|
||||||
dialogsUnreadBgMuted: #bbbbbb;
|
dialogsUnreadBgMuted: #bbbbbb;
|
||||||
dialogsUnreadFg: #ffffff;
|
dialogsUnreadFg: #ffffff;
|
||||||
|
|
||||||
dialogsBgOver: windowOverBg;
|
dialogsBgOver: windowBgOver;
|
||||||
dialogsNameFgOver: windowTextFg;
|
dialogsNameFgOver: windowBoldFgOver;
|
||||||
dialogsChatIconFgOver: dialogsNameFgOver;
|
dialogsChatIconFgOver: dialogsNameFgOver;
|
||||||
dialogsDateFgOver: #8a8a8a | dialogsDateFg;
|
dialogsDateFgOver: windowSubTextFgOver;
|
||||||
dialogsTextFgOver: dialogsTextFg;
|
dialogsTextFgOver: windowSubTextFgOver;
|
||||||
dialogsTextFgServiceOver: dialogsTextFgService;
|
dialogsTextFgServiceOver: dialogsTextFgService;
|
||||||
dialogsDraftFgOver: dialogsDraftFg;
|
dialogsDraftFgOver: dialogsDraftFg;
|
||||||
dialogsVerifiedIconBgOver: dialogsVerifiedIconBg;
|
dialogsVerifiedIconBgOver: dialogsVerifiedIconBg;
|
||||||
|
@ -158,10 +163,10 @@ dialogsUnreadBgMutedOver: dialogsUnreadBgMuted;
|
||||||
dialogsUnreadFgOver: dialogsUnreadFg;
|
dialogsUnreadFgOver: dialogsUnreadFg;
|
||||||
|
|
||||||
dialogsBgActive: #419fd9;
|
dialogsBgActive: #419fd9;
|
||||||
dialogsNameFgActive: windowActiveFg;
|
dialogsNameFgActive: windowFgActive;
|
||||||
dialogsChatIconFgActive: dialogsNameFgActive;
|
dialogsChatIconFgActive: dialogsNameFgActive;
|
||||||
dialogsDateFgActive: windowActiveFg;
|
dialogsDateFgActive: windowFgActive;
|
||||||
dialogsTextFgActive: windowActiveFg;
|
dialogsTextFgActive: windowFgActive;
|
||||||
dialogsTextFgServiceActive: dialogsTextFgActive;
|
dialogsTextFgServiceActive: dialogsTextFgActive;
|
||||||
dialogsDraftFgActive: #c6e1f7;
|
dialogsDraftFgActive: #c6e1f7;
|
||||||
dialogsVerifiedIconBgActive: dialogsTextFgActive;
|
dialogsVerifiedIconBgActive: dialogsTextFgActive;
|
||||||
|
@ -186,19 +191,19 @@ emojiPanHeaderBg: #fffffff2 | emojiPanBg;
|
||||||
historyComposeAreaBg: windowBg;
|
historyComposeAreaBg: windowBg;
|
||||||
historyComposeIconFg: menuIconFg;
|
historyComposeIconFg: menuIconFg;
|
||||||
historyComposeIconFgOver: menuIconFgOver;
|
historyComposeIconFgOver: menuIconFgOver;
|
||||||
historySendIconFg: windowActiveBg;
|
historySendIconFg: windowBgActive;
|
||||||
historySendIconFgOver: windowActiveBg;
|
historySendIconFgOver: windowBgActive;
|
||||||
historyPinnedBg: historyComposeAreaBg;
|
historyPinnedBg: historyComposeAreaBg;
|
||||||
historyReplyBg: historyComposeAreaBg;
|
historyReplyBg: historyComposeAreaBg;
|
||||||
historyReplyCancelFg: cancelIconFg;
|
historyReplyCancelFg: cancelIconFg;
|
||||||
historyReplyCancelFgOver: cancelIconFgOver;
|
historyReplyCancelFgOver: cancelIconFgOver;
|
||||||
|
|
||||||
historyComposeButtonBg: historyComposeAreaBg;
|
historyComposeButtonBg: historyComposeAreaBg;
|
||||||
historyComposeButtonBgOver: #f5f5f5;
|
historyComposeButtonBgOver: windowBgOver;
|
||||||
historyComposeButtonBgRipple: #e7e7e7;
|
historyComposeButtonBgRipple: windowBgRipple;
|
||||||
|
|
||||||
historyTextInFg: windowTextFg;
|
historyTextInFg: windowFg;
|
||||||
historyTextOutFg: windowTextFg;
|
historyTextOutFg: windowFg;
|
||||||
historyCaptionInFg: historyTextInFg;
|
historyCaptionInFg: historyTextInFg;
|
||||||
historyCaptionOutFg: historyTextOutFg;
|
historyCaptionOutFg: historyTextOutFg;
|
||||||
historyFileNameInFg: historyTextInFg;
|
historyFileNameInFg: historyTextInFg;
|
||||||
|
@ -213,7 +218,7 @@ historySystemFg: #ffffff;
|
||||||
|
|
||||||
// mediaview
|
// mediaview
|
||||||
mediaviewFileBg: windowBg;
|
mediaviewFileBg: windowBg;
|
||||||
mediaviewFileNameFg: windowTextFg;
|
mediaviewFileNameFg: windowFg;
|
||||||
mediaviewFileSizeFg: windowSubTextFg;
|
mediaviewFileSizeFg: windowSubTextFg;
|
||||||
mediaviewFileRedCornerFg: #d55959;
|
mediaviewFileRedCornerFg: #d55959;
|
||||||
mediaviewFileYellowCornerFg: #e8a659;
|
mediaviewFileYellowCornerFg: #e8a659;
|
||||||
|
|
|
@ -22,34 +22,39 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
windowBg: #ffffff;
|
windowBg: #ffffff;
|
||||||
windowTextFg: #000000;
|
windowFg: #000000;
|
||||||
|
windowBgOver: #f1f1f1;
|
||||||
|
windowBgRipple: #e5e5e5;
|
||||||
|
windowFgOver: windowFg;
|
||||||
windowSubTextFg: #999999;
|
windowSubTextFg: #999999;
|
||||||
windowActiveBg: #40ace3;
|
windowSubTextFgOver: #919191;
|
||||||
windowActiveFg: #ffffff;
|
windowBoldFg: #222222;
|
||||||
windowOverBg: #f0f0f0;
|
windowBoldFgOver: #222222;
|
||||||
windowSubTextFgOver: #7c99b2;
|
windowBgActive: #40ace3;
|
||||||
|
windowFgActive: #ffffff;
|
||||||
windowActiveTextFg: #2687bf;
|
windowActiveTextFg: #2687bf;
|
||||||
windowShadowFg: #000000;
|
windowShadowFg: #000000;
|
||||||
windowShadowFgFallback: #cdcdcd;
|
windowShadowFgFallback: #cdcdcd;
|
||||||
imageBg: #000000;
|
imageBg: #000000;
|
||||||
imageBgTransparent: #ffffff;
|
imageBgTransparent: #ffffff;
|
||||||
activeButtonBg: windowActiveBg;
|
activeButtonBg: windowBgActive;
|
||||||
activeButtonBgOver: #46b4eb;
|
activeButtonBgOver: #39a5db;
|
||||||
activeButtonBgRipple: #177eb2;
|
activeButtonBgRipple: #2095d0;
|
||||||
activeButtonFg: windowActiveFg;
|
activeButtonFg: windowFgActive;
|
||||||
activeButtonFgOver: activeButtonFg;
|
activeButtonFgOver: activeButtonFg;
|
||||||
activeButtonSecondaryFg: #cceeff;
|
activeButtonSecondaryFg: #cceeff;
|
||||||
activeButtonSecondaryFgOver: activeButtonSecondaryFg;
|
activeButtonSecondaryFgOver: activeButtonSecondaryFg;
|
||||||
lightButtonBg: windowBg;
|
lightButtonBg: windowBg;
|
||||||
lightButtonBgOver: #edf7ff;
|
lightButtonBgOver: #e3f1fa;
|
||||||
lightButtonBgRipple: #c7e1f6;
|
lightButtonBgRipple: #c9e4f6;
|
||||||
lightButtonFg: #2b99d5;
|
lightButtonFg: #2b99d5;
|
||||||
lightButtonFgOver: lightButtonFg;
|
lightButtonFgOver: lightButtonFg;
|
||||||
menuBg: windowBg;
|
menuBg: windowBg;
|
||||||
menuBgOver: windowOverBg;
|
menuBgOver: windowBgOver;
|
||||||
|
menuBgRipple: windowBgRipple;
|
||||||
menuIconFg: #a8a8a8;
|
menuIconFg: #a8a8a8;
|
||||||
menuIconFgOver: #999999;
|
menuIconFgOver: #999999;
|
||||||
titleBg: windowOverBg;
|
titleBg: windowBgOver;
|
||||||
titleShadow: #00000003;
|
titleShadow: #00000003;
|
||||||
titleButtonFg: #ababab;
|
titleButtonFg: #ababab;
|
||||||
titleButtonBgOver: #e5e5e5;
|
titleButtonBgOver: #e5e5e5;
|
||||||
|
@ -67,7 +72,7 @@ layerBg: #0000007f;
|
||||||
cancelIconFg: #a2a2a2;
|
cancelIconFg: #a2a2a2;
|
||||||
cancelIconFgOver: #808080;
|
cancelIconFgOver: #808080;
|
||||||
boxBg: windowBg;
|
boxBg: windowBg;
|
||||||
boxTextFg: windowTextFg;
|
boxTextFg: windowFg;
|
||||||
boxTextFgGood: #4ab44a;
|
boxTextFgGood: #4ab44a;
|
||||||
boxTextFgError: #d84d4d;
|
boxTextFgError: #d84d4d;
|
||||||
boxTitleFg: #404040;
|
boxTitleFg: #404040;
|
||||||
|
@ -79,30 +84,30 @@ boxBlockTitleFg: boxTitleFg;
|
||||||
boxBlockTitleAdditionalFg: #808080;
|
boxBlockTitleAdditionalFg: #808080;
|
||||||
boxBlockTitleCloseFg: cancelIconFg;
|
boxBlockTitleCloseFg: cancelIconFg;
|
||||||
boxBlockTitleCloseFgOver: cancelIconFgOver;
|
boxBlockTitleCloseFgOver: cancelIconFgOver;
|
||||||
attentionBoxButtonFg: #ea4b2f;
|
attentionBoxButtonFg: #d14e4e;
|
||||||
attentionBoxButtonFgOver: #ea4b2f;
|
attentionBoxButtonFgOver: #d14e4e;
|
||||||
attentionBoxButtonBgOver: #fff0ed;
|
attentionBoxButtonBgOver: #fcdfde;
|
||||||
attentionBoxButtonBgRipple: #efbcb2;
|
attentionBoxButtonBgRipple: #f4c3c2;
|
||||||
membersAboutLimitFg: windowSubTextFg;
|
membersAboutLimitFg: windowSubTextFgOver;
|
||||||
contactsBg: windowBg;
|
contactsBg: windowBg;
|
||||||
contactsBgOver: windowOverBg;
|
contactsBgOver: windowBgOver;
|
||||||
contactsNameFg: boxTextFg;
|
contactsNameFg: boxTextFg;
|
||||||
contactsStatusFg: windowSubTextFg;
|
contactsStatusFg: windowSubTextFg;
|
||||||
contactsStatusFgOver: contactsStatusFg;
|
contactsStatusFgOver: windowSubTextFgOver;
|
||||||
contactsStatusFgOnline: #3b8dcc;
|
contactsStatusFgOnline: windowActiveTextFg;
|
||||||
photoCropFadeBg: #0000007f;
|
photoCropFadeBg: #0000007f;
|
||||||
photoCropPointFg: #ffffff7f;
|
photoCropPointFg: #ffffff7f;
|
||||||
notificationsBoxMonitorFg: windowTextFg;
|
notificationsBoxMonitorFg: windowFg;
|
||||||
notificationSampleUserpicFg: windowActiveBg;
|
notificationSampleUserpicFg: windowBgActive;
|
||||||
notificationSampleCloseFg: #d7d7d7; // windowSubTextFg;
|
notificationSampleCloseFg: #d7d7d7; // windowSubTextFg;
|
||||||
notificationSampleTextFg: #d7d7d7; // windowSubTextFg;
|
notificationSampleTextFg: #d7d7d7; // windowSubTextFg;
|
||||||
notificationSampleNameFg: #939393; // windowSubTextFg;
|
notificationSampleNameFg: #939393; // windowSubTextFg;
|
||||||
introHeaderFg: windowTextFg;
|
introHeaderFg: windowFg;
|
||||||
introErrorFg: windowTextFg;
|
introErrorFg: windowFg;
|
||||||
dialogsMenuIconFg: menuIconFg;
|
dialogsMenuIconFg: menuIconFg;
|
||||||
dialogsMenuIconFgOver: menuIconFgOver;
|
dialogsMenuIconFgOver: menuIconFgOver;
|
||||||
dialogsBg: windowBg;
|
dialogsBg: windowBg;
|
||||||
dialogsNameFg: #373737;
|
dialogsNameFg: windowBoldFg;
|
||||||
dialogsChatIconFg: dialogsNameFg;
|
dialogsChatIconFg: dialogsNameFg;
|
||||||
dialogsDateFg: windowSubTextFg;
|
dialogsDateFg: windowSubTextFg;
|
||||||
dialogsTextFg: windowSubTextFg;
|
dialogsTextFg: windowSubTextFg;
|
||||||
|
@ -112,14 +117,14 @@ dialogsVerifiedIconBg: #4abcf1;
|
||||||
dialogsVerifiedIconFg: #ffffff;
|
dialogsVerifiedIconFg: #ffffff;
|
||||||
dialogsSendingIconFg: #c1c1c1;
|
dialogsSendingIconFg: #c1c1c1;
|
||||||
dialogsSentIconFg: #5dc452;
|
dialogsSentIconFg: #5dc452;
|
||||||
dialogsUnreadBg: windowActiveBg;
|
dialogsUnreadBg: windowBgActive;
|
||||||
dialogsUnreadBgMuted: #bbbbbb;
|
dialogsUnreadBgMuted: #bbbbbb;
|
||||||
dialogsUnreadFg: #ffffff;
|
dialogsUnreadFg: #ffffff;
|
||||||
dialogsBgOver: windowOverBg;
|
dialogsBgOver: windowBgOver;
|
||||||
dialogsNameFgOver: windowTextFg;
|
dialogsNameFgOver: windowBoldFgOver;
|
||||||
dialogsChatIconFgOver: dialogsNameFgOver;
|
dialogsChatIconFgOver: dialogsNameFgOver;
|
||||||
dialogsDateFgOver: #8a8a8a; // dialogsDateFg;
|
dialogsDateFgOver: windowSubTextFgOver;
|
||||||
dialogsTextFgOver: dialogsTextFg;
|
dialogsTextFgOver: windowSubTextFgOver;
|
||||||
dialogsTextFgServiceOver: dialogsTextFgService;
|
dialogsTextFgServiceOver: dialogsTextFgService;
|
||||||
dialogsDraftFgOver: dialogsDraftFg;
|
dialogsDraftFgOver: dialogsDraftFg;
|
||||||
dialogsVerifiedIconBgOver: dialogsVerifiedIconBg;
|
dialogsVerifiedIconBgOver: dialogsVerifiedIconBg;
|
||||||
|
@ -130,10 +135,10 @@ dialogsUnreadBgOver: dialogsUnreadBg;
|
||||||
dialogsUnreadBgMutedOver: dialogsUnreadBgMuted;
|
dialogsUnreadBgMutedOver: dialogsUnreadBgMuted;
|
||||||
dialogsUnreadFgOver: dialogsUnreadFg;
|
dialogsUnreadFgOver: dialogsUnreadFg;
|
||||||
dialogsBgActive: #419fd9;
|
dialogsBgActive: #419fd9;
|
||||||
dialogsNameFgActive: windowActiveFg;
|
dialogsNameFgActive: windowFgActive;
|
||||||
dialogsChatIconFgActive: dialogsNameFgActive;
|
dialogsChatIconFgActive: dialogsNameFgActive;
|
||||||
dialogsDateFgActive: windowActiveFg;
|
dialogsDateFgActive: windowFgActive;
|
||||||
dialogsTextFgActive: windowActiveFg;
|
dialogsTextFgActive: windowFgActive;
|
||||||
dialogsTextFgServiceActive: dialogsTextFgActive;
|
dialogsTextFgServiceActive: dialogsTextFgActive;
|
||||||
dialogsDraftFgActive: #c6e1f7;
|
dialogsDraftFgActive: #c6e1f7;
|
||||||
dialogsVerifiedIconBgActive: dialogsTextFgActive;
|
dialogsVerifiedIconBgActive: dialogsTextFgActive;
|
||||||
|
@ -153,17 +158,17 @@ emojiPanHeaderBg: #fffffff2; // emojiPanBg;
|
||||||
historyComposeAreaBg: windowBg;
|
historyComposeAreaBg: windowBg;
|
||||||
historyComposeIconFg: menuIconFg;
|
historyComposeIconFg: menuIconFg;
|
||||||
historyComposeIconFgOver: menuIconFgOver;
|
historyComposeIconFgOver: menuIconFgOver;
|
||||||
historySendIconFg: windowActiveBg;
|
historySendIconFg: windowBgActive;
|
||||||
historySendIconFgOver: windowActiveBg;
|
historySendIconFgOver: windowBgActive;
|
||||||
historyPinnedBg: historyComposeAreaBg;
|
historyPinnedBg: historyComposeAreaBg;
|
||||||
historyReplyBg: historyComposeAreaBg;
|
historyReplyBg: historyComposeAreaBg;
|
||||||
historyReplyCancelFg: cancelIconFg;
|
historyReplyCancelFg: cancelIconFg;
|
||||||
historyReplyCancelFgOver: cancelIconFgOver;
|
historyReplyCancelFgOver: cancelIconFgOver;
|
||||||
historyComposeButtonBg: historyComposeAreaBg;
|
historyComposeButtonBg: historyComposeAreaBg;
|
||||||
historyComposeButtonBgOver: #f5f5f5;
|
historyComposeButtonBgOver: windowBgOver;
|
||||||
historyComposeButtonBgRipple: #e7e7e7;
|
historyComposeButtonBgRipple: windowBgRipple;
|
||||||
historyTextInFg: windowTextFg;
|
historyTextInFg: windowFg;
|
||||||
historyTextOutFg: windowTextFg;
|
historyTextOutFg: windowFg;
|
||||||
historyCaptionInFg: historyTextInFg;
|
historyCaptionInFg: historyTextInFg;
|
||||||
historyCaptionOutFg: historyTextOutFg;
|
historyCaptionOutFg: historyTextOutFg;
|
||||||
historyFileNameInFg: historyTextInFg;
|
historyFileNameInFg: historyTextInFg;
|
||||||
|
@ -175,7 +180,7 @@ historySystemBg: #89a0b47f;
|
||||||
historySystemBgSelected: #bbc8d4a2;
|
historySystemBgSelected: #bbc8d4a2;
|
||||||
historySystemFg: #ffffff;
|
historySystemFg: #ffffff;
|
||||||
mediaviewFileBg: windowBg;
|
mediaviewFileBg: windowBg;
|
||||||
mediaviewFileNameFg: windowTextFg;
|
mediaviewFileNameFg: windowFg;
|
||||||
mediaviewFileSizeFg: windowSubTextFg;
|
mediaviewFileSizeFg: windowSubTextFg;
|
||||||
mediaviewFileRedCornerFg: #d55959;
|
mediaviewFileRedCornerFg: #d55959;
|
||||||
mediaviewFileYellowCornerFg: #e8a659;
|
mediaviewFileYellowCornerFg: #e8a659;
|
||||||
|
|
|
@ -28,6 +28,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_overview.h"
|
#include "styles/style_overview.h"
|
||||||
#include "styles/style_mediaview.h"
|
#include "styles/style_mediaview.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
|
#include "styles/style_history.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "data/data_abstract_structure.h"
|
#include "data/data_abstract_structure.h"
|
||||||
#include "history/history_service_layout.h"
|
#include "history/history_service_layout.h"
|
||||||
|
|
|
@ -28,12 +28,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
|
|
||||||
AboutBox::AboutBox() : AbstractBox(st::aboutWidth)
|
AboutBox::AboutBox() : AbstractBox(st::aboutWidth)
|
||||||
, _version(this, lng_about_version(lt_version, QString::fromLatin1(AppVersionStr.c_str()) + (cAlphaVersion() ? " alpha" : "") + (cBetaVersion() ? qsl(" beta %1").arg(cBetaVersion()) : QString())), st::aboutVersionLink)
|
, _version(this, lng_about_version(lt_version, QString::fromLatin1(AppVersionStr.c_str()) + (cAlphaVersion() ? " alpha" : "") + (cBetaVersion() ? qsl(" beta %1").arg(cBetaVersion()) : QString())), st::aboutVersionLink)
|
||||||
, _text1(this, lang(lng_about_text_1), FlatLabel::InitType::Rich, st::aboutLabel, st::aboutTextStyle)
|
, _text1(this, lang(lng_about_text_1), Ui::FlatLabel::InitType::Rich, st::aboutLabel, st::aboutTextStyle)
|
||||||
, _text2(this, lang(lng_about_text_2), FlatLabel::InitType::Rich, st::aboutLabel, st::aboutTextStyle)
|
, _text2(this, lang(lng_about_text_2), Ui::FlatLabel::InitType::Rich, st::aboutLabel, st::aboutTextStyle)
|
||||||
, _text3(this,st::aboutLabel, st::aboutTextStyle)
|
, _text3(this,st::aboutLabel, st::aboutTextStyle)
|
||||||
, _done(this, lang(lng_close), st::defaultBoxButton) {
|
, _done(this, lang(lng_close), st::defaultBoxButton) {
|
||||||
_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));
|
_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));
|
||||||
|
@ -140,3 +141,14 @@ QString telegramFaqLink() {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString currentVersionText() {
|
||||||
|
auto result = QString::fromLatin1(AppVersionStr.c_str());
|
||||||
|
if (cAlphaVersion()) {
|
||||||
|
result += " alpha";
|
||||||
|
}
|
||||||
|
if (cBetaVersion()) {
|
||||||
|
result += qsl(" beta %1").arg(cBetaVersion() % 1000);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
@ -20,12 +20,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "abstractbox.h"
|
#include "boxes/abstractbox.h"
|
||||||
#include "ui/flatlabel.h"
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
class LinkButton;
|
class LinkButton;
|
||||||
|
class FlatLabel;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
class AboutBox : public AbstractBox {
|
class AboutBox : public AbstractBox {
|
||||||
|
@ -48,11 +48,12 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChildWidget<Ui::LinkButton> _version;
|
ChildWidget<Ui::LinkButton> _version;
|
||||||
ChildWidget<FlatLabel> _text1;
|
ChildWidget<Ui::FlatLabel> _text1;
|
||||||
ChildWidget<FlatLabel> _text2;
|
ChildWidget<Ui::FlatLabel> _text2;
|
||||||
ChildWidget<FlatLabel> _text3;
|
ChildWidget<Ui::FlatLabel> _text3;
|
||||||
ChildWidget<Ui::RoundButton> _done;
|
ChildWidget<Ui::RoundButton> _done;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QString telegramFaqLink();
|
QString telegramFaqLink();
|
||||||
|
QString currentVersionText();
|
||||||
|
|
|
@ -25,6 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "localstorage.h"
|
#include "localstorage.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
@ -150,7 +151,7 @@ void AbstractBox::raiseShadow() {
|
||||||
ScrollableBoxShadow::ScrollableBoxShadow(QWidget *parent) : Ui::PlainShadow(parent, st::boxScrollShadowBg) {
|
ScrollableBoxShadow::ScrollableBoxShadow(QWidget *parent) : Ui::PlainShadow(parent, st::boxScrollShadowBg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollableBox::ScrollableBox(const style::flatScroll &scroll, int32 w) : AbstractBox(w)
|
ScrollableBox::ScrollableBox(const style::FlatScroll &scroll, int32 w) : AbstractBox(w)
|
||||||
, _scroll(this, scroll)
|
, _scroll(this, scroll)
|
||||||
, _topSkip(st::boxBlockTitleHeight)
|
, _topSkip(st::boxBlockTitleHeight)
|
||||||
, _bottomSkip(st::boxScrollSkip) {
|
, _bottomSkip(st::boxScrollSkip) {
|
||||||
|
@ -185,6 +186,6 @@ void ScrollableBox::updateScrollGeometry() {
|
||||||
_scroll->setGeometry(0, _topSkip, width(), height() - _topSkip - _bottomSkip);
|
_scroll->setGeometry(0, _topSkip, width(), height() - _topSkip - _bottomSkip);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemListBox::ItemListBox(const style::flatScroll &scroll, int32 w) : ScrollableBox(scroll, w) {
|
ItemListBox::ItemListBox(const style::FlatScroll &scroll, int32 w) : ScrollableBox(scroll, w) {
|
||||||
setMaxHeight(st::boxMaxListHeight);
|
setMaxHeight(st::boxMaxListHeight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class IconButton;
|
class IconButton;
|
||||||
class GradientShadow;
|
class GradientShadow;
|
||||||
|
class ScrollArea;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
class AbstractBox : public LayerWidget, protected base::Subscriber {
|
class AbstractBox : public LayerWidget, protected base::Subscriber {
|
||||||
|
@ -81,7 +82,7 @@ public:
|
||||||
|
|
||||||
class ScrollableBox : public AbstractBox {
|
class ScrollableBox : public AbstractBox {
|
||||||
public:
|
public:
|
||||||
ScrollableBox(const style::flatScroll &scroll, int w = 0);
|
ScrollableBox(const style::FlatScroll &scroll, int w = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void init(TWidget *inner, int bottomSkip = -1, int topSkip = -1);
|
void init(TWidget *inner, int bottomSkip = -1, int topSkip = -1);
|
||||||
|
@ -89,21 +90,21 @@ protected:
|
||||||
|
|
||||||
void resizeEvent(QResizeEvent *e) override;
|
void resizeEvent(QResizeEvent *e) override;
|
||||||
|
|
||||||
ScrollArea *scrollArea() {
|
Ui::ScrollArea *scrollArea() {
|
||||||
return _scroll;
|
return _scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateScrollGeometry();
|
void updateScrollGeometry();
|
||||||
|
|
||||||
ChildWidget<ScrollArea> _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
int _topSkip, _bottomSkip;
|
int _topSkip, _bottomSkip;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ItemListBox : public ScrollableBox {
|
class ItemListBox : public ScrollableBox {
|
||||||
public:
|
public:
|
||||||
ItemListBox(const style::flatScroll &scroll, int32 w = 0);
|
ItemListBox(const style::FlatScroll &scroll, int32 w = 0);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
|
@ -1301,7 +1302,7 @@ void EditChannelBox::onSaveSignDone(const MTPUpdates &updates) {
|
||||||
RevokePublicLinkBox::RevokePublicLinkBox(base::lambda_unique<void()> &&revokeCallback) : AbstractBox()
|
RevokePublicLinkBox::RevokePublicLinkBox(base::lambda_unique<void()> &&revokeCallback) : AbstractBox()
|
||||||
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
|
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
|
||||||
, _revokeWidth(st::normalFont->width(lang(lng_channels_too_much_public_revoke)))
|
, _revokeWidth(st::normalFont->width(lang(lng_channels_too_much_public_revoke)))
|
||||||
, _aboutRevoke(this, lang(lng_channels_too_much_public_about), FlatLabel::InitType::Simple, st::aboutRevokePublicLabel)
|
, _aboutRevoke(this, lang(lng_channels_too_much_public_about), Ui::FlatLabel::InitType::Simple, st::aboutRevokePublicLabel)
|
||||||
, _cancel(this, lang(lng_cancel), st::cancelBoxButton)
|
, _cancel(this, lang(lng_cancel), st::cancelBoxButton)
|
||||||
, _revokeCallback(std_::move(revokeCallback)) {
|
, _revokeCallback(std_::move(revokeCallback)) {
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|
|
@ -20,14 +20,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "abstractbox.h"
|
#include "boxes/abstractbox.h"
|
||||||
#include "core/lambda_wrap.h"
|
|
||||||
#include "ui/filedialog.h"
|
#include "ui/filedialog.h"
|
||||||
|
|
||||||
class FlatLabel;
|
|
||||||
class ConfirmBox;
|
class ConfirmBox;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class InputField;
|
class InputField;
|
||||||
class PhoneInput;
|
class PhoneInput;
|
||||||
class InputArea;
|
class InputArea;
|
||||||
|
@ -342,7 +341,7 @@ private:
|
||||||
int _rowHeight = 0;
|
int _rowHeight = 0;
|
||||||
int _revokeWidth = 0;
|
int _revokeWidth = 0;
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _aboutRevoke;
|
ChildWidget<Ui::FlatLabel> _aboutRevoke;
|
||||||
ChildWidget<Ui::RoundButton> _cancel;
|
ChildWidget<Ui::RoundButton> _cancel;
|
||||||
|
|
||||||
base::lambda_unique<void()> _revokeCallback;
|
base::lambda_unique<void()> _revokeCallback;
|
||||||
|
|
|
@ -23,6 +23,7 @@ using "basic.style";
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
using "intro/intro.style";
|
using "intro/intro.style";
|
||||||
|
|
||||||
|
boxButtonFont: font(boxFontSize semibold);
|
||||||
defaultBoxButton: RoundButton {
|
defaultBoxButton: RoundButton {
|
||||||
textFg: #2f9fea;
|
textFg: #2f9fea;
|
||||||
textFgOver: #2f9fea;
|
textFgOver: #2f9fea;
|
||||||
|
@ -90,14 +91,70 @@ boxLinkButton: LinkButton {
|
||||||
|
|
||||||
boxOptionListPadding: margins(2px, 20px, 2px, 2px);
|
boxOptionListPadding: margins(2px, 20px, 2px, 2px);
|
||||||
|
|
||||||
confirmInviteTitle: flatLabel(labelDefFlat) {
|
boxVerticalMargin: 10px;
|
||||||
|
boxWidth: 320px;
|
||||||
|
boxWideWidth: 364px;
|
||||||
|
boxPadding: margins(26px, 30px, 34px, 8px);
|
||||||
|
boxMaxListHeight: 600px;
|
||||||
|
boxLittleSkip: 10px;
|
||||||
|
boxMediumSkip: 20px;
|
||||||
|
|
||||||
|
boxTitleFont: font(boxFontSize bold);
|
||||||
|
boxTitlePosition: point(26px, 28px);
|
||||||
|
boxTitleHeight: 54px;
|
||||||
|
|
||||||
|
boxButtonPadding: margins(12px, 16px, 22px, 16px);
|
||||||
|
boxLabel: FlatLabel(defaultFlatLabel) {
|
||||||
|
font: font(boxFontSize);
|
||||||
|
align: align(topleft);
|
||||||
|
}
|
||||||
|
|
||||||
|
boxScroll: FlatScroll(defaultSolidScroll) {
|
||||||
|
round: 3px;
|
||||||
|
width: 18px;
|
||||||
|
deltax: 6px;
|
||||||
|
}
|
||||||
|
boxScrollSkip: 6px;
|
||||||
|
boxScrollShadowBg: #00000012;
|
||||||
|
|
||||||
|
boxShadow: icon {{ "box_shadow", windowShadowFg }};
|
||||||
|
boxShadowShift: 2px;
|
||||||
|
|
||||||
|
countryRowHeight: 36px;
|
||||||
|
countryRowNameFont: semiboldFont;
|
||||||
|
countryRowNameFg: boxTextFg;
|
||||||
|
countryRowPadding: margins(22px, 9px, 8px, 0px);
|
||||||
|
countryRowCodeFont: font(fsize);
|
||||||
|
countryRowBg: windowBg;
|
||||||
|
countryRowBgOver: windowBgOver;
|
||||||
|
countryRowCodeFg: windowSubTextFg;
|
||||||
|
countryRowCodeFgOver: windowSubTextFgOver;
|
||||||
|
countriesSkip: 12px;
|
||||||
|
countriesScroll: FlatScroll(boxScroll) {
|
||||||
|
deltat: 9px;
|
||||||
|
deltab: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
boxTextStyle: TextStyle(defaultTextStyle) {
|
||||||
|
lineHeight: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
boxPhotoPadding: margins(28px, 28px, 28px, 18px);
|
||||||
|
boxPhotoCompressedPadding: margins(0px, 2px, 0px, 22px);
|
||||||
|
boxPhotoTextFg: #808080;
|
||||||
|
|
||||||
|
cropPointSize: 10px;
|
||||||
|
cropSkip: 13px;
|
||||||
|
cropMinSize: 20px;
|
||||||
|
|
||||||
|
confirmInviteTitle: FlatLabel(defaultFlatLabel) {
|
||||||
font: font(16px semibold);
|
font: font(16px semibold);
|
||||||
align: align(center);
|
align: align(center);
|
||||||
width: 320px;
|
width: 320px;
|
||||||
maxHeight: 24px;
|
maxHeight: 24px;
|
||||||
textFg: #333333;
|
textFg: #333333;
|
||||||
}
|
}
|
||||||
confirmInviteStatus: flatLabel(labelDefFlat) {
|
confirmInviteStatus: FlatLabel(defaultFlatLabel) {
|
||||||
font: font(boxFontSize);
|
font: font(boxFontSize);
|
||||||
align: align(center);
|
align: align(center);
|
||||||
width: 320px;
|
width: 320px;
|
||||||
|
@ -111,7 +168,7 @@ confirmInviteStatusTop: 136px;
|
||||||
confirmInviteUserHeight: 80px;
|
confirmInviteUserHeight: 80px;
|
||||||
confirmInviteUserPhotoSize: 56px;
|
confirmInviteUserPhotoSize: 56px;
|
||||||
confirmInviteUserPhotoTop: 166px;
|
confirmInviteUserPhotoTop: 166px;
|
||||||
confirmInviteUserName: flatLabel(labelDefFlat) {
|
confirmInviteUserName: FlatLabel(defaultFlatLabel) {
|
||||||
font: normalFont;
|
font: normalFont;
|
||||||
align: align(center);
|
align: align(center);
|
||||||
width: 66px;
|
width: 66px;
|
||||||
|
@ -119,22 +176,22 @@ confirmInviteUserName: flatLabel(labelDefFlat) {
|
||||||
}
|
}
|
||||||
confirmInviteUserNameTop: 227px;
|
confirmInviteUserNameTop: 227px;
|
||||||
|
|
||||||
confirmPhoneAboutLabel: flatLabel(labelDefFlat) {
|
confirmPhoneAboutLabel: FlatLabel(defaultFlatLabel) {
|
||||||
width: 282px;
|
width: 282px;
|
||||||
}
|
}
|
||||||
confirmPhoneCodeField: InputField(defaultInputField) {
|
confirmPhoneCodeField: InputField(defaultInputField) {
|
||||||
}
|
}
|
||||||
|
|
||||||
revokePublicLinkStatusStyle: textStyle(defaultTextStyle) {
|
revokePublicLinkStatusStyle: TextStyle(defaultTextStyle) {
|
||||||
linkFg: contactsStatusFgOnline;
|
linkFg: contactsStatusFgOnline;
|
||||||
linkFgDown: contactsStatusFgOnline;
|
linkFgDown: contactsStatusFgOnline;
|
||||||
linkFlagsOver: font(fsize);
|
linkFlagsOver: font(fsize);
|
||||||
}
|
}
|
||||||
aboutRevokePublicLabel: flatLabel(labelDefFlat) {
|
aboutRevokePublicLabel: FlatLabel(defaultFlatLabel) {
|
||||||
font: normalFont;
|
font: normalFont;
|
||||||
align: align(topleft);
|
align: align(topleft);
|
||||||
width: 320px;
|
width: 320px;
|
||||||
textFg: windowTextFg;
|
textFg: windowFg;
|
||||||
}
|
}
|
||||||
|
|
||||||
contactUserIcon: icon {{ "add_contact_user", #999999 }};
|
contactUserIcon: icon {{ "add_contact_user", #999999 }};
|
||||||
|
@ -172,7 +229,7 @@ contactsAdminCheckbox: Checkbox(defaultBoxCheckbox) {
|
||||||
contactsAboutSkip: 53px;
|
contactsAboutSkip: 53px;
|
||||||
contactsAboutHeight: 42px;
|
contactsAboutHeight: 42px;
|
||||||
contactsAboutTop: 9px;
|
contactsAboutTop: 9px;
|
||||||
contactsScroll: flatScroll(boxScroll) {
|
contactsScroll: FlatScroll(boxScroll) {
|
||||||
deltab: 0px;
|
deltab: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +237,7 @@ contactsMultiSelect: MultiSelect {
|
||||||
bg: boxSearchBg;
|
bg: boxSearchBg;
|
||||||
padding: margins(8px, 8px, 8px, 8px);
|
padding: margins(8px, 8px, 8px, 8px);
|
||||||
maxHeight: 104px;
|
maxHeight: 104px;
|
||||||
scroll: flatScroll(solidScroll) {
|
scroll: FlatScroll(defaultSolidScroll) {
|
||||||
deltat: 3px;
|
deltat: 3px;
|
||||||
deltab: 3px;
|
deltab: 3px;
|
||||||
round: 1px;
|
round: 1px;
|
||||||
|
@ -195,7 +252,7 @@ contactsMultiSelect: MultiSelect {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
font: normalFont;
|
font: normalFont;
|
||||||
textBg: contactsBgOver;
|
textBg: contactsBgOver;
|
||||||
textFg: windowTextFg;
|
textFg: windowFg;
|
||||||
textActiveBg: activeButtonBg;
|
textActiveBg: activeButtonBg;
|
||||||
textActiveFg: activeButtonFg;
|
textActiveFg: activeButtonFg;
|
||||||
deleteFg: activeButtonFg;
|
deleteFg: activeButtonFg;
|
||||||
|
@ -242,13 +299,13 @@ contactsPhotoCheckbox: RoundImageCheckbox {
|
||||||
imageRadius: 21px;
|
imageRadius: 21px;
|
||||||
imageSmallRadius: 18px;
|
imageSmallRadius: 18px;
|
||||||
selectWidth: 2px;
|
selectWidth: 2px;
|
||||||
selectFg: windowActiveBg;
|
selectFg: windowBgActive;
|
||||||
selectDuration: 150;
|
selectDuration: 150;
|
||||||
checkBorder: windowBg;
|
checkBorder: windowBg;
|
||||||
checkBg: windowActiveBg;
|
checkBg: windowBgActive;
|
||||||
checkRadius: 10px;
|
checkRadius: 10px;
|
||||||
checkSmallRadius: 3px;
|
checkSmallRadius: 3px;
|
||||||
checkIcon: icon {{ "default_checkbox_check", windowActiveFg, point(3px, 6px) }};
|
checkIcon: icon {{ "default_checkbox_check", windowFgActive, point(3px, 6px) }};
|
||||||
}
|
}
|
||||||
contactsPhotoDisabledCheckFg: #bbbbbb;
|
contactsPhotoDisabledCheckFg: #bbbbbb;
|
||||||
contactsNameCheckedFg: #2b88b8;
|
contactsNameCheckedFg: #2b88b8;
|
||||||
|
@ -263,7 +320,7 @@ sharePhotoCheckbox: RoundImageCheckbox(contactsPhotoCheckbox) {
|
||||||
imageSmallRadius: 24px;
|
imageSmallRadius: 24px;
|
||||||
}
|
}
|
||||||
shareNameFont: font(11px);
|
shareNameFont: font(11px);
|
||||||
shareNameFg: windowTextFg;
|
shareNameFg: windowFg;
|
||||||
shareNameActiveFg: btnYesColor;
|
shareNameActiveFg: btnYesColor;
|
||||||
shareNameTop: 6px;
|
shareNameTop: 6px;
|
||||||
shareColumnSkip: 6px;
|
shareColumnSkip: 6px;
|
||||||
|
@ -289,7 +346,7 @@ notificationSampleSize: size(64px, 16px);
|
||||||
|
|
||||||
membersAboutLimitPadding: margins(0px, 12px, 0px, 12px);
|
membersAboutLimitPadding: margins(0px, 12px, 0px, 12px);
|
||||||
|
|
||||||
sessionsScroll: flatScroll(boxScroll) {
|
sessionsScroll: FlatScroll(boxScroll) {
|
||||||
round: 2px;
|
round: 2px;
|
||||||
deltax: 5px;
|
deltax: 5px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
|
@ -376,12 +433,12 @@ aboutVersionLink: LinkButton(defaultLinkButton) {
|
||||||
}
|
}
|
||||||
aboutTextTop: 34px;
|
aboutTextTop: 34px;
|
||||||
aboutSkip: 14px;
|
aboutSkip: 14px;
|
||||||
aboutLabel: flatLabel(labelDefFlat) {
|
aboutLabel: FlatLabel(defaultFlatLabel) {
|
||||||
font: normalFont;
|
font: normalFont;
|
||||||
width: 330px;
|
width: 330px;
|
||||||
align: align(topleft);
|
align: align(topleft);
|
||||||
}
|
}
|
||||||
aboutTextStyle: textStyle(defaultTextStyle) {
|
aboutTextStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 22px;
|
lineHeight: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,7 +476,7 @@ langsButton: Radiobutton(defaultRadiobutton) {
|
||||||
|
|
||||||
backgroundPadding: 10px;
|
backgroundPadding: 10px;
|
||||||
backgroundSize: size(108px, 193px);
|
backgroundSize: size(108px, 193px);
|
||||||
backgroundScroll: flatScroll(boxScroll) {
|
backgroundScroll: FlatScroll(boxScroll) {
|
||||||
round: 2px;
|
round: 2px;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
deltax: 3px;
|
deltax: 3px;
|
||||||
|
|
|
@ -29,6 +29,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
#include "core/click_handler_types.h"
|
#include "core/click_handler_types.h"
|
||||||
#include "localstorage.h"
|
#include "localstorage.h"
|
||||||
|
|
||||||
|
@ -397,7 +398,7 @@ void ConvertToSupergroupBox::resizeEvent(QResizeEvent *e) {
|
||||||
PinMessageBox::PinMessageBox(ChannelData *channel, MsgId msgId) : AbstractBox(st::boxWidth)
|
PinMessageBox::PinMessageBox(ChannelData *channel, MsgId msgId) : AbstractBox(st::boxWidth)
|
||||||
, _channel(channel)
|
, _channel(channel)
|
||||||
, _msgId(msgId)
|
, _msgId(msgId)
|
||||||
, _text(this, lang(lng_pinned_pin_sure), FlatLabel::InitType::Simple, st::boxLabel)
|
, _text(this, lang(lng_pinned_pin_sure), Ui::FlatLabel::InitType::Simple, st::boxLabel)
|
||||||
, _notify(this, lang(lng_pinned_notify), true, st::defaultBoxCheckbox)
|
, _notify(this, lang(lng_pinned_notify), true, st::defaultBoxCheckbox)
|
||||||
, _pin(this, lang(lng_pinned_pin), st::defaultBoxButton)
|
, _pin(this, lang(lng_pinned_pin), st::defaultBoxButton)
|
||||||
, _cancel(this, lang(lng_cancel), st::cancelBoxButton) {
|
, _cancel(this, lang(lng_cancel), st::cancelBoxButton) {
|
||||||
|
@ -450,7 +451,7 @@ RichDeleteMessageBox::RichDeleteMessageBox(ChannelData *channel, UserData *from,
|
||||||
, _channel(channel)
|
, _channel(channel)
|
||||||
, _from(from)
|
, _from(from)
|
||||||
, _msgId(msgId)
|
, _msgId(msgId)
|
||||||
, _text(this, lang(lng_selected_delete_sure_this), FlatLabel::InitType::Simple, st::boxLabel)
|
, _text(this, lang(lng_selected_delete_sure_this), Ui::FlatLabel::InitType::Simple, st::boxLabel)
|
||||||
, _banUser(this, lang(lng_ban_user), false, st::defaultBoxCheckbox)
|
, _banUser(this, lang(lng_ban_user), false, st::defaultBoxCheckbox)
|
||||||
, _reportSpam(this, lang(lng_report_spam), false, st::defaultBoxCheckbox)
|
, _reportSpam(this, lang(lng_report_spam), false, st::defaultBoxCheckbox)
|
||||||
, _deleteAll(this, lang(lng_delete_all_from), false, st::defaultBoxCheckbox)
|
, _deleteAll(this, lang(lng_delete_all_from), false, st::defaultBoxCheckbox)
|
||||||
|
@ -562,7 +563,7 @@ ConfirmInviteBox::ConfirmInviteBox(const QString &title, const MTPChatPhoto &pho
|
||||||
int sumWidth = _participants.size() * _userWidth;
|
int sumWidth = _participants.size() * _userWidth;
|
||||||
int left = (width() - sumWidth) / 2;
|
int left = (width() - sumWidth) / 2;
|
||||||
for_const (auto user, _participants) {
|
for_const (auto user, _participants) {
|
||||||
auto name = new FlatLabel(this, st::confirmInviteUserName);
|
auto name = new Ui::FlatLabel(this, st::confirmInviteUserName);
|
||||||
name->resizeToWidth(st::confirmInviteUserPhotoSize + padding);
|
name->resizeToWidth(st::confirmInviteUserPhotoSize + padding);
|
||||||
name->setText(user->firstName.isEmpty() ? App::peerName(user) : user->firstName);
|
name->setText(user->firstName.isEmpty() ? App::peerName(user) : user->firstName);
|
||||||
name->moveToLeft(left + (padding / 2), st::confirmInviteUserNameTop);
|
name->moveToLeft(left + (padding / 2), st::confirmInviteUserNameTop);
|
||||||
|
|
|
@ -20,13 +20,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "abstractbox.h"
|
#include "boxes/abstractbox.h"
|
||||||
#include "ui/flatlabel.h"
|
|
||||||
#include "core/lambda_wrap.h"
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class Checkbox;
|
class Checkbox;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
|
class FlatLabel;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
namespace st {
|
namespace st {
|
||||||
|
@ -237,7 +236,7 @@ private:
|
||||||
ChannelData *_channel;
|
ChannelData *_channel;
|
||||||
MsgId _msgId;
|
MsgId _msgId;
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _text;
|
ChildWidget<Ui::FlatLabel> _text;
|
||||||
ChildWidget<Ui::Checkbox> _notify;
|
ChildWidget<Ui::Checkbox> _notify;
|
||||||
|
|
||||||
ChildWidget<Ui::RoundButton> _pin;
|
ChildWidget<Ui::RoundButton> _pin;
|
||||||
|
@ -266,7 +265,7 @@ private:
|
||||||
UserData *_from;
|
UserData *_from;
|
||||||
MsgId _msgId;
|
MsgId _msgId;
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _text;
|
ChildWidget<Ui::FlatLabel> _text;
|
||||||
ChildWidget<Ui::Checkbox> _banUser;
|
ChildWidget<Ui::Checkbox> _banUser;
|
||||||
ChildWidget<Ui::Checkbox> _reportSpam;
|
ChildWidget<Ui::Checkbox> _reportSpam;
|
||||||
ChildWidget<Ui::Checkbox> _deleteAll;
|
ChildWidget<Ui::Checkbox> _deleteAll;
|
||||||
|
@ -304,8 +303,8 @@ protected:
|
||||||
void showAll() override;
|
void showAll() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChildWidget<FlatLabel> _title;
|
ChildWidget<Ui::FlatLabel> _title;
|
||||||
ChildWidget<FlatLabel> _status;
|
ChildWidget<Ui::FlatLabel> _status;
|
||||||
ImagePtr _photo;
|
ImagePtr _photo;
|
||||||
QVector<UserData*> _participants;
|
QVector<UserData*> _participants;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
|
|
||||||
|
@ -97,7 +98,7 @@ void ConfirmPhoneBox::setCallStatus(const CallStatus &status) {
|
||||||
void ConfirmPhoneBox::launch() {
|
void ConfirmPhoneBox::launch() {
|
||||||
setBlockTitle(true);
|
setBlockTitle(true);
|
||||||
|
|
||||||
_about = new FlatLabel(this, st::confirmPhoneAboutLabel);
|
_about.create(this, st::confirmPhoneAboutLabel);
|
||||||
TextWithEntities aboutText;
|
TextWithEntities aboutText;
|
||||||
auto formattedPhone = App::formatPhone(_phone);
|
auto formattedPhone = App::formatPhone(_phone);
|
||||||
aboutText.text = lng_confirm_phone_about(lt_phone, formattedPhone);
|
aboutText.text = lng_confirm_phone_about(lt_phone, formattedPhone);
|
||||||
|
|
|
@ -22,11 +22,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "boxes/abstractbox.h"
|
#include "boxes/abstractbox.h"
|
||||||
|
|
||||||
class FlatLabel;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class InputField;
|
class InputField;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
|
class FlatLabel;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
class ConfirmPhoneBox : public AbstractBox, public RPCSender {
|
class ConfirmPhoneBox : public AbstractBox, public RPCSender {
|
||||||
|
@ -92,7 +91,7 @@ private:
|
||||||
|
|
||||||
mtpRequestId _checkCodeRequestId = 0;
|
mtpRequestId _checkCodeRequestId = 0;
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _about = { nullptr };
|
ChildWidget<Ui::FlatLabel> _about = { nullptr };
|
||||||
ChildWidget<Ui::RoundButton> _send = { nullptr };
|
ChildWidget<Ui::RoundButton> _send = { nullptr };
|
||||||
ChildWidget<Ui::RoundButton> _cancel = { nullptr };
|
ChildWidget<Ui::RoundButton> _cancel = { nullptr };
|
||||||
ChildWidget<Ui::InputField> _code = { nullptr };
|
ChildWidget<Ui::InputField> _code = { nullptr };
|
||||||
|
|
|
@ -34,6 +34,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/filedialog.h"
|
#include "ui/filedialog.h"
|
||||||
#include "ui/widgets/multi_select.h"
|
#include "ui/widgets/multi_select.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "ui/effects/widget_slide_wrap.h"
|
#include "ui/effects/widget_slide_wrap.h"
|
||||||
#include "boxes/photocropbox.h"
|
#include "boxes/photocropbox.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
|
|
|
@ -81,7 +81,7 @@ void LocalStorageBox::paintEvent(QPaintEvent *e) {
|
||||||
paintTitle(p, lang(lng_local_storage_title));
|
paintTitle(p, lang(lng_local_storage_title));
|
||||||
|
|
||||||
p.setFont(st::boxTextFont);
|
p.setFont(st::boxTextFont);
|
||||||
p.setPen(st::windowTextFg);
|
p.setPen(st::windowFg);
|
||||||
checkLocalStoredCounts();
|
checkLocalStoredCounts();
|
||||||
int top = titleHeight() + st::localStorageBoxSkip;
|
int top = titleHeight() + st::localStorageBoxSkip;
|
||||||
if (_imagesCount > 0) {
|
if (_imagesCount > 0) {
|
||||||
|
|
|
@ -29,6 +29,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "boxes/contactsbox.h"
|
#include "boxes/contactsbox.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
|
|
||||||
MembersBox::MembersBox(ChannelData *channel, MembersFilter filter) : ItemListBox(st::boxScroll)
|
MembersBox::MembersBox(ChannelData *channel, MembersFilter filter) : ItemListBox(st::boxScroll)
|
||||||
|
|
|
@ -28,6 +28,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "countries.h"
|
#include "countries.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
|
|
||||||
SessionsBox::SessionsBox() : ScrollableBox(st::sessionsScroll)
|
SessionsBox::SessionsBox() : ScrollableBox(st::sessionsScroll)
|
||||||
|
|
|
@ -36,6 +36,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/widgets/multi_select.h"
|
#include "ui/widgets/multi_select.h"
|
||||||
#include "history/history_media_types.h"
|
#include "history/history_media_types.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "boxes/contactsbox.h"
|
#include "boxes/contactsbox.h"
|
||||||
|
|
||||||
ShareBox::ShareBox(CopyCallback &©Callback, SubmitCallback &&submitCallback, FilterCallback &&filterCallback) : ItemListBox(st::boxScroll)
|
ShareBox::ShareBox(CopyCallback &©Callback, SubmitCallback &&submitCallback, FilterCallback &&filterCallback) : ItemListBox(st::boxScroll)
|
||||||
|
|
|
@ -32,6 +32,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
|
|
||||||
StickerSetBox::StickerSetBox(const MTPInputStickerSet &set) : ScrollableBox(st::stickersScroll)
|
StickerSetBox::StickerSetBox(const MTPInputStickerSet &set) : ScrollableBox(st::stickersScroll)
|
||||||
, _inner(this, set)
|
, _inner(this, set)
|
||||||
|
|
|
@ -178,3 +178,18 @@ protected:
|
||||||
virtual void onClickImpl() const = 0;
|
virtual void onClickImpl() const = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LambdaClickHandler : public ClickHandler {
|
||||||
|
public:
|
||||||
|
LambdaClickHandler(base::lambda_unique<void()> handler) : _handler(std_::move(handler)) {
|
||||||
|
}
|
||||||
|
void onClick(Qt::MouseButton button) const override final {
|
||||||
|
if (button == Qt::LeftButton && _handler) {
|
||||||
|
_handler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
base::lambda_unique<void()> _handler;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
|
@ -33,7 +33,8 @@ dialogsDateSkip: 5px;
|
||||||
dialogsNameTop: 2px;
|
dialogsNameTop: 2px;
|
||||||
|
|
||||||
dialogsRowHeight: 62px;
|
dialogsRowHeight: 62px;
|
||||||
dialogsFilterPadding: point(11px, 11px);
|
dialogsFilterPadding: point(7px, 7px);
|
||||||
|
dialogsFilterSkip: 4px;
|
||||||
dialogsPhotoSize: 46px;
|
dialogsPhotoSize: 46px;
|
||||||
dialogsPhotoPadding: 12px;
|
dialogsPhotoPadding: 12px;
|
||||||
dialogsPadding: point(10px, 8px);
|
dialogsPadding: point(10px, 8px);
|
||||||
|
@ -45,49 +46,51 @@ dialogsSkip: 8px;
|
||||||
dialogsWidthMin: 260px;
|
dialogsWidthMin: 260px;
|
||||||
dialogsWidthMax: 540px;
|
dialogsWidthMax: 540px;
|
||||||
dialogsTextWidthMin: 150px;
|
dialogsTextWidthMin: 150px;
|
||||||
dialogsScroll: flatScroll(scrollDef) {
|
dialogsScroll: FlatScroll(defaultFlatScroll) {
|
||||||
topsh: 0px;
|
topsh: 0px;
|
||||||
bottomsh: 0px;
|
bottomsh: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogsTextStyle: textStyle(defaultTextStyle) {
|
dialogsTextStyle: TextStyle(defaultTextStyle) {
|
||||||
linkFg: dialogsTextFgService;
|
linkFg: dialogsTextFgService;
|
||||||
linkFgDown: dialogsTextFgService;
|
linkFgDown: dialogsTextFgService;
|
||||||
linkFlagsOver: font(fsize);
|
linkFlagsOver: font(fsize);
|
||||||
}
|
}
|
||||||
dialogsTextStyleOver: textStyle(dialogsTextStyle) {
|
dialogsTextStyleOver: TextStyle(dialogsTextStyle) {
|
||||||
linkFg: dialogsTextFgServiceOver;
|
linkFg: dialogsTextFgServiceOver;
|
||||||
linkFgDown: dialogsTextFgServiceOver;
|
linkFgDown: dialogsTextFgServiceOver;
|
||||||
}
|
}
|
||||||
dialogsTextStyleActive: textStyle(dialogsTextStyle) {
|
dialogsTextStyleActive: TextStyle(dialogsTextStyle) {
|
||||||
linkFg: dialogsTextFgServiceActive;
|
linkFg: dialogsTextFgServiceActive;
|
||||||
linkFgDown: dialogsTextFgServiceActive;
|
linkFgDown: dialogsTextFgServiceActive;
|
||||||
}
|
}
|
||||||
dialogsTextStyleDraft: textStyle(dialogsTextStyle) {
|
dialogsTextStyleDraft: TextStyle(dialogsTextStyle) {
|
||||||
linkFg: dialogsDraftFg;
|
linkFg: dialogsDraftFg;
|
||||||
linkFgDown: dialogsDraftFg;
|
linkFgDown: dialogsDraftFg;
|
||||||
}
|
}
|
||||||
dialogsTextStyleDraftOver: textStyle(dialogsTextStyle) {
|
dialogsTextStyleDraftOver: TextStyle(dialogsTextStyle) {
|
||||||
linkFg: dialogsDraftFgOver;
|
linkFg: dialogsDraftFgOver;
|
||||||
linkFgDown: dialogsDraftFgOver;
|
linkFgDown: dialogsDraftFgOver;
|
||||||
}
|
}
|
||||||
dialogsTextStyleDraftActive: textStyle(dialogsTextStyle) {
|
dialogsTextStyleDraftActive: TextStyle(dialogsTextStyle) {
|
||||||
linkFg: dialogsDraftFgActive;
|
linkFg: dialogsDraftFgActive;
|
||||||
linkFgDown: dialogsDraftFgActive;
|
linkFgDown: dialogsDraftFgActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogsMenuToggle: IconButton {
|
dialogsMenuToggle: IconButton {
|
||||||
width: 32px;
|
width: 40px;
|
||||||
height: 32px;
|
height: 40px;
|
||||||
|
|
||||||
icon: icon {{ "dialogs_menu", dialogsMenuIconFg }};
|
icon: icon {{ "dialogs_menu", dialogsMenuIconFg }};
|
||||||
iconOver: icon {{ "dialogs_menu", dialogsMenuIconFgOver }};
|
iconOver: icon {{ "dialogs_menu", dialogsMenuIconFgOver }};
|
||||||
iconPosition: point(6px, 6px);
|
iconPosition: point(10px, 10px);
|
||||||
iconPositionDown: point(6px, 6px);
|
iconPositionDown: point(10px, 10px);
|
||||||
|
|
||||||
rippleAreaPosition: point(0px, 0px);
|
rippleAreaPosition: point(0px, 0px);
|
||||||
rippleAreaSize: 32px;
|
rippleAreaSize: 40px;
|
||||||
ripple: defaultRippleAnimation;
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: windowBgOver;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dialogsLock: IconButton(dialogsMenuToggle) {
|
dialogsLock: IconButton(dialogsMenuToggle) {
|
||||||
icon: icon {{ "dialogs_lock", dialogsMenuIconFg }};
|
icon: icon {{ "dialogs_lock", dialogsMenuIconFg }};
|
||||||
|
@ -110,33 +113,19 @@ dialogsCancelSearchInPeer: IconButton(dialogsMenuToggle) {
|
||||||
icon: icon {{ "dialogs_cancel_search", dialogsMenuIconFg }};
|
icon: icon {{ "dialogs_cancel_search", dialogsMenuIconFg }};
|
||||||
iconOver: icon {{ "dialogs_cancel_search", dialogsMenuIconFgOver }};
|
iconOver: icon {{ "dialogs_cancel_search", dialogsMenuIconFgOver }};
|
||||||
|
|
||||||
iconPosition: point(7px, 7px);
|
iconPosition: point(11px, 11px);
|
||||||
iconPositionDown: point(7px, 7px);
|
iconPositionDown: point(11px, 11px);
|
||||||
}
|
}
|
||||||
dialogsCancelSearch: IconButton(dialogsCancelSearchInPeer) {
|
dialogsCancelSearch: IconButton(dialogsCancelSearchInPeer) {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
|
||||||
|
iconPosition: point(7px, 7px);
|
||||||
|
iconPositionDown: point(7px, 7px);
|
||||||
|
|
||||||
rippleAreaSize: 0px;
|
rippleAreaSize: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogsMenu: Menu(defaultMenu) {
|
|
||||||
itemFont: semiboldFont;
|
|
||||||
itemIconPosition: point(28px, 11px);
|
|
||||||
itemPadding: margins(76px, 14px, 28px, 14px);
|
|
||||||
}
|
|
||||||
dialogsMenuWrap: DropdownMenu(defaultDropdownMenu) {
|
|
||||||
menu: dialogsMenu;
|
|
||||||
}
|
|
||||||
dialogsMenuPosition: point(-3px, -2px);
|
|
||||||
dialogsMenuNewGroup: icon {{ "menu_new_group", menuIconFg }};
|
|
||||||
dialogsMenuNewGroupOver: icon {{ "menu_new_group", menuIconFgOver }};
|
|
||||||
dialogsMenuNewChannel: icon {{ "menu_new_channel", menuIconFg }};
|
|
||||||
dialogsMenuNewChannelOver: icon {{ "menu_new_channel", menuIconFgOver }};
|
|
||||||
dialogsMenuContacts: icon {{ "menu_contacts", menuIconFg }};
|
|
||||||
dialogsMenuContactsOver: icon {{ "menu_contacts", menuIconFgOver }};
|
|
||||||
dialogsMenuSettings: icon {{ "menu_settings", menuIconFg }};
|
|
||||||
dialogsMenuSettingsOver: icon {{ "menu_settings", menuIconFgOver }};
|
|
||||||
dialogsMenuHelp: icon {{ "menu_help", menuIconFg }};
|
|
||||||
dialogsMenuHelpOver: icon {{ "menu_help", menuIconFgOver }};
|
|
||||||
|
|
||||||
dialogsChatTypeSkip: 22px;
|
dialogsChatTypeSkip: 22px;
|
||||||
dialogsChatIcon: icon {{ "dialogs_chat", dialogsChatIconFg, point(1px, 4px) }};
|
dialogsChatIcon: icon {{ "dialogs_chat", dialogsChatIconFg, point(1px, 4px) }};
|
||||||
dialogsChatIconOver: icon {{ "dialogs_chat", dialogsChatIconFgOver, point(1px, 4px) }};
|
dialogsChatIconOver: icon {{ "dialogs_chat", dialogsChatIconFgOver, point(1px, 4px) }};
|
||||||
|
|
|
@ -25,6 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "dialogs/dialogs_layout.h"
|
#include "dialogs/dialogs_layout.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
|
#include "styles/style_history.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/widgets/popup_menu.h"
|
#include "ui/widgets/popup_menu.h"
|
||||||
#include "data/data_drafts.h"
|
#include "data/data_drafts.h"
|
||||||
|
@ -412,7 +413,7 @@ void DialogsInner::mousePressEvent(QMouseEvent *e) {
|
||||||
|
|
||||||
void DialogsInner::resizeEvent(QResizeEvent *e) {
|
void DialogsInner::resizeEvent(QResizeEvent *e) {
|
||||||
_addContactLnk->move((width() - _addContactLnk->width()) / 2, (st::noContactsHeight + st::noContactsFont->height) / 2);
|
_addContactLnk->move((width() - _addContactLnk->width()) / 2, (st::noContactsHeight + st::noContactsFont->height) / 2);
|
||||||
_cancelSearchInPeer->move(width() - st::dialogsPadding.x() - st::dialogsCancelSearch.width, (st::dialogsRowHeight - st::dialogsCancelSearch.height) / 2);
|
_cancelSearchInPeer->moveToRight(st::dialogsFilterSkip + st::dialogsFilterPadding.x() - otherWidth(), (st::dialogsRowHeight - st::dialogsCancelSearchInPeer.height) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogsInner::onDialogRowReplaced(Dialogs::Row *oldRow, Dialogs::Row *newRow) {
|
void DialogsInner::onDialogRowReplaced(Dialogs::Row *oldRow, Dialogs::Row *newRow) {
|
||||||
|
@ -2014,28 +2015,6 @@ void DialogsWidget::onChooseByDrag() {
|
||||||
|
|
||||||
void DialogsWidget::showMainMenu() {
|
void DialogsWidget::showMainMenu() {
|
||||||
App::wnd()->showMainMenu();
|
App::wnd()->showMainMenu();
|
||||||
return;
|
|
||||||
|
|
||||||
if (!_mainMenu) {
|
|
||||||
_mainMenu.create(this, st::dialogsMenuWrap);
|
|
||||||
_mainMenu->addAction(lang(lng_create_group_title), [] {
|
|
||||||
App::wnd()->onShowNewGroup();
|
|
||||||
}, &st::dialogsMenuNewGroup, &st::dialogsMenuNewGroupOver);
|
|
||||||
_mainMenu->addAction(lang(lng_create_channel_title), [] {
|
|
||||||
App::wnd()->onShowNewChannel();
|
|
||||||
}, &st::dialogsMenuNewChannel, &st::dialogsMenuNewChannelOver);
|
|
||||||
_mainMenu->addAction(lang(lng_menu_contacts), [] {
|
|
||||||
Ui::showLayer(new ContactsBox());
|
|
||||||
}, &st::dialogsMenuContacts, &st::dialogsMenuContactsOver);
|
|
||||||
_mainMenu->addAction(lang(lng_menu_settings), [] {
|
|
||||||
App::wnd()->showSettings();
|
|
||||||
}, &st::dialogsMenuSettings, &st::dialogsMenuSettingsOver);
|
|
||||||
_mainMenu->addAction(lang(lng_settings_faq), [] {
|
|
||||||
QDesktopServices::openUrl(telegramFaqLink());
|
|
||||||
}, &st::dialogsMenuHelp, &st::dialogsMenuHelpOver);
|
|
||||||
}
|
|
||||||
updateMainMenuGeometry();
|
|
||||||
_mainMenu->showAnimated(Ui::PanelAnimation::Origin::TopLeft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogsWidget::searchMessages(const QString &query, PeerData *inPeer) {
|
void DialogsWidget::searchMessages(const QString &query, PeerData *inPeer) {
|
||||||
|
@ -2381,7 +2360,6 @@ void DialogsWidget::onCompleteHashtag(QString tag) {
|
||||||
|
|
||||||
void DialogsWidget::resizeEvent(QResizeEvent *e) {
|
void DialogsWidget::resizeEvent(QResizeEvent *e) {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
updateMainMenuGeometry();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogsWidget::updateLockUnlockVisibility() {
|
void DialogsWidget::updateLockUnlockVisibility() {
|
||||||
|
@ -2397,21 +2375,18 @@ void DialogsWidget::updateControlsGeometry() {
|
||||||
_forwardCancel->moveToLeft(0, filterTop);
|
_forwardCancel->moveToLeft(0, filterTop);
|
||||||
filterTop += st::dialogsForwardHeight;
|
filterTop += st::dialogsForwardHeight;
|
||||||
}
|
}
|
||||||
auto filterLeft = st::dialogsFilterPadding.x() * 2 + _mainMenuToggle->width();
|
auto filterLeft = st::dialogsFilterPadding.x() + _mainMenuToggle->width() + st::dialogsFilterPadding.x();
|
||||||
auto filterWidth = width() - 2 * st::dialogsFilterPadding.x();
|
auto filterRight = (Global::LocalPasscode() ? (st::dialogsFilterPadding.x() + _lockUnlock->width()) : st::dialogsFilterSkip) + st::dialogsFilterPadding.x();
|
||||||
filterWidth -= st::dialogsFilterPadding.x() + _mainMenuToggle->width();
|
auto filterWidth = width() - filterLeft - filterRight;
|
||||||
if (Global::LocalPasscode()) {
|
auto scrollTop = st::dialogsFilterPadding.y() + _mainMenuToggle->height() + st::dialogsFilterPadding.y();
|
||||||
filterWidth -= st::dialogsFilterPadding.x() + _lockUnlock->width();
|
filterTop += (scrollTop - _filter->height()) / 2;
|
||||||
}
|
|
||||||
filterTop += st::dialogsFilterPadding.y();
|
|
||||||
_filter->setGeometryToLeft(filterLeft, filterTop, filterWidth, _filter->height());
|
_filter->setGeometryToLeft(filterLeft, filterTop, filterWidth, _filter->height());
|
||||||
_mainMenuToggle->moveToLeft(st::dialogsFilterPadding.x(), _filter->y());
|
_mainMenuToggle->moveToLeft(st::dialogsFilterPadding.x(), st::dialogsFilterPadding.y());
|
||||||
_lockUnlock->moveToRight(st::dialogsFilterPadding.x(), _filter->y());
|
_lockUnlock->moveToRight(st::dialogsFilterPadding.x(), st::dialogsFilterPadding.y());
|
||||||
_cancelSearch->moveToLeft(filterLeft + filterWidth - _cancelSearch->width(), _filter->y());
|
_cancelSearch->moveToLeft(filterLeft + filterWidth - _cancelSearch->width(), _filter->y());
|
||||||
|
|
||||||
auto addToScroll = App::main() ? App::main()->contentScrollAddToY() : 0;
|
auto addToScroll = App::main() ? App::main()->contentScrollAddToY() : 0;
|
||||||
auto newScrollTop = _scroll->scrollTop() + addToScroll;
|
auto newScrollTop = _scroll->scrollTop() + addToScroll;
|
||||||
auto scrollTop = filterTop + _filter->height() + st::dialogsFilterPadding.y();
|
|
||||||
auto scrollHeight = height() - scrollTop;
|
auto scrollHeight = height() - scrollTop;
|
||||||
if (_updateTelegram) {
|
if (_updateTelegram) {
|
||||||
auto updateHeight = _updateTelegram->height();
|
auto updateHeight = _updateTelegram->height();
|
||||||
|
@ -2428,12 +2403,6 @@ void DialogsWidget::updateControlsGeometry() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogsWidget::updateMainMenuGeometry() {
|
|
||||||
if (!_mainMenu) return;
|
|
||||||
|
|
||||||
_mainMenu->moveToLeft(st::dialogsMenuPosition.x(), st::dialogsMenuPosition.y());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DialogsWidget::updateForwardBar() {
|
void DialogsWidget::updateForwardBar() {
|
||||||
auto selecting = App::main()->selectingPeer();
|
auto selecting = App::main()->selectingPeer();
|
||||||
auto oneColumnSelecting = (Adaptive::OneColumn() && selecting);
|
auto oneColumnSelecting = (Adaptive::OneColumn() && selecting);
|
||||||
|
|
|
@ -21,6 +21,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "window/section_widget.h"
|
#include "window/section_widget.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
|
|
||||||
namespace Dialogs {
|
namespace Dialogs {
|
||||||
class Row;
|
class Row;
|
||||||
|
@ -46,7 +47,7 @@ enum DialogsSearchRequestType {
|
||||||
DialogsSearchMigratedFromOffset,
|
DialogsSearchMigratedFromOffset,
|
||||||
};
|
};
|
||||||
|
|
||||||
class DialogsInner : public SplittedWidget, public RPCSender, private base::Subscriber {
|
class DialogsInner : public Ui::SplittedWidget, public RPCSender, private base::Subscriber {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -310,7 +311,6 @@ private:
|
||||||
void showMainMenu();
|
void showMainMenu();
|
||||||
void updateLockUnlockVisibility();
|
void updateLockUnlockVisibility();
|
||||||
void updateControlsGeometry();
|
void updateControlsGeometry();
|
||||||
void updateMainMenuGeometry();
|
|
||||||
void updateForwardBar();
|
void updateForwardBar();
|
||||||
|
|
||||||
bool _dragInScroll = false;
|
bool _dragInScroll = false;
|
||||||
|
@ -332,11 +332,10 @@ private:
|
||||||
|
|
||||||
ChildWidget<Ui::IconButton> _forwardCancel = { nullptr };
|
ChildWidget<Ui::IconButton> _forwardCancel = { nullptr };
|
||||||
ChildWidget<Ui::IconButton> _mainMenuToggle;
|
ChildWidget<Ui::IconButton> _mainMenuToggle;
|
||||||
ChildWidget<Ui::DropdownMenu> _mainMenu = { nullptr };
|
|
||||||
ChildWidget<Ui::FlatInput> _filter;
|
ChildWidget<Ui::FlatInput> _filter;
|
||||||
ChildWidget<Ui::IconButton> _cancelSearch;
|
ChildWidget<Ui::IconButton> _cancelSearch;
|
||||||
ChildWidget<Ui::IconButton> _lockUnlock;
|
ChildWidget<Ui::IconButton> _lockUnlock;
|
||||||
ChildWidget<ScrollArea> _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
ChildWidget<DialogsInner> _inner;
|
ChildWidget<DialogsInner> _inner;
|
||||||
ChildWidget<Ui::FlatButton> _updateTelegram = { nullptr };
|
ChildWidget<Ui::FlatButton> _updateTelegram = { nullptr };
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "localstorage.h"
|
#include "localstorage.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "styles/style_history.h"
|
#include "styles/style_history.h"
|
||||||
#include "styles/style_widgets.h"
|
#include "styles/style_widgets.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
|
@ -624,11 +625,11 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) {
|
||||||
user->loadUserpic();
|
user->loadUserpic();
|
||||||
user->paintUserpicLeft(p, st::mentionPhotoSize, st::mentionPadding.left(), i * st::mentionHeight + st::mentionPadding.top(), width());
|
user->paintUserpicLeft(p, st::mentionPhotoSize, st::mentionPadding.left(), i * st::mentionHeight + st::mentionPadding.top(), width());
|
||||||
|
|
||||||
p.setPen(st::mentionNameFg);
|
p.setPen(selected ? st::mentionNameFgOver : st::mentionNameFg);
|
||||||
user->nameText.drawElided(p, 2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop, namewidth);
|
user->nameText.drawElided(p, 2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop, namewidth);
|
||||||
|
|
||||||
p.setFont(st::mentionFont);
|
p.setFont(st::mentionFont);
|
||||||
p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p);
|
p.setPen(selected ? st::mentionFgOverActive : st::mentionFgActive);
|
||||||
p.drawText(mentionleft + namewidth + st::mentionPadding.right(), i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first);
|
p.drawText(mentionleft + namewidth + st::mentionPadding.right(), i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first);
|
||||||
if (!second.isEmpty()) {
|
if (!second.isEmpty()) {
|
||||||
p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p);
|
p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p);
|
||||||
|
@ -671,7 +672,7 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
auto commandText = '/' + toHighlight;
|
auto commandText = '/' + toHighlight;
|
||||||
|
|
||||||
p.setPen(st::mentionNameFg);
|
p.setPen(selected ? st::mentionNameFgOver : st::mentionNameFg);
|
||||||
p.setFont(st::semiboldFont);
|
p.setFont(st::semiboldFont);
|
||||||
p.drawText(2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop + st::semiboldFont->ascent, commandText);
|
p.drawText(2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop + st::semiboldFont->ascent, commandText);
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/twidget.h"
|
#include "ui/twidget.h"
|
||||||
#include "ui/effects/rect_shadow.h"
|
#include "ui/effects/rect_shadow.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ScrollArea;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
using MentionRows = QList<UserData*>;
|
using MentionRows = QList<UserData*>;
|
||||||
|
@ -106,7 +110,7 @@ private:
|
||||||
|
|
||||||
void rowsUpdated(const internal::MentionRows &mrows, const internal::HashtagRows &hrows, const internal::BotCommandRows &brows, const StickerPack &srows, bool resetScroll);
|
void rowsUpdated(const internal::MentionRows &mrows, const internal::HashtagRows &hrows, const internal::BotCommandRows &brows, const StickerPack &srows, bool resetScroll);
|
||||||
|
|
||||||
ChildWidget<ScrollArea> _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
ChildWidget<internal::FieldAutocompleteInner> _inner;
|
ChildWidget<internal::FieldAutocompleteInner> _inner;
|
||||||
|
|
||||||
ChatData *_chat = nullptr;
|
ChatData *_chat = nullptr;
|
||||||
|
|
|
@ -22,6 +22,31 @@ using "basic.style";
|
||||||
using "dialogs/dialogs.style";
|
using "dialogs/dialogs.style";
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
|
|
||||||
|
BotKeyboardButton {
|
||||||
|
margin: pixels;
|
||||||
|
padding: pixels;
|
||||||
|
height: pixels;
|
||||||
|
textTop: pixels;
|
||||||
|
downTextTop: pixels;
|
||||||
|
}
|
||||||
|
|
||||||
|
historyScroll: FlatScroll(defaultFlatScroll) {
|
||||||
|
barColor: #89a0b47a;
|
||||||
|
bgColor: #89a0b44c;
|
||||||
|
barOverColor: #89a0b4bc;
|
||||||
|
bgOverColor: #89a0b46b;
|
||||||
|
|
||||||
|
round: 3px;
|
||||||
|
|
||||||
|
width: 12px;
|
||||||
|
deltax: 3px;
|
||||||
|
deltat: 3px;
|
||||||
|
deltab: 3px;
|
||||||
|
|
||||||
|
topsh: 0px;
|
||||||
|
bottomsh: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
historyPaddingBottom: 10px;
|
historyPaddingBottom: 10px;
|
||||||
|
|
||||||
historyToDownPosition: point(12px, 10px);
|
historyToDownPosition: point(12px, 10px);
|
||||||
|
@ -41,7 +66,7 @@ historyEmptySize: 128px;
|
||||||
membersInnerWidth: 310px;
|
membersInnerWidth: 310px;
|
||||||
membersInnerHeightMax: 360px;
|
membersInnerHeightMax: 360px;
|
||||||
membersInnerDropdown: InnerDropdown(defaultInnerDropdown) {
|
membersInnerDropdown: InnerDropdown(defaultInnerDropdown) {
|
||||||
scroll: flatScroll(solidScroll) {
|
scroll: FlatScroll(defaultSolidScroll) {
|
||||||
deltat: 3px;
|
deltat: 3px;
|
||||||
deltab: 3px;
|
deltab: 3px;
|
||||||
round: 1px;
|
round: 1px;
|
||||||
|
@ -202,6 +227,12 @@ historyEditSaveIconOver: icon {{ "send_control_save", historySendIconFgOver, poi
|
||||||
historyAttach: IconButton(historySend) {
|
historyAttach: IconButton(historySend) {
|
||||||
icon: icon {{ "send_control_attach", historyComposeIconFg }};
|
icon: icon {{ "send_control_attach", historyComposeIconFg }};
|
||||||
iconOver: icon {{ "send_control_attach", historyComposeIconFgOver }};
|
iconOver: icon {{ "send_control_attach", historyComposeIconFgOver }};
|
||||||
|
|
||||||
|
rippleAreaPosition: point(3px, 3px);
|
||||||
|
rippleAreaSize: 40px;
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: windowBgOver;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
historyAttachFileIcon: icon {{ "media_type_file", historyComposeIconFg }};
|
historyAttachFileIcon: icon {{ "media_type_file", historyComposeIconFg }};
|
||||||
historyAttachFileIconOver: icon {{ "media_type_file", historyComposeIconFgOver }};
|
historyAttachFileIconOver: icon {{ "media_type_file", historyComposeIconFgOver }};
|
||||||
|
@ -214,6 +245,8 @@ historyAttachEmoji: IconButton(historyAttach) {
|
||||||
|
|
||||||
iconPosition: point(15px, 15px);
|
iconPosition: point(15px, 15px);
|
||||||
iconPositionDown: point(15px, 15px);
|
iconPositionDown: point(15px, 15px);
|
||||||
|
|
||||||
|
rippleAreaSize: 0px;
|
||||||
}
|
}
|
||||||
historyEmojiCircle: size(20px, 20px);
|
historyEmojiCircle: size(20px, 20px);
|
||||||
historyEmojiCirclePeriod: 1500;
|
historyEmojiCirclePeriod: 1500;
|
||||||
|
@ -289,9 +322,17 @@ historyReplyCancel: IconButton {
|
||||||
|
|
||||||
iconPosition: point(-1px, -1px);
|
iconPosition: point(-1px, -1px);
|
||||||
iconPositionDown: point(-1px, -1px);
|
iconPositionDown: point(-1px, -1px);
|
||||||
|
|
||||||
|
rippleAreaPosition: point(4px, 4px);
|
||||||
|
rippleAreaSize: 40px;
|
||||||
|
ripple: RippleAnimation(defaultRippleAnimation) {
|
||||||
|
color: windowBgOver;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
historyInlineBotCancel: IconButton(historyReplyCancel) {
|
historyInlineBotCancel: IconButton(historyReplyCancel) {
|
||||||
height: 46px;
|
height: 46px;
|
||||||
|
|
||||||
|
rippleAreaPosition: point(4px, 3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
reportSpamHide: FlatButton {
|
reportSpamHide: FlatButton {
|
||||||
|
@ -318,3 +359,59 @@ reportSpamSeparator: 30px;
|
||||||
reportSpamBg: #fffffff0;
|
reportSpamBg: #fffffff0;
|
||||||
reportSpamFg: #000000;
|
reportSpamFg: #000000;
|
||||||
|
|
||||||
|
msgBotKbDuration: 200;
|
||||||
|
msgBotKbFont: semiboldFont;
|
||||||
|
msgBotKbOverBg: #ffffff1a;
|
||||||
|
msgBotKbIconPadding: 2px;
|
||||||
|
msgBotKbUrlIcon: icon {{ "inline_button_url", #ffffff }};
|
||||||
|
msgBotKbSwitchPmIcon: icon {{ "inline_button_switch", #ffffff }};
|
||||||
|
msgBotKbButton: BotKeyboardButton {
|
||||||
|
margin: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
height: 36px;
|
||||||
|
textTop: 8px;
|
||||||
|
downTextTop: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
botKbDuration: 200;
|
||||||
|
botKbBg: #edf1f5;
|
||||||
|
botKbOverBg: #d8e2ec;
|
||||||
|
botKbDownBg: #d8e2ec;
|
||||||
|
botKbColor: #4b565f;
|
||||||
|
botKbFont: font(15px semibold);
|
||||||
|
botKbButton: BotKeyboardButton {
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
height: 38px;
|
||||||
|
textTop: 9px;
|
||||||
|
downTextTop: 9px;
|
||||||
|
}
|
||||||
|
botKbTinyButton: BotKeyboardButton {
|
||||||
|
margin: 4px;
|
||||||
|
padding: 3px;
|
||||||
|
height: 25px;
|
||||||
|
textTop: 2px;
|
||||||
|
downTextTop: 2px;
|
||||||
|
}
|
||||||
|
botKbScroll: FlatScroll(defaultSolidScroll) {
|
||||||
|
deltax: 3px;
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
mentionHeight: 40px;
|
||||||
|
mentionScroll: FlatScroll(defaultFlatScroll) {
|
||||||
|
topsh: 0px;
|
||||||
|
bottomsh: 0px;
|
||||||
|
}
|
||||||
|
mentionPadding: margins(8px, 5px, 8px, 5px);
|
||||||
|
mentionTop: 11px;
|
||||||
|
mentionFont: linkFont;
|
||||||
|
mentionNameFg: windowFg;
|
||||||
|
mentionNameFgOver: windowFgOver;
|
||||||
|
mentionPhotoSize: msgPhotoSize;
|
||||||
|
mentionBg: #ffffff;
|
||||||
|
mentionBgOver: #f5f5f5;
|
||||||
|
mentionFg: #777777;
|
||||||
|
mentionFgOver: #707070;
|
||||||
|
mentionFgActive: #0080c0;
|
||||||
|
mentionFgOverActive: #0077b3;
|
||||||
|
|
|
@ -22,6 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "history/history_drag_area.h"
|
#include "history/history_drag_area.h"
|
||||||
|
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
|
#include "styles/style_boxes.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "boxes/stickersetbox.h"
|
#include "boxes/stickersetbox.h"
|
||||||
#include "inline_bots/inline_bot_result.h"
|
#include "inline_bots/inline_bot_result.h"
|
||||||
|
|
|
@ -26,6 +26,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "history/history_service_layout.h"
|
#include "history/history_service_layout.h"
|
||||||
#include "media/media_clip_reader.h"
|
#include "media/media_clip_reader.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
|
#include "styles/style_history.h"
|
||||||
#include "fileuploader.h"
|
#include "fileuploader.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -176,7 +177,7 @@ void ReplyKeyboard::resize(int width, int height) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReplyKeyboard::isEnoughSpace(int width, const style::botKeyboardButton &st) const {
|
bool ReplyKeyboard::isEnoughSpace(int width, const style::BotKeyboardButton &st) const {
|
||||||
for_const (auto &row, _rows) {
|
for_const (auto &row, _rows) {
|
||||||
int s = row.size();
|
int s = row.size();
|
||||||
int widthLeft = width - ((s - 1) * st.margin + s * 2 * st.padding);
|
int widthLeft = width - ((s - 1) * st.margin + s * 2 * st.padding);
|
||||||
|
@ -317,6 +318,18 @@ void ReplyKeyboard::clearSelection() {
|
||||||
_a_selected.stop();
|
_a_selected.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ReplyKeyboard::Style::buttonSkip() const {
|
||||||
|
return _st->margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ReplyKeyboard::Style::buttonPadding() const {
|
||||||
|
return _st->padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ReplyKeyboard::Style::buttonHeight() const {
|
||||||
|
return _st->height;
|
||||||
|
}
|
||||||
|
|
||||||
void ReplyKeyboard::Style::paintButton(Painter &p, int outerWidth, const ReplyKeyboard::Button &button) const {
|
void ReplyKeyboard::Style::paintButton(Painter &p, int outerWidth, const ReplyKeyboard::Button &button) const {
|
||||||
const QRect &rect = button.rect;
|
const QRect &rect = button.rect;
|
||||||
bool pressed = ClickHandler::showAsPressed(button.link);
|
bool pressed = ClickHandler::showAsPressed(button.link);
|
||||||
|
@ -880,12 +893,14 @@ HistoryItem::~HistoryItem() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToMessageClickHandler::onClickImpl() const {
|
ClickHandlerPtr goToMessageClickHandler(PeerData *peer, MsgId msgId) {
|
||||||
if (App::main()) {
|
return MakeShared<LambdaClickHandler>([peer, msgId] {
|
||||||
HistoryItem *current = App::mousedItem();
|
if (App::main()) {
|
||||||
if (current && current->history()->peer->id == peer()) {
|
auto current = App::mousedItem();
|
||||||
App::main()->pushReplyReturn(current);
|
if (current && current->history()->peer == peer) {
|
||||||
|
App::main()->pushReplyReturn(current);
|
||||||
|
}
|
||||||
|
Ui::showPeerHistory(peer, msgId, Ui::ShowWay::Forward);
|
||||||
}
|
}
|
||||||
Ui::showPeerHistory(peer(), msgid(), Ui::ShowWay::Forward);
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "core/runtime_composer.h"
|
#include "core/runtime_composer.h"
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct BotKeyboardButton;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
class HistoryElement {
|
class HistoryElement {
|
||||||
public:
|
public:
|
||||||
HistoryElement() = default;
|
HistoryElement() = default;
|
||||||
|
@ -281,21 +285,15 @@ private:
|
||||||
public:
|
public:
|
||||||
class Style {
|
class Style {
|
||||||
public:
|
public:
|
||||||
Style(const style::botKeyboardButton &st) : _st(&st) {
|
Style(const style::BotKeyboardButton &st) : _st(&st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void startPaint(Painter &p) const = 0;
|
virtual void startPaint(Painter &p) const = 0;
|
||||||
virtual style::font textFont() const = 0;
|
virtual style::font textFont() const = 0;
|
||||||
|
|
||||||
int buttonSkip() const {
|
int buttonSkip() const;
|
||||||
return _st->margin;
|
int buttonPadding() const;
|
||||||
}
|
int buttonHeight() const;
|
||||||
int buttonPadding() const {
|
|
||||||
return _st->padding;
|
|
||||||
}
|
|
||||||
int buttonHeight() const {
|
|
||||||
return _st->height;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void repaint(const HistoryItem *item) const = 0;
|
virtual void repaint(const HistoryItem *item) const = 0;
|
||||||
virtual ~Style() {
|
virtual ~Style() {
|
||||||
|
@ -308,7 +306,7 @@ public:
|
||||||
virtual int minButtonWidth(HistoryMessageReplyMarkup::Button::Type type) const = 0;
|
virtual int minButtonWidth(HistoryMessageReplyMarkup::Button::Type type) const = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const style::botKeyboardButton *_st;
|
const style::BotKeyboardButton *_st;
|
||||||
|
|
||||||
void paintButton(Painter &p, int outerWidth, const ReplyKeyboard::Button &button) const;
|
void paintButton(Painter &p, int outerWidth, const ReplyKeyboard::Button &button) const;
|
||||||
friend class ReplyKeyboard;
|
friend class ReplyKeyboard;
|
||||||
|
@ -320,7 +318,7 @@ public:
|
||||||
ReplyKeyboard(const ReplyKeyboard &other) = delete;
|
ReplyKeyboard(const ReplyKeyboard &other) = delete;
|
||||||
ReplyKeyboard &operator=(const ReplyKeyboard &other) = delete;
|
ReplyKeyboard &operator=(const ReplyKeyboard &other) = delete;
|
||||||
|
|
||||||
bool isEnoughSpace(int width, const style::botKeyboardButton &st) const;
|
bool isEnoughSpace(int width, const style::BotKeyboardButton &st) const;
|
||||||
void setStyle(StylePtr &&s);
|
void setStyle(StylePtr &&s);
|
||||||
void resize(int width, int height);
|
void resize(int width, int height);
|
||||||
|
|
||||||
|
@ -951,30 +949,8 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class MessageClickHandler : public LeftButtonClickHandler {
|
ClickHandlerPtr goToMessageClickHandler(PeerData *peer, MsgId msgId);
|
||||||
public:
|
|
||||||
MessageClickHandler(PeerId peer, MsgId msgid) : _peer(peer), _msgid(msgid) {
|
|
||||||
}
|
|
||||||
MessageClickHandler(HistoryItem *item) : _peer(item->history()->peer->id), _msgid(item->id) {
|
|
||||||
}
|
|
||||||
PeerId peer() const {
|
|
||||||
return _peer;
|
|
||||||
}
|
|
||||||
MsgId msgid() const {
|
|
||||||
return _msgid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
inline ClickHandlerPtr goToMessageClickHandler(HistoryItem *item) {
|
||||||
PeerId _peer;
|
return goToMessageClickHandler(item->history()->peer, item->id);
|
||||||
MsgId _msgid;
|
}
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class GoToMessageClickHandler : public MessageClickHandler {
|
|
||||||
public:
|
|
||||||
using MessageClickHandler::MessageClickHandler;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
|
@ -1927,33 +1927,6 @@ bool HistoryGif::dataLoaded() const {
|
||||||
return (!_parent || _parent->id > 0) ? _data->loaded() : false;
|
return (!_parent || _parent->id > 0) ? _data->loaded() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class StickerClickHandler : public LeftButtonClickHandler {
|
|
||||||
public:
|
|
||||||
StickerClickHandler(const HistoryItem *item) : _item(item) {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override {
|
|
||||||
if (auto media = _item->getMedia()) {
|
|
||||||
if (auto document = media->getDocument()) {
|
|
||||||
if (auto sticker = document->sticker()) {
|
|
||||||
if (sticker->set.type() != mtpc_inputStickerSetEmpty && App::main()) {
|
|
||||||
App::main()->stickersBox(sticker->set);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
const HistoryItem *_item;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
HistorySticker::HistorySticker(HistoryItem *parent, DocumentData *document) : HistoryMedia(parent)
|
HistorySticker::HistorySticker(HistoryItem *parent, DocumentData *document) : HistoryMedia(parent)
|
||||||
, _data(document)
|
, _data(document)
|
||||||
, _emoji(_data->sticker()->alt) {
|
, _emoji(_data->sticker()->alt) {
|
||||||
|
@ -1963,11 +1936,21 @@ HistorySticker::HistorySticker(HistoryItem *parent, DocumentData *document) : Hi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TestClickHandler : public ClickHandler {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
void HistorySticker::initDimensions() {
|
void HistorySticker::initDimensions() {
|
||||||
auto sticker = _data->sticker();
|
auto sticker = _data->sticker();
|
||||||
|
|
||||||
if (!_packLink && sticker && sticker->set.type() != mtpc_inputStickerSetEmpty) {
|
if (!_packLink && sticker && sticker->set.type() != mtpc_inputStickerSetEmpty) {
|
||||||
_packLink = ClickHandlerPtr(new StickerClickHandler(_parent));
|
_packLink = MakeShared<LambdaClickHandler>([document = _data] {
|
||||||
|
if (auto sticker = document->sticker()) {
|
||||||
|
if (sticker->set.type() != mtpc_inputStickerSetEmpty && App::main()) {
|
||||||
|
App::main()->stickersBox(sticker->set);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
_pixw = _data->dimensions.width();
|
_pixw = _data->dimensions.width();
|
||||||
_pixh = _data->dimensions.height();
|
_pixh = _data->dimensions.height();
|
||||||
|
@ -2198,23 +2181,32 @@ int HistorySticker::additionalWidth(const HistoryMessageVia *via, const HistoryM
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendMessageClickHandler::onClickImpl() const {
|
namespace {
|
||||||
Ui::showPeerHistory(peer()->id, ShowAtUnreadMsgId, Ui::ShowWay::Forward);
|
|
||||||
|
ClickHandlerPtr sendMessageClickHandler(PeerData *peer) {
|
||||||
|
return MakeShared<LambdaClickHandler>([peer] {
|
||||||
|
Ui::showPeerHistory(peer->id, ShowAtUnreadMsgId, Ui::ShowWay::Forward);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddContactClickHandler::onClickImpl() const {
|
ClickHandlerPtr addContactClickHandler(HistoryItem *item) {
|
||||||
if (HistoryItem *item = App::histItemById(peerToChannel(peer()), msgid())) {
|
return MakeShared<LambdaClickHandler>([fullId = item->fullId()] {
|
||||||
if (HistoryMedia *media = item->getMedia()) {
|
if (auto item = App::histItemById(fullId)) {
|
||||||
if (media->type() == MediaTypeContact) {
|
if (auto media = item->getMedia()) {
|
||||||
QString fname = static_cast<HistoryContact*>(media)->fname();
|
if (media->type() == MediaTypeContact) {
|
||||||
QString lname = static_cast<HistoryContact*>(media)->lname();
|
auto contact = static_cast<HistoryContact*>(media);
|
||||||
QString phone = static_cast<HistoryContact*>(media)->phone();
|
auto fname = contact->fname();
|
||||||
Ui::showLayer(new AddContactBox(fname, lname, phone));
|
auto lname = contact->lname();
|
||||||
|
auto phone = contact->phone();
|
||||||
|
Ui::showLayer(new AddContactBox(fname, lname, phone));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
HistoryContact::HistoryContact(HistoryItem *parent, int32 userId, const QString &first, const QString &last, const QString &phone) : HistoryMedia(parent)
|
HistoryContact::HistoryContact(HistoryItem *parent, int32 userId, const QString &first, const QString &last, const QString &phone) : HistoryMedia(parent)
|
||||||
, _userId(userId)
|
, _userId(userId)
|
||||||
, _contact(0)
|
, _contact(0)
|
||||||
|
@ -2236,10 +2228,10 @@ void HistoryContact::initDimensions() {
|
||||||
_contact->loadUserpic();
|
_contact->loadUserpic();
|
||||||
}
|
}
|
||||||
if (_contact && _contact->contact > 0) {
|
if (_contact && _contact->contact > 0) {
|
||||||
_linkl.reset(new SendMessageClickHandler(_contact));
|
_linkl = sendMessageClickHandler(_contact);
|
||||||
_link = lang(lng_profile_send_message).toUpper();
|
_link = lang(lng_profile_send_message).toUpper();
|
||||||
} else if (_userId) {
|
} else if (_userId) {
|
||||||
_linkl.reset(new AddContactClickHandler(_parent->history()->peer->id, _parent->id));
|
_linkl = addContactClickHandler(_parent);
|
||||||
_link = lang(lng_profile_add_contact).toUpper();
|
_link = lang(lng_profile_add_contact).toUpper();
|
||||||
}
|
}
|
||||||
_linkw = _link.isEmpty() ? 0 : st::semiboldFont->width(_link);
|
_linkw = _link.isEmpty() ? 0 : st::semiboldFont->width(_link);
|
||||||
|
|
|
@ -898,21 +898,3 @@ private:
|
||||||
int32 fullHeight() const;
|
int32 fullHeight() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SendMessageClickHandler : public PeerClickHandler {
|
|
||||||
public:
|
|
||||||
using PeerClickHandler::PeerClickHandler;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class AddContactClickHandler : public MessageClickHandler {
|
|
||||||
public:
|
|
||||||
using MessageClickHandler::MessageClickHandler;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
|
@ -83,7 +83,9 @@ void historyInitMessages() {
|
||||||
void HistoryMessageVia::create(int32 userId) {
|
void HistoryMessageVia::create(int32 userId) {
|
||||||
_bot = App::user(peerFromUser(userId));
|
_bot = App::user(peerFromUser(userId));
|
||||||
_maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + _bot->username));
|
_maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + _bot->username));
|
||||||
_lnk.reset(new ViaInlineBotClickHandler(_bot));
|
_lnk = MakeShared<LambdaClickHandler>([bot = _bot] {
|
||||||
|
App::insertBotCommand('@' + bot->username);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMessageVia::resize(int32 availw) const {
|
void HistoryMessageVia::resize(int32 availw) const {
|
||||||
|
@ -149,7 +151,7 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
|
||||||
textstyleSet(&st::inFwdTextStyle);
|
textstyleSet(&st::inFwdTextStyle);
|
||||||
_text.setText(st::msgServiceNameFont, text, opts);
|
_text.setText(st::msgServiceNameFont, text, opts);
|
||||||
textstyleRestore();
|
textstyleRestore();
|
||||||
_text.setLink(1, (_originalId && _authorOriginal->isChannel()) ? ClickHandlerPtr(new GoToMessageClickHandler(_authorOriginal->id, _originalId)) : _authorOriginal->openLink());
|
_text.setLink(1, (_originalId && _authorOriginal->isChannel()) ? goToMessageClickHandler(_authorOriginal, _originalId) : _authorOriginal->openLink());
|
||||||
if (via) {
|
if (via) {
|
||||||
_text.setLink(2, via->_lnk);
|
_text.setLink(2, via->_lnk);
|
||||||
}
|
}
|
||||||
|
@ -173,7 +175,7 @@ bool HistoryMessageReply::updateData(HistoryMessage *holder, bool force) {
|
||||||
|
|
||||||
updateName();
|
updateName();
|
||||||
|
|
||||||
replyToLnk.reset(new GoToMessageClickHandler(replyToMsg->history()->peer->id, replyToMsg->id));
|
replyToLnk = goToMessageClickHandler(replyToMsg);
|
||||||
if (!replyToMsg->Has<HistoryMessageForwarded>()) {
|
if (!replyToMsg->Has<HistoryMessageForwarded>()) {
|
||||||
if (auto bot = replyToMsg->viaBot()) {
|
if (auto bot = replyToMsg->viaBot()) {
|
||||||
_replyToVia.reset(new HistoryMessageVia());
|
_replyToVia.reset(new HistoryMessageVia());
|
||||||
|
@ -1760,7 +1762,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto from = textcmdLink(1, _from->name);
|
auto from = textcmdLink(1, _from->name);
|
||||||
|
|
||||||
Links links;
|
Links links;
|
||||||
links.push_back(MakeShared<PeerOpenClickHandler>(_from));
|
links.push_back(peerOpenClickHandler(_from));
|
||||||
|
|
||||||
switch (action.type()) {
|
switch (action.type()) {
|
||||||
case mtpc_messageActionChatAddUser: {
|
case mtpc_messageActionChatAddUser: {
|
||||||
|
@ -1778,7 +1780,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
if (u == _from) {
|
if (u == _from) {
|
||||||
text = lng_action_user_joined(lt_from, from);
|
text = lng_action_user_joined(lt_from, from);
|
||||||
} else {
|
} else {
|
||||||
links.push_back(MakeShared<PeerOpenClickHandler>(u));
|
links.push_back(peerOpenClickHandler(u));
|
||||||
text = lng_action_add_user(lt_from, from, lt_user, textcmdLink(2, u->name));
|
text = lng_action_add_user(lt_from, from, lt_user, textcmdLink(2, u->name));
|
||||||
}
|
}
|
||||||
} else if (v.isEmpty()) {
|
} else if (v.isEmpty()) {
|
||||||
|
@ -1794,7 +1796,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
} else {
|
} else {
|
||||||
text = lng_action_add_users_and_last(lt_accumulated, text, lt_user, linkText);
|
text = lng_action_add_users_and_last(lt_accumulated, text, lt_user, linkText);
|
||||||
}
|
}
|
||||||
links.push_back(MakeShared<PeerOpenClickHandler>(u));
|
links.push_back(peerOpenClickHandler(u));
|
||||||
}
|
}
|
||||||
text = lng_action_add_users_many(lt_from, from, lt_users, text);
|
text = lng_action_add_users_many(lt_from, from, lt_users, text);
|
||||||
}
|
}
|
||||||
|
@ -1811,7 +1813,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
text = lng_action_user_joined_by_link(lt_from, from);
|
text = lng_action_user_joined_by_link(lt_from, from);
|
||||||
//} else {
|
//} else {
|
||||||
// UserData *u = App::user(App::peerFromUser(d.vinviter_id));
|
// UserData *u = App::user(App::peerFromUser(d.vinviter_id));
|
||||||
// links.push_back(MakeShared<PeerOpenClickHandler>(u));
|
// links.push_back(peerOpenClickHandler(u));
|
||||||
// text = lng_action_user_joined_by_link_from(lt_from, from, lt_inviter, textcmdLink(2, u->name));
|
// text = lng_action_user_joined_by_link_from(lt_from, from, lt_inviter, textcmdLink(2, u->name));
|
||||||
//}
|
//}
|
||||||
if (_from->isSelf() && history()->peer->isMegagroup()) {
|
if (_from->isSelf() && history()->peer->isMegagroup()) {
|
||||||
|
@ -1847,7 +1849,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
text = lng_action_user_left(lt_from, from);
|
text = lng_action_user_left(lt_from, from);
|
||||||
} else {
|
} else {
|
||||||
auto u = App::user(peerFromUser(d.vuser_id));
|
auto u = App::user(peerFromUser(d.vuser_id));
|
||||||
links.push_back(MakeShared<PeerOpenClickHandler>(u));
|
links.push_back(peerOpenClickHandler(u));
|
||||||
text = lng_action_kick_user(lt_from, from, lt_user, textcmdLink(2, u->name));
|
text = lng_action_kick_user(lt_from, from, lt_user, textcmdLink(2, u->name));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -1913,7 +1915,7 @@ bool HistoryService::updateDependent(bool force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dependent->lnk) {
|
if (!dependent->lnk) {
|
||||||
dependent->lnk.reset(new GoToMessageClickHandler(history()->peer->id, dependent->msgId));
|
dependent->lnk = goToMessageClickHandler(history()->peer, dependent->msgId);
|
||||||
}
|
}
|
||||||
bool gotDependencyItem = false;
|
bool gotDependencyItem = false;
|
||||||
if (!dependent->msg) {
|
if (!dependent->msg) {
|
||||||
|
@ -2312,7 +2314,7 @@ bool HistoryService::updateDependentText() {
|
||||||
auto from = textcmdLink(1, _from->name);
|
auto from = textcmdLink(1, _from->name);
|
||||||
QString text;
|
QString text;
|
||||||
Links links;
|
Links links;
|
||||||
links.push_back(MakeShared<PeerOpenClickHandler>(_from));
|
links.push_back(peerOpenClickHandler(_from));
|
||||||
if (Has<HistoryServicePinned>()) {
|
if (Has<HistoryServicePinned>()) {
|
||||||
result = preparePinnedText(from, &text, &links);
|
result = preparePinnedText(from, &text, &links);
|
||||||
} else if (Has<HistoryServiceGameScore>()) {
|
} else if (Has<HistoryServiceGameScore>()) {
|
||||||
|
@ -2352,7 +2354,7 @@ HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, User
|
||||||
if (peerToUser(inviter->id) == MTP::authedId()) {
|
if (peerToUser(inviter->id) == MTP::authedId()) {
|
||||||
return lang(history->isMegagroup() ? lng_action_you_joined_group : lng_action_you_joined);
|
return lang(history->isMegagroup() ? lng_action_you_joined_group : lng_action_you_joined);
|
||||||
}
|
}
|
||||||
links.push_back(MakeShared<PeerOpenClickHandler>(inviter));
|
links.push_back(peerOpenClickHandler(inviter));
|
||||||
if (history->isMegagroup()) {
|
if (history->isMegagroup()) {
|
||||||
return lng_action_add_you_group(lt_from, textcmdLink(1, inviter->name));
|
return lng_action_add_you_group(lt_from, textcmdLink(1, inviter->name));
|
||||||
}
|
}
|
||||||
|
@ -2360,7 +2362,3 @@ HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, User
|
||||||
})();
|
})();
|
||||||
setServiceText(text, links);
|
setServiceText(text, links);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViaInlineBotClickHandler::onClickImpl() const {
|
|
||||||
App::insertBotCommand('@' + _bot->username);
|
|
||||||
}
|
|
||||||
|
|
|
@ -366,16 +366,3 @@ protected:
|
||||||
friend class HistoryItemInstantiated<HistoryJoined>;
|
friend class HistoryItemInstantiated<HistoryJoined>;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ViaInlineBotClickHandler : public LeftButtonClickHandler {
|
|
||||||
public:
|
|
||||||
ViaInlineBotClickHandler(UserData *bot) : _bot(bot) {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
UserData *_bot;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ ApiWrap::RequestMessageDataCallback replyEditMessageDataCallback() {
|
||||||
|
|
||||||
// flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
|
// flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
|
||||||
|
|
||||||
HistoryInner::HistoryInner(HistoryWidget *historyWidget, ScrollArea *scroll, History *history) : TWidget(nullptr)
|
HistoryInner::HistoryInner(HistoryWidget *historyWidget, Ui::ScrollArea *scroll, History *history) : TWidget(nullptr)
|
||||||
, _peer(history->peer)
|
, _peer(history->peer)
|
||||||
, _migrated(history->peer->migrateFrom() ? App::history(history->peer->migrateFrom()->id) : nullptr)
|
, _migrated(history->peer->migrateFrom() ? App::history(history->peer->migrateFrom()->id) : nullptr)
|
||||||
, _history(history)
|
, _history(history)
|
||||||
|
@ -567,16 +567,16 @@ bool HistoryInner::event(QEvent *e) {
|
||||||
|
|
||||||
void HistoryInner::onTouchScrollTimer() {
|
void HistoryInner::onTouchScrollTimer() {
|
||||||
uint64 nowTime = getms();
|
uint64 nowTime = getms();
|
||||||
if (_touchScrollState == TouchScrollAcceleration && _touchWaitingAcceleration && (nowTime - _touchAccelerationTime) > 40) {
|
if (_touchScrollState == Ui::TouchScrollState::Acceleration && _touchWaitingAcceleration && (nowTime - _touchAccelerationTime) > 40) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
touchResetSpeed();
|
touchResetSpeed();
|
||||||
} else if (_touchScrollState == TouchScrollAuto || _touchScrollState == TouchScrollAcceleration) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Auto || _touchScrollState == Ui::TouchScrollState::Acceleration) {
|
||||||
int32 elapsed = int32(nowTime - _touchTime);
|
int32 elapsed = int32(nowTime - _touchTime);
|
||||||
QPoint delta = _touchSpeed * elapsed / 1000;
|
QPoint delta = _touchSpeed * elapsed / 1000;
|
||||||
bool hasScrolled = _widget->touchScroll(delta);
|
bool hasScrolled = _widget->touchScroll(delta);
|
||||||
|
|
||||||
if (_touchSpeed.isNull() || !hasScrolled) {
|
if (_touchSpeed.isNull() || !hasScrolled) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
_touchScroll = false;
|
_touchScroll = false;
|
||||||
_touchScrollTimer.stop();
|
_touchScrollTimer.stop();
|
||||||
} else {
|
} else {
|
||||||
|
@ -598,7 +598,7 @@ void HistoryInner::touchUpdateSpeed() {
|
||||||
// of a small horizontal offset when scrolling vertically
|
// of a small horizontal offset when scrolling vertically
|
||||||
const int newSpeedY = (qAbs(pixelsPerSecond.y()) > FingerAccuracyThreshold) ? pixelsPerSecond.y() : 0;
|
const int newSpeedY = (qAbs(pixelsPerSecond.y()) > FingerAccuracyThreshold) ? pixelsPerSecond.y() : 0;
|
||||||
const int newSpeedX = (qAbs(pixelsPerSecond.x()) > FingerAccuracyThreshold) ? pixelsPerSecond.x() : 0;
|
const int newSpeedX = (qAbs(pixelsPerSecond.x()) > FingerAccuracyThreshold) ? pixelsPerSecond.x() : 0;
|
||||||
if (_touchScrollState == TouchScrollAuto) {
|
if (_touchScrollState == Ui::TouchScrollState::Auto) {
|
||||||
const int oldSpeedY = _touchSpeed.y();
|
const int oldSpeedY = _touchSpeed.y();
|
||||||
const int oldSpeedX = _touchSpeed.x();
|
const int oldSpeedX = _touchSpeed.x();
|
||||||
if ((oldSpeedY <= 0 && newSpeedY <= 0) || ((oldSpeedY >= 0 && newSpeedY >= 0)
|
if ((oldSpeedY <= 0 && newSpeedY <= 0) || ((oldSpeedY >= 0 && newSpeedY >= 0)
|
||||||
|
@ -644,7 +644,7 @@ void HistoryInner::touchEvent(QTouchEvent *e) {
|
||||||
_touchInProgress = false;
|
_touchInProgress = false;
|
||||||
_touchSelectTimer.stop();
|
_touchSelectTimer.stop();
|
||||||
_touchScroll = _touchSelect = false;
|
_touchScroll = _touchSelect = false;
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
dragActionCancel();
|
dragActionCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -664,8 +664,8 @@ void HistoryInner::touchEvent(QTouchEvent *e) {
|
||||||
if (e->touchPoints().isEmpty()) return;
|
if (e->touchPoints().isEmpty()) return;
|
||||||
|
|
||||||
_touchInProgress = true;
|
_touchInProgress = true;
|
||||||
if (_touchScrollState == TouchScrollAuto) {
|
if (_touchScrollState == Ui::TouchScrollState::Auto) {
|
||||||
_touchScrollState = TouchScrollAcceleration;
|
_touchScrollState = Ui::TouchScrollState::Acceleration;
|
||||||
_touchWaitingAcceleration = true;
|
_touchWaitingAcceleration = true;
|
||||||
_touchAccelerationTime = getms();
|
_touchAccelerationTime = getms();
|
||||||
touchUpdateSpeed();
|
touchUpdateSpeed();
|
||||||
|
@ -688,13 +688,13 @@ void HistoryInner::touchEvent(QTouchEvent *e) {
|
||||||
touchUpdateSpeed();
|
touchUpdateSpeed();
|
||||||
}
|
}
|
||||||
if (_touchScroll) {
|
if (_touchScroll) {
|
||||||
if (_touchScrollState == TouchScrollManual) {
|
if (_touchScrollState == Ui::TouchScrollState::Manual) {
|
||||||
touchScrollUpdated(_touchPos);
|
touchScrollUpdated(_touchPos);
|
||||||
} else if (_touchScrollState == TouchScrollAcceleration) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Acceleration) {
|
||||||
touchUpdateSpeed();
|
touchUpdateSpeed();
|
||||||
_touchAccelerationTime = getms();
|
_touchAccelerationTime = getms();
|
||||||
if (_touchSpeed.isNull()) {
|
if (_touchSpeed.isNull()) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -709,17 +709,17 @@ void HistoryInner::touchEvent(QTouchEvent *e) {
|
||||||
showContextMenu(&contextMenu, true);
|
showContextMenu(&contextMenu, true);
|
||||||
_touchScroll = false;
|
_touchScroll = false;
|
||||||
} else if (_touchScroll) {
|
} else if (_touchScroll) {
|
||||||
if (_touchScrollState == TouchScrollManual) {
|
if (_touchScrollState == Ui::TouchScrollState::Manual) {
|
||||||
_touchScrollState = TouchScrollAuto;
|
_touchScrollState = Ui::TouchScrollState::Auto;
|
||||||
_touchPrevPosValid = false;
|
_touchPrevPosValid = false;
|
||||||
_touchScrollTimer.start(15);
|
_touchScrollTimer.start(15);
|
||||||
_touchTime = getms();
|
_touchTime = getms();
|
||||||
} else if (_touchScrollState == TouchScrollAuto) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Auto) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
_touchScroll = false;
|
_touchScroll = false;
|
||||||
touchResetSpeed();
|
touchResetSpeed();
|
||||||
} else if (_touchScrollState == TouchScrollAcceleration) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Acceleration) {
|
||||||
_touchScrollState = TouchScrollAuto;
|
_touchScrollState = Ui::TouchScrollState::Auto;
|
||||||
_touchWaitingAcceleration = false;
|
_touchWaitingAcceleration = false;
|
||||||
_touchPrevPosValid = false;
|
_touchPrevPosValid = false;
|
||||||
}
|
}
|
||||||
|
@ -2421,7 +2421,8 @@ void ReportSpamPanel::setReported(bool reported, PeerData *onPeer) {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
BotKeyboard::BotKeyboard() {
|
BotKeyboard::BotKeyboard(QWidget *parent) : TWidget(parent)
|
||||||
|
, _st(&st::botKbButton) {
|
||||||
setGeometry(0, 0, _st->margin, st::botKbScroll.deltat);
|
setGeometry(0, 0, _st->margin, st::botKbScroll.deltat);
|
||||||
_height = st::botKbScroll.deltat;
|
_height = st::botKbScroll.deltat;
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
@ -3037,6 +3038,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
|
||||||
, a_recordCancelActive(0, 0)
|
, a_recordCancelActive(0, 0)
|
||||||
, _recordCancelWidth(st::historyRecordFont->width(lang(lng_record_cancel)))
|
, _recordCancelWidth(st::historyRecordFont->width(lang(lng_record_cancel)))
|
||||||
, _kbScroll(this, st::botKbScroll)
|
, _kbScroll(this, st::botKbScroll)
|
||||||
|
, _keyboard(this)
|
||||||
, _attachType(this, st::historyAttachDropdownMenu)
|
, _attachType(this, st::historyAttachDropdownMenu)
|
||||||
, _emojiPan(this)
|
, _emojiPan(this)
|
||||||
, _attachDragDocument(this)
|
, _attachDragDocument(this)
|
||||||
|
@ -3047,10 +3049,10 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
|
||||||
subscribe(FileDownload::ImageLoaded(), [this] { update(); });
|
subscribe(FileDownload::ImageLoaded(), [this] { update(); });
|
||||||
connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||||
connect(&_reportSpamPanel, SIGNAL(reportClicked()), this, SLOT(onReportSpamClicked()));
|
connect(_reportSpamPanel, SIGNAL(reportClicked()), this, SLOT(onReportSpamClicked()));
|
||||||
connect(&_reportSpamPanel, SIGNAL(hideClicked()), this, SLOT(onReportSpamHide()));
|
connect(_reportSpamPanel, SIGNAL(hideClicked()), this, SLOT(onReportSpamHide()));
|
||||||
connect(&_reportSpamPanel, SIGNAL(clearClicked()), this, SLOT(onReportSpamClear()));
|
connect(_reportSpamPanel, SIGNAL(clearClicked()), this, SLOT(onReportSpamClear()));
|
||||||
connect(_historyToEnd, SIGNAL(clicked()), this, SLOT(onHistoryToEnd()));
|
connect(_historyToEnd, SIGNAL(clicked()), this, SLOT(onHistoryToEnd()));
|
||||||
connect(_fieldBarCancel, SIGNAL(clicked()), this, SLOT(onFieldBarCancel()));
|
connect(_fieldBarCancel, SIGNAL(clicked()), this, SLOT(onFieldBarCancel()));
|
||||||
connect(_send, SIGNAL(clicked()), this, SLOT(onSend()));
|
connect(_send, SIGNAL(clicked()), this, SLOT(onSend()));
|
||||||
|
@ -3117,10 +3119,10 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
|
||||||
|
|
||||||
_fieldBarCancel->hide();
|
_fieldBarCancel->hide();
|
||||||
|
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
|
|
||||||
_kbScroll.setWidget(&_keyboard);
|
_kbScroll->setOwnedWidget(_keyboard);
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
|
|
||||||
updateScrollColors();
|
updateScrollColors();
|
||||||
|
|
||||||
|
@ -3143,8 +3145,8 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
|
||||||
_joinChannel->hide();
|
_joinChannel->hide();
|
||||||
_muteUnmute->hide();
|
_muteUnmute->hide();
|
||||||
|
|
||||||
_reportSpamPanel.move(0, 0);
|
_reportSpamPanel->move(0, 0);
|
||||||
_reportSpamPanel.hide();
|
_reportSpamPanel->hide();
|
||||||
|
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_attachEmoji->hide();
|
_attachEmoji->hide();
|
||||||
|
@ -3509,7 +3511,7 @@ void HistoryWidget::activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::setInnerFocus() {
|
void HistoryWidget::setInnerFocus() {
|
||||||
if (_scroll.isHidden()) {
|
if (_scroll->isHidden()) {
|
||||||
setFocus();
|
setFocus();
|
||||||
} else if (_list) {
|
} else if (_list) {
|
||||||
if (_selCount || (_list && _list->wasSelectedText()) || _recording || isBotStart() || isBlocked() || !_canSendMessages) {
|
if (_selCount || (_list && _list->wasSelectedText()) || _recording || isBotStart() || isBlocked() || !_canSendMessages) {
|
||||||
|
@ -3588,7 +3590,7 @@ void HistoryWidget::notify_inlineBotRequesting(bool requesting) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::notify_replyMarkupUpdated(const HistoryItem *item) {
|
void HistoryWidget::notify_replyMarkupUpdated(const HistoryItem *item) {
|
||||||
if (_keyboard.forMsgId() == item->fullId()) {
|
if (_keyboard->forMsgId() == item->fullId()) {
|
||||||
updateBotKeyboard(item->history(), true);
|
updateBotKeyboard(item->history(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4248,7 +4250,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
|
||||||
_membersDropdownShowTimer.stop();
|
_membersDropdownShowTimer.stop();
|
||||||
if (_list) _list->deleteLater();
|
if (_list) _list->deleteLater();
|
||||||
_list = nullptr;
|
_list = nullptr;
|
||||||
_scroll.takeWidget();
|
_scroll->takeWidget();
|
||||||
|
|
||||||
clearInlineBot();
|
clearInlineBot();
|
||||||
|
|
||||||
|
@ -4312,10 +4314,10 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_list = new HistoryInner(this, &_scroll, _history);
|
_list = new HistoryInner(this, _scroll, _history);
|
||||||
_list->hide();
|
_list->hide();
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
_scroll.setWidget(_list);
|
_scroll->setWidget(_list);
|
||||||
_list->show();
|
_list->show();
|
||||||
|
|
||||||
_updateHistoryItems.stop();
|
_updateHistoryItems.stop();
|
||||||
|
@ -4343,7 +4345,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
|
||||||
onPreviewParse();
|
onPreviewParse();
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(&_scroll, SIGNAL(geometryChanged()), _list, SLOT(onParentGeometryChanged()));
|
connect(_scroll, SIGNAL(geometryChanged()), _list, SLOT(onParentGeometryChanged()));
|
||||||
|
|
||||||
if (startBot && _peer->isUser() && _peer->asUser()->botInfo) {
|
if (startBot && _peer->isUser() && _peer->asUser()->botInfo) {
|
||||||
if (wasHistory) _peer->asUser()->botInfo->inlineReturnPeerId = wasHistory->peer->id;
|
if (wasHistory) _peer->asUser()->botInfo->inlineReturnPeerId = wasHistory->peer->id;
|
||||||
|
@ -4446,7 +4448,7 @@ void HistoryWidget::updateReportSpamStatus() {
|
||||||
} else if (_reportSpamStatus == dbiprsShowButton) {
|
} else if (_reportSpamStatus == dbiprsShowButton) {
|
||||||
requestReportSpamSetting();
|
requestReportSpamSetting();
|
||||||
}
|
}
|
||||||
_reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent, _peer);
|
_reportSpamPanel->setReported(_reportSpamStatus == dbiprsReportSent, _peer);
|
||||||
return;
|
return;
|
||||||
} else if (_peer->migrateFrom()) { // migrate report status
|
} else if (_peer->migrateFrom()) { // migrate report status
|
||||||
i = cReportSpamStatuses().constFind(_peer->migrateFrom()->id);
|
i = cReportSpamStatuses().constFind(_peer->migrateFrom()->id);
|
||||||
|
@ -4463,7 +4465,7 @@ void HistoryWidget::updateReportSpamStatus() {
|
||||||
cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus);
|
cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus);
|
||||||
Local::writeReportSpamStatuses();
|
Local::writeReportSpamStatuses();
|
||||||
|
|
||||||
_reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent, _peer);
|
_reportSpamPanel->setReported(_reportSpamStatus == dbiprsReportSent, _peer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4477,7 +4479,7 @@ void HistoryWidget::updateReportSpamStatus() {
|
||||||
requestReportSpamSetting();
|
requestReportSpamSetting();
|
||||||
}
|
}
|
||||||
if (_reportSpamStatus == dbiprsHidden) {
|
if (_reportSpamStatus == dbiprsHidden) {
|
||||||
_reportSpamPanel.setReported(false, _peer);
|
_reportSpamPanel->setReported(false, _peer);
|
||||||
cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus);
|
cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus);
|
||||||
Local::writeReportSpamStatuses();
|
Local::writeReportSpamStatuses();
|
||||||
}
|
}
|
||||||
|
@ -4498,7 +4500,7 @@ void HistoryWidget::reportSpamSettingDone(const MTPPeerSettings &result, mtpRequ
|
||||||
DBIPeerReportSpamStatus status = d.is_report_spam() ? dbiprsShowButton : dbiprsHidden;
|
DBIPeerReportSpamStatus status = d.is_report_spam() ? dbiprsShowButton : dbiprsHidden;
|
||||||
if (status != _reportSpamStatus) {
|
if (status != _reportSpamStatus) {
|
||||||
_reportSpamStatus = status;
|
_reportSpamStatus = status;
|
||||||
_reportSpamPanel.setReported(false, _peer);
|
_reportSpamPanel->setReported(false, _peer);
|
||||||
|
|
||||||
cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus);
|
cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus);
|
||||||
Local::writeReportSpamStatuses();
|
Local::writeReportSpamStatuses();
|
||||||
|
@ -4530,9 +4532,9 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
}
|
}
|
||||||
updateToEndVisibility();
|
updateToEndVisibility();
|
||||||
if (!_history || _a_show.animating()) {
|
if (!_history || _a_show.animating()) {
|
||||||
_reportSpamPanel.hide();
|
_reportSpamPanel->hide();
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_send->hide();
|
_send->hide();
|
||||||
if (_inlineBotCancel) _inlineBotCancel->hide();
|
if (_inlineBotCancel) _inlineBotCancel->hide();
|
||||||
_unblock->hide();
|
_unblock->hide();
|
||||||
|
@ -4562,15 +4564,15 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_pinnedBar->cancel->show();
|
_pinnedBar->cancel->show();
|
||||||
_pinnedBar->shadow->show();
|
_pinnedBar->shadow->show();
|
||||||
}
|
}
|
||||||
if (_firstLoadRequest && !_scroll.isHidden()) {
|
if (_firstLoadRequest && !_scroll->isHidden()) {
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
} else if (!_firstLoadRequest && _scroll.isHidden()) {
|
} else if (!_firstLoadRequest && _scroll->isHidden()) {
|
||||||
_scroll.show();
|
_scroll->show();
|
||||||
}
|
}
|
||||||
if (_reportSpamStatus == dbiprsShowButton || _reportSpamStatus == dbiprsReportSent) {
|
if (_reportSpamStatus == dbiprsShowButton || _reportSpamStatus == dbiprsReportSent) {
|
||||||
_reportSpamPanel.show();
|
_reportSpamPanel->show();
|
||||||
} else {
|
} else {
|
||||||
_reportSpamPanel.hide();
|
_reportSpamPanel->hide();
|
||||||
}
|
}
|
||||||
if (isBlocked() || isJoinChannel() || isMuteUnmute()) {
|
if (isBlocked() || isJoinChannel() || isMuteUnmute()) {
|
||||||
if (isBlocked()) {
|
if (isBlocked()) {
|
||||||
|
@ -4602,7 +4604,7 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_botStart->hide();
|
_botStart->hide();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_silent->hide();
|
_silent->hide();
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_fieldBarCancel->hide();
|
_fieldBarCancel->hide();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_attachEmoji->hide();
|
_attachEmoji->hide();
|
||||||
|
@ -4636,7 +4638,7 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_silent->hide();
|
_silent->hide();
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_fieldBarCancel->hide();
|
_fieldBarCancel->hide();
|
||||||
} else {
|
} else {
|
||||||
_unblock->hide();
|
_unblock->hide();
|
||||||
|
@ -4665,29 +4667,29 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_silent->hide();
|
_silent->hide();
|
||||||
if (_kbShown) {
|
if (_kbShown) {
|
||||||
_kbScroll.show();
|
_kbScroll->show();
|
||||||
} else {
|
} else {
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_field->show();
|
_field->show();
|
||||||
if (_kbShown) {
|
if (_kbShown) {
|
||||||
_kbScroll.show();
|
_kbScroll->show();
|
||||||
_attachEmoji->hide();
|
_attachEmoji->hide();
|
||||||
_botKeyboardHide->show();
|
_botKeyboardHide->show();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
} else if (_kbReplyTo) {
|
} else if (_kbReplyTo) {
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_attachEmoji->show();
|
_attachEmoji->show();
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
} else {
|
} else {
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_attachEmoji->show();
|
_attachEmoji->show();
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
if (_keyboard.hasMarkup()) {
|
if (_keyboard->hasMarkup()) {
|
||||||
_botKeyboardShow->show();
|
_botKeyboardShow->show();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
} else {
|
} else {
|
||||||
|
@ -4727,7 +4729,7 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_muteUnmute->hide();
|
_muteUnmute->hide();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_silent->hide();
|
_silent->hide();
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_fieldBarCancel->hide();
|
_fieldBarCancel->hide();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_attachEmoji->hide();
|
_attachEmoji->hide();
|
||||||
|
@ -4736,7 +4738,7 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
_attachType->hide();
|
_attachType->hide();
|
||||||
_emojiPan->hide();
|
_emojiPan->hide();
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
if (!_field->isHidden()) {
|
if (!_field->isHidden()) {
|
||||||
_field->hide();
|
_field->hide();
|
||||||
resizeEvent(0);
|
resizeEvent(0);
|
||||||
|
@ -4758,7 +4760,7 @@ void HistoryWidget::destroyUnreadBar() {
|
||||||
|
|
||||||
void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) {
|
void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) {
|
||||||
if (_history == history) {
|
if (_history == history) {
|
||||||
if (_scroll.scrollTop() + 1 > _scroll.scrollTopMax()) {
|
if (_scroll->scrollTop() + 1 > _scroll->scrollTopMax()) {
|
||||||
destroyUnreadBar();
|
destroyUnreadBar();
|
||||||
}
|
}
|
||||||
if (App::wnd()->doWeReadServerHistory()) {
|
if (App::wnd()->doWeReadServerHistory()) {
|
||||||
|
@ -4776,7 +4778,7 @@ void HistoryWidget::historyToDown(History *history) {
|
||||||
migrated->forgetScrollState();
|
migrated->forgetScrollState();
|
||||||
}
|
}
|
||||||
if (history == _history) {
|
if (history == _history) {
|
||||||
_scroll.scrollToY(_scroll.scrollTopMax());
|
_scroll->scrollToY(_scroll->scrollTopMax());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4958,12 +4960,12 @@ bool HistoryWidget::doWeReadServerHistory() const {
|
||||||
if (!_history || !_list) return true;
|
if (!_history || !_list) return true;
|
||||||
if (_firstLoadRequest || _a_show.animating()) return false;
|
if (_firstLoadRequest || _a_show.animating()) return false;
|
||||||
if (_history->loadedAtBottom()) {
|
if (_history->loadedAtBottom()) {
|
||||||
int scrollTop = _scroll.scrollTop();
|
int scrollTop = _scroll->scrollTop();
|
||||||
if (scrollTop + 1 > _scroll.scrollTopMax()) return true;
|
if (scrollTop + 1 > _scroll->scrollTopMax()) return true;
|
||||||
|
|
||||||
auto showFrom = (_migrated && _migrated->showFrom) ? _migrated->showFrom : (_history ? _history->showFrom : nullptr);
|
auto showFrom = (_migrated && _migrated->showFrom) ? _migrated->showFrom : (_history ? _history->showFrom : nullptr);
|
||||||
if (showFrom && !showFrom->detached()) {
|
if (showFrom && !showFrom->detached()) {
|
||||||
int scrollBottom = scrollTop + _scroll.height();
|
int scrollBottom = scrollTop + _scroll->height();
|
||||||
if (scrollBottom > _list->itemTop(showFrom)) return true;
|
if (scrollBottom > _list->itemTop(showFrom)) return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5110,9 +5112,9 @@ void HistoryWidget::onScroll() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::visibleAreaUpdated() {
|
void HistoryWidget::visibleAreaUpdated() {
|
||||||
if (_list && !_scroll.isHidden()) {
|
if (_list && !_scroll->isHidden()) {
|
||||||
int scrollTop = _scroll.scrollTop();
|
int scrollTop = _scroll->scrollTop();
|
||||||
int scrollBottom = scrollTop + _scroll.height();
|
int scrollBottom = scrollTop + _scroll->height();
|
||||||
_list->visibleAreaUpdated(scrollTop, scrollBottom);
|
_list->visibleAreaUpdated(scrollTop, scrollBottom);
|
||||||
if (_history->loadedAtBottom() && (_history->unreadCount() > 0 || (_migrated && _migrated->unreadCount() > 0))) {
|
if (_history->loadedAtBottom() && (_history->unreadCount() > 0 || (_migrated && _migrated->unreadCount() > 0))) {
|
||||||
auto showFrom = (_migrated && _migrated->showFrom) ? _migrated->showFrom : (_history ? _history->showFrom : nullptr);
|
auto showFrom = (_migrated && _migrated->showFrom) ? _migrated->showFrom : (_history ? _history->showFrom : nullptr);
|
||||||
|
@ -5124,11 +5126,11 @@ void HistoryWidget::visibleAreaUpdated() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::preloadHistoryIfNeeded() {
|
void HistoryWidget::preloadHistoryIfNeeded() {
|
||||||
if (_firstLoadRequest || _scroll.isHidden() || !_peer) return;
|
if (_firstLoadRequest || _scroll->isHidden() || !_peer) return;
|
||||||
|
|
||||||
updateToEndVisibility();
|
updateToEndVisibility();
|
||||||
|
|
||||||
int st = _scroll.scrollTop(), stm = _scroll.scrollTopMax(), sh = _scroll.height();
|
int st = _scroll->scrollTop(), stm = _scroll->scrollTopMax(), sh = _scroll->height();
|
||||||
if (st + PreloadHeightsCount * sh > stm) {
|
if (st + PreloadHeightsCount * sh > stm) {
|
||||||
loadMessagesDown();
|
loadMessagesDown();
|
||||||
}
|
}
|
||||||
|
@ -5287,7 +5289,7 @@ void HistoryWidget::onSend(bool ctrlShiftEnter, MsgId replyTo) {
|
||||||
if (_previewData && _previewData->pendingTill) previewCancel();
|
if (_previewData && _previewData->pendingTill) previewCancel();
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
|
|
||||||
if (!_keyboard.hasMarkup() && _keyboard.forceReply() && !_kbReplyTo) onKbToggle();
|
if (!_keyboard->hasMarkup() && _keyboard->forceReply() && !_kbReplyTo) onKbToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::onUnblock() {
|
void HistoryWidget::onUnblock() {
|
||||||
|
@ -5335,11 +5337,11 @@ void HistoryWidget::onBotStart() {
|
||||||
MTP::send(MTPmessages_StartBot(_peer->asUser()->inputUser, MTP_inputPeerEmpty(), MTP_long(randomId), MTP_string(token)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _peer->asUser()));
|
MTP::send(MTPmessages_StartBot(_peer->asUser()->inputUser, MTP_inputPeerEmpty(), MTP_long(randomId), MTP_string(token)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _peer->asUser()));
|
||||||
|
|
||||||
_peer->asUser()->botInfo->startToken = QString();
|
_peer->asUser()->botInfo->startToken = QString();
|
||||||
if (_keyboard.hasMarkup()) {
|
if (_keyboard->hasMarkup()) {
|
||||||
if (_keyboard.singleUse() && _keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _history->lastKeyboardUsed) {
|
if (_keyboard->singleUse() && _keyboard->forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _history->lastKeyboardUsed) {
|
||||||
_history->lastKeyboardHiddenId = _history->lastKeyboardId;
|
_history->lastKeyboardHiddenId = _history->lastKeyboardId;
|
||||||
}
|
}
|
||||||
if (!kbWasHidden()) _kbShown = _keyboard.hasMarkup();
|
if (!kbWasHidden()) _kbShown = _keyboard->hasMarkup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateControlsVisibility();
|
updateControlsVisibility();
|
||||||
|
@ -5479,9 +5481,9 @@ void HistoryWidget::showAnimated(Window::SlideDirection direction, const Window:
|
||||||
App::main()->topBar()->startAnim();
|
App::main()->topBar()->startAnim();
|
||||||
_topShadow->setVisible(params.withTopBarShadow ? true : false);
|
_topShadow->setVisible(params.withTopBarShadow ? true : false);
|
||||||
|
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_reportSpamPanel.hide();
|
_reportSpamPanel->hide();
|
||||||
_historyToEnd->hide();
|
_historyToEnd->hide();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
_attachEmoji->hide();
|
_attachEmoji->hide();
|
||||||
|
@ -5684,7 +5686,7 @@ void HistoryWidget::leaveEvent(QEvent *e) {
|
||||||
void HistoryWidget::mouseMoveEvent(QMouseEvent *e) {
|
void HistoryWidget::mouseMoveEvent(QMouseEvent *e) {
|
||||||
QPoint pos(e ? e->pos() : mapFromGlobal(QCursor::pos()));
|
QPoint pos(e ? e->pos() : mapFromGlobal(QCursor::pos()));
|
||||||
bool inRecord = _send->geometry().contains(pos);
|
bool inRecord = _send->geometry().contains(pos);
|
||||||
bool inField = pos.y() >= (_scroll.y() + _scroll.height()) && pos.y() < height() && pos.x() >= 0 && pos.x() < width();
|
bool inField = pos.y() >= (_scroll->y() + _scroll->height()) && pos.y() < height() && pos.x() >= 0 && pos.x() < width();
|
||||||
bool inReplyEdit = QRect(st::historyReplySkip, _field->y() - st::historySendPadding - st::historyReplyHeight, width() - st::historyReplySkip - _fieldBarCancel->width(), st::historyReplyHeight).contains(pos) && (_editMsgId || replyToId());
|
bool inReplyEdit = QRect(st::historyReplySkip, _field->y() - st::historySendPadding - st::historyReplyHeight, width() - st::historyReplySkip - _fieldBarCancel->width(), st::historyReplyHeight).contains(pos) && (_editMsgId || replyToId());
|
||||||
bool inPinnedMsg = QRect(0, 0, width(), st::historyReplyHeight).contains(pos) && _pinnedBar;
|
bool inPinnedMsg = QRect(0, 0, width(), st::historyReplyHeight).contains(pos) && _pinnedBar;
|
||||||
if (inRecord != _inRecord) {
|
if (inRecord != _inRecord) {
|
||||||
|
@ -5750,7 +5752,7 @@ void HistoryWidget::stopRecording(bool send) {
|
||||||
void HistoryWidget::sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo) { // replyTo != 0 from ReplyKeyboardMarkup, == 0 from cmd links
|
void HistoryWidget::sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo) { // replyTo != 0 from ReplyKeyboardMarkup, == 0 from cmd links
|
||||||
if (!_peer || _peer != peer) return;
|
if (!_peer || _peer != peer) return;
|
||||||
|
|
||||||
bool lastKeyboardUsed = (_keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard.forMsgId() == FullMsgId(_channel, replyTo));
|
bool lastKeyboardUsed = (_keyboard->forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard->forMsgId() == FullMsgId(_channel, replyTo));
|
||||||
|
|
||||||
QString toSend = cmd;
|
QString toSend = cmd;
|
||||||
if (bot && (!bot->isUser() || !bot->asUser()->botInfo)) {
|
if (bot && (!bot->isUser() || !bot->asUser()->botInfo)) {
|
||||||
|
@ -5773,7 +5775,7 @@ void HistoryWidget::sendBotCommand(PeerData *peer, UserData *bot, const QString
|
||||||
cancelReply();
|
cancelReply();
|
||||||
onCloudDraftSave();
|
onCloudDraftSave();
|
||||||
}
|
}
|
||||||
if (_keyboard.singleUse() && _keyboard.hasMarkup() && lastKeyboardUsed) {
|
if (_keyboard->singleUse() && _keyboard->hasMarkup() && lastKeyboardUsed) {
|
||||||
if (_kbShown) onKbToggle(false);
|
if (_kbShown) onKbToggle(false);
|
||||||
_history->lastKeyboardUsed = true;
|
_history->lastKeyboardUsed = true;
|
||||||
}
|
}
|
||||||
|
@ -5787,7 +5789,7 @@ void HistoryWidget::app_sendBotCallback(const HistoryMessageReplyMarkup::Button
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lastKeyboardUsed = (_keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard.forMsgId() == FullMsgId(_channel, msg->id));
|
bool lastKeyboardUsed = (_keyboard->forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard->forMsgId() == FullMsgId(_channel, msg->id));
|
||||||
|
|
||||||
auto bot = msg->getMessageBot();
|
auto bot = msg->getMessageBot();
|
||||||
|
|
||||||
|
@ -5807,7 +5809,7 @@ void HistoryWidget::app_sendBotCallback(const HistoryMessageReplyMarkup::Button
|
||||||
if (_replyToId == msg->id) {
|
if (_replyToId == msg->id) {
|
||||||
cancelReply();
|
cancelReply();
|
||||||
}
|
}
|
||||||
if (_keyboard.singleUse() && _keyboard.hasMarkup() && lastKeyboardUsed) {
|
if (_keyboard->singleUse() && _keyboard->hasMarkup() && lastKeyboardUsed) {
|
||||||
if (_kbShown) onKbToggle(false);
|
if (_kbShown) onKbToggle(false);
|
||||||
_history->lastKeyboardUsed = true;
|
_history->lastKeyboardUsed = true;
|
||||||
}
|
}
|
||||||
|
@ -5917,7 +5919,7 @@ bool HistoryWidget::insertBotCommand(const QString &cmd, bool specialGif) {
|
||||||
|
|
||||||
bool HistoryWidget::eventFilter(QObject *obj, QEvent *e) {
|
bool HistoryWidget::eventFilter(QObject *obj, QEvent *e) {
|
||||||
if (obj == _historyToEnd && e->type() == QEvent::Wheel) {
|
if (obj == _historyToEnd && e->type() == QEvent::Wheel) {
|
||||||
return _scroll.viewportEvent(e);
|
return _scroll->viewportEvent(e);
|
||||||
}
|
}
|
||||||
return TWidget::eventFilter(obj, e);
|
return TWidget::eventFilter(obj, e);
|
||||||
}
|
}
|
||||||
|
@ -6073,7 +6075,7 @@ bool HistoryWidget::isMuteUnmute() const {
|
||||||
bool HistoryWidget::updateCmdStartShown() {
|
bool HistoryWidget::updateCmdStartShown() {
|
||||||
bool cmdStartShown = false;
|
bool cmdStartShown = false;
|
||||||
if (_history && _peer && ((_peer->isChat() && _peer->asChat()->botStatus > 0) || (_peer->isMegagroup() && _peer->asChannel()->mgInfo->botStatus > 0) || (_peer->isUser() && _peer->asUser()->botInfo))) {
|
if (_history && _peer && ((_peer->isChat() && _peer->asChat()->botStatus > 0) || (_peer->isMegagroup() && _peer->asChannel()->mgInfo->botStatus > 0) || (_peer->isUser() && _peer->asUser()->botInfo))) {
|
||||||
if (!isBotStart() && !isBlocked() && !_keyboard.hasMarkup() && !_keyboard.forceReply()) {
|
if (!isBotStart() && !isBlocked() && !_keyboard->hasMarkup() && !_keyboard->forceReply()) {
|
||||||
if (!_field->hasSendText()) {
|
if (!_field->hasSendText()) {
|
||||||
cmdStartShown = true;
|
cmdStartShown = true;
|
||||||
}
|
}
|
||||||
|
@ -6087,7 +6089,7 @@ bool HistoryWidget::updateCmdStartShown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::kbWasHidden() const {
|
bool HistoryWidget::kbWasHidden() const {
|
||||||
return _history && (_keyboard.forMsgId() == FullMsgId(_history->channelId(), _history->lastKeyboardHiddenId));
|
return _history && (_keyboard->forMsgId() == FullMsgId(_history->channelId(), _history->lastKeyboardHiddenId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::dropEvent(QDropEvent *e) {
|
void HistoryWidget::dropEvent(QDropEvent *e) {
|
||||||
|
@ -6154,10 +6156,10 @@ void HistoryWidget::onKbToggle(bool manual) {
|
||||||
_botKeyboardShow->show();
|
_botKeyboardShow->show();
|
||||||
}
|
}
|
||||||
if (manual && _history) {
|
if (manual && _history) {
|
||||||
_history->lastKeyboardHiddenId = _keyboard.forMsgId().msg;
|
_history->lastKeyboardHiddenId = _keyboard->forMsgId().msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_kbShown = false;
|
_kbShown = false;
|
||||||
|
|
||||||
_field->setMaxHeight(st::historyComposeFieldMaxHeight);
|
_field->setMaxHeight(st::historyComposeFieldMaxHeight);
|
||||||
|
@ -6174,18 +6176,18 @@ void HistoryWidget::onKbToggle(bool manual) {
|
||||||
updateBotKeyboard();
|
updateBotKeyboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!_keyboard.hasMarkup() && _keyboard.forceReply()) {
|
} else if (!_keyboard->hasMarkup() && _keyboard->forceReply()) {
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
if (fieldEnabled) {
|
if (fieldEnabled) {
|
||||||
_botCommandStart->show();
|
_botCommandStart->show();
|
||||||
}
|
}
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_kbShown = false;
|
_kbShown = false;
|
||||||
|
|
||||||
_field->setMaxHeight(st::historyComposeFieldMaxHeight);
|
_field->setMaxHeight(st::historyComposeFieldMaxHeight);
|
||||||
|
|
||||||
_kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard.forceReply()) ? App::histItemById(_keyboard.forMsgId()) : 0;
|
_kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard->forceReply()) ? App::histItemById(_keyboard->forMsgId()) : 0;
|
||||||
if (_kbReplyTo && !_editMsgId && !_replyToId && fieldEnabled) {
|
if (_kbReplyTo && !_editMsgId && !_replyToId && fieldEnabled) {
|
||||||
updateReplyToName();
|
updateReplyToName();
|
||||||
_replyEditMsgText.setText(st::msgFont, textClean(_kbReplyTo->inReplyText()), _textDlgOptions);
|
_replyEditMsgText.setText(st::msgFont, textClean(_kbReplyTo->inReplyText()), _textDlgOptions);
|
||||||
|
@ -6198,13 +6200,13 @@ void HistoryWidget::onKbToggle(bool manual) {
|
||||||
} else if (fieldEnabled) {
|
} else if (fieldEnabled) {
|
||||||
_botKeyboardHide->show();
|
_botKeyboardHide->show();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_kbScroll.show();
|
_kbScroll->show();
|
||||||
_kbShown = true;
|
_kbShown = true;
|
||||||
|
|
||||||
int32 maxh = qMin(_keyboard.height(), st::historyComposeFieldMaxHeight - (st::historyComposeFieldMaxHeight / 2));
|
int32 maxh = qMin(_keyboard->height(), st::historyComposeFieldMaxHeight - (st::historyComposeFieldMaxHeight / 2));
|
||||||
_field->setMaxHeight(st::historyComposeFieldMaxHeight - maxh);
|
_field->setMaxHeight(st::historyComposeFieldMaxHeight - maxh);
|
||||||
|
|
||||||
_kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard.forceReply()) ? App::histItemById(_keyboard.forMsgId()) : 0;
|
_kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard->forceReply()) ? App::histItemById(_keyboard->forMsgId()) : 0;
|
||||||
if (_kbReplyTo && !_editMsgId && !_replyToId) {
|
if (_kbReplyTo && !_editMsgId && !_replyToId) {
|
||||||
updateReplyToName();
|
updateReplyToName();
|
||||||
_replyEditMsgText.setText(st::msgFont, textClean(_kbReplyTo->inReplyText()), _textDlgOptions);
|
_replyEditMsgText.setText(st::msgFont, textClean(_kbReplyTo->inReplyText()), _textDlgOptions);
|
||||||
|
@ -6342,7 +6344,7 @@ void HistoryWidget::onMembersDropdownShow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::onModerateKeyActivate(int index, bool *outHandled) {
|
void HistoryWidget::onModerateKeyActivate(int index, bool *outHandled) {
|
||||||
*outHandled = _keyboard.isHidden() ? false : _keyboard.moderateKeyActivate(index);
|
*outHandled = _keyboard->isHidden() ? false : _keyboard->moderateKeyActivate(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::topBarClick() {
|
void HistoryWidget::topBarClick() {
|
||||||
|
@ -6442,11 +6444,11 @@ void HistoryWidget::moveFieldControls() {
|
||||||
auto keyboardHeight = 0;
|
auto keyboardHeight = 0;
|
||||||
auto bottom = height();
|
auto bottom = height();
|
||||||
auto maxKeyboardHeight = st::historyComposeFieldMaxHeight - _field->height();
|
auto maxKeyboardHeight = st::historyComposeFieldMaxHeight - _field->height();
|
||||||
_keyboard.resizeToWidth(width(), maxKeyboardHeight);
|
_keyboard->resizeToWidth(width(), maxKeyboardHeight);
|
||||||
if (_kbShown) {
|
if (_kbShown) {
|
||||||
keyboardHeight = qMin(_keyboard.height(), maxKeyboardHeight);
|
keyboardHeight = qMin(_keyboard->height(), maxKeyboardHeight);
|
||||||
bottom -= keyboardHeight;
|
bottom -= keyboardHeight;
|
||||||
_kbScroll.setGeometry(0, bottom, width(), keyboardHeight);
|
_kbScroll->setGeometry(0, bottom, width(), keyboardHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _attachToggle --------------------------------------------------------- _emojiPan --------- _fieldBarCancel
|
// _attachToggle --------------------------------------------------------- _emojiPan --------- _fieldBarCancel
|
||||||
|
@ -6478,7 +6480,7 @@ void HistoryWidget::moveFieldControls() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateFieldSize() {
|
void HistoryWidget::updateFieldSize() {
|
||||||
bool kbShowShown = _history && !_kbShown && _keyboard.hasMarkup();
|
bool kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
|
||||||
int fieldWidth = width() - _attachToggle->width();
|
int fieldWidth = width() - _attachToggle->width();
|
||||||
fieldWidth -= _send->width();
|
fieldWidth -= _send->width();
|
||||||
fieldWidth -= _attachEmoji->width();
|
fieldWidth -= _attachEmoji->width();
|
||||||
|
@ -6878,7 +6880,7 @@ void HistoryWidget::reportSpamDone(PeerData *peer, const MTPBool &result, mtpReq
|
||||||
Local::writeReportSpamStatuses();
|
Local::writeReportSpamStatuses();
|
||||||
}
|
}
|
||||||
_reportSpamStatus = dbiprsReportSent;
|
_reportSpamStatus = dbiprsReportSent;
|
||||||
_reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent, peer);
|
_reportSpamPanel->setReported(_reportSpamStatus == dbiprsReportSent, peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::reportSpamFail(const RPCError &error, mtpRequestId req) {
|
bool HistoryWidget::reportSpamFail(const RPCError &error, mtpRequestId req) {
|
||||||
|
@ -6921,7 +6923,7 @@ void HistoryWidget::peerMessagesUpdated(PeerId peer) {
|
||||||
if (_peer && _list && peer == _peer->id) {
|
if (_peer && _list && peer == _peer->id) {
|
||||||
updateListSize();
|
updateListSize();
|
||||||
updateBotKeyboard();
|
updateBotKeyboard();
|
||||||
if (!_scroll.isHidden()) {
|
if (!_scroll->isHidden()) {
|
||||||
bool unblock = isBlocked(), botStart = isBotStart(), joinChannel = isJoinChannel(), muteUnmute = isMuteUnmute();
|
bool unblock = isBlocked(), botStart = isBotStart(), joinChannel = isJoinChannel(), muteUnmute = isMuteUnmute();
|
||||||
bool upd = (_unblock->isHidden() == unblock);
|
bool upd = (_unblock->isHidden() == unblock);
|
||||||
if (!upd && !unblock) upd = (_botStart->isHidden() == botStart);
|
if (!upd && !unblock) upd = (_botStart->isHidden() == botStart);
|
||||||
|
@ -6954,8 +6956,8 @@ bool HistoryWidget::isItemVisible(HistoryItem *item) {
|
||||||
if (isHidden() || _a_show.animating() || !_list) {
|
if (isHidden() || _a_show.animating() || !_list) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int32 top = _list->itemTop(item), st = _scroll.scrollTop();
|
int32 top = _list->itemTop(item), st = _scroll->scrollTop();
|
||||||
if (top < 0 || top + item->height() <= st || top >= st + _scroll.height()) {
|
if (top < 0 || top + item->height() <= st || top >= st + _scroll->height()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -7021,29 +7023,29 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateControlsGeometry() {
|
void HistoryWidget::updateControlsGeometry() {
|
||||||
_reportSpamPanel.resize(width(), _reportSpamPanel.height());
|
_reportSpamPanel->resize(width(), _reportSpamPanel->height());
|
||||||
|
|
||||||
moveFieldControls();
|
moveFieldControls();
|
||||||
|
|
||||||
if (_pinnedBar) {
|
if (_pinnedBar) {
|
||||||
if (_scroll.y() != st::historyReplyHeight) {
|
if (_scroll->y() != st::historyReplyHeight) {
|
||||||
_scroll.move(0, st::historyReplyHeight);
|
_scroll->move(0, st::historyReplyHeight);
|
||||||
_reportSpamPanel.move(0, st::historyReplyHeight);
|
_reportSpamPanel->move(0, st::historyReplyHeight);
|
||||||
_fieldAutocomplete->setBoundings(_scroll.geometry());
|
_fieldAutocomplete->setBoundings(_scroll->geometry());
|
||||||
}
|
}
|
||||||
_pinnedBar->cancel->move(width() - _pinnedBar->cancel->width(), 0);
|
_pinnedBar->cancel->move(width() - _pinnedBar->cancel->width(), 0);
|
||||||
_pinnedBar->shadow->setGeometry(0, st::historyReplyHeight, width(), st::lineWidth);
|
_pinnedBar->shadow->setGeometry(0, st::historyReplyHeight, width(), st::lineWidth);
|
||||||
} else if (_scroll.y() != 0) {
|
} else if (_scroll->y() != 0) {
|
||||||
_scroll.move(0, 0);
|
_scroll->move(0, 0);
|
||||||
_reportSpamPanel.move(0, 0);
|
_reportSpamPanel->move(0, 0);
|
||||||
_fieldAutocomplete->setBoundings(_scroll.geometry());
|
_fieldAutocomplete->setBoundings(_scroll->geometry());
|
||||||
}
|
}
|
||||||
|
|
||||||
updateListSize(false, false, { ScrollChangeAdd, App::main() ? App::main()->contentScrollAddToY() : 0 });
|
updateListSize(false, false, { ScrollChangeAdd, App::main() ? App::main()->contentScrollAddToY() : 0 });
|
||||||
|
|
||||||
updateFieldSize();
|
updateFieldSize();
|
||||||
|
|
||||||
_historyToEnd->moveToRight(st::historyToDownPosition.x(), _scroll.y() + _scroll.height() - _historyToEnd->height() - st::historyToDownPosition.y());
|
_historyToEnd->moveToRight(st::historyToDownPosition.x(), _scroll->y() + _scroll->height() - _historyToEnd->height() - st::historyToDownPosition.y());
|
||||||
|
|
||||||
_emojiPan->setMaxHeight(height() - st::defaultDropdownPadding.top() - st::defaultDropdownPadding.bottom() - _attachEmoji->height());
|
_emojiPan->setMaxHeight(height() - st::defaultDropdownPadding.top() - st::defaultDropdownPadding.bottom() - _attachEmoji->height());
|
||||||
if (_membersDropdown) {
|
if (_membersDropdown) {
|
||||||
|
@ -7101,7 +7103,7 @@ void HistoryWidget::itemEdited(HistoryItem *item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateScrollColors() {
|
void HistoryWidget::updateScrollColors() {
|
||||||
_scroll.updateBars();
|
_scroll->updateBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgId HistoryWidget::replyToId() const {
|
MsgId HistoryWidget::replyToId() const {
|
||||||
|
@ -7125,36 +7127,36 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
newScrollHeight -= st::historyReplyHeight;
|
newScrollHeight -= st::historyReplyHeight;
|
||||||
}
|
}
|
||||||
if (_kbShown) {
|
if (_kbShown) {
|
||||||
newScrollHeight -= _kbScroll.height();
|
newScrollHeight -= _kbScroll->height();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_pinnedBar) {
|
if (_pinnedBar) {
|
||||||
newScrollHeight -= st::historyReplyHeight;
|
newScrollHeight -= st::historyReplyHeight;
|
||||||
}
|
}
|
||||||
int wasScrollTop = _scroll.scrollTop();
|
int wasScrollTop = _scroll->scrollTop();
|
||||||
bool wasAtBottom = wasScrollTop + 1 > _scroll.scrollTopMax();
|
bool wasAtBottom = wasScrollTop + 1 > _scroll->scrollTopMax();
|
||||||
bool needResize = (_scroll.width() != width()) || (_scroll.height() != newScrollHeight);
|
bool needResize = (_scroll->width() != width()) || (_scroll->height() != newScrollHeight);
|
||||||
if (needResize) {
|
if (needResize) {
|
||||||
_scroll.resize(width(), newScrollHeight);
|
_scroll->resize(width(), newScrollHeight);
|
||||||
// on initial updateListSize we didn't put the _scroll.scrollTop correctly yet
|
// on initial updateListSize we didn't put the _scroll->scrollTop correctly yet
|
||||||
// so visibleAreaUpdated() call will erase it with the new (undefined) value
|
// so visibleAreaUpdated() call will erase it with the new (undefined) value
|
||||||
if (!initial) {
|
if (!initial) {
|
||||||
visibleAreaUpdated();
|
visibleAreaUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
_fieldAutocomplete->setBoundings(_scroll.geometry());
|
_fieldAutocomplete->setBoundings(_scroll->geometry());
|
||||||
_historyToEnd->moveToRight(st::historyToDownPosition.x(), _scroll.y() + _scroll.height() - _historyToEnd->height() - st::historyToDownPosition.y());
|
_historyToEnd->moveToRight(st::historyToDownPosition.x(), _scroll->y() + _scroll->height() - _historyToEnd->height() - st::historyToDownPosition.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
_list->recountHeight();
|
_list->recountHeight();
|
||||||
|
|
||||||
bool washidden = _scroll.isHidden();
|
bool washidden = _scroll->isHidden();
|
||||||
if (washidden) {
|
if (washidden) {
|
||||||
_scroll.show();
|
_scroll->show();
|
||||||
}
|
}
|
||||||
_list->updateSize();
|
_list->updateSize();
|
||||||
if (washidden) {
|
if (washidden) {
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!initial && !wasAtBottom) || (loadedDown && (!_history->showFrom || _history->unreadBar || _history->loadedAtBottom()) && (!_migrated || !_migrated->showFrom || _migrated->unreadBar || _history->loadedAtBottom()))) {
|
if ((!initial && !wasAtBottom) || (loadedDown && (!_history->showFrom || _history->unreadBar || _history->loadedAtBottom()) && (!_migrated || !_migrated->showFrom || _migrated->unreadBar || _history->loadedAtBottom()))) {
|
||||||
|
@ -7167,13 +7169,13 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
toY += _addToScroll;
|
toY += _addToScroll;
|
||||||
_addToScroll = 0;
|
_addToScroll = 0;
|
||||||
}
|
}
|
||||||
if (toY > _scroll.scrollTopMax()) {
|
if (toY > _scroll->scrollTopMax()) {
|
||||||
toY = _scroll.scrollTopMax();
|
toY = _scroll->scrollTopMax();
|
||||||
}
|
}
|
||||||
if (_scroll.scrollTop() == toY) {
|
if (_scroll->scrollTop() == toY) {
|
||||||
visibleAreaUpdated();
|
visibleAreaUpdated();
|
||||||
} else {
|
} else {
|
||||||
_scroll.scrollToY(toY);
|
_scroll->scrollToY(toY);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -7193,7 +7195,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
_histInited = false;
|
_histInited = false;
|
||||||
return updateListSize(initial, false, change);
|
return updateListSize(initial, false, change);
|
||||||
} else {
|
} else {
|
||||||
toY = (_scroll.height() > item->height()) ? qMax(iy - (_scroll.height() - item->height()) / 2, 0) : iy;
|
toY = (_scroll->height() > item->height()) ? qMax(iy - (_scroll->height() - item->height()) / 2, 0) : iy;
|
||||||
_animActiveStart = getms();
|
_animActiveStart = getms();
|
||||||
_animActiveTimer.start(AnimationTimerDelta);
|
_animActiveTimer.start(AnimationTimerDelta);
|
||||||
_activeAnimMsgId = _showAtMsgId;
|
_activeAnimMsgId = _showAtMsgId;
|
||||||
|
@ -7206,7 +7208,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
_histInited = false;
|
_histInited = false;
|
||||||
return updateListSize(initial, false, change);
|
return updateListSize(initial, false, change);
|
||||||
} else {
|
} else {
|
||||||
toY = (_scroll.height() > item->height()) ? qMax(iy - (_scroll.height() - item->height()) / 2, 0) : iy;
|
toY = (_scroll->height() > item->height()) ? qMax(iy - (_scroll->height() - item->height()) / 2, 0) : iy;
|
||||||
_animActiveStart = getms();
|
_animActiveStart = getms();
|
||||||
_animActiveTimer.start(AnimationTimerDelta);
|
_animActiveTimer.start(AnimationTimerDelta);
|
||||||
_activeAnimMsgId = _showAtMsgId;
|
_activeAnimMsgId = _showAtMsgId;
|
||||||
|
@ -7218,7 +7220,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
toY = unreadBarTop();
|
toY = unreadBarTop();
|
||||||
} else if (_migrated && _migrated->showFrom) {
|
} else if (_migrated && _migrated->showFrom) {
|
||||||
toY = _list->itemTop(_migrated->showFrom);
|
toY = _list->itemTop(_migrated->showFrom);
|
||||||
if (toY < _scroll.scrollTopMax() + HistoryMessageUnreadBar::height() - HistoryMessageUnreadBar::marginTop()) {
|
if (toY < _scroll->scrollTopMax() + HistoryMessageUnreadBar::height() - HistoryMessageUnreadBar::marginTop()) {
|
||||||
_migrated->addUnreadBar();
|
_migrated->addUnreadBar();
|
||||||
if (_migrated->unreadBar) {
|
if (_migrated->unreadBar) {
|
||||||
setMsgId(ShowAtUnreadMsgId);
|
setMsgId(ShowAtUnreadMsgId);
|
||||||
|
@ -7230,7 +7232,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
}
|
}
|
||||||
} else if (_history->showFrom) {
|
} else if (_history->showFrom) {
|
||||||
toY = _list->itemTop(_history->showFrom);
|
toY = _list->itemTop(_history->showFrom);
|
||||||
if (toY < _scroll.scrollTopMax() + st::unreadBarHeight) {
|
if (toY < _scroll->scrollTopMax() + st::unreadBarHeight) {
|
||||||
_history->addUnreadBar();
|
_history->addUnreadBar();
|
||||||
if (_history->unreadBar) {
|
if (_history->unreadBar) {
|
||||||
setMsgId(ShowAtUnreadMsgId);
|
setMsgId(ShowAtUnreadMsgId);
|
||||||
|
@ -7242,12 +7244,12 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
auto scrollMax = _scroll.scrollTopMax();
|
auto scrollMax = _scroll->scrollTopMax();
|
||||||
accumulate_min(toY, scrollMax);
|
accumulate_min(toY, scrollMax);
|
||||||
if (_scroll.scrollTop() == toY) {
|
if (_scroll->scrollTop() == toY) {
|
||||||
visibleAreaUpdated();
|
visibleAreaUpdated();
|
||||||
} else {
|
} else {
|
||||||
_scroll.scrollToY(toY);
|
_scroll->scrollToY(toY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7311,39 +7313,39 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bool wasVisible = _kbShown || _kbReplyTo;
|
bool wasVisible = _kbShown || _kbReplyTo;
|
||||||
if ((_replyToId && !_replyEditMsg) || _editMsgId || !_history) {
|
if ((_replyToId && !_replyEditMsg) || _editMsgId || !_history) {
|
||||||
changed = _keyboard.updateMarkup(nullptr, force);
|
changed = _keyboard->updateMarkup(nullptr, force);
|
||||||
} else if (_replyToId && _replyEditMsg) {
|
} else if (_replyToId && _replyEditMsg) {
|
||||||
changed = _keyboard.updateMarkup(_replyEditMsg, force);
|
changed = _keyboard->updateMarkup(_replyEditMsg, force);
|
||||||
} else {
|
} else {
|
||||||
HistoryItem *keyboardItem = _history->lastKeyboardId ? App::histItemById(_channel, _history->lastKeyboardId) : nullptr;
|
HistoryItem *keyboardItem = _history->lastKeyboardId ? App::histItemById(_channel, _history->lastKeyboardId) : nullptr;
|
||||||
changed = _keyboard.updateMarkup(keyboardItem, force);
|
changed = _keyboard->updateMarkup(keyboardItem, force);
|
||||||
}
|
}
|
||||||
updateCmdStartShown();
|
updateCmdStartShown();
|
||||||
if (!changed) return;
|
if (!changed) return;
|
||||||
|
|
||||||
bool hasMarkup = _keyboard.hasMarkup(), forceReply = _keyboard.forceReply() && (!_replyToId || !_replyEditMsg);
|
bool hasMarkup = _keyboard->hasMarkup(), forceReply = _keyboard->forceReply() && (!_replyToId || !_replyEditMsg);
|
||||||
if (hasMarkup || forceReply) {
|
if (hasMarkup || forceReply) {
|
||||||
if (_keyboard.singleUse() && _keyboard.hasMarkup() && _keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _history->lastKeyboardUsed) {
|
if (_keyboard->singleUse() && _keyboard->hasMarkup() && _keyboard->forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _history->lastKeyboardUsed) {
|
||||||
_history->lastKeyboardHiddenId = _history->lastKeyboardId;
|
_history->lastKeyboardHiddenId = _history->lastKeyboardId;
|
||||||
}
|
}
|
||||||
if (!isBotStart() && !isBlocked() && _canSendMessages && (wasVisible || (_replyToId && _replyEditMsg) || (!_field->hasSendText() && !kbWasHidden()))) {
|
if (!isBotStart() && !isBlocked() && _canSendMessages && (wasVisible || (_replyToId && _replyEditMsg) || (!_field->hasSendText() && !kbWasHidden()))) {
|
||||||
if (!_a_show.animating()) {
|
if (!_a_show.animating()) {
|
||||||
if (hasMarkup) {
|
if (hasMarkup) {
|
||||||
_kbScroll.show();
|
_kbScroll->show();
|
||||||
_attachEmoji->hide();
|
_attachEmoji->hide();
|
||||||
_botKeyboardHide->show();
|
_botKeyboardHide->show();
|
||||||
} else {
|
} else {
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_attachEmoji->show();
|
_attachEmoji->show();
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
}
|
}
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
}
|
}
|
||||||
int32 maxh = hasMarkup ? qMin(_keyboard.height(), st::historyComposeFieldMaxHeight - (st::historyComposeFieldMaxHeight / 2)) : 0;
|
int32 maxh = hasMarkup ? qMin(_keyboard->height(), st::historyComposeFieldMaxHeight - (st::historyComposeFieldMaxHeight / 2)) : 0;
|
||||||
_field->setMaxHeight(st::historyComposeFieldMaxHeight - maxh);
|
_field->setMaxHeight(st::historyComposeFieldMaxHeight - maxh);
|
||||||
_kbShown = hasMarkup;
|
_kbShown = hasMarkup;
|
||||||
_kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard.forceReply()) ? App::histItemById(_keyboard.forMsgId()) : 0;
|
_kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard->forceReply()) ? App::histItemById(_keyboard->forMsgId()) : 0;
|
||||||
if (_kbReplyTo && !_replyToId) {
|
if (_kbReplyTo && !_replyToId) {
|
||||||
updateReplyToName();
|
updateReplyToName();
|
||||||
_replyEditMsgText.setText(st::msgFont, textClean(_kbReplyTo->inReplyText()), _textDlgOptions);
|
_replyEditMsgText.setText(st::msgFont, textClean(_kbReplyTo->inReplyText()), _textDlgOptions);
|
||||||
|
@ -7352,7 +7354,7 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!_a_show.animating()) {
|
if (!_a_show.animating()) {
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_attachEmoji->show();
|
_attachEmoji->show();
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->show();
|
_botKeyboardShow->show();
|
||||||
|
@ -7367,8 +7369,8 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!_scroll.isHidden()) {
|
if (!_scroll->isHidden()) {
|
||||||
_kbScroll.hide();
|
_kbScroll->hide();
|
||||||
_attachEmoji->show();
|
_attachEmoji->show();
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
|
@ -7396,7 +7398,7 @@ void HistoryWidget::updateToEndVisibility() {
|
||||||
if (!history->showFrom || history->showFrom->detached()) {
|
if (!history->showFrom || history->showFrom->detached()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return (_list->itemTop(history->showFrom) >= _scroll.scrollTop() + _scroll.height());
|
return (_list->itemTop(history->showFrom) >= _scroll->scrollTop() + _scroll->height());
|
||||||
};
|
};
|
||||||
auto isToEndVisible = [this, &haveUnreadBelowBottom]() {
|
auto isToEndVisible = [this, &haveUnreadBelowBottom]() {
|
||||||
if (!_history || _firstLoadRequest) {
|
if (!_history || _firstLoadRequest) {
|
||||||
|
@ -7405,7 +7407,7 @@ void HistoryWidget::updateToEndVisibility() {
|
||||||
if (!_history->loadedAtBottom() || _replyReturn) {
|
if (!_history->loadedAtBottom() || _replyReturn) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_scroll.scrollTop() + st::historyToDownShownAfter < _scroll.scrollTopMax()) {
|
if (_scroll->scrollTop() + st::historyToDownShownAfter < _scroll->scrollTopMax()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (haveUnreadBelowBottom(_history) || haveUnreadBelowBottom(_migrated)) {
|
if (haveUnreadBelowBottom(_history) || haveUnreadBelowBottom(_migrated)) {
|
||||||
|
@ -7453,12 +7455,12 @@ void HistoryWidget::keyPressEvent(QKeyEvent *e) {
|
||||||
App::main()->showBackFromStack();
|
App::main()->showBackFromStack();
|
||||||
emit cancelled();
|
emit cancelled();
|
||||||
} else if (e->key() == Qt::Key_PageDown) {
|
} else if (e->key() == Qt::Key_PageDown) {
|
||||||
_scroll.keyPressEvent(e);
|
_scroll->keyPressEvent(e);
|
||||||
} else if (e->key() == Qt::Key_PageUp) {
|
} else if (e->key() == Qt::Key_PageUp) {
|
||||||
_scroll.keyPressEvent(e);
|
_scroll->keyPressEvent(e);
|
||||||
} else if (e->key() == Qt::Key_Down) {
|
} else if (e->key() == Qt::Key_Down) {
|
||||||
if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) {
|
if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) {
|
||||||
_scroll.keyPressEvent(e);
|
_scroll->keyPressEvent(e);
|
||||||
}
|
}
|
||||||
} else if (e->key() == Qt::Key_Up) {
|
} else if (e->key() == Qt::Key_Up) {
|
||||||
if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) {
|
if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) {
|
||||||
|
@ -7469,7 +7471,7 @@ void HistoryWidget::keyPressEvent(QKeyEvent *e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_scroll.keyPressEvent(e);
|
_scroll->keyPressEvent(e);
|
||||||
}
|
}
|
||||||
} else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
|
} else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
|
||||||
onListEnterPressed();
|
onListEnterPressed();
|
||||||
|
@ -7625,7 +7627,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() {
|
||||||
_pinnedBar->shadow->show();
|
_pinnedBar->shadow->show();
|
||||||
}
|
}
|
||||||
connect(_pinnedBar->cancel, SIGNAL(clicked()), this, SLOT(onPinnedHide()));
|
connect(_pinnedBar->cancel, SIGNAL(clicked()), this, SLOT(onPinnedHide()));
|
||||||
_reportSpamPanel.raise();
|
_reportSpamPanel->raise();
|
||||||
_topShadow->raise();
|
_topShadow->raise();
|
||||||
if (_membersDropdown) {
|
if (_membersDropdown) {
|
||||||
_membersDropdown->raise();
|
_membersDropdown->raise();
|
||||||
|
@ -7638,8 +7640,8 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() {
|
||||||
updatePinnedBar();
|
updatePinnedBar();
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
if (_scroll.scrollTop() != unreadBarTop()) {
|
if (_scroll->scrollTop() != unreadBarTop()) {
|
||||||
_scroll.scrollToY(_scroll.scrollTop() + st::historyReplyHeight);
|
_scroll->scrollToY(_scroll->scrollTop() + st::historyReplyHeight);
|
||||||
}
|
}
|
||||||
} else if (_pinnedBar->msgId != pinnedMsgId) {
|
} else if (_pinnedBar->msgId != pinnedMsgId) {
|
||||||
_pinnedBar->msgId = pinnedMsgId;
|
_pinnedBar->msgId = pinnedMsgId;
|
||||||
|
@ -7653,8 +7655,8 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() {
|
||||||
} else if (_pinnedBar) {
|
} else if (_pinnedBar) {
|
||||||
destroyPinnedBar();
|
destroyPinnedBar();
|
||||||
result = true;
|
result = true;
|
||||||
if (_scroll.scrollTop() != unreadBarTop()) {
|
if (_scroll->scrollTop() != unreadBarTop()) {
|
||||||
_scroll.scrollToY(_scroll.scrollTop() - st::historyReplyHeight);
|
_scroll->scrollToY(_scroll->scrollTop() - st::historyReplyHeight);
|
||||||
}
|
}
|
||||||
resizeEvent(0);
|
resizeEvent(0);
|
||||||
}
|
}
|
||||||
|
@ -7958,7 +7960,7 @@ void HistoryWidget::onCopyPostLink() {
|
||||||
|
|
||||||
bool HistoryWidget::lastForceReplyReplied(const FullMsgId &replyTo) const {
|
bool HistoryWidget::lastForceReplyReplied(const FullMsgId &replyTo) const {
|
||||||
if (replyTo.msg > 0 && replyTo.channel != _channel) return false;
|
if (replyTo.msg > 0 && replyTo.channel != _channel) return false;
|
||||||
return _keyboard.forceReply() && _keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _keyboard.forMsgId().msg == (replyTo.msg < 0 ? replyToId() : replyTo.msg);
|
return _keyboard->forceReply() && _keyboard->forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _keyboard->forMsgId().msg == (replyTo.msg < 0 ? replyToId() : replyTo.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
|
bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
|
||||||
|
@ -7992,7 +7994,7 @@ bool HistoryWidget::cancelReply(bool lastKeyboardUsed) {
|
||||||
_saveDraftStart = getms();
|
_saveDraftStart = getms();
|
||||||
onDraftSave();
|
onDraftSave();
|
||||||
}
|
}
|
||||||
if (!_editMsgId && _keyboard.singleUse() && _keyboard.forceReply() && lastKeyboardUsed) {
|
if (!_editMsgId && _keyboard->singleUse() && _keyboard->forceReply() && lastKeyboardUsed) {
|
||||||
if (_kbReplyTo) {
|
if (_kbReplyTo) {
|
||||||
onKbToggle(false);
|
onKbToggle(false);
|
||||||
}
|
}
|
||||||
|
@ -8252,7 +8254,7 @@ void HistoryWidget::onFullPeerUpdated(PeerData *data) {
|
||||||
if (updateCmdStartShown()) {
|
if (updateCmdStartShown()) {
|
||||||
updateControlsVisibility();
|
updateControlsVisibility();
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
} else if (!_scroll.isHidden() && _unblock->isHidden() == isBlocked()) {
|
} else if (!_scroll->isHidden() && _unblock->isHidden() == isBlocked()) {
|
||||||
updateControlsVisibility();
|
updateControlsVisibility();
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
|
@ -8497,7 +8499,7 @@ void HistoryWidget::updateReplyToName() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateField() {
|
void HistoryWidget::updateField() {
|
||||||
int32 fy = _scroll.y() + _scroll.height();
|
int32 fy = _scroll->y() + _scroll->height();
|
||||||
update(0, fy, width(), height() - fy);
|
update(0, fy, width(), height() - fy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8786,8 +8788,8 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
|
||||||
if (_pinnedBar && !_pinnedBar->cancel->isHidden()) {
|
if (_pinnedBar && !_pinnedBar->cancel->isHidden()) {
|
||||||
drawPinnedBar(p);
|
drawPinnedBar(p);
|
||||||
}
|
}
|
||||||
if (_scroll.isHidden()) {
|
if (_scroll->isHidden()) {
|
||||||
p.setClipRect(_scroll.geometry());
|
p.setClipRect(_scroll->geometry());
|
||||||
HistoryLayout::paintEmpty(p, width(), height() - _field->height() - 2 * st::historySendPadding);
|
HistoryLayout::paintEmpty(p, width(), height() - _field->height() - 2 * st::historySendPadding);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -8803,7 +8805,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect HistoryWidget::historyRect() const {
|
QRect HistoryWidget::historyRect() const {
|
||||||
return _scroll.geometry();
|
return _scroll->geometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::destroyData() {
|
void HistoryWidget::destroyData() {
|
||||||
|
@ -8849,27 +8851,27 @@ QStringList HistoryWidget::getMediasFromMime(const QMimeData *d) {
|
||||||
QPoint HistoryWidget::clampMousePosition(QPoint point) {
|
QPoint HistoryWidget::clampMousePosition(QPoint point) {
|
||||||
if (point.x() < 0) {
|
if (point.x() < 0) {
|
||||||
point.setX(0);
|
point.setX(0);
|
||||||
} else if (point.x() >= _scroll.width()) {
|
} else if (point.x() >= _scroll->width()) {
|
||||||
point.setX(_scroll.width() - 1);
|
point.setX(_scroll->width() - 1);
|
||||||
}
|
}
|
||||||
if (point.y() < _scroll.scrollTop()) {
|
if (point.y() < _scroll->scrollTop()) {
|
||||||
point.setY(_scroll.scrollTop());
|
point.setY(_scroll->scrollTop());
|
||||||
} else if (point.y() >= _scroll.scrollTop() + _scroll.height()) {
|
} else if (point.y() >= _scroll->scrollTop() + _scroll->height()) {
|
||||||
point.setY(_scroll.scrollTop() + _scroll.height() - 1);
|
point.setY(_scroll->scrollTop() + _scroll->height() - 1);
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::onScrollTimer() {
|
void HistoryWidget::onScrollTimer() {
|
||||||
int32 d = (_scrollDelta > 0) ? qMin(_scrollDelta * 3 / 20 + 1, int32(MaxScrollSpeed)) : qMax(_scrollDelta * 3 / 20 - 1, -int32(MaxScrollSpeed));
|
int32 d = (_scrollDelta > 0) ? qMin(_scrollDelta * 3 / 20 + 1, int32(MaxScrollSpeed)) : qMax(_scrollDelta * 3 / 20 - 1, -int32(MaxScrollSpeed));
|
||||||
_scroll.scrollToY(_scroll.scrollTop() + d);
|
_scroll->scrollToY(_scroll->scrollTop() + d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::checkSelectingScroll(QPoint point) {
|
void HistoryWidget::checkSelectingScroll(QPoint point) {
|
||||||
if (point.y() < _scroll.scrollTop()) {
|
if (point.y() < _scroll->scrollTop()) {
|
||||||
_scrollDelta = point.y() - _scroll.scrollTop();
|
_scrollDelta = point.y() - _scroll->scrollTop();
|
||||||
} else if (point.y() >= _scroll.scrollTop() + _scroll.height()) {
|
} else if (point.y() >= _scroll->scrollTop() + _scroll->height()) {
|
||||||
_scrollDelta = point.y() - _scroll.scrollTop() - _scroll.height() + 1;
|
_scrollDelta = point.y() - _scroll->scrollTop() - _scroll->height() + 1;
|
||||||
} else {
|
} else {
|
||||||
_scrollDelta = 0;
|
_scrollDelta = 0;
|
||||||
}
|
}
|
||||||
|
@ -8885,10 +8887,10 @@ void HistoryWidget::noSelectingScroll() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::touchScroll(const QPoint &delta) {
|
bool HistoryWidget::touchScroll(const QPoint &delta) {
|
||||||
int32 scTop = _scroll.scrollTop(), scMax = _scroll.scrollTopMax(), scNew = snap(scTop - delta.y(), 0, scMax);
|
int32 scTop = _scroll->scrollTop(), scMax = _scroll->scrollTopMax(), scNew = snap(scTop - delta.y(), 0, scMax);
|
||||||
if (scNew == scTop) return false;
|
if (scNew == scTop) return false;
|
||||||
|
|
||||||
_scroll.scrollToY(scNew);
|
_scroll->scrollToY(scNew);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/effects/rect_shadow.h"
|
#include "ui/effects/rect_shadow.h"
|
||||||
#include "ui/widgets/tooltip.h"
|
#include "ui/widgets/tooltip.h"
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "history/history_common.h"
|
#include "history/history_common.h"
|
||||||
#include "history/field_autocomplete.h"
|
#include "history/field_autocomplete.h"
|
||||||
#include "window/section_widget.h"
|
#include "window/section_widget.h"
|
||||||
|
@ -58,7 +59,7 @@ class HistoryInner : public TWidget, public Ui::AbstractTooltipShower, private b
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HistoryInner(HistoryWidget *historyWidget, ScrollArea *scroll, History *history);
|
HistoryInner(HistoryWidget *historyWidget, Ui::ScrollArea *scroll, History *history);
|
||||||
|
|
||||||
void messagesReceived(PeerData *peer, const QVector<MTPMessage> &messages);
|
void messagesReceived(PeerData *peer, const QVector<MTPMessage> &messages);
|
||||||
void messagesReceivedDown(PeerData *peer, const QVector<MTPMessage> &messages);
|
void messagesReceivedDown(PeerData *peer, const QVector<MTPMessage> &messages);
|
||||||
|
@ -203,7 +204,7 @@ private:
|
||||||
std_::unique_ptr<BotAbout> _botAbout;
|
std_::unique_ptr<BotAbout> _botAbout;
|
||||||
|
|
||||||
HistoryWidget *_widget = nullptr;
|
HistoryWidget *_widget = nullptr;
|
||||||
ScrollArea *_scroll = nullptr;
|
Ui::ScrollArea *_scroll = nullptr;
|
||||||
mutable History *_curHistory = nullptr;
|
mutable History *_curHistory = nullptr;
|
||||||
mutable int _curBlock = 0;
|
mutable int _curBlock = 0;
|
||||||
mutable int _curItem = 0;
|
mutable int _curItem = 0;
|
||||||
|
@ -254,7 +255,7 @@ private:
|
||||||
QPoint _touchStart, _touchPrevPos, _touchPos;
|
QPoint _touchStart, _touchPrevPos, _touchPos;
|
||||||
QTimer _touchSelectTimer;
|
QTimer _touchSelectTimer;
|
||||||
|
|
||||||
TouchScrollState _touchScrollState = TouchScrollManual;
|
Ui::TouchScrollState _touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
bool _touchPrevPosValid = false;
|
bool _touchPrevPosValid = false;
|
||||||
bool _touchWaitingAcceleration = false;
|
bool _touchWaitingAcceleration = false;
|
||||||
QPoint _touchSpeed;
|
QPoint _touchSpeed;
|
||||||
|
@ -364,7 +365,7 @@ class BotKeyboard : public TWidget, public Ui::AbstractTooltipShower, public Cli
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BotKeyboard();
|
BotKeyboard(QWidget *parent);
|
||||||
|
|
||||||
bool moderateKeyActivate(int index);
|
bool moderateKeyActivate(int index);
|
||||||
|
|
||||||
|
@ -423,7 +424,7 @@ private:
|
||||||
|
|
||||||
class Style : public ReplyKeyboard::Style {
|
class Style : public ReplyKeyboard::Style {
|
||||||
public:
|
public:
|
||||||
Style(BotKeyboard *parent, const style::botKeyboardButton &st) : ReplyKeyboard::Style(st), _parent(parent) {
|
Style(BotKeyboard *parent, const style::BotKeyboardButton &st) : ReplyKeyboard::Style(st), _parent(parent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void startPaint(Painter &p) const override;
|
void startPaint(Painter &p) const override;
|
||||||
|
@ -440,7 +441,7 @@ private:
|
||||||
BotKeyboard *_parent;
|
BotKeyboard *_parent;
|
||||||
|
|
||||||
};
|
};
|
||||||
const style::botKeyboardButton *_st = &st::botKbButton;
|
const style::BotKeyboardButton *_st = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1049,7 +1050,7 @@ private:
|
||||||
|
|
||||||
MsgId _activeAnimMsgId = 0;
|
MsgId _activeAnimMsgId = 0;
|
||||||
|
|
||||||
ScrollArea _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
HistoryInner *_list = nullptr;
|
HistoryInner *_list = nullptr;
|
||||||
History *_migrated = nullptr;
|
History *_migrated = nullptr;
|
||||||
History *_history = nullptr;
|
History *_history = nullptr;
|
||||||
|
@ -1077,7 +1078,7 @@ private:
|
||||||
bool isMuteUnmute() const;
|
bool isMuteUnmute() const;
|
||||||
bool updateCmdStartShown();
|
bool updateCmdStartShown();
|
||||||
|
|
||||||
ReportSpamPanel _reportSpamPanel;
|
ChildWidget<ReportSpamPanel> _reportSpamPanel;
|
||||||
|
|
||||||
ChildWidget<Ui::IconButton> _send;
|
ChildWidget<Ui::IconButton> _send;
|
||||||
ChildWidget<Ui::FlatButton> _unblock;
|
ChildWidget<Ui::FlatButton> _unblock;
|
||||||
|
@ -1110,8 +1111,8 @@ private:
|
||||||
|
|
||||||
bool _kbShown = false;
|
bool _kbShown = false;
|
||||||
HistoryItem *_kbReplyTo = nullptr;
|
HistoryItem *_kbReplyTo = nullptr;
|
||||||
ScrollArea _kbScroll;
|
ChildWidget<Ui::ScrollArea> _kbScroll;
|
||||||
BotKeyboard _keyboard;
|
ChildWidget<BotKeyboard> _keyboard;
|
||||||
|
|
||||||
ChildWidget<Ui::InnerDropdown> _membersDropdown = { nullptr };
|
ChildWidget<Ui::InnerDropdown> _membersDropdown = { nullptr };
|
||||||
QTimer _membersDropdownShowTimer;
|
QTimer _membersDropdownShowTimer;
|
||||||
|
|
|
@ -24,6 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_overview.h"
|
#include "styles/style_overview.h"
|
||||||
#include "styles/style_history.h"
|
#include "styles/style_history.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
|
#include "styles/style_widgets.h"
|
||||||
#include "inline_bots/inline_bot_result.h"
|
#include "inline_bots/inline_bot_result.h"
|
||||||
#include "media/media_audio.h"
|
#include "media/media_audio.h"
|
||||||
#include "media/media_clip_reader.h"
|
#include "media/media_clip_reader.h"
|
||||||
|
|
|
@ -63,7 +63,7 @@ introLink: LinkButton(defaultLinkButton) {
|
||||||
font: introFont;
|
font: introFont;
|
||||||
overFont: font(16px underline);
|
overFont: font(16px underline);
|
||||||
}
|
}
|
||||||
introLabel: flatLabel(labelDefFlat) {
|
introLabel: FlatLabel(defaultFlatLabel) {
|
||||||
font: introFont;
|
font: introFont;
|
||||||
align: align(center);
|
align: align(center);
|
||||||
}
|
}
|
||||||
|
@ -124,14 +124,14 @@ introErrorTop: 15px;
|
||||||
introErrorHeight: 40px;
|
introErrorHeight: 40px;
|
||||||
introErrorFont: font(16px);
|
introErrorFont: font(16px);
|
||||||
|
|
||||||
introLabelTextStyle: textStyle(defaultTextStyle) {
|
introLabelTextStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 30px;
|
lineHeight: 30px;
|
||||||
}
|
}
|
||||||
introErrorLabelTextStyle: textStyle(defaultTextStyle) {
|
introErrorLabelTextStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 27px;
|
lineHeight: 27px;
|
||||||
}
|
}
|
||||||
|
|
||||||
introErrorLabel: flatLabel(labelDefFlat) {
|
introErrorLabel: FlatLabel(defaultFlatLabel) {
|
||||||
font: introErrorFont;
|
font: introErrorFont;
|
||||||
align: align(center);
|
align: align(center);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,23 +26,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "intro/introcode.h"
|
#include "intro/introcode.h"
|
||||||
#include "styles/style_intro.h"
|
#include "styles/style_intro.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
namespace {
|
|
||||||
class SignUpClickHandler : public LeftButtonClickHandler {
|
|
||||||
public:
|
|
||||||
SignUpClickHandler(IntroPhone *widget) : _widget(widget) {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override {
|
|
||||||
_widget->toSignUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
IntroPhone *_widget;
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
IntroPhone::IntroPhone(IntroWidget *parent) : IntroStep(parent)
|
IntroPhone::IntroPhone(IntroWidget *parent) : IntroStep(parent)
|
||||||
, a_errorAlpha(0)
|
, a_errorAlpha(0)
|
||||||
|
@ -51,7 +35,7 @@ IntroPhone::IntroPhone(IntroWidget *parent) : IntroStep(parent)
|
||||||
, _country(this, st::introCountry)
|
, _country(this, st::introCountry)
|
||||||
, _phone(this, st::introPhone)
|
, _phone(this, st::introPhone)
|
||||||
, _code(this, st::introCountryCode)
|
, _code(this, st::introCountryCode)
|
||||||
, _signup(this, lng_phone_notreg(lt_signup_start, textcmdStartLink(1), lt_signup_end, textcmdStopLink()), FlatLabel::InitType::Rich, st::introErrorLabel, st::introErrorLabelTextStyle)
|
, _signup(this, lng_phone_notreg(lt_signup_start, textcmdStartLink(1), lt_signup_end, textcmdStopLink()), Ui::FlatLabel::InitType::Rich, st::introErrorLabel, st::introErrorLabelTextStyle)
|
||||||
, _checkRequest(this) {
|
, _checkRequest(this) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
setGeometry(parent->innerRect());
|
setGeometry(parent->innerRect());
|
||||||
|
@ -68,7 +52,9 @@ IntroPhone::IntroPhone(IntroWidget *parent) : IntroStep(parent)
|
||||||
connect(intro(), SIGNAL(countryChanged()), this, SLOT(countryChanged()));
|
connect(intro(), SIGNAL(countryChanged()), this, SLOT(countryChanged()));
|
||||||
connect(_checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));
|
connect(_checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));
|
||||||
|
|
||||||
_signup->setLink(1, MakeShared<SignUpClickHandler>(this));
|
_signup->setLink(1, MakeShared<LambdaClickHandler>([this] {
|
||||||
|
toSignUp();
|
||||||
|
}));
|
||||||
_signup->hide();
|
_signup->hide();
|
||||||
|
|
||||||
_signupCache = myGrab(_signup);
|
_signupCache = myGrab(_signup);
|
||||||
|
|
|
@ -21,13 +21,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/countryinput.h"
|
#include "ui/countryinput.h"
|
||||||
#include "ui/flatlabel.h"
|
|
||||||
#include "intro/introwidget.h"
|
#include "intro/introwidget.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PhonePartInput;
|
class PhonePartInput;
|
||||||
class CountryCodeInput;
|
class CountryCodeInput;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
|
class FlatLabel;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
class IntroPhone final : public IntroStep {
|
class IntroPhone final : public IntroStep {
|
||||||
|
@ -52,8 +52,6 @@ public:
|
||||||
void phoneSubmitDone(const MTPauth_SentCode &result);
|
void phoneSubmitDone(const MTPauth_SentCode &result);
|
||||||
bool phoneSubmitFail(const RPCError &error);
|
bool phoneSubmitFail(const RPCError &error);
|
||||||
|
|
||||||
void toSignUp();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void countryChanged();
|
void countryChanged();
|
||||||
void onInputChange();
|
void onInputChange();
|
||||||
|
@ -61,6 +59,8 @@ public slots:
|
||||||
void onCheckRequest();
|
void onCheckRequest();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void toSignUp();
|
||||||
|
|
||||||
QString fullNumber() const;
|
QString fullNumber() const;
|
||||||
void disableAll();
|
void disableAll();
|
||||||
void enableAll(bool failed);
|
void enableAll(bool failed);
|
||||||
|
@ -81,7 +81,7 @@ private:
|
||||||
ChildWidget<Ui::PhonePartInput> _phone;
|
ChildWidget<Ui::PhonePartInput> _phone;
|
||||||
ChildWidget<Ui::CountryCodeInput> _code;
|
ChildWidget<Ui::CountryCodeInput> _code;
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _signup;
|
ChildWidget<Ui::FlatLabel> _signup;
|
||||||
QPixmap _signupCache;
|
QPixmap _signupCache;
|
||||||
bool _showSignup = false;
|
bool _showSignup = false;
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "intro/introphone.h"
|
#include "intro/introphone.h"
|
||||||
#include "langloaderplain.h"
|
#include "langloaderplain.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
|
|
||||||
IntroStart::IntroStart(IntroWidget *parent) : IntroStep(parent)
|
IntroStart::IntroStart(IntroWidget *parent) : IntroStep(parent)
|
||||||
, _intro(this, lang(lng_intro), FlatLabel::InitType::Rich, st::introLabel, st::introLabelTextStyle)
|
, _intro(this, lang(lng_intro), Ui::FlatLabel::InitType::Rich, st::introLabel, st::introLabelTextStyle)
|
||||||
, _changeLang(this, QString())
|
, _changeLang(this, QString())
|
||||||
, _next(this, lang(lng_start_msgs), st::introNextButton) {
|
, _next(this, lang(lng_start_msgs), st::introNextButton) {
|
||||||
_changeLang->hide();
|
_changeLang->hide();
|
||||||
|
|
|
@ -22,9 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "intro/introwidget.h"
|
#include "intro/introwidget.h"
|
||||||
|
|
||||||
class FlatLabel;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class LinkButton;
|
class LinkButton;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
@ -39,7 +38,7 @@ public:
|
||||||
void onSubmit() override;
|
void onSubmit() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChildWidget<FlatLabel> _intro;
|
ChildWidget<Ui::FlatLabel> _intro;
|
||||||
|
|
||||||
ChildWidget<Ui::LinkButton> _changeLang;
|
ChildWidget<Ui::LinkButton> _changeLang;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "ui/filedialog.h"
|
#include "ui/filedialog.h"
|
||||||
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_stickers.h"
|
#include "styles/style_stickers.h"
|
||||||
#include "window/window_main_menu.h"
|
#include "window/window_main_menu.h"
|
||||||
|
|
||||||
|
@ -366,6 +367,7 @@ void LayerStackWidget::showMainMenu() {
|
||||||
startShow();
|
startShow();
|
||||||
} else {
|
} else {
|
||||||
_mainMenu->show();
|
_mainMenu->show();
|
||||||
|
_mainMenu->showFinished();
|
||||||
if (App::wnd()) App::wnd()->setInnerFocus();
|
if (App::wnd()) App::wnd()->setInnerFocus();
|
||||||
updateLayerBox();
|
updateLayerBox();
|
||||||
}
|
}
|
||||||
|
@ -474,6 +476,7 @@ void LayerStackWidget::step_background(float64 ms, bool timer) {
|
||||||
_background->setMainMenuRight(_mainMenu->width());
|
_background->setMainMenuRight(_mainMenu->width());
|
||||||
_background->setMainMenuCache(QPixmap());
|
_background->setMainMenuCache(QPixmap());
|
||||||
_mainMenu->show();
|
_mainMenu->show();
|
||||||
|
_mainMenu->showFinished();
|
||||||
}
|
}
|
||||||
if (App::wnd()) App::wnd()->setInnerFocus();
|
if (App::wnd()) App::wnd()->setInnerFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3541,7 +3541,9 @@ void MainWidget::start(const MTPUser &user) {
|
||||||
Local::readSavedPeers();
|
Local::readSavedPeers();
|
||||||
|
|
||||||
cSetOtherOnline(0);
|
cSetOtherOnline(0);
|
||||||
App::feedUsers(MTP_vector<MTPUser>(1, user));
|
if (auto self = App::feedUsers(MTP_vector<MTPUser>(1, user))) {
|
||||||
|
self->loadUserpic();
|
||||||
|
}
|
||||||
MTP::send(MTPupdates_GetState(), rpcDone(&MainWidget::gotState));
|
MTP::send(MTPupdates_GetState(), rpcDone(&MainWidget::gotState));
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
|
|
@ -1503,7 +1503,7 @@ PreLaunchWindow::PreLaunchWindow(QString title) : TWidget(0) {
|
||||||
int paddingVertical = (_size / 2);
|
int paddingVertical = (_size / 2);
|
||||||
int paddingHorizontal = _size;
|
int paddingHorizontal = _size;
|
||||||
int borderRadius = (_size / 5);
|
int borderRadius = (_size / 5);
|
||||||
setStyleSheet(qsl("QPushButton { padding: %1px %2px; background-color: #ffffff; border-radius: %3px; }\nQPushButton#confirm:hover, QPushButton#cancel:hover { background-color: #edf7ff; color: #2f9fea; }\nQPushButton#confirm { color: #2f9fea; }\nQPushButton#cancel { color: #aeaeae; }\nQLineEdit { border: 1px solid #e0e0e0; padding: 5px; }\nQLineEdit:focus { border: 2px solid #62c0f7; padding: 4px; }").arg(paddingVertical).arg(paddingHorizontal).arg(borderRadius));
|
setStyleSheet(qsl("QPushButton { padding: %1px %2px; background-color: #ffffff; border-radius: %3px; }\nQPushButton#confirm:hover, QPushButton#cancel:hover { background-color: #e3f1fa; color: #2f9fea; }\nQPushButton#confirm { color: #2f9fea; }\nQPushButton#cancel { color: #aeaeae; }\nQLineEdit { border: 1px solid #e0e0e0; padding: 5px; }\nQLineEdit:focus { border: 2px solid #62c0f7; padding: 4px; }").arg(paddingVertical).arg(paddingHorizontal).arg(borderRadius));
|
||||||
if (!PreLaunchWindowInstance) {
|
if (!PreLaunchWindowInstance) {
|
||||||
PreLaunchWindowInstance = this;
|
PreLaunchWindowInstance = this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ MediaPlayerButton {
|
||||||
cancelStroke: pixels;
|
cancelStroke: pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaPlayerActiveFg: windowActiveBg;
|
mediaPlayerActiveFg: windowBgActive;
|
||||||
mediaPlayerInactiveFg: #dfebf2;
|
mediaPlayerInactiveFg: #dfebf2;
|
||||||
|
|
||||||
mediaPlayerButton: MediaPlayerButton {
|
mediaPlayerButton: MediaPlayerButton {
|
||||||
|
@ -60,9 +60,9 @@ mediaPlayerPlaySkip: 1px;
|
||||||
mediaPlayerPlayTop: 0px;
|
mediaPlayerPlayTop: 0px;
|
||||||
mediaPlayerCloseRight: 0px;
|
mediaPlayerCloseRight: 0px;
|
||||||
|
|
||||||
mediaPlayerName: flatLabel(labelDefFlat) {
|
mediaPlayerName: FlatLabel(defaultFlatLabel) {
|
||||||
maxHeight: 20px;
|
maxHeight: 20px;
|
||||||
textFg: windowTextFg;
|
textFg: windowFg;
|
||||||
}
|
}
|
||||||
mediaPlayerTime: LabelSimple(defaultLabelSimple) {
|
mediaPlayerTime: LabelSimple(defaultLabelSimple) {
|
||||||
textFg: windowSubTextFg;
|
textFg: windowSubTextFg;
|
||||||
|
@ -209,7 +209,7 @@ mediaPlayerPanelVolumeWidth: 64px;
|
||||||
mediaPlayerPanelVolumeToggleSkip: 0px;
|
mediaPlayerPanelVolumeToggleSkip: 0px;
|
||||||
mediaPlayerPanelVolumeToggleTop: 57px;
|
mediaPlayerPanelVolumeToggleTop: 57px;
|
||||||
|
|
||||||
mediaPlayerScroll: flatScroll(solidScroll) {
|
mediaPlayerScroll: FlatScroll(defaultSolidScroll) {
|
||||||
deltat: 10px;
|
deltat: 10px;
|
||||||
deltab: 0px;
|
deltab: 0px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "media/player/media_player_cover.h"
|
#include "media/player/media_player_cover.h"
|
||||||
|
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/widgets/label_simple.h"
|
|
||||||
#include "ui/widgets/media_slider.h"
|
#include "ui/widgets/media_slider.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "media/media_audio.h"
|
#include "media/media_audio.h"
|
||||||
|
|
|
@ -22,8 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
class AudioMsgId;
|
class AudioMsgId;
|
||||||
struct AudioPlaybackState;
|
struct AudioPlaybackState;
|
||||||
class FlatLabel;
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class LabelSimple;
|
class LabelSimple;
|
||||||
class IconButton;
|
class IconButton;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
@ -77,7 +78,7 @@ private:
|
||||||
QString _time;
|
QString _time;
|
||||||
|
|
||||||
class PlayButton;
|
class PlayButton;
|
||||||
ChildWidget<FlatLabel> _nameLabel;
|
ChildWidget<Ui::FlatLabel> _nameLabel;
|
||||||
ChildWidget<Ui::LabelSimple> _timeLabel;
|
ChildWidget<Ui::LabelSimple> _timeLabel;
|
||||||
ChildWidget<Ui::IconButton> _close;
|
ChildWidget<Ui::IconButton> _close;
|
||||||
ChildWidget<Clip::Playback> _playback;
|
ChildWidget<Clip::Playback> _playback;
|
||||||
|
|
|
@ -28,6 +28,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_widgets.h"
|
#include "styles/style_widgets.h"
|
||||||
#include "styles/style_media_player.h"
|
#include "styles/style_media_player.h"
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
namespace Media {
|
namespace Media {
|
||||||
|
|
|
@ -22,9 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "ui/effects/rect_shadow.h"
|
#include "ui/effects/rect_shadow.h"
|
||||||
|
|
||||||
class ScrollArea;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class ScrollArea;
|
||||||
class GradientShadow;
|
class GradientShadow;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
|
@ -110,7 +109,7 @@ private:
|
||||||
Ui::RectShadow _shadow;
|
Ui::RectShadow _shadow;
|
||||||
ButtonCallback _pinCallback, _closeCallback;
|
ButtonCallback _pinCallback, _closeCallback;
|
||||||
ChildWidget<CoverWidget> _cover = { nullptr };
|
ChildWidget<CoverWidget> _cover = { nullptr };
|
||||||
ChildWidget<ScrollArea> _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
ChildWidget<Ui::GradientShadow> _scrollShadow = { nullptr };
|
ChildWidget<Ui::GradientShadow> _scrollShadow = { nullptr };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,8 +21,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "media/player/media_player_widget.h"
|
#include "media/player/media_player_widget.h"
|
||||||
|
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/widgets/label_simple.h"
|
|
||||||
#include "ui/widgets/filled_slider.h"
|
#include "ui/widgets/filled_slider.h"
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
|
|
@ -22,9 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
class AudioMsgId;
|
class AudioMsgId;
|
||||||
struct AudioPlaybackState;
|
struct AudioPlaybackState;
|
||||||
class FlatLabel;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class LabelSimple;
|
class LabelSimple;
|
||||||
class IconButton;
|
class IconButton;
|
||||||
class PlainShadow;
|
class PlainShadow;
|
||||||
|
@ -91,7 +91,7 @@ private:
|
||||||
QString _time;
|
QString _time;
|
||||||
|
|
||||||
class PlayButton;
|
class PlayButton;
|
||||||
ChildWidget<FlatLabel> _nameLabel;
|
ChildWidget<Ui::FlatLabel> _nameLabel;
|
||||||
ChildWidget<Ui::LabelSimple> _timeLabel;
|
ChildWidget<Ui::LabelSimple> _timeLabel;
|
||||||
ChildWidget<Ui::IconButton> _previousTrack = { nullptr };
|
ChildWidget<Ui::IconButton> _previousTrack = { nullptr };
|
||||||
ChildWidget<PlayButton> _playPause;
|
ChildWidget<PlayButton> _playPause;
|
||||||
|
|
|
@ -24,7 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "media/view/media_clip_playback.h"
|
#include "media/view/media_clip_playback.h"
|
||||||
#include "media/view/media_clip_volume_controller.h"
|
#include "media/view/media_clip_volume_controller.h"
|
||||||
#include "styles/style_mediaview.h"
|
#include "styles/style_mediaview.h"
|
||||||
#include "ui/widgets/label_simple.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/widgets/media_slider.h"
|
#include "ui/widgets/media_slider.h"
|
||||||
#include "ui/effects/widget_fade_wrap.h"
|
#include "ui/effects/widget_fade_wrap.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
|
|
|
@ -37,23 +37,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class SaveMsgClickHandler : public ClickHandler {
|
|
||||||
public:
|
|
||||||
|
|
||||||
SaveMsgClickHandler(MediaView *view) : _view(view) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void onClick(Qt::MouseButton button) const {
|
|
||||||
if (button == Qt::LeftButton) {
|
|
||||||
_view->showSaveMsgFile();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
MediaView *_view;
|
|
||||||
};
|
|
||||||
|
|
||||||
TextParseOptions _captionTextOptions = {
|
TextParseOptions _captionTextOptions = {
|
||||||
TextParseLinks | TextParseMentions | TextParseHashtags | TextParseMultiline | TextParseRichText, // flags
|
TextParseLinks | TextParseMentions | TextParseHashtags | TextParseMultiline | TextParseRichText, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
|
@ -95,7 +78,7 @@ MediaView::MediaView() : TWidget(App::wnd())
|
||||||
custom.insert(QChar('c'), qMakePair(textcmdStartLink(1), textcmdStopLink()));
|
custom.insert(QChar('c'), qMakePair(textcmdStartLink(1), textcmdStopLink()));
|
||||||
_saveMsgText.setRichText(st::medviewSaveMsgFont, lang(lng_mediaview_saved), _textDlgOptions, custom);
|
_saveMsgText.setRichText(st::medviewSaveMsgFont, lang(lng_mediaview_saved), _textDlgOptions, custom);
|
||||||
_saveMsg = QRect(0, 0, _saveMsgText.maxWidth() + st::medviewSaveMsgPadding.left() + st::medviewSaveMsgPadding.right(), st::medviewSaveMsgFont->height + st::medviewSaveMsgPadding.top() + st::medviewSaveMsgPadding.bottom());
|
_saveMsg = QRect(0, 0, _saveMsgText.maxWidth() + st::medviewSaveMsgPadding.left() + st::medviewSaveMsgPadding.right(), st::medviewSaveMsgFont->height + st::medviewSaveMsgPadding.top() + st::medviewSaveMsgPadding.bottom());
|
||||||
_saveMsgText.setLink(1, MakeShared<SaveMsgClickHandler>(this));
|
_saveMsgText.setLink(1, MakeShared<LambdaClickHandler>([this] { showSaveMsgFile(); }));
|
||||||
|
|
||||||
connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(onScreenResized(int)));
|
connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(onScreenResized(int)));
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@ public:
|
||||||
void documentUpdated(DocumentData *doc);
|
void documentUpdated(DocumentData *doc);
|
||||||
void changingMsgId(HistoryItem *row, MsgId newId);
|
void changingMsgId(HistoryItem *row, MsgId newId);
|
||||||
|
|
||||||
void showSaveMsgFile();
|
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
void activateControls();
|
void activateControls();
|
||||||
|
@ -128,6 +127,8 @@ private slots:
|
||||||
void onVideoPlayProgress(const AudioMsgId &audioId);
|
void onVideoPlayProgress(const AudioMsgId &audioId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void showSaveMsgFile();
|
||||||
|
|
||||||
void dropdownHidden();
|
void dropdownHidden();
|
||||||
void updateDocSize();
|
void updateDocSize();
|
||||||
void updateControls();
|
void updateControls();
|
||||||
|
|
|
@ -409,7 +409,7 @@ Voice::Voice(DocumentData *voice, HistoryItem *parent) : FileBase(parent)
|
||||||
QString d = textcmdLink(1, textRichPrepare(langDateTime(date(_data->date))));
|
QString d = textcmdLink(1, textRichPrepare(langDateTime(date(_data->date))));
|
||||||
TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto };
|
TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto };
|
||||||
_details.setText(st::normalFont, lng_date_and_duration(lt_date, d, lt_duration, formatDurationText(_data->voice()->duration)), opts);
|
_details.setText(st::normalFont, lng_date_and_duration(lt_date, d, lt_duration, formatDurationText(_data->voice()->duration)), opts);
|
||||||
_details.setLink(1, MakeShared<GoToMessageClickHandler>(parent));
|
_details.setLink(1, goToMessageClickHandler(parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Voice::initDimensions() {
|
void Voice::initDimensions() {
|
||||||
|
@ -588,7 +588,7 @@ bool Voice::updateStatusText() const {
|
||||||
|
|
||||||
Document::Document(DocumentData *document, HistoryItem *parent, const style::OverviewFileLayout &st) : FileBase(parent)
|
Document::Document(DocumentData *document, HistoryItem *parent, const style::OverviewFileLayout &st) : FileBase(parent)
|
||||||
, _data(document)
|
, _data(document)
|
||||||
, _msgl(new GoToMessageClickHandler(parent))
|
, _msgl(goToMessageClickHandler(parent))
|
||||||
, _namel(new DocumentOpenClickHandler(_data))
|
, _namel(new DocumentOpenClickHandler(_data))
|
||||||
, _st(st)
|
, _st(st)
|
||||||
, _date(langDateTime(date(_data->date)))
|
, _date(langDateTime(date(_data->date)))
|
||||||
|
|
|
@ -23,6 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_overview.h"
|
#include "styles/style_overview.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
#include "styles/style_window.h"
|
#include "styles/style_window.h"
|
||||||
|
#include "styles/style_settings.h"
|
||||||
#include "boxes/addcontactbox.h"
|
#include "boxes/addcontactbox.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "boxes/photocropbox.h"
|
#include "boxes/photocropbox.h"
|
||||||
|
@ -45,7 +46,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
// flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
|
// flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
|
||||||
|
|
||||||
OverviewInner::OverviewInner(OverviewWidget *overview, ScrollArea *scroll, PeerData *peer, MediaOverviewType type) : TWidget(nullptr)
|
OverviewInner::OverviewInner(OverviewWidget *overview, Ui::ScrollArea *scroll, PeerData *peer, MediaOverviewType type) : TWidget(nullptr)
|
||||||
, _overview(overview)
|
, _overview(overview)
|
||||||
, _scroll(scroll)
|
, _scroll(scroll)
|
||||||
, _peer(peer->migrateTo() ? peer->migrateTo() : peer)
|
, _peer(peer->migrateTo() ? peer->migrateTo() : peer)
|
||||||
|
@ -116,7 +117,7 @@ void OverviewInner::touchUpdateSpeed() {
|
||||||
// of a small horizontal offset when scrolling vertically
|
// of a small horizontal offset when scrolling vertically
|
||||||
const int newSpeedY = (qAbs(pixelsPerSecond.y()) > FingerAccuracyThreshold) ? pixelsPerSecond.y() : 0;
|
const int newSpeedY = (qAbs(pixelsPerSecond.y()) > FingerAccuracyThreshold) ? pixelsPerSecond.y() : 0;
|
||||||
const int newSpeedX = (qAbs(pixelsPerSecond.x()) > FingerAccuracyThreshold) ? pixelsPerSecond.x() : 0;
|
const int newSpeedX = (qAbs(pixelsPerSecond.x()) > FingerAccuracyThreshold) ? pixelsPerSecond.x() : 0;
|
||||||
if (_touchScrollState == TouchScrollAuto) {
|
if (_touchScrollState == Ui::TouchScrollState::Auto) {
|
||||||
const int oldSpeedY = _touchSpeed.y();
|
const int oldSpeedY = _touchSpeed.y();
|
||||||
const int oldSpeedX = _touchSpeed.x();
|
const int oldSpeedX = _touchSpeed.x();
|
||||||
if ((oldSpeedY <= 0 && newSpeedY <= 0) || ((oldSpeedY >= 0 && newSpeedY >= 0)
|
if ((oldSpeedY <= 0 && newSpeedY <= 0) || ((oldSpeedY >= 0 && newSpeedY >= 0)
|
||||||
|
@ -352,7 +353,7 @@ void OverviewInner::touchEvent(QTouchEvent *e) {
|
||||||
_touchInProgress = false;
|
_touchInProgress = false;
|
||||||
_touchSelectTimer.stop();
|
_touchSelectTimer.stop();
|
||||||
_touchScroll = _touchSelect = false;
|
_touchScroll = _touchSelect = false;
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
dragActionCancel();
|
dragActionCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -368,8 +369,8 @@ void OverviewInner::touchEvent(QTouchEvent *e) {
|
||||||
if (e->touchPoints().isEmpty()) return;
|
if (e->touchPoints().isEmpty()) return;
|
||||||
|
|
||||||
_touchInProgress = true;
|
_touchInProgress = true;
|
||||||
if (_touchScrollState == TouchScrollAuto) {
|
if (_touchScrollState == Ui::TouchScrollState::Auto) {
|
||||||
_touchScrollState = TouchScrollAcceleration;
|
_touchScrollState = Ui::TouchScrollState::Acceleration;
|
||||||
_touchWaitingAcceleration = true;
|
_touchWaitingAcceleration = true;
|
||||||
_touchAccelerationTime = getms();
|
_touchAccelerationTime = getms();
|
||||||
touchUpdateSpeed();
|
touchUpdateSpeed();
|
||||||
|
@ -392,13 +393,13 @@ void OverviewInner::touchEvent(QTouchEvent *e) {
|
||||||
touchUpdateSpeed();
|
touchUpdateSpeed();
|
||||||
}
|
}
|
||||||
if (_touchScroll) {
|
if (_touchScroll) {
|
||||||
if (_touchScrollState == TouchScrollManual) {
|
if (_touchScrollState == Ui::TouchScrollState::Manual) {
|
||||||
touchScrollUpdated(_touchPos);
|
touchScrollUpdated(_touchPos);
|
||||||
} else if (_touchScrollState == TouchScrollAcceleration) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Acceleration) {
|
||||||
touchUpdateSpeed();
|
touchUpdateSpeed();
|
||||||
_touchAccelerationTime = getms();
|
_touchAccelerationTime = getms();
|
||||||
if (_touchSpeed.isNull()) {
|
if (_touchSpeed.isNull()) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,17 +414,17 @@ void OverviewInner::touchEvent(QTouchEvent *e) {
|
||||||
showContextMenu(&contextMenu, true);
|
showContextMenu(&contextMenu, true);
|
||||||
_touchScroll = false;
|
_touchScroll = false;
|
||||||
} else if (_touchScroll) {
|
} else if (_touchScroll) {
|
||||||
if (_touchScrollState == TouchScrollManual) {
|
if (_touchScrollState == Ui::TouchScrollState::Manual) {
|
||||||
_touchScrollState = TouchScrollAuto;
|
_touchScrollState = Ui::TouchScrollState::Auto;
|
||||||
_touchPrevPosValid = false;
|
_touchPrevPosValid = false;
|
||||||
_touchScrollTimer.start(15);
|
_touchScrollTimer.start(15);
|
||||||
_touchTime = getms();
|
_touchTime = getms();
|
||||||
} else if (_touchScrollState == TouchScrollAuto) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Auto) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
_touchScroll = false;
|
_touchScroll = false;
|
||||||
touchResetSpeed();
|
touchResetSpeed();
|
||||||
} else if (_touchScrollState == TouchScrollAcceleration) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Acceleration) {
|
||||||
_touchScrollState = TouchScrollAuto;
|
_touchScrollState = Ui::TouchScrollState::Auto;
|
||||||
_touchWaitingAcceleration = false;
|
_touchWaitingAcceleration = false;
|
||||||
_touchPrevPosValid = false;
|
_touchPrevPosValid = false;
|
||||||
}
|
}
|
||||||
|
@ -1561,16 +1562,16 @@ void OverviewInner::onTouchSelect() {
|
||||||
|
|
||||||
void OverviewInner::onTouchScrollTimer() {
|
void OverviewInner::onTouchScrollTimer() {
|
||||||
uint64 nowTime = getms();
|
uint64 nowTime = getms();
|
||||||
if (_touchScrollState == TouchScrollAcceleration && _touchWaitingAcceleration && (nowTime - _touchAccelerationTime) > 40) {
|
if (_touchScrollState == Ui::TouchScrollState::Acceleration && _touchWaitingAcceleration && (nowTime - _touchAccelerationTime) > 40) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
touchResetSpeed();
|
touchResetSpeed();
|
||||||
} else if (_touchScrollState == TouchScrollAuto || _touchScrollState == TouchScrollAcceleration) {
|
} else if (_touchScrollState == Ui::TouchScrollState::Auto || _touchScrollState == Ui::TouchScrollState::Acceleration) {
|
||||||
int32 elapsed = int32(nowTime - _touchTime);
|
int32 elapsed = int32(nowTime - _touchTime);
|
||||||
QPoint delta = _touchSpeed * elapsed / 1000;
|
QPoint delta = _touchSpeed * elapsed / 1000;
|
||||||
bool hasScrolled = _overview->touchScroll(delta);
|
bool hasScrolled = _overview->touchScroll(delta);
|
||||||
|
|
||||||
if (_touchSpeed.isNull() || !hasScrolled) {
|
if (_touchSpeed.isNull() || !hasScrolled) {
|
||||||
_touchScrollState = TouchScrollManual;
|
_touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
_touchScroll = false;
|
_touchScroll = false;
|
||||||
_touchScrollTimer.stop();
|
_touchScrollTimer.stop();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1876,16 +1877,16 @@ OverviewInner::~OverviewInner() {
|
||||||
}
|
}
|
||||||
|
|
||||||
OverviewWidget::OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewType type) : TWidget(parent)
|
OverviewWidget::OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewType type) : TWidget(parent)
|
||||||
, _scroll(this, st::setScroll, false)
|
, _scroll(this, st::settingsScroll, false)
|
||||||
, _inner(this, &_scroll, peer, type)
|
, _inner(this, _scroll, peer, type)
|
||||||
, _a_show(animation(this, &OverviewWidget::step_show))
|
, _a_show(animation(this, &OverviewWidget::step_show))
|
||||||
, _topShadow(this, st::shadowColor) {
|
, _topShadow(this, st::shadowColor) {
|
||||||
_scroll.setWidget(&_inner);
|
_scroll->setOwnedWidget(_inner);
|
||||||
_scroll.move(0, 0);
|
_scroll->move(0, 0);
|
||||||
_inner.move(0, 0);
|
_inner->move(0, 0);
|
||||||
|
|
||||||
_scroll.show();
|
_scroll->show();
|
||||||
connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||||
|
|
||||||
connect(&_scrollTimer, SIGNAL(timeout()), this, SLOT(onScrollTimer()));
|
connect(&_scrollTimer, SIGNAL(timeout()), this, SLOT(onScrollTimer()));
|
||||||
_scrollTimer.setSingleShot(false);
|
_scrollTimer.setSingleShot(false);
|
||||||
|
@ -1894,37 +1895,37 @@ OverviewWidget::OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewTyp
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::clear() {
|
void OverviewWidget::clear() {
|
||||||
_inner.clear();
|
_inner->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::onScroll() {
|
void OverviewWidget::onScroll() {
|
||||||
MTP::clearLoaderPriorities();
|
MTP::clearLoaderPriorities();
|
||||||
int32 preloadThreshold = _scroll.height() * 5;
|
int32 preloadThreshold = _scroll->height() * 5;
|
||||||
bool needToPreload = false;
|
bool needToPreload = false;
|
||||||
do {
|
do {
|
||||||
needToPreload = (type() == OverviewMusicFiles || type() == OverviewVoiceFiles) ? (_scroll.scrollTop() < preloadThreshold) : (_scroll.scrollTop() + preloadThreshold > _scroll.scrollTopMax());
|
needToPreload = (type() == OverviewMusicFiles || type() == OverviewVoiceFiles) ? (_scroll->scrollTop() < preloadThreshold) : (_scroll->scrollTop() + preloadThreshold > _scroll->scrollTopMax());
|
||||||
if (!needToPreload || !_inner.preloadLocal()) {
|
if (!needToPreload || !_inner->preloadLocal()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (true);
|
} while (true);
|
||||||
if (needToPreload) {
|
if (needToPreload) {
|
||||||
_inner.preloadMore();
|
_inner->preloadMore();
|
||||||
}
|
}
|
||||||
if (!_noDropResizeIndex) {
|
if (!_noDropResizeIndex) {
|
||||||
_inner.dropResizeIndex();
|
_inner->dropResizeIndex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::resizeEvent(QResizeEvent *e) {
|
void OverviewWidget::resizeEvent(QResizeEvent *e) {
|
||||||
_noDropResizeIndex = true;
|
_noDropResizeIndex = true;
|
||||||
int32 st = _scroll.scrollTop();
|
int32 st = _scroll->scrollTop();
|
||||||
_scroll.resize(size());
|
_scroll->resize(size());
|
||||||
int32 newScrollTop = _inner.resizeToWidth(width(), st, height());
|
int32 newScrollTop = _inner->resizeToWidth(width(), st, height());
|
||||||
if (int32 addToY = App::main() ? App::main()->contentScrollAddToY() : 0) {
|
if (int32 addToY = App::main() ? App::main()->contentScrollAddToY() : 0) {
|
||||||
newScrollTop += addToY;
|
newScrollTop += addToY;
|
||||||
}
|
}
|
||||||
if (newScrollTop != _scroll.scrollTop()) {
|
if (newScrollTop != _scroll->scrollTop()) {
|
||||||
_scroll.scrollToY(newScrollTop);
|
_scroll->scrollToY(newScrollTop);
|
||||||
}
|
}
|
||||||
_noDropResizeIndex = false;
|
_noDropResizeIndex = false;
|
||||||
|
|
||||||
|
@ -1955,19 +1956,19 @@ void OverviewWidget::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::contextMenuEvent(QContextMenuEvent *e) {
|
void OverviewWidget::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
return _inner.showContextMenu(e);
|
return _inner->showContextMenu(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::scrollBy(int32 add) {
|
void OverviewWidget::scrollBy(int32 add) {
|
||||||
if (_scroll.isHidden()) {
|
if (_scroll->isHidden()) {
|
||||||
_scrollSetAfterShow += add;
|
_scrollSetAfterShow += add;
|
||||||
} else {
|
} else {
|
||||||
_scroll.scrollToY(_scroll.scrollTop() + add);
|
_scroll->scrollToY(_scroll->scrollTop() + add);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::scrollReset() {
|
void OverviewWidget::scrollReset() {
|
||||||
_scroll.scrollToY((type() == OverviewMusicFiles || type() == OverviewVoiceFiles) ? _scroll.scrollTopMax() : 0);
|
_scroll->scrollToY((type() == OverviewMusicFiles || type() == OverviewVoiceFiles) ? _scroll->scrollTopMax() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OverviewWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) {
|
bool OverviewWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) {
|
||||||
|
@ -1998,24 +1999,24 @@ void OverviewWidget::topBarClick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
PeerData *OverviewWidget::peer() const {
|
PeerData *OverviewWidget::peer() const {
|
||||||
return _inner.peer();
|
return _inner->peer();
|
||||||
}
|
}
|
||||||
|
|
||||||
PeerData *OverviewWidget::migratePeer() const {
|
PeerData *OverviewWidget::migratePeer() const {
|
||||||
return _inner.migratePeer();
|
return _inner->migratePeer();
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaOverviewType OverviewWidget::type() const {
|
MediaOverviewType OverviewWidget::type() const {
|
||||||
return _inner.type();
|
return _inner->type();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::switchType(MediaOverviewType type) {
|
void OverviewWidget::switchType(MediaOverviewType type) {
|
||||||
_selCount = 0;
|
_selCount = 0;
|
||||||
|
|
||||||
disconnect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
disconnect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||||
|
|
||||||
_inner.setSelectMode(false);
|
_inner->setSelectMode(false);
|
||||||
_inner.switchType(type);
|
_inner->switchType(type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case OverviewPhotos: _header = lang(lng_profile_photos_header); break;
|
case OverviewPhotos: _header = lang(lng_profile_photos_header); break;
|
||||||
case OverviewVideos: _header = lang(lng_profile_videos_header); break;
|
case OverviewVideos: _header = lang(lng_profile_videos_header); break;
|
||||||
|
@ -2029,7 +2030,7 @@ void OverviewWidget::switchType(MediaOverviewType type) {
|
||||||
updateTopBarSelection();
|
updateTopBarSelection();
|
||||||
scrollReset();
|
scrollReset();
|
||||||
|
|
||||||
connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||||
|
|
||||||
onScroll();
|
onScroll();
|
||||||
activate();
|
activate();
|
||||||
|
@ -2037,15 +2038,15 @@ void OverviewWidget::switchType(MediaOverviewType type) {
|
||||||
|
|
||||||
void OverviewWidget::updateTopBarSelection() {
|
void OverviewWidget::updateTopBarSelection() {
|
||||||
int32 selectedForForward, selectedForDelete;
|
int32 selectedForForward, selectedForDelete;
|
||||||
_inner.getSelectionState(selectedForForward, selectedForDelete);
|
_inner->getSelectionState(selectedForForward, selectedForDelete);
|
||||||
_selCount = selectedForForward ? selectedForForward : selectedForDelete;
|
_selCount = selectedForForward ? selectedForForward : selectedForDelete;
|
||||||
_inner.setSelectMode(_selCount > 0);
|
_inner->setSelectMode(_selCount > 0);
|
||||||
if (App::main()) {
|
if (App::main()) {
|
||||||
App::main()->topBar()->showSelected(_selCount > 0 ? _selCount : 0, (selectedForDelete == selectedForForward));
|
App::main()->topBar()->showSelected(_selCount > 0 ? _selCount : 0, (selectedForDelete == selectedForForward));
|
||||||
App::main()->topBar()->update();
|
App::main()->topBar()->update();
|
||||||
}
|
}
|
||||||
if (App::wnd() && !Ui::isLayerShown()) {
|
if (App::wnd() && !Ui::isLayerShown()) {
|
||||||
_inner.activate();
|
_inner->activate();
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -2055,7 +2056,7 @@ int32 OverviewWidget::lastWidth() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 OverviewWidget::lastScrollTop() const {
|
int32 OverviewWidget::lastScrollTop() const {
|
||||||
return _scroll.scrollTop();
|
return _scroll->scrollTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 OverviewWidget::countBestScroll() const {
|
int32 OverviewWidget::countBestScroll() const {
|
||||||
|
@ -2063,22 +2064,22 @@ int32 OverviewWidget::countBestScroll() const {
|
||||||
AudioMsgId playing;
|
AudioMsgId playing;
|
||||||
audioPlayer()->currentState(&playing, AudioMsgId::Type::Song);
|
audioPlayer()->currentState(&playing, AudioMsgId::Type::Song);
|
||||||
if (playing) {
|
if (playing) {
|
||||||
int32 top = _inner.itemTop(playing.contextId());
|
int32 top = _inner->itemTop(playing.contextId());
|
||||||
if (top >= 0) {
|
if (top >= 0) {
|
||||||
return snap(top - int(_scroll.height() - (st::msgPadding.top() + st::mediaThumbSize + st::msgPadding.bottom())) / 2, 0, _scroll.scrollTopMax());
|
return snap(top - int(_scroll->height() - (st::msgPadding.top() + st::mediaThumbSize + st::msgPadding.bottom())) / 2, 0, _scroll->scrollTopMax());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (type() == OverviewLinks || type() == OverviewFiles) {
|
} else if (type() == OverviewLinks || type() == OverviewFiles) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return _scroll.scrollTopMax();
|
return _scroll->scrollTopMax();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::fastShow(bool back, int32 lastScrollTop) {
|
void OverviewWidget::fastShow(bool back, int32 lastScrollTop) {
|
||||||
resizeEvent(0);
|
resizeEvent(0);
|
||||||
_scrollSetAfterShow = (lastScrollTop < 0 ? countBestScroll() : lastScrollTop);
|
_scrollSetAfterShow = (lastScrollTop < 0 ? countBestScroll() : lastScrollTop);
|
||||||
show();
|
show();
|
||||||
_inner.activate();
|
_inner->activate();
|
||||||
doneShow();
|
doneShow();
|
||||||
|
|
||||||
if (App::app()) App::app()->mtpUnpause();
|
if (App::app()) App::app()->mtpUnpause();
|
||||||
|
@ -2086,7 +2087,7 @@ void OverviewWidget::fastShow(bool back, int32 lastScrollTop) {
|
||||||
|
|
||||||
void OverviewWidget::setLastScrollTop(int lastScrollTop) {
|
void OverviewWidget::setLastScrollTop(int lastScrollTop) {
|
||||||
resizeEvent(0);
|
resizeEvent(0);
|
||||||
_scroll.scrollToY(lastScrollTop < 0 ? countBestScroll() : lastScrollTop);
|
_scroll->scrollToY(lastScrollTop < 0 ? countBestScroll() : lastScrollTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::showAnimated(Window::SlideDirection direction, const Window::SectionSlideParams ¶ms) {
|
void OverviewWidget::showAnimated(Window::SlideDirection direction, const Window::SectionSlideParams ¶ms) {
|
||||||
|
@ -2101,8 +2102,8 @@ void OverviewWidget::showAnimated(Window::SlideDirection direction, const Window
|
||||||
_topShadow->setVisible(params.withTopBarShadow ? true : false);
|
_topShadow->setVisible(params.withTopBarShadow ? true : false);
|
||||||
App::main()->topBar()->startAnim();
|
App::main()->topBar()->startAnim();
|
||||||
|
|
||||||
_scrollSetAfterShow = _scroll.scrollTop();
|
_scrollSetAfterShow = _scroll->scrollTop();
|
||||||
_scroll.hide();
|
_scroll->hide();
|
||||||
|
|
||||||
int delta = st::slideShift;
|
int delta = st::slideShift;
|
||||||
if (direction == Window::SlideDirection::FromLeft) {
|
if (direction == Window::SlideDirection::FromLeft) {
|
||||||
|
@ -2149,15 +2150,15 @@ void OverviewWidget::step_show(float64 ms, bool timer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::doneShow() {
|
void OverviewWidget::doneShow() {
|
||||||
_scroll.show();
|
_scroll->show();
|
||||||
_scroll.scrollToY(_scrollSetAfterShow);
|
_scroll->scrollToY(_scrollSetAfterShow);
|
||||||
activate();
|
activate();
|
||||||
onScroll();
|
onScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::mediaOverviewUpdated(PeerData *p, MediaOverviewType t) {
|
void OverviewWidget::mediaOverviewUpdated(PeerData *p, MediaOverviewType t) {
|
||||||
if ((peer() == p || migratePeer() == p) && t == type()) {
|
if ((peer() == p || migratePeer() == p) && t == type()) {
|
||||||
_inner.mediaOverviewUpdated();
|
_inner->mediaOverviewUpdated();
|
||||||
onScroll();
|
onScroll();
|
||||||
updateTopBarSelection();
|
updateTopBarSelection();
|
||||||
}
|
}
|
||||||
|
@ -2165,7 +2166,7 @@ void OverviewWidget::mediaOverviewUpdated(PeerData *p, MediaOverviewType t) {
|
||||||
|
|
||||||
void OverviewWidget::changingMsgId(HistoryItem *row, MsgId newId) {
|
void OverviewWidget::changingMsgId(HistoryItem *row, MsgId newId) {
|
||||||
if (peer() == row->history()->peer || migratePeer() == row->history()->peer) {
|
if (peer() == row->history()->peer || migratePeer() == row->history()->peer) {
|
||||||
_inner.changingMsgId(row, newId);
|
_inner->changingMsgId(row, newId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2182,22 +2183,22 @@ void OverviewWidget::grabFinish() {
|
||||||
|
|
||||||
void OverviewWidget::ui_repaintHistoryItem(const HistoryItem *item) {
|
void OverviewWidget::ui_repaintHistoryItem(const HistoryItem *item) {
|
||||||
if (peer() == item->history()->peer || migratePeer() == item->history()->peer) {
|
if (peer() == item->history()->peer || migratePeer() == item->history()->peer) {
|
||||||
_inner.repaintItem(item);
|
_inner->repaintItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::notify_historyItemLayoutChanged(const HistoryItem *item) {
|
void OverviewWidget::notify_historyItemLayoutChanged(const HistoryItem *item) {
|
||||||
if (peer() == item->history()->peer || migratePeer() == item->history()->peer) {
|
if (peer() == item->history()->peer || migratePeer() == item->history()->peer) {
|
||||||
_inner.onUpdateSelected();
|
_inner->onUpdateSelected();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::fillSelectedItems(SelectedItemSet &sel, bool forDelete) {
|
void OverviewWidget::fillSelectedItems(SelectedItemSet &sel, bool forDelete) {
|
||||||
_inner.fillSelectedItems(sel, forDelete);
|
_inner->fillSelectedItems(sel, forDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::updateAfterDrag() {
|
void OverviewWidget::updateAfterDrag() {
|
||||||
_inner.dragActionUpdate(QCursor::pos());
|
_inner->dragActionUpdate(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
OverviewWidget::~OverviewWidget() {
|
OverviewWidget::~OverviewWidget() {
|
||||||
|
@ -2206,37 +2207,37 @@ OverviewWidget::~OverviewWidget() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::activate() {
|
void OverviewWidget::activate() {
|
||||||
if (_scroll.isHidden()) {
|
if (_scroll->isHidden()) {
|
||||||
setFocus();
|
setFocus();
|
||||||
} else {
|
} else {
|
||||||
_inner.activate();
|
_inner->activate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint OverviewWidget::clampMousePosition(QPoint point) {
|
QPoint OverviewWidget::clampMousePosition(QPoint point) {
|
||||||
if (point.x() < 0) {
|
if (point.x() < 0) {
|
||||||
point.setX(0);
|
point.setX(0);
|
||||||
} else if (point.x() >= _scroll.width()) {
|
} else if (point.x() >= _scroll->width()) {
|
||||||
point.setX(_scroll.width() - 1);
|
point.setX(_scroll->width() - 1);
|
||||||
}
|
}
|
||||||
if (point.y() < _scroll.scrollTop()) {
|
if (point.y() < _scroll->scrollTop()) {
|
||||||
point.setY(_scroll.scrollTop());
|
point.setY(_scroll->scrollTop());
|
||||||
} else if (point.y() >= _scroll.scrollTop() + _scroll.height()) {
|
} else if (point.y() >= _scroll->scrollTop() + _scroll->height()) {
|
||||||
point.setY(_scroll.scrollTop() + _scroll.height() - 1);
|
point.setY(_scroll->scrollTop() + _scroll->height() - 1);
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::onScrollTimer() {
|
void OverviewWidget::onScrollTimer() {
|
||||||
int32 d = (_scrollDelta > 0) ? qMin(_scrollDelta * 3 / 20 + 1, int32(MaxScrollSpeed)) : qMax(_scrollDelta * 3 / 20 - 1, -int32(MaxScrollSpeed));
|
int32 d = (_scrollDelta > 0) ? qMin(_scrollDelta * 3 / 20 + 1, int32(MaxScrollSpeed)) : qMax(_scrollDelta * 3 / 20 - 1, -int32(MaxScrollSpeed));
|
||||||
_scroll.scrollToY(_scroll.scrollTop() + d);
|
_scroll->scrollToY(_scroll->scrollTop() + d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::checkSelectingScroll(QPoint point) {
|
void OverviewWidget::checkSelectingScroll(QPoint point) {
|
||||||
if (point.y() < _scroll.scrollTop()) {
|
if (point.y() < _scroll->scrollTop()) {
|
||||||
_scrollDelta = point.y() - _scroll.scrollTop();
|
_scrollDelta = point.y() - _scroll->scrollTop();
|
||||||
} else if (point.y() >= _scroll.scrollTop() + _scroll.height()) {
|
} else if (point.y() >= _scroll->scrollTop() + _scroll->height()) {
|
||||||
_scrollDelta = point.y() - _scroll.scrollTop() - _scroll.height() + 1;
|
_scrollDelta = point.y() - _scroll->scrollTop() - _scroll->height() + 1;
|
||||||
} else {
|
} else {
|
||||||
_scrollDelta = 0;
|
_scrollDelta = 0;
|
||||||
}
|
}
|
||||||
|
@ -2252,10 +2253,10 @@ void OverviewWidget::noSelectingScroll() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OverviewWidget::touchScroll(const QPoint &delta) {
|
bool OverviewWidget::touchScroll(const QPoint &delta) {
|
||||||
int32 scTop = _scroll.scrollTop(), scMax = _scroll.scrollTopMax(), scNew = snap(scTop - delta.y(), 0, scMax);
|
int32 scTop = _scroll->scrollTop(), scMax = _scroll->scrollTopMax(), scNew = snap(scTop - delta.y(), 0, scMax);
|
||||||
if (scNew == scTop) return false;
|
if (scNew == scTop) return false;
|
||||||
|
|
||||||
_scroll.scrollToY(scNew);
|
_scroll->scrollToY(scNew);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2265,7 +2266,7 @@ void OverviewWidget::onForwardSelected() {
|
||||||
|
|
||||||
void OverviewWidget::onDeleteSelected() {
|
void OverviewWidget::onDeleteSelected() {
|
||||||
SelectedItemSet sel;
|
SelectedItemSet sel;
|
||||||
_inner.fillSelectedItems(sel);
|
_inner->fillSelectedItems(sel);
|
||||||
if (sel.isEmpty()) return;
|
if (sel.isEmpty()) return;
|
||||||
|
|
||||||
App::main()->deleteLayer(sel.size());
|
App::main()->deleteLayer(sel.size());
|
||||||
|
@ -2275,7 +2276,7 @@ void OverviewWidget::onDeleteSelectedSure() {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
|
|
||||||
SelectedItemSet sel;
|
SelectedItemSet sel;
|
||||||
_inner.fillSelectedItems(sel);
|
_inner->fillSelectedItems(sel);
|
||||||
if (sel.isEmpty()) return;
|
if (sel.isEmpty()) return;
|
||||||
|
|
||||||
QMap<PeerData*, QVector<MTPint> > ids;
|
QMap<PeerData*, QVector<MTPint> > ids;
|
||||||
|
@ -2318,5 +2319,5 @@ void OverviewWidget::onDeleteContextSure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewWidget::onClearSelected() {
|
void OverviewWidget::onClearSelected() {
|
||||||
_inner.clearSelectedItems();
|
_inner->clearSelectedItems();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "window/section_widget.h"
|
#include "window/section_widget.h"
|
||||||
#include "ui/widgets/tooltip.h"
|
#include "ui/widgets/tooltip.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
|
|
||||||
namespace Overview {
|
namespace Overview {
|
||||||
namespace Layout {
|
namespace Layout {
|
||||||
|
@ -43,7 +44,7 @@ class OverviewInner : public TWidget, public Ui::AbstractTooltipShower, public R
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OverviewInner(OverviewWidget *overview, ScrollArea *scroll, PeerData *peer, MediaOverviewType type);
|
OverviewInner(OverviewWidget *overview, Ui::ScrollArea *scroll, PeerData *peer, MediaOverviewType type);
|
||||||
|
|
||||||
void activate();
|
void activate();
|
||||||
|
|
||||||
|
@ -154,7 +155,7 @@ private:
|
||||||
int32 countHeight();
|
int32 countHeight();
|
||||||
|
|
||||||
OverviewWidget *_overview;
|
OverviewWidget *_overview;
|
||||||
ScrollArea *_scroll;
|
Ui::ScrollArea *_scroll;
|
||||||
int _resizeIndex = -1;
|
int _resizeIndex = -1;
|
||||||
int _resizeSkip = 0;
|
int _resizeSkip = 0;
|
||||||
|
|
||||||
|
@ -257,7 +258,7 @@ private:
|
||||||
QPoint _touchStart, _touchPrevPos, _touchPos;
|
QPoint _touchStart, _touchPrevPos, _touchPos;
|
||||||
QTimer _touchSelectTimer;
|
QTimer _touchSelectTimer;
|
||||||
|
|
||||||
TouchScrollState _touchScrollState = TouchScrollManual;
|
Ui::TouchScrollState _touchScrollState = Ui::TouchScrollState::Manual;
|
||||||
bool _touchPrevPosValid = false;
|
bool _touchPrevPosValid = false;
|
||||||
bool _touchWaitingAcceleration = false;
|
bool _touchWaitingAcceleration = false;
|
||||||
QPoint _touchSpeed;
|
QPoint _touchSpeed;
|
||||||
|
@ -325,7 +326,7 @@ public:
|
||||||
void grapWithoutTopBarShadow();
|
void grapWithoutTopBarShadow();
|
||||||
void grabFinish() override;
|
void grabFinish() override;
|
||||||
void rpcClear() override {
|
void rpcClear() override {
|
||||||
_inner.rpcClear();
|
_inner->rpcClear();
|
||||||
RPCSender::rpcClear();
|
RPCSender::rpcClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,8 +354,8 @@ public slots:
|
||||||
void onClearSelected();
|
void onClearSelected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScrollArea _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
OverviewInner _inner;
|
ChildWidget<OverviewInner> _inner;
|
||||||
bool _noDropResizeIndex = false;
|
bool _noDropResizeIndex = false;
|
||||||
|
|
||||||
QString _header;
|
QString _header;
|
||||||
|
|
|
@ -187,7 +187,7 @@ void PasscodeWidget::paintEvent(QPaintEvent *e) {
|
||||||
p.fillRect(rect(), st::windowBg);
|
p.fillRect(rect(), st::windowBg);
|
||||||
|
|
||||||
p.setFont(st::passcodeHeaderFont);
|
p.setFont(st::passcodeHeaderFont);
|
||||||
p.setPen(st::windowTextFg);
|
p.setPen(st::windowFg);
|
||||||
p.drawText(QRect(0, _passcode->y() - st::passcodeHeaderHeight, width(), st::passcodeHeaderHeight), lang(lng_passcode_enter), style::al_center);
|
p.drawText(QRect(0, _passcode->y() - st::passcodeHeaderHeight, width(), st::passcodeHeaderHeight), lang(lng_passcode_enter), style::al_center);
|
||||||
|
|
||||||
if (!_error.isEmpty()) {
|
if (!_error.isEmpty()) {
|
||||||
|
|
|
@ -39,14 +39,14 @@ profilePhotoLeftMax: 35px;
|
||||||
profilePhotoDuration: 500;
|
profilePhotoDuration: 500;
|
||||||
profileNameLeft: 26px;
|
profileNameLeft: 26px;
|
||||||
profileNameTop: 9px;
|
profileNameTop: 9px;
|
||||||
profileNameLabel: flatLabel(labelDefFlat) {
|
profileNameLabel: FlatLabel(defaultFlatLabel) {
|
||||||
margin: margins(10px, 5px, 10px, 5px);
|
margin: margins(10px, 5px, 10px, 5px);
|
||||||
font: font(16px semibold);
|
font: font(16px semibold);
|
||||||
width: 160px;
|
width: 160px;
|
||||||
maxHeight: 24px;
|
maxHeight: 24px;
|
||||||
textFg: #333333;
|
textFg: #333333;
|
||||||
}
|
}
|
||||||
profileNameTextStyle: textStyle(defaultTextStyle) {
|
profileNameTextStyle: TextStyle(defaultTextStyle) {
|
||||||
}
|
}
|
||||||
profileStatusLeft: 27px;
|
profileStatusLeft: 27px;
|
||||||
profileStatusTop: 35px;
|
profileStatusTop: 35px;
|
||||||
|
@ -94,14 +94,14 @@ profileBlockTitleHeight: 24px;
|
||||||
profileBlockTitleFont: font(14px semibold);
|
profileBlockTitleFont: font(14px semibold);
|
||||||
profileBlockTitleFg: #333333;
|
profileBlockTitleFg: #333333;
|
||||||
profileBlockTitlePosition: point(24px, 0px);
|
profileBlockTitlePosition: point(24px, 0px);
|
||||||
profileBlockLabel: flatLabel(labelDefFlat) {
|
profileBlockLabel: FlatLabel(defaultFlatLabel) {
|
||||||
textFg: windowSubTextFg;
|
textFg: windowSubTextFg;
|
||||||
}
|
}
|
||||||
profileBlockTextPart: flatLabel(labelDefFlat) {
|
profileBlockTextPart: FlatLabel(defaultFlatLabel) {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
margin: margins(5px, 5px, 5px, 5px);
|
margin: margins(5px, 5px, 5px, 5px);
|
||||||
}
|
}
|
||||||
profileBlockOneLineTextPart: flatLabel(profileBlockTextPart) {
|
profileBlockOneLineTextPart: FlatLabel(profileBlockTextPart) {
|
||||||
width: 0px; // No need to set minWidth in one-line text.
|
width: 0px; // No need to set minWidth in one-line text.
|
||||||
maxHeight: 20px;
|
maxHeight: 20px;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ profileBlockOneLineWidthMax: 240px;
|
||||||
profileEnableNotificationsTop: 7px;
|
profileEnableNotificationsTop: 7px;
|
||||||
profileSettingsBlockSkip: 8px;
|
profileSettingsBlockSkip: 8px;
|
||||||
|
|
||||||
profileInviteLinkText: flatLabel(profileBlockTextPart) {
|
profileInviteLinkText: FlatLabel(profileBlockTextPart) {
|
||||||
width: 1px; // Required for BreakEverywhere
|
width: 1px; // Required for BreakEverywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,17 +122,17 @@ profileMemberPaddingLeft: 16px;
|
||||||
profileMemberPhotoSize: 46px;
|
profileMemberPhotoSize: 46px;
|
||||||
profileMemberPhotoPosition: point(12px, 6px);
|
profileMemberPhotoPosition: point(12px, 6px);
|
||||||
profileMemberNamePosition: point(68px, 11px);
|
profileMemberNamePosition: point(68px, 11px);
|
||||||
profileMemberNameFg: #222222;//windowTextFg;
|
profileMemberNameFg: #222222;
|
||||||
profileMemberStatusPosition: point(68px, 31px);
|
profileMemberStatusPosition: point(68px, 31px);
|
||||||
profileMemberStatusFg: windowSubTextFg;
|
profileMemberStatusFg: windowSubTextFg;
|
||||||
profileMemberStatusFgOver: windowSubTextFgOver;
|
profileMemberStatusFgOver: windowSubTextFgOver;
|
||||||
profileMemberStatusFgActive: windowActiveTextFg;
|
profileMemberStatusFgActive: windowActiveTextFg;
|
||||||
profileMemberAdminIcon: icon {{ "profile_admin_star", #3babe7, point(4px, 3px) }};
|
profileMemberAdminIcon: icon {{ "profile_admin_star", #3babe7, point(4px, 3px) }};
|
||||||
profileLimitReachedLabel: flatLabel(labelDefFlat) {
|
profileLimitReachedLabel: FlatLabel(defaultFlatLabel) {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
margin: margins(profileMemberPaddingLeft, 9px, profileMemberPaddingLeft, 6px);
|
margin: margins(profileMemberPaddingLeft, 9px, profileMemberPaddingLeft, 6px);
|
||||||
}
|
}
|
||||||
profileLimitReachedStyle: textStyle(defaultTextStyle) {
|
profileLimitReachedStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 19px;
|
lineHeight: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "profile/profile_userpic_button.h"
|
#include "profile/profile_userpic_button.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/filedialog.h"
|
#include "ui/filedialog.h"
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "boxes/contactsbox.h"
|
#include "boxes/contactsbox.h"
|
||||||
|
|
|
@ -23,13 +23,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "core/observer.h"
|
#include "core/observer.h"
|
||||||
#include "ui/filedialog.h"
|
#include "ui/filedialog.h"
|
||||||
|
|
||||||
class FlatLabel;
|
|
||||||
|
|
||||||
namespace style {
|
namespace style {
|
||||||
struct RoundButton;
|
struct RoundButton;
|
||||||
} // namespace style
|
} // namespace style
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
class LinkButton;
|
class LinkButton;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
@ -121,7 +120,7 @@ private:
|
||||||
ChildWidget<UserpicButton> _userpicButton;
|
ChildWidget<UserpicButton> _userpicButton;
|
||||||
ChildWidget<CoverDropArea> _dropArea = { nullptr };
|
ChildWidget<CoverDropArea> _dropArea = { nullptr };
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _name;
|
ChildWidget<Ui::FlatLabel> _name;
|
||||||
ChildWidget<Ui::LinkButton> _cancelPhotoUpload = { nullptr };
|
ChildWidget<Ui::LinkButton> _cancelPhotoUpload = { nullptr };
|
||||||
|
|
||||||
QPoint _statusPosition;
|
QPoint _statusPosition;
|
||||||
|
|
|
@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "profile/profile_info_widget.h"
|
#include "profile/profile_info_widget.h"
|
||||||
|
|
||||||
#include "styles/style_profile.h"
|
#include "styles/style_profile.h"
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "core/click_handler_types.h"
|
#include "core/click_handler_types.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
|
@ -80,7 +80,7 @@ int InfoWidget::resizeGetHeight(int newWidth) {
|
||||||
newHeight += _about->height();
|
newHeight += _about->height();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto moveLabeledText = [&newHeight, left, newWidth, marginLeft, marginRight](FlatLabel *label, FlatLabel *text, FlatLabel *shortText) {
|
auto moveLabeledText = [&newHeight, left, newWidth, marginLeft, marginRight](Ui::FlatLabel *label, Ui::FlatLabel *text, Ui::FlatLabel *shortText) {
|
||||||
if (!label) return;
|
if (!label) return;
|
||||||
|
|
||||||
label->moveToLeft(left, newHeight);
|
label->moveToLeft(left, newHeight);
|
||||||
|
@ -144,7 +144,7 @@ void InfoWidget::refreshAbout() {
|
||||||
_about.destroy();
|
_about.destroy();
|
||||||
auto aboutText = textClean(getAboutText());
|
auto aboutText = textClean(getAboutText());
|
||||||
if (!aboutText.isEmpty()) {
|
if (!aboutText.isEmpty()) {
|
||||||
_about = new FlatLabel(this, st::profileBlockTextPart);
|
_about.create(this, st::profileBlockTextPart);
|
||||||
_about->show();
|
_about->show();
|
||||||
|
|
||||||
EntitiesInText aboutEntities;
|
EntitiesInText aboutEntities;
|
||||||
|
@ -198,17 +198,17 @@ void InfoWidget::refreshChannelLink() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoWidget::setLabeledText(ChildWidget<FlatLabel> *labelWidget, const QString &label,
|
void InfoWidget::setLabeledText(ChildWidget<Ui::FlatLabel> *labelWidget, const QString &label,
|
||||||
ChildWidget<FlatLabel> *textWidget, const TextWithEntities &textWithEntities, const QString ©Text) {
|
ChildWidget<Ui::FlatLabel> *textWidget, const TextWithEntities &textWithEntities, const QString ©Text) {
|
||||||
if (labelWidget) labelWidget->destroy();
|
if (labelWidget) labelWidget->destroy();
|
||||||
textWidget->destroy();
|
textWidget->destroy();
|
||||||
if (textWithEntities.text.isEmpty()) return;
|
if (textWithEntities.text.isEmpty()) return;
|
||||||
|
|
||||||
if (labelWidget) {
|
if (labelWidget) {
|
||||||
*labelWidget = new FlatLabel(this, label, FlatLabel::InitType::Simple, st::profileBlockLabel);
|
labelWidget->create(this, label, Ui::FlatLabel::InitType::Simple, st::profileBlockLabel);
|
||||||
(*labelWidget)->show();
|
(*labelWidget)->show();
|
||||||
}
|
}
|
||||||
*textWidget = new FlatLabel(this, QString(), FlatLabel::InitType::Simple, st::profileBlockOneLineTextPart);
|
textWidget->create(this, QString(), Ui::FlatLabel::InitType::Simple, st::profileBlockOneLineTextPart);
|
||||||
(*textWidget)->show();
|
(*textWidget)->show();
|
||||||
(*textWidget)->setMarkedText(textWithEntities);
|
(*textWidget)->setMarkedText(textWithEntities);
|
||||||
(*textWidget)->setContextCopyText(copyText);
|
(*textWidget)->setContextCopyText(copyText);
|
||||||
|
|
|
@ -22,7 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "profile/profile_block_widget.h"
|
#include "profile/profile_block_widget.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
class FlatLabel;
|
class FlatLabel;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Notify {
|
namespace Notify {
|
||||||
struct PeerUpdate;
|
struct PeerUpdate;
|
||||||
|
@ -52,17 +54,17 @@ private:
|
||||||
void refreshVisibility();
|
void refreshVisibility();
|
||||||
|
|
||||||
// labelWidget may be nullptr.
|
// labelWidget may be nullptr.
|
||||||
void setLabeledText(ChildWidget<FlatLabel> *labelWidget, const QString &label,
|
void setLabeledText(ChildWidget<Ui::FlatLabel> *labelWidget, const QString &label,
|
||||||
ChildWidget<FlatLabel> *textWidget, const TextWithEntities &textWithEntities, const QString ©Text);
|
ChildWidget<Ui::FlatLabel> *textWidget, const TextWithEntities &textWithEntities, const QString ©Text);
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _about = { nullptr };
|
ChildWidget<Ui::FlatLabel> _about = { nullptr };
|
||||||
ChildWidget<FlatLabel> _channelLinkLabel = { nullptr };
|
ChildWidget<Ui::FlatLabel> _channelLinkLabel = { nullptr };
|
||||||
ChildWidget<FlatLabel> _channelLink = { nullptr };
|
ChildWidget<Ui::FlatLabel> _channelLink = { nullptr };
|
||||||
ChildWidget<FlatLabel> _channelLinkShort = { nullptr };
|
ChildWidget<Ui::FlatLabel> _channelLinkShort = { nullptr };
|
||||||
ChildWidget<FlatLabel> _mobileNumberLabel = { nullptr };
|
ChildWidget<Ui::FlatLabel> _mobileNumberLabel = { nullptr };
|
||||||
ChildWidget<FlatLabel> _mobileNumber = { nullptr };
|
ChildWidget<Ui::FlatLabel> _mobileNumber = { nullptr };
|
||||||
ChildWidget<FlatLabel> _usernameLabel = { nullptr };
|
ChildWidget<Ui::FlatLabel> _usernameLabel = { nullptr };
|
||||||
ChildWidget<FlatLabel> _username = { nullptr };
|
ChildWidget<Ui::FlatLabel> _username = { nullptr };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "profile/profile_invite_link_widget.h"
|
#include "profile/profile_invite_link_widget.h"
|
||||||
|
|
||||||
#include "styles/style_profile.h"
|
#include "styles/style_profile.h"
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
|
@ -94,7 +94,7 @@ void InviteLinkWidget::refreshLink() {
|
||||||
if (linkData.text.isEmpty()) {
|
if (linkData.text.isEmpty()) {
|
||||||
_link.destroy();
|
_link.destroy();
|
||||||
} else {
|
} else {
|
||||||
_link = new FlatLabel(this, QString(), FlatLabel::InitType::Simple, st::profileInviteLinkText);
|
_link.create(this, QString(), Ui::FlatLabel::InitType::Simple, st::profileInviteLinkText);
|
||||||
_link->show();
|
_link->show();
|
||||||
|
|
||||||
linkData.entities.push_back(EntityInText(EntityInTextUrl, 0, linkData.text.size()));
|
linkData.entities.push_back(EntityInText(EntityInTextUrl, 0, linkData.text.size()));
|
||||||
|
|
|
@ -22,7 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "profile/profile_block_widget.h"
|
#include "profile/profile_block_widget.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
class FlatLabel;
|
class FlatLabel;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Notify {
|
namespace Notify {
|
||||||
struct PeerUpdate;
|
struct PeerUpdate;
|
||||||
|
@ -46,7 +48,7 @@ private:
|
||||||
void refreshLink();
|
void refreshLink();
|
||||||
void refreshVisibility();
|
void refreshVisibility();
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _link = { nullptr };
|
ChildWidget<Ui::FlatLabel> _link = { nullptr };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_profile.h"
|
#include "styles/style_profile.h"
|
||||||
#include "mtproto/file_download.h"
|
#include "mtproto/file_download.h"
|
||||||
#include "ui/buttons/left_outline_button.h"
|
#include "ui/buttons/left_outline_button.h"
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "boxes/contactsbox.h"
|
#include "boxes/contactsbox.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
#include "core/click_handler_types.h"
|
#include "core/click_handler_types.h"
|
||||||
|
@ -307,7 +307,7 @@ void MembersWidget::refreshLimitReached() {
|
||||||
|
|
||||||
bool limitReachedShown = (_list.size() >= Global::ChatSizeMax()) && chat->amCreator() && !emptyTitle();
|
bool limitReachedShown = (_list.size() >= Global::ChatSizeMax()) && chat->amCreator() && !emptyTitle();
|
||||||
if (limitReachedShown && !_limitReachedInfo) {
|
if (limitReachedShown && !_limitReachedInfo) {
|
||||||
_limitReachedInfo = new FlatLabel(this, st::profileLimitReachedLabel, st::profileLimitReachedStyle);
|
_limitReachedInfo.create(this, st::profileLimitReachedLabel, st::profileLimitReachedStyle);
|
||||||
QString title = textRichPrepare(lng_profile_migrate_reached(lt_count, Global::ChatSizeMax()));
|
QString title = textRichPrepare(lng_profile_migrate_reached(lt_count, Global::ChatSizeMax()));
|
||||||
QString body = textRichPrepare(lang(lng_profile_migrate_body));
|
QString body = textRichPrepare(lang(lng_profile_migrate_body));
|
||||||
QString link = textRichPrepare(lang(lng_profile_migrate_learn_more));
|
QString link = textRichPrepare(lang(lng_profile_migrate_learn_more));
|
||||||
|
|
|
@ -22,9 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "profile/profile_block_widget.h"
|
#include "profile/profile_block_widget.h"
|
||||||
|
|
||||||
class FlatLabel;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class LeftOutlineButton;
|
class LeftOutlineButton;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
|
@ -123,7 +122,7 @@ private:
|
||||||
Member *addUser(ChannelData *megagroup, UserData *user);
|
Member *addUser(ChannelData *megagroup, UserData *user);
|
||||||
bool addUsersToEnd(ChannelData *megagroup);
|
bool addUsersToEnd(ChannelData *megagroup);
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _limitReachedInfo = { nullptr };
|
ChildWidget<Ui::FlatLabel> _limitReachedInfo = { nullptr };
|
||||||
|
|
||||||
QList<Member*> _list;
|
QList<Member*> _list;
|
||||||
QMap<UserData*, Member*> _membersByUser;
|
QMap<UserData*, Member*> _membersByUser;
|
||||||
|
|
|
@ -27,8 +27,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
namespace Profile {
|
namespace Profile {
|
||||||
|
|
||||||
UserpicButton::UserpicButton(QWidget *parent, PeerData *peer) : AbstractButton(parent), _peer(peer) {
|
UserpicButton::UserpicButton(QWidget *parent, PeerData *peer, int size) : AbstractButton(parent)
|
||||||
resize(st::profilePhotoSize, st::profilePhotoSize);
|
, _size(size ? size : st::profilePhotoSize)
|
||||||
|
, _peer(peer) {
|
||||||
|
resize(_size, _size);
|
||||||
|
|
||||||
processPeerPhoto();
|
processPeerPhoto();
|
||||||
_notShownYet = _waiting;
|
_notShownYet = _waiting;
|
||||||
|
@ -107,13 +109,13 @@ void UserpicButton::startNewPhotoShowing() {
|
||||||
|
|
||||||
QPixmap UserpicButton::prepareUserpicPixmap() const {
|
QPixmap UserpicButton::prepareUserpicPixmap() const {
|
||||||
auto retina = cIntRetinaFactor();
|
auto retina = cIntRetinaFactor();
|
||||||
auto size = st::profilePhotoSize * retina;
|
auto size = width() * retina;
|
||||||
QImage image(size, size, QImage::Format_ARGB32_Premultiplied);
|
QImage image(size, size, QImage::Format_ARGB32_Premultiplied);
|
||||||
image.setDevicePixelRatio(cRetinaFactor());
|
image.setDevicePixelRatio(cRetinaFactor());
|
||||||
|
image.fill(Qt::transparent);
|
||||||
{
|
{
|
||||||
Painter p(&image);
|
Painter p(&image);
|
||||||
p.fillRect(0, 0, st::profilePhotoSize, st::profilePhotoSize, st::profileBg);
|
_peer->paintUserpic(p, width(), 0, 0);
|
||||||
_peer->paintUserpic(p, st::profilePhotoSize, 0, 0);
|
|
||||||
}
|
}
|
||||||
return App::pixmapFromImageInPlace(std_::move(image));
|
return App::pixmapFromImageInPlace(std_::move(image));
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace Profile {
|
||||||
|
|
||||||
class UserpicButton : public Ui::AbstractButton, private base::Subscriber {
|
class UserpicButton : public Ui::AbstractButton, private base::Subscriber {
|
||||||
public:
|
public:
|
||||||
UserpicButton(QWidget *parent, PeerData *peer);
|
UserpicButton(QWidget *parent, PeerData *peer, int size = 0);
|
||||||
|
|
||||||
// If at the first moment the _userpic was not loaded,
|
// If at the first moment the _userpic was not loaded,
|
||||||
// we need to show it animated after the profile is fully shown.
|
// we need to show it animated after the profile is fully shown.
|
||||||
|
@ -50,6 +50,7 @@ private:
|
||||||
|
|
||||||
bool _notShownYet;
|
bool _notShownYet;
|
||||||
|
|
||||||
|
int _size = 0;
|
||||||
PeerData *_peer;
|
PeerData *_peer;
|
||||||
bool _waiting = false;
|
bool _waiting = false;
|
||||||
QPixmap _userpic, _oldUserpic;
|
QPixmap _userpic, _oldUserpic;
|
||||||
|
|
|
@ -21,16 +21,18 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "profile/profile_widget.h"
|
#include "profile/profile_widget.h"
|
||||||
|
|
||||||
|
#include "styles/style_settings.h"
|
||||||
#include "profile/profile_fixed_bar.h"
|
#include "profile/profile_fixed_bar.h"
|
||||||
#include "profile/profile_inner_widget.h"
|
#include "profile/profile_inner_widget.h"
|
||||||
#include "profile/profile_section_memento.h"
|
#include "profile/profile_section_memento.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
|
|
||||||
namespace Profile {
|
namespace Profile {
|
||||||
|
|
||||||
Widget::Widget(QWidget *parent, PeerData *peer) : Window::SectionWidget(parent)
|
Widget::Widget(QWidget *parent, PeerData *peer) : Window::SectionWidget(parent)
|
||||||
, _scroll(this, st::setScroll)
|
, _scroll(this, st::settingsScroll)
|
||||||
, _inner(this, peer)
|
, _inner(this, peer)
|
||||||
, _fixedBar(this, peer)
|
, _fixedBar(this, peer)
|
||||||
, _fixedBarShadow(this, st::shadowColor) {
|
, _fixedBarShadow(this, st::shadowColor) {
|
||||||
|
|
|
@ -23,7 +23,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "window/section_widget.h"
|
#include "window/section_widget.h"
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
class ScrollArea;
|
class ScrollArea;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Profile {
|
namespace Profile {
|
||||||
|
|
||||||
|
@ -68,7 +70,7 @@ private:
|
||||||
|
|
||||||
friend class SectionMemento;
|
friend class SectionMemento;
|
||||||
|
|
||||||
ChildWidget<ScrollArea> _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
ChildWidget<InnerWidget> _inner;
|
ChildWidget<InnerWidget> _inner;
|
||||||
ChildWidget<FixedBar> _fixedBar;
|
ChildWidget<FixedBar> _fixedBar;
|
||||||
ChildWidget<Ui::ToggleableShadow> _fixedBarShadow;
|
ChildWidget<Ui::ToggleableShadow> _fixedBarShadow;
|
||||||
|
|
|
@ -24,6 +24,11 @@ using "dialogs/dialogs.style";
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
using "boxes/boxes.style";
|
using "boxes/boxes.style";
|
||||||
|
|
||||||
|
settingsScroll: FlatScroll(defaultFlatScroll) {
|
||||||
|
bottomsh: 0px;
|
||||||
|
topsh: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
settingsMaxWidth: 520px;
|
settingsMaxWidth: 520px;
|
||||||
settingsMaxPadding: 48px;
|
settingsMaxPadding: 48px;
|
||||||
settingsMinPadding: 32px;
|
settingsMinPadding: 32px;
|
||||||
|
@ -44,14 +49,14 @@ settingsPhotoLeft: -8px;
|
||||||
settingsPhotoDuration: 500;
|
settingsPhotoDuration: 500;
|
||||||
settingsNameLeft: 26px;
|
settingsNameLeft: 26px;
|
||||||
settingsNameTop: 9px;
|
settingsNameTop: 9px;
|
||||||
settingsNameLabel: flatLabel(labelDefFlat) {
|
settingsNameLabel: FlatLabel(defaultFlatLabel) {
|
||||||
margin: margins(10px, 5px, 10px, 5px);
|
margin: margins(10px, 5px, 10px, 5px);
|
||||||
font: font(16px semibold);
|
font: font(16px semibold);
|
||||||
width: 160px;
|
width: 160px;
|
||||||
maxHeight: 24px;
|
maxHeight: 24px;
|
||||||
textFg: #333333;
|
textFg: #333333;
|
||||||
}
|
}
|
||||||
settingsNameTextStyle: textStyle(defaultTextStyle) {
|
settingsNameTextStyle: TextStyle(defaultTextStyle) {
|
||||||
}
|
}
|
||||||
settingsStatusLeft: 27px;
|
settingsStatusLeft: 27px;
|
||||||
settingsStatusTop: 35px;
|
settingsStatusTop: 35px;
|
||||||
|
@ -83,13 +88,13 @@ settingsBlockTitleHeight: 31px;
|
||||||
settingsBlockTitleFont: font(15px semibold);
|
settingsBlockTitleFont: font(15px semibold);
|
||||||
settingsBlockTitleFg: #333333;
|
settingsBlockTitleFg: #333333;
|
||||||
settingsBlockTitleTop: 0px;
|
settingsBlockTitleTop: 0px;
|
||||||
settingsPrimaryLabel: flatLabel(labelDefFlat) {
|
settingsPrimaryLabel: FlatLabel(defaultFlatLabel) {
|
||||||
font: boxTextFont;
|
font: boxTextFont;
|
||||||
}
|
}
|
||||||
settingsBlockLabel: flatLabel(settingsPrimaryLabel) {
|
settingsBlockLabel: FlatLabel(settingsPrimaryLabel) {
|
||||||
textFg: windowSubTextFg;
|
textFg: windowSubTextFg;
|
||||||
}
|
}
|
||||||
settingsBlockOneLineTextPart: flatLabel(settingsPrimaryLabel) {
|
settingsBlockOneLineTextPart: FlatLabel(settingsPrimaryLabel) {
|
||||||
width: 0px; // No need to set minWidth in one-line text.
|
width: 0px; // No need to set minWidth in one-line text.
|
||||||
margin: margins(5px, 5px, 5px, 5px);
|
margin: margins(5px, 5px, 5px, 5px);
|
||||||
maxHeight: 20px;
|
maxHeight: 20px;
|
||||||
|
|
|
@ -26,7 +26,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/effects/widget_slide_wrap.h"
|
#include "ui/effects/widget_slide_wrap.h"
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "localstorage.h"
|
#include "localstorage.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -39,7 +39,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
LabeledLink::LabeledLink(QWidget *parent, const QString &label, const QString &text, Type type, const char *slot) : TWidget(parent)
|
LabeledLink::LabeledLink(QWidget *parent, const QString &label, const QString &text, Type type, const char *slot) : TWidget(parent)
|
||||||
, _label(this, label, FlatLabel::InitType::Simple, (type == Type::Primary) ? st::settingsPrimaryLabel : st::labelDefFlat)
|
, _label(this, label, Ui::FlatLabel::InitType::Simple, (type == Type::Primary) ? st::settingsPrimaryLabel : st::defaultFlatLabel)
|
||||||
, _link(this, text, (type == Type::Primary) ? st::boxLinkButton : st::defaultLinkButton) {
|
, _link(this, text, (type == Type::Primary) ? st::boxLinkButton : st::defaultLinkButton) {
|
||||||
connect(_link, SIGNAL(clicked()), parent, slot);
|
connect(_link, SIGNAL(clicked()), parent, slot);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void DownloadPathState::paintEvent(QPaintEvent *e) {
|
||||||
})();
|
})();
|
||||||
if (!text.isEmpty()) {
|
if (!text.isEmpty()) {
|
||||||
p.setFont(st::linkFont);
|
p.setFont(st::linkFont);
|
||||||
p.setPen(st::windowTextFg);
|
p.setPen(st::windowFg);
|
||||||
p.drawTextRight(0, 0, width(), text);
|
p.drawTextRight(0, 0, width(), text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "settings/settings_block_widget.h"
|
#include "settings/settings_block_widget.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
class FlatLabel;
|
class FlatLabel;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
|
@ -46,7 +48,7 @@ protected:
|
||||||
int resizeGetHeight(int newWidth) override;
|
int resizeGetHeight(int newWidth) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChildWidget<FlatLabel> _label;
|
ChildWidget<Ui::FlatLabel> _label;
|
||||||
ChildWidget<Ui::LinkButton> _link;
|
ChildWidget<Ui::LinkButton> _link;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "settings/settings_cover.h"
|
#include "settings/settings_cover.h"
|
||||||
|
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
|
|
|
@ -25,8 +25,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "settings/settings_block_widget.h"
|
#include "settings/settings_block_widget.h"
|
||||||
|
|
||||||
class FlatLabel;
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class FlatLabel;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
class IconButton;
|
class IconButton;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
@ -91,7 +91,7 @@ private:
|
||||||
ChildWidget<Profile::UserpicButton> _userpicButton;
|
ChildWidget<Profile::UserpicButton> _userpicButton;
|
||||||
ChildWidget<Profile::CoverDropArea> _dropArea = { nullptr };
|
ChildWidget<Profile::CoverDropArea> _dropArea = { nullptr };
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _name;
|
ChildWidget<Ui::FlatLabel> _name;
|
||||||
ChildWidget<Ui::IconButton> _editNameInline;
|
ChildWidget<Ui::IconButton> _editNameInline;
|
||||||
ChildWidget<Ui::LinkButton> _cancelPhotoUpload = { nullptr };
|
ChildWidget<Ui::LinkButton> _cancelPhotoUpload = { nullptr };
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ void FixedBar::paintEvent(QPaintEvent *e) {
|
||||||
p.fillRect(e->rect(), st::boxBlockTitleBg);
|
p.fillRect(e->rect(), st::boxBlockTitleBg);
|
||||||
|
|
||||||
p.setFont(st::settingsFixedBarFont);
|
p.setFont(st::settingsFixedBarFont);
|
||||||
p.setPen(st::windowTextFg);
|
p.setPen(st::windowFg);
|
||||||
p.drawTextLeft(st::settingsFixedBarTextLeft, st::settingsFixedBarTextTop, width(), lang(lng_menu_settings));
|
p.drawTextLeft(st::settingsFixedBarTextLeft, st::settingsFixedBarTextTop, width(), lang(lng_menu_settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,25 +32,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "boxes/languagebox.h"
|
#include "boxes/languagebox.h"
|
||||||
#include "boxes/confirmbox.h"
|
#include "boxes/confirmbox.h"
|
||||||
|
#include "boxes/aboutbox.h"
|
||||||
#include "ui/filedialog.h"
|
#include "ui/filedialog.h"
|
||||||
#include "langloaderplain.h"
|
#include "langloaderplain.h"
|
||||||
#include "autoupdater.h"
|
#include "autoupdater.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
namespace {
|
|
||||||
|
|
||||||
QString currentVersion() {
|
|
||||||
auto result = QString::fromLatin1(AppVersionStr.c_str());
|
|
||||||
if (cAlphaVersion()) {
|
|
||||||
result += " alpha";
|
|
||||||
}
|
|
||||||
if (cBetaVersion()) {
|
|
||||||
result += qsl(" beta %1").arg(cBetaVersion() % 1000);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||||
UpdateStateRow::UpdateStateRow(QWidget *parent) : TWidget(parent)
|
UpdateStateRow::UpdateStateRow(QWidget *parent) : TWidget(parent)
|
||||||
|
@ -189,7 +176,7 @@ void GeneralWidget::refreshControls() {
|
||||||
style::margins slidedPadding(0, marginSmall.bottom() / 2, 0, marginSmall.bottom() - (marginSmall.bottom() / 2));
|
style::margins slidedPadding(0, marginSmall.bottom() / 2, 0, marginSmall.bottom() - (marginSmall.bottom() / 2));
|
||||||
|
|
||||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||||
addChildRow(_updateAutomatically, marginSub, lng_settings_update_automatically(lt_version, currentVersion()), SLOT(onUpdateAutomatically()), cAutoUpdate());
|
addChildRow(_updateAutomatically, marginSub, lng_settings_update_automatically(lt_version, currentVersionText()), SLOT(onUpdateAutomatically()), cAutoUpdate());
|
||||||
style::margins marginLink(st::defaultBoxCheckbox.textPosition.x(), 0, 0, st::settingsSkip);
|
style::margins marginLink(st::defaultBoxCheckbox.textPosition.x(), 0, 0, st::settingsSkip);
|
||||||
addChildRow(_updateRow, marginLink, slidedPadding);
|
addChildRow(_updateRow, marginLink, slidedPadding);
|
||||||
connect(_updateRow->entity(), SIGNAL(restart()), this, SLOT(onRestart()));
|
connect(_updateRow->entity(), SIGNAL(restart()), this, SLOT(onRestart()));
|
||||||
|
|
|
@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "ui/flatlabel.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/effects/widget_slide_wrap.h"
|
#include "ui/effects/widget_slide_wrap.h"
|
||||||
#include "boxes/usernamebox.h"
|
#include "boxes/usernamebox.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
|
@ -133,18 +133,18 @@ void InfoWidget::LabeledWidget::setLabeledText(const QString &label, const TextW
|
||||||
_shortText.destroy();
|
_shortText.destroy();
|
||||||
if (textWithEntities.text.isEmpty()) return;
|
if (textWithEntities.text.isEmpty()) return;
|
||||||
|
|
||||||
_label = new FlatLabel(this, label, FlatLabel::InitType::Simple, st::settingsBlockLabel);
|
_label.create(this, label, Ui::FlatLabel::InitType::Simple, st::settingsBlockLabel);
|
||||||
_label->show();
|
_label->show();
|
||||||
setLabelText(_text, textWithEntities, copyText);
|
setLabelText(_text, textWithEntities, copyText);
|
||||||
setLabelText(_shortText, shortTextWithEntities, copyText);
|
setLabelText(_shortText, shortTextWithEntities, copyText);
|
||||||
resizeToWidth(width());
|
resizeToWidth(width());
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoWidget::LabeledWidget::setLabelText(ChildWidget<FlatLabel> &text, const TextWithEntities &textWithEntities, const QString ©Text) {
|
void InfoWidget::LabeledWidget::setLabelText(ChildWidget<Ui::FlatLabel> &text, const TextWithEntities &textWithEntities, const QString ©Text) {
|
||||||
text.destroy();
|
text.destroy();
|
||||||
if (textWithEntities.text.isEmpty()) return;
|
if (textWithEntities.text.isEmpty()) return;
|
||||||
|
|
||||||
text = new FlatLabel(this, QString(), FlatLabel::InitType::Simple, st::settingsBlockOneLineTextPart);
|
text.create(this, QString(), Ui::FlatLabel::InitType::Simple, st::settingsBlockOneLineTextPart);
|
||||||
text->show();
|
text->show();
|
||||||
text->setMarkedText(textWithEntities);
|
text->setMarkedText(textWithEntities);
|
||||||
text->setContextCopyText(copyText);
|
text->setContextCopyText(copyText);
|
||||||
|
|
|
@ -22,7 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "settings/settings_block_widget.h"
|
#include "settings/settings_block_widget.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
class FlatLabel;
|
class FlatLabel;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Notify {
|
namespace Notify {
|
||||||
struct PeerUpdate;
|
struct PeerUpdate;
|
||||||
|
@ -50,10 +52,10 @@ private:
|
||||||
|
|
||||||
void setLabeledText(const QString &label, const TextWithEntities &textWithEntities, const TextWithEntities &shortTextWithEntities, const QString ©Text);
|
void setLabeledText(const QString &label, const TextWithEntities &textWithEntities, const TextWithEntities &shortTextWithEntities, const QString ©Text);
|
||||||
|
|
||||||
FlatLabel *textLabel() {
|
Ui::FlatLabel *textLabel() {
|
||||||
return _text;
|
return _text;
|
||||||
}
|
}
|
||||||
FlatLabel *shortTextLabel() {
|
Ui::FlatLabel *shortTextLabel() {
|
||||||
return _shortText;
|
return _shortText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,11 +65,11 @@ private:
|
||||||
int resizeGetHeight(int newWidth) override;
|
int resizeGetHeight(int newWidth) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setLabelText(ChildWidget<FlatLabel> &text, const TextWithEntities &textWithEntities, const QString ©Text);
|
void setLabelText(ChildWidget<Ui::FlatLabel> &text, const TextWithEntities &textWithEntities, const QString ©Text);
|
||||||
|
|
||||||
ChildWidget<FlatLabel> _label = { nullptr };
|
ChildWidget<Ui::FlatLabel> _label = { nullptr };
|
||||||
ChildWidget<FlatLabel> _text = { nullptr };
|
ChildWidget<Ui::FlatLabel> _text = { nullptr };
|
||||||
ChildWidget<FlatLabel> _shortText = { nullptr };
|
ChildWidget<Ui::FlatLabel> _shortText = { nullptr };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ void CloudPasswordState::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
auto text = st::linkFont->elided(_waitingConfirm, width() - _turnOff->width());
|
auto text = st::linkFont->elided(_waitingConfirm, width() - _turnOff->width());
|
||||||
if (!text.isEmpty()) {
|
if (!text.isEmpty()) {
|
||||||
p.setPen(st::windowTextFg);
|
p.setPen(st::windowFg);
|
||||||
p.setFont(st::boxTextFont);
|
p.setFont(st::boxTextFont);
|
||||||
p.drawTextLeft(0, 0, width(), text);
|
p.drawTextLeft(0, 0, width(), text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "styles/style_window.h"
|
#include "styles/style_window.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
#include "ui/scrollarea.h"
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "localstorage.h"
|
#include "localstorage.h"
|
||||||
|
@ -125,7 +125,7 @@ void codesFeedString(const QString &text) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Widget::Widget(QWidget *parent) : LayerWidget(parent)
|
Widget::Widget(QWidget *parent) : LayerWidget(parent)
|
||||||
, _scroll(this, st::setScroll)
|
, _scroll(this, st::settingsScroll)
|
||||||
, _inner(this)
|
, _inner(this)
|
||||||
, _fixedBar(this)
|
, _fixedBar(this)
|
||||||
, _fixedBarShadow(this, st::boxBlockTitleShadow) {
|
, _fixedBarShadow(this, st::boxBlockTitleShadow) {
|
||||||
|
|
|
@ -23,6 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "layerwidget.h"
|
#include "layerwidget.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class ScrollArea;
|
||||||
class GradientShadow;
|
class GradientShadow;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
|
@ -51,7 +52,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
void resizeUsingInnerHeight(int newWidth, int newContentLeft);
|
void resizeUsingInnerHeight(int newWidth, int newContentLeft);
|
||||||
|
|
||||||
ChildWidget<ScrollArea> _scroll;
|
ChildWidget<Ui::ScrollArea> _scroll;
|
||||||
ChildWidget<InnerWidget> _inner;
|
ChildWidget<InnerWidget> _inner;
|
||||||
ChildWidget<FixedBar> _fixedBar;
|
ChildWidget<FixedBar> _fixedBar;
|
||||||
ChildWidget<Ui::GradientShadow> _fixedBarShadow;
|
ChildWidget<Ui::GradientShadow> _fixedBarShadow;
|
||||||
|
|
|
@ -70,7 +70,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "ui/animation.h"
|
#include "ui/animation.h"
|
||||||
#include "ui/twidget.h"
|
#include "ui/twidget.h"
|
||||||
#include "ui/scrollarea.h"
|
|
||||||
#include "ui/images.h"
|
#include "ui/images.h"
|
||||||
#include "ui/text/text.h"
|
#include "ui/text/text.h"
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ void EmojiColorPicker::drawVariant(Painter &p, int variant) {
|
||||||
p.drawPixmapLeft(w.x() + (st::emojiPanSize.width() - (esize / cIntRetinaFactor())) / 2, w.y() + (st::emojiPanSize.height() - (esize / cIntRetinaFactor())) / 2, width(), App::emojiLarge(), QRect(_variants[variant]->x * esize, _variants[variant]->y * esize, esize, esize));
|
p.drawPixmapLeft(w.x() + (st::emojiPanSize.width() - (esize / cIntRetinaFactor())) / 2, w.y() + (st::emojiPanSize.height() - (esize / cIntRetinaFactor())) / 2, width(), App::emojiLarge(), QRect(_variants[variant]->x * esize, _variants[variant]->y * esize, esize, esize));
|
||||||
}
|
}
|
||||||
|
|
||||||
EmojiPanInner::EmojiPanInner() : TWidget()
|
EmojiPanInner::EmojiPanInner(QWidget *parent) : TWidget(parent)
|
||||||
, _maxHeight(int(st::emojiPanMaxHeight) - st::emojiCategory.height)
|
, _maxHeight(int(st::emojiPanMaxHeight) - st::emojiCategory.height)
|
||||||
, _a_selected(animation(this, &EmojiPanInner::step_selected)) {
|
, _a_selected(animation(this, &EmojiPanInner::step_selected)) {
|
||||||
resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight());
|
resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight());
|
||||||
|
@ -793,7 +793,7 @@ void EmojiPanInner::showEmojiPack(DBIEmojiTab packIndex) {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
StickerPanInner::StickerPanInner() : TWidget()
|
StickerPanInner::StickerPanInner(QWidget *parent) : TWidget(parent)
|
||||||
, _a_selected(animation(this, &StickerPanInner::step_selected))
|
, _a_selected(animation(this, &StickerPanInner::step_selected))
|
||||||
, _section(cShowingSavedGifs() ? Section::Gifs : Section::Stickers)
|
, _section(cShowingSavedGifs() ? Section::Gifs : Section::Stickers)
|
||||||
, _addText(lang(lng_stickers_featured_add).toUpper())
|
, _addText(lang(lng_stickers_featured_add).toUpper())
|
||||||
|
@ -2813,26 +2813,26 @@ EmojiPan::EmojiPan(QWidget *parent) : TWidget(parent)
|
||||||
, _symbols(this, st::emojiCategorySymbols)
|
, _symbols(this, st::emojiCategorySymbols)
|
||||||
, _a_icons(animation(this, &EmojiPan::step_icons))
|
, _a_icons(animation(this, &EmojiPan::step_icons))
|
||||||
, e_scroll(this, st::emojiScroll)
|
, e_scroll(this, st::emojiScroll)
|
||||||
, e_inner()
|
, e_inner(this)
|
||||||
, e_switch(&e_scroll, true)
|
, e_switch(e_scroll, true)
|
||||||
, s_scroll(this, st::emojiScroll)
|
, s_scroll(this, st::emojiScroll)
|
||||||
, s_inner()
|
, s_inner(this)
|
||||||
, s_switch(&s_scroll, false) {
|
, s_switch(s_scroll, false) {
|
||||||
resize(QRect(0, 0, st::emojiPanWidth, _contentHeight).marginsAdded(innerPadding()).size());
|
resize(QRect(0, 0, st::emojiPanWidth, _contentHeight).marginsAdded(innerPadding()).size());
|
||||||
_width = width();
|
_width = width();
|
||||||
_height = height();
|
_height = height();
|
||||||
_bottom = 0;
|
_bottom = 0;
|
||||||
|
|
||||||
e_scroll.resize(st::emojiPanWidth - st::buttonRadius, _contentHeightEmoji);
|
e_scroll->resize(st::emojiPanWidth - st::buttonRadius, _contentHeightEmoji);
|
||||||
s_scroll.resize(st::emojiPanWidth - st::buttonRadius, _contentHeightStickers);
|
s_scroll->resize(st::emojiPanWidth - st::buttonRadius, _contentHeightStickers);
|
||||||
|
|
||||||
e_scroll.move(verticalRect().topLeft());
|
e_scroll->move(verticalRect().topLeft());
|
||||||
e_scroll.setWidget(&e_inner);
|
e_scroll->setOwnedWidget(e_inner);
|
||||||
s_scroll.move(verticalRect().topLeft());
|
s_scroll->move(verticalRect().topLeft());
|
||||||
s_scroll.setWidget(&s_inner);
|
s_scroll->setOwnedWidget(s_inner);
|
||||||
|
|
||||||
e_inner.moveToLeft(0, 0, e_scroll.width());
|
e_inner->moveToLeft(0, 0, e_scroll->width());
|
||||||
s_inner.moveToLeft(0, 0, s_scroll.width());
|
s_inner->moveToLeft(0, 0, s_scroll->width());
|
||||||
|
|
||||||
int32 left = _iconsLeft = innerRect().x() + (st::emojiPanWidth - 8 * st::emojiCategory.width) / 2;
|
int32 left = _iconsLeft = innerRect().x() + (st::emojiPanWidth - 8 * st::emojiCategory.width) / 2;
|
||||||
int32 top = _iconsTop = innerRect().y() + innerRect().height() - st::emojiCategory.height;
|
int32 top = _iconsTop = innerRect().y() + innerRect().height() - st::emojiCategory.height;
|
||||||
|
@ -2844,7 +2844,7 @@ EmojiPan::EmojiPan(QWidget *parent) : TWidget(parent)
|
||||||
prepareTab(left, top, _width, _travel, dbietTravel);
|
prepareTab(left, top, _width, _travel, dbietTravel);
|
||||||
prepareTab(left, top, _width, _objects, dbietObjects);
|
prepareTab(left, top, _width, _objects, dbietObjects);
|
||||||
prepareTab(left, top, _width, _symbols, dbietSymbols);
|
prepareTab(left, top, _width, _symbols, dbietSymbols);
|
||||||
e_inner.fillPanels(e_panels);
|
e_inner->fillPanels(e_panels);
|
||||||
updatePanelsPositions(e_panels, 0);
|
updatePanelsPositions(e_panels, 0);
|
||||||
|
|
||||||
setCurrentTabIcon(dbietRecent);
|
setCurrentTabIcon(dbietRecent);
|
||||||
|
@ -2852,38 +2852,38 @@ EmojiPan::EmojiPan(QWidget *parent) : TWidget(parent)
|
||||||
_hideTimer.setSingleShot(true);
|
_hideTimer.setSingleShot(true);
|
||||||
connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideByTimerOrLeave()));
|
connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideByTimerOrLeave()));
|
||||||
|
|
||||||
connect(&e_inner, SIGNAL(scrollToY(int)), &e_scroll, SLOT(scrollToY(int)));
|
connect(e_inner, SIGNAL(scrollToY(int)), e_scroll, SLOT(scrollToY(int)));
|
||||||
connect(&e_inner, SIGNAL(disableScroll(bool)), &e_scroll, SLOT(disableScroll(bool)));
|
connect(e_inner, SIGNAL(disableScroll(bool)), e_scroll, SLOT(disableScroll(bool)));
|
||||||
|
|
||||||
connect(&s_inner, SIGNAL(scrollToY(int)), &s_scroll, SLOT(scrollToY(int)));
|
connect(s_inner, SIGNAL(scrollToY(int)), s_scroll, SLOT(scrollToY(int)));
|
||||||
connect(&s_inner, SIGNAL(scrollUpdated()), this, SLOT(onScrollStickers()));
|
connect(s_inner, SIGNAL(scrollUpdated()), this, SLOT(onScrollStickers()));
|
||||||
|
|
||||||
connect(&e_scroll, SIGNAL(scrolled()), this, SLOT(onScrollEmoji()));
|
connect(e_scroll, SIGNAL(scrolled()), this, SLOT(onScrollEmoji()));
|
||||||
connect(&s_scroll, SIGNAL(scrolled()), this, SLOT(onScrollStickers()));
|
connect(s_scroll, SIGNAL(scrolled()), this, SLOT(onScrollStickers()));
|
||||||
|
|
||||||
connect(&e_inner, SIGNAL(selected(EmojiPtr)), this, SIGNAL(emojiSelected(EmojiPtr)));
|
connect(e_inner, SIGNAL(selected(EmojiPtr)), this, SIGNAL(emojiSelected(EmojiPtr)));
|
||||||
connect(&s_inner, SIGNAL(selected(DocumentData*)), this, SIGNAL(stickerSelected(DocumentData*)));
|
connect(s_inner, SIGNAL(selected(DocumentData*)), this, SIGNAL(stickerSelected(DocumentData*)));
|
||||||
connect(&s_inner, SIGNAL(selected(PhotoData*)), this, SIGNAL(photoSelected(PhotoData*)));
|
connect(s_inner, SIGNAL(selected(PhotoData*)), this, SIGNAL(photoSelected(PhotoData*)));
|
||||||
connect(&s_inner, SIGNAL(selected(InlineBots::Result*,UserData*)), this, SIGNAL(inlineResultSelected(InlineBots::Result*,UserData*)));
|
connect(s_inner, SIGNAL(selected(InlineBots::Result*,UserData*)), this, SIGNAL(inlineResultSelected(InlineBots::Result*,UserData*)));
|
||||||
|
|
||||||
connect(&s_inner, SIGNAL(emptyInlineRows()), this, SLOT(onEmptyInlineRows()));
|
connect(s_inner, SIGNAL(emptyInlineRows()), this, SLOT(onEmptyInlineRows()));
|
||||||
|
|
||||||
connect(&s_switch, SIGNAL(clicked()), this, SLOT(onSwitch()));
|
connect(s_switch, SIGNAL(clicked()), this, SLOT(onSwitch()));
|
||||||
connect(&e_switch, SIGNAL(clicked()), this, SLOT(onSwitch()));
|
connect(e_switch, SIGNAL(clicked()), this, SLOT(onSwitch()));
|
||||||
s_switch.moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
s_switch->moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
||||||
e_switch.moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
e_switch->moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
||||||
|
|
||||||
connect(&s_inner, SIGNAL(displaySet(quint64)), this, SLOT(onDisplaySet(quint64)));
|
connect(s_inner, SIGNAL(displaySet(quint64)), this, SLOT(onDisplaySet(quint64)));
|
||||||
connect(&s_inner, SIGNAL(installSet(quint64)), this, SLOT(onInstallSet(quint64)));
|
connect(s_inner, SIGNAL(installSet(quint64)), this, SLOT(onInstallSet(quint64)));
|
||||||
connect(&s_inner, SIGNAL(removeSet(quint64)), this, SLOT(onRemoveSet(quint64)));
|
connect(s_inner, SIGNAL(removeSet(quint64)), this, SLOT(onRemoveSet(quint64)));
|
||||||
connect(&s_inner, SIGNAL(refreshIcons(bool)), this, SLOT(onRefreshIcons(bool)));
|
connect(s_inner, SIGNAL(refreshIcons(bool)), this, SLOT(onRefreshIcons(bool)));
|
||||||
connect(&e_inner, SIGNAL(needRefreshPanels()), this, SLOT(onRefreshPanels()));
|
connect(e_inner, SIGNAL(needRefreshPanels()), this, SLOT(onRefreshPanels()));
|
||||||
connect(&s_inner, SIGNAL(needRefreshPanels()), this, SLOT(onRefreshPanels()));
|
connect(s_inner, SIGNAL(needRefreshPanels()), this, SLOT(onRefreshPanels()));
|
||||||
|
|
||||||
_saveConfigTimer.setSingleShot(true);
|
_saveConfigTimer.setSingleShot(true);
|
||||||
connect(&_saveConfigTimer, SIGNAL(timeout()), this, SLOT(onSaveConfig()));
|
connect(&_saveConfigTimer, SIGNAL(timeout()), this, SLOT(onSaveConfig()));
|
||||||
connect(&e_inner, SIGNAL(saveConfigDelayed(int32)), this, SLOT(onSaveConfigDelayed(int32)));
|
connect(e_inner, SIGNAL(saveConfigDelayed(int32)), this, SLOT(onSaveConfigDelayed(int32)));
|
||||||
connect(&s_inner, SIGNAL(saveConfigDelayed(int32)), this, SLOT(onSaveConfigDelayed(int32)));
|
connect(s_inner, SIGNAL(saveConfigDelayed(int32)), this, SLOT(onSaveConfigDelayed(int32)));
|
||||||
|
|
||||||
// inline bots
|
// inline bots
|
||||||
_inlineRequestTimer.setSingleShot(true);
|
_inlineRequestTimer.setSingleShot(true);
|
||||||
|
@ -2905,7 +2905,7 @@ void EmojiPan::setMaxHeight(int32 h) {
|
||||||
void EmojiPan::updateContentHeight() {
|
void EmojiPan::updateContentHeight() {
|
||||||
int32 h = qMin(_contentMaxHeight, _maxHeight);
|
int32 h = qMin(_contentMaxHeight, _maxHeight);
|
||||||
int32 he = h - st::emojiCategory.height;
|
int32 he = h - st::emojiCategory.height;
|
||||||
int32 hs = h - (s_inner.showSectionIcons() ? st::emojiCategory.height : 0);
|
int32 hs = h - (s_inner->showSectionIcons() ? st::emojiCategory.height : 0);
|
||||||
if (h == _contentHeight && he == _contentHeightEmoji && hs == _contentHeightStickers) return;
|
if (h == _contentHeight && he == _contentHeightEmoji && hs == _contentHeightStickers) return;
|
||||||
|
|
||||||
int32 was = _contentHeight, wase = _contentHeightEmoji, wass = _contentHeightStickers;
|
int32 was = _contentHeight, wase = _contentHeightEmoji, wass = _contentHeightStickers;
|
||||||
|
@ -2918,15 +2918,15 @@ void EmojiPan::updateContentHeight() {
|
||||||
move(x(), _bottom - _height);
|
move(x(), _bottom - _height);
|
||||||
|
|
||||||
if (was > _contentHeight || (was == _contentHeight && wass > _contentHeightStickers)) {
|
if (was > _contentHeight || (was == _contentHeight && wass > _contentHeightStickers)) {
|
||||||
e_scroll.resize(e_scroll.width(), _contentHeightEmoji);
|
e_scroll->resize(e_scroll->width(), _contentHeightEmoji);
|
||||||
s_scroll.resize(s_scroll.width(), _contentHeightStickers);
|
s_scroll->resize(s_scroll->width(), _contentHeightStickers);
|
||||||
s_inner.setMaxHeight(_contentHeightStickers);
|
s_inner->setMaxHeight(_contentHeightStickers);
|
||||||
e_inner.setMaxHeight(_contentHeightEmoji);
|
e_inner->setMaxHeight(_contentHeightEmoji);
|
||||||
} else {
|
} else {
|
||||||
s_inner.setMaxHeight(_contentHeightStickers);
|
s_inner->setMaxHeight(_contentHeightStickers);
|
||||||
e_inner.setMaxHeight(_contentHeightEmoji);
|
e_inner->setMaxHeight(_contentHeightEmoji);
|
||||||
e_scroll.resize(e_scroll.width(), _contentHeightEmoji);
|
e_scroll->resize(e_scroll->width(), _contentHeightEmoji);
|
||||||
s_scroll.resize(s_scroll.width(), _contentHeightStickers);
|
s_scroll->resize(s_scroll->width(), _contentHeightStickers);
|
||||||
}
|
}
|
||||||
|
|
||||||
_iconsTop = innerRect().y() + innerRect().height() - st::emojiCategory.height;
|
_iconsTop = innerRect().y() + innerRect().height() - st::emojiCategory.height;
|
||||||
|
@ -3016,14 +3016,14 @@ void EmojiPan::paintContent(Painter &p) {
|
||||||
auto inner = innerRect();
|
auto inner = innerRect();
|
||||||
App::roundRect(p, inner, st::emojiPanBg, ImageRoundRadius::Small, App::RectPart::TopFull);
|
App::roundRect(p, inner, st::emojiPanBg, ImageRoundRadius::Small, App::RectPart::TopFull);
|
||||||
|
|
||||||
auto showSectionIcons = _emojiShown || s_inner.showSectionIcons();
|
auto showSectionIcons = _emojiShown || s_inner->showSectionIcons();
|
||||||
auto &bottomBg = showSectionIcons ? st::emojiPanCategories : st::emojiPanBg;
|
auto &bottomBg = showSectionIcons ? st::emojiPanCategories : st::emojiPanBg;
|
||||||
auto bottomParts = showSectionIcons ? (App::RectPart::NoTopBottom | App::RectPart::BottomFull) : App::RectPart::BottomFull;
|
auto bottomParts = showSectionIcons ? (App::RectPart::NoTopBottom | App::RectPart::BottomFull) : App::RectPart::BottomFull;
|
||||||
App::roundRect(p, inner.x(), _iconsTop - st::buttonRadius, inner.width(), st::emojiCategory.height + st::buttonRadius, bottomBg, ImageRoundRadius::Small, bottomParts);
|
App::roundRect(p, inner.x(), _iconsTop - st::buttonRadius, inner.width(), st::emojiCategory.height + st::buttonRadius, bottomBg, ImageRoundRadius::Small, bottomParts);
|
||||||
|
|
||||||
auto horizontal = horizontalRect();
|
auto horizontal = horizontalRect();
|
||||||
auto sidesTop = horizontal.y();
|
auto sidesTop = horizontal.y();
|
||||||
auto sidesHeight = e_scroll.y() + e_scroll.height() - sidesTop;
|
auto sidesHeight = e_scroll->y() + e_scroll->height() - sidesTop;
|
||||||
p.fillRect(myrtlrect(inner.x() + inner.width() - st::emojiScroll.width, sidesTop, st::emojiScroll.width, sidesHeight), st::emojiPanBg);
|
p.fillRect(myrtlrect(inner.x() + inner.width() - st::emojiScroll.width, sidesTop, st::emojiScroll.width, sidesHeight), st::emojiPanBg);
|
||||||
p.fillRect(myrtlrect(inner.x(), sidesTop, st::buttonRadius, sidesHeight), st::emojiPanBg);
|
p.fillRect(myrtlrect(inner.x(), sidesTop, st::buttonRadius, sidesHeight), st::emojiPanBg);
|
||||||
if (_emojiShown) {
|
if (_emojiShown) {
|
||||||
|
@ -3099,7 +3099,7 @@ void EmojiPan::moveBottom(int32 bottom, bool force) {
|
||||||
move(x(), _bottom - height());
|
move(x(), _bottom - height());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!_emojiShown && s_inner.inlineResultsShown()) {
|
if (!_emojiShown && s_inner->inlineResultsShown()) {
|
||||||
setOrigin(Ui::PanelAnimation::Origin::BottomLeft);
|
setOrigin(Ui::PanelAnimation::Origin::BottomLeft);
|
||||||
moveToLeft(0, _bottom - height());
|
moveToLeft(0, _bottom - height());
|
||||||
} else {
|
} else {
|
||||||
|
@ -3118,7 +3118,7 @@ bool EmojiPan::preventAutoHide() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::leaveEvent(QEvent *e) {
|
void EmojiPan::leaveEvent(QEvent *e) {
|
||||||
if (preventAutoHide() || s_inner.inlineResultsShown()) return;
|
if (preventAutoHide() || s_inner->inlineResultsShown()) return;
|
||||||
auto ms = getms();
|
auto ms = getms();
|
||||||
if (_a_show.animating(ms) || _a_opacity.animating(ms)) {
|
if (_a_show.animating(ms) || _a_opacity.animating(ms)) {
|
||||||
hideAnimated();
|
hideAnimated();
|
||||||
|
@ -3134,7 +3134,7 @@ void EmojiPan::otherEnter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::otherLeave() {
|
void EmojiPan::otherLeave() {
|
||||||
if (preventAutoHide() || s_inner.inlineResultsShown()) return;
|
if (preventAutoHide() || s_inner->inlineResultsShown()) return;
|
||||||
auto ms = getms();
|
auto ms = getms();
|
||||||
if (_a_opacity.animating(ms)) {
|
if (_a_opacity.animating(ms)) {
|
||||||
hideByTimerOrLeave();
|
hideByTimerOrLeave();
|
||||||
|
@ -3200,7 +3200,7 @@ void EmojiPan::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
|
|
||||||
if (wasDown == _iconOver && _iconOver >= 0 && _iconOver < _icons.size()) {
|
if (wasDown == _iconOver && _iconOver >= 0 && _iconOver < _icons.size()) {
|
||||||
_iconSelX = anim::ivalue(_iconOver * st::emojiCategory.width, _iconOver * st::emojiCategory.width);
|
_iconSelX = anim::ivalue(_iconOver * st::emojiCategory.width, _iconOver * st::emojiCategory.width);
|
||||||
s_inner.showStickerSet(_icons.at(_iconOver).setId);
|
s_inner->showStickerSet(_icons.at(_iconOver).setId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3242,19 +3242,19 @@ void EmojiPan::hideFast() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::refreshStickers() {
|
void EmojiPan::refreshStickers() {
|
||||||
s_inner.refreshStickers();
|
s_inner->refreshStickers();
|
||||||
if (_emojiShown) {
|
if (_emojiShown) {
|
||||||
s_inner.preloadImages();
|
s_inner->preloadImages();
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::refreshSavedGifs() {
|
void EmojiPan::refreshSavedGifs() {
|
||||||
e_switch.updateText();
|
e_switch->updateText();
|
||||||
e_switch.moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
e_switch->moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
||||||
s_inner.refreshSavedGifs();
|
s_inner->refreshSavedGifs();
|
||||||
if (_emojiShown) {
|
if (_emojiShown) {
|
||||||
s_inner.preloadImages();
|
s_inner->preloadImages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3262,8 +3262,8 @@ void EmojiPan::onRefreshIcons(bool scrollAnimation) {
|
||||||
_iconOver = -1;
|
_iconOver = -1;
|
||||||
_iconHovers.clear();
|
_iconHovers.clear();
|
||||||
_iconAnimations.clear();
|
_iconAnimations.clear();
|
||||||
s_inner.fillIcons(_icons);
|
s_inner->fillIcons(_icons);
|
||||||
s_inner.fillPanels(s_panels);
|
s_inner->fillPanels(s_panels);
|
||||||
_iconsX.finish();
|
_iconsX.finish();
|
||||||
_iconSelX.finish();
|
_iconSelX.finish();
|
||||||
_iconsStartAnim = 0;
|
_iconsStartAnim = 0;
|
||||||
|
@ -3277,7 +3277,7 @@ void EmojiPan::onRefreshIcons(bool scrollAnimation) {
|
||||||
if (_iconsX.current() > _iconsMax) {
|
if (_iconsX.current() > _iconsMax) {
|
||||||
_iconsX = anim::ivalue(_iconsMax, _iconsMax);
|
_iconsX = anim::ivalue(_iconsMax, _iconsMax);
|
||||||
}
|
}
|
||||||
updatePanelsPositions(s_panels, s_scroll.scrollTop());
|
updatePanelsPositions(s_panels, s_scroll->scrollTop());
|
||||||
updateSelected();
|
updateSelected();
|
||||||
if (!_emojiShown) {
|
if (!_emojiShown) {
|
||||||
validateSelectedIcon(scrollAnimation ? ValidateIconAnimations::Scroll : ValidateIconAnimations::None);
|
validateSelectedIcon(scrollAnimation ? ValidateIconAnimations::Scroll : ValidateIconAnimations::None);
|
||||||
|
@ -3287,12 +3287,12 @@ void EmojiPan::onRefreshIcons(bool scrollAnimation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::onRefreshPanels() {
|
void EmojiPan::onRefreshPanels() {
|
||||||
e_inner.refreshPanels(e_panels);
|
e_inner->refreshPanels(e_panels);
|
||||||
s_inner.refreshPanels(s_panels);
|
s_inner->refreshPanels(s_panels);
|
||||||
if (_emojiShown) {
|
if (_emojiShown) {
|
||||||
updatePanelsPositions(e_panels, e_scroll.scrollTop());
|
updatePanelsPositions(e_panels, e_scroll->scrollTop());
|
||||||
} else {
|
} else {
|
||||||
updatePanelsPositions(s_panels, s_scroll.scrollTop());
|
updatePanelsPositions(s_panels, s_scroll->scrollTop());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3346,7 +3346,7 @@ void EmojiPan::updateSelected() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::updateIcons() {
|
void EmojiPan::updateIcons() {
|
||||||
if (_emojiShown || !s_inner.showSectionIcons()) return;
|
if (_emojiShown || !s_inner->showSectionIcons()) return;
|
||||||
|
|
||||||
QRect r(st::defaultDropdownPadding.left(), st::defaultDropdownPadding.top(), _width - st::defaultDropdownPadding.left() - st::defaultDropdownPadding.right(), _height - st::defaultDropdownPadding.top() - st::defaultDropdownPadding.bottom());
|
QRect r(st::defaultDropdownPadding.left(), st::defaultDropdownPadding.top(), _width - st::defaultDropdownPadding.left() - st::defaultDropdownPadding.right(), _height - st::defaultDropdownPadding.top() - st::defaultDropdownPadding.bottom());
|
||||||
update(r.left(), _iconsTop, r.width(), st::emojiCategory.height);
|
update(r.left(), _iconsTop, r.width(), st::emojiCategory.height);
|
||||||
|
@ -3405,7 +3405,7 @@ void EmojiPan::opacityAnimationCallback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::hideByTimerOrLeave() {
|
void EmojiPan::hideByTimerOrLeave() {
|
||||||
if (isHidden() || preventAutoHide() || s_inner.inlineResultsShown()) return;
|
if (isHidden() || preventAutoHide() || s_inner->inlineResultsShown()) return;
|
||||||
|
|
||||||
hideAnimated();
|
hideAnimated();
|
||||||
}
|
}
|
||||||
|
@ -3481,8 +3481,8 @@ EmojiPan::~EmojiPan() = default;
|
||||||
|
|
||||||
void EmojiPan::hideFinished() {
|
void EmojiPan::hideFinished() {
|
||||||
hide();
|
hide();
|
||||||
e_inner.hideFinish();
|
e_inner->hideFinish();
|
||||||
s_inner.hideFinish(true);
|
s_inner->hideFinish(true);
|
||||||
_a_show.finish();
|
_a_show.finish();
|
||||||
_showAnimation.reset();
|
_showAnimation.reset();
|
||||||
_a_slide.finish();
|
_a_slide.finish();
|
||||||
|
@ -3491,9 +3491,9 @@ void EmojiPan::hideFinished() {
|
||||||
_horizontal = false;
|
_horizontal = false;
|
||||||
_hiding = false;
|
_hiding = false;
|
||||||
|
|
||||||
e_scroll.scrollToY(0);
|
e_scroll->scrollToY(0);
|
||||||
setCurrentTabIcon(dbietRecent);
|
setCurrentTabIcon(dbietRecent);
|
||||||
s_scroll.scrollToY(0);
|
s_scroll->scrollToY(0);
|
||||||
_iconOver = _iconDown = -1;
|
_iconOver = _iconDown = -1;
|
||||||
_iconSel = 0;
|
_iconSel = 0;
|
||||||
_iconsX = anim::ivalue(0, 0);
|
_iconsX = anim::ivalue(0, 0);
|
||||||
|
@ -3518,32 +3518,30 @@ void EmojiPan::showAnimated(Ui::PanelAnimation::Origin origin) {
|
||||||
|
|
||||||
void EmojiPan::showStarted() {
|
void EmojiPan::showStarted() {
|
||||||
if (isHidden()) {
|
if (isHidden()) {
|
||||||
e_inner.refreshRecent();
|
emit updateStickers();
|
||||||
if (s_inner.inlineResultsShown() && refreshInlineRows()) {
|
e_inner->refreshRecent();
|
||||||
|
if (s_inner->inlineResultsShown() && refreshInlineRows()) {
|
||||||
_emojiShown = false;
|
_emojiShown = false;
|
||||||
_shownFromInlineQuery = true;
|
_shownFromInlineQuery = true;
|
||||||
} else {
|
} else {
|
||||||
s_inner.refreshRecent();
|
s_inner->refreshRecent();
|
||||||
_emojiShown = true;
|
_emojiShown = true;
|
||||||
_shownFromInlineQuery = false;
|
_shownFromInlineQuery = false;
|
||||||
_cache = QPixmap(); // clear after refreshInlineRows()
|
_cache = QPixmap(); // clear after refreshInlineRows()
|
||||||
}
|
}
|
||||||
recountContentMaxHeight();
|
recountContentMaxHeight();
|
||||||
s_inner.preloadImages();
|
s_inner->preloadImages();
|
||||||
_a_slide.finish();
|
_a_slide.finish();
|
||||||
_slideAnimation.reset();
|
_slideAnimation.reset();
|
||||||
moveBottom(y() + height(), true);
|
moveBottom(y() + height(), true);
|
||||||
show();
|
show();
|
||||||
startShowAnimation();
|
startShowAnimation();
|
||||||
return;
|
} else if (_hiding) {
|
||||||
} else if (!_hiding) {
|
if (s_inner->inlineResultsShown() && refreshInlineRows()) {
|
||||||
return;
|
onSwitch();
|
||||||
|
}
|
||||||
|
startOpacityAnimation(false);
|
||||||
}
|
}
|
||||||
if (s_inner.inlineResultsShown() && refreshInlineRows()) {
|
|
||||||
onSwitch();
|
|
||||||
}
|
|
||||||
startOpacityAnimation(false);
|
|
||||||
emit updateStickers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmojiPan::eventFilter(QObject *obj, QEvent *e) {
|
bool EmojiPan::eventFilter(QObject *obj, QEvent *e) {
|
||||||
|
@ -3578,40 +3576,40 @@ void EmojiPan::stickersInstalled(uint64 setId) {
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
showAll();
|
showAll();
|
||||||
s_inner.showStickerSet(setId);
|
s_inner->showStickerSet(setId);
|
||||||
updateContentHeight();
|
updateContentHeight();
|
||||||
showAnimated(Ui::PanelAnimation::Origin::BottomRight);
|
showAnimated(Ui::PanelAnimation::Origin::BottomRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::notify_inlineItemLayoutChanged(const InlineBots::Layout::ItemBase *layout) {
|
void EmojiPan::notify_inlineItemLayoutChanged(const InlineBots::Layout::ItemBase *layout) {
|
||||||
if (!_emojiShown && !isHidden()) {
|
if (!_emojiShown && !isHidden()) {
|
||||||
s_inner.notify_inlineItemLayoutChanged(layout);
|
s_inner->notify_inlineItemLayoutChanged(layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::ui_repaintInlineItem(const InlineBots::Layout::ItemBase *layout) {
|
void EmojiPan::ui_repaintInlineItem(const InlineBots::Layout::ItemBase *layout) {
|
||||||
if (!_emojiShown && !isHidden()) {
|
if (!_emojiShown && !isHidden()) {
|
||||||
s_inner.ui_repaintInlineItem(layout);
|
s_inner->ui_repaintInlineItem(layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmojiPan::ui_isInlineItemVisible(const InlineBots::Layout::ItemBase *layout) {
|
bool EmojiPan::ui_isInlineItemVisible(const InlineBots::Layout::ItemBase *layout) {
|
||||||
if (!_emojiShown && !isHidden()) {
|
if (!_emojiShown && !isHidden()) {
|
||||||
return s_inner.ui_isInlineItemVisible(layout);
|
return s_inner->ui_isInlineItemVisible(layout);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmojiPan::ui_isInlineItemBeingChosen() {
|
bool EmojiPan::ui_isInlineItemBeingChosen() {
|
||||||
if (!_emojiShown && !isHidden()) {
|
if (!_emojiShown && !isHidden()) {
|
||||||
return s_inner.ui_isInlineItemBeingChosen();
|
return s_inner->ui_isInlineItemBeingChosen();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::showAll() {
|
void EmojiPan::showAll() {
|
||||||
if (_emojiShown) {
|
if (_emojiShown) {
|
||||||
s_scroll.hide();
|
s_scroll->hide();
|
||||||
_recent->show();
|
_recent->show();
|
||||||
_people->show();
|
_people->show();
|
||||||
_nature->show();
|
_nature->show();
|
||||||
|
@ -3620,9 +3618,9 @@ void EmojiPan::showAll() {
|
||||||
_travel->show();
|
_travel->show();
|
||||||
_objects->show();
|
_objects->show();
|
||||||
_symbols->show();
|
_symbols->show();
|
||||||
e_scroll.show();
|
e_scroll->show();
|
||||||
} else {
|
} else {
|
||||||
s_scroll.show();
|
s_scroll->show();
|
||||||
_recent->hide();
|
_recent->hide();
|
||||||
_people->hide();
|
_people->hide();
|
||||||
_nature->hide();
|
_nature->hide();
|
||||||
|
@ -3631,7 +3629,7 @@ void EmojiPan::showAll() {
|
||||||
_travel->hide();
|
_travel->hide();
|
||||||
_objects->hide();
|
_objects->hide();
|
||||||
_symbols->hide();
|
_symbols->hide();
|
||||||
e_scroll.hide();
|
e_scroll->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3644,14 +3642,14 @@ void EmojiPan::hideAll() {
|
||||||
_travel->hide();
|
_travel->hide();
|
||||||
_objects->hide();
|
_objects->hide();
|
||||||
_symbols->hide();
|
_symbols->hide();
|
||||||
e_scroll.hide();
|
e_scroll->hide();
|
||||||
s_scroll.hide();
|
s_scroll->hide();
|
||||||
e_inner.clearSelection(true);
|
e_inner->clearSelection(true);
|
||||||
s_inner.clearSelection(true);
|
s_inner->clearSelection(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::setActiveTab(DBIEmojiTab tab) {
|
void EmojiPan::setActiveTab(DBIEmojiTab tab) {
|
||||||
e_inner.showEmojiPack(tab);
|
e_inner->showEmojiPack(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::updatePanelsPositions(const QVector<internal::EmojiPanel*> &panels, int32 st) {
|
void EmojiPan::updatePanelsPositions(const QVector<internal::EmojiPanel*> &panels, int32 st) {
|
||||||
|
@ -3666,20 +3664,20 @@ void EmojiPan::updatePanelsPositions(const QVector<internal::EmojiPanel*> &panel
|
||||||
// Somehow the panels gets hidden (not displayed) when scrolling
|
// Somehow the panels gets hidden (not displayed) when scrolling
|
||||||
// by clicking on the scroll bar to the middle of the panel.
|
// by clicking on the scroll bar to the middle of the panel.
|
||||||
// This bug occurs only in the Section::Featured stickers.
|
// This bug occurs only in the Section::Featured stickers.
|
||||||
if (s_inner.currentSet(0) == Stickers::FeaturedSetId) {
|
if (s_inner->currentSet(0) == Stickers::FeaturedSetId) {
|
||||||
panels.at(i)->repaint();
|
panels.at(i)->repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::onScrollEmoji() {
|
void EmojiPan::onScrollEmoji() {
|
||||||
auto st = e_scroll.scrollTop();
|
auto st = e_scroll->scrollTop();
|
||||||
|
|
||||||
updatePanelsPositions(e_panels, st);
|
updatePanelsPositions(e_panels, st);
|
||||||
|
|
||||||
setCurrentTabIcon(e_inner.currentTab(st));
|
setCurrentTabIcon(e_inner->currentTab(st));
|
||||||
|
|
||||||
e_inner.setVisibleTopBottom(st, st + e_scroll.height());
|
e_inner->setVisibleTopBottom(st, st + e_scroll->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::setCurrentTabIcon(DBIEmojiTab tab) {
|
void EmojiPan::setCurrentTabIcon(DBIEmojiTab tab) {
|
||||||
|
@ -3694,20 +3692,20 @@ void EmojiPan::setCurrentTabIcon(DBIEmojiTab tab) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::onScrollStickers() {
|
void EmojiPan::onScrollStickers() {
|
||||||
auto st = s_scroll.scrollTop();
|
auto st = s_scroll->scrollTop();
|
||||||
|
|
||||||
updatePanelsPositions(s_panels, st);
|
updatePanelsPositions(s_panels, st);
|
||||||
|
|
||||||
validateSelectedIcon(ValidateIconAnimations::Full);
|
validateSelectedIcon(ValidateIconAnimations::Full);
|
||||||
if (st + s_scroll.height() > s_scroll.scrollTopMax()) {
|
if (st + s_scroll->height() > s_scroll->scrollTopMax()) {
|
||||||
onInlineRequest();
|
onInlineRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
s_inner.setVisibleTopBottom(st, st + s_scroll.height());
|
s_inner->setVisibleTopBottom(st, st + s_scroll->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::validateSelectedIcon(ValidateIconAnimations animations) {
|
void EmojiPan::validateSelectedIcon(ValidateIconAnimations animations) {
|
||||||
uint64 setId = s_inner.currentSet(s_scroll.scrollTop());
|
uint64 setId = s_inner->currentSet(s_scroll->scrollTop());
|
||||||
int32 newSel = 0;
|
int32 newSel = 0;
|
||||||
for (int i = 0, l = _icons.size(); i < l; ++i) {
|
for (int i = 0, l = _icons.size(); i < l; ++i) {
|
||||||
if (_icons.at(i).setId == setId) {
|
if (_icons.at(i).setId == setId) {
|
||||||
|
@ -3784,9 +3782,9 @@ void EmojiPan::onSwitch() {
|
||||||
hideAll();
|
hideAll();
|
||||||
|
|
||||||
if (_emojiShown) {
|
if (_emojiShown) {
|
||||||
s_inner.hideFinish(false);
|
s_inner->hideFinish(false);
|
||||||
} else {
|
} else {
|
||||||
e_inner.hideFinish();
|
e_inner->hideFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
_a_slide.start([this] { update(); }, 0., 1., st::emojiPanSlideDuration, anim::linear);
|
_a_slide.start([this] { update(); }, 0., 1., st::emojiPanSlideDuration, anim::linear);
|
||||||
|
@ -3799,14 +3797,14 @@ void EmojiPan::performSwitch() {
|
||||||
Notify::clipStopperHidden(ClipStopperSavedGifsPanel);
|
Notify::clipStopperHidden(ClipStopperSavedGifsPanel);
|
||||||
} else {
|
} else {
|
||||||
if (cShowingSavedGifs() && cSavedGifs().isEmpty()) {
|
if (cShowingSavedGifs() && cSavedGifs().isEmpty()) {
|
||||||
s_inner.showStickerSet(Stickers::DefaultSetId);
|
s_inner->showStickerSet(Stickers::DefaultSetId);
|
||||||
} else if (!cShowingSavedGifs() && !cSavedGifs().isEmpty() && Global::StickerSetsOrder().isEmpty()) {
|
} else if (!cShowingSavedGifs() && !cSavedGifs().isEmpty() && Global::StickerSetsOrder().isEmpty()) {
|
||||||
s_inner.showStickerSet(Stickers::NoneSetId);
|
s_inner->showStickerSet(Stickers::NoneSetId);
|
||||||
} else {
|
} else {
|
||||||
s_inner.updateShowingSavedGifs();
|
s_inner->updateShowingSavedGifs();
|
||||||
}
|
}
|
||||||
if (cShowingSavedGifs()) {
|
if (cShowingSavedGifs()) {
|
||||||
s_inner.showFinish();
|
s_inner->showFinish();
|
||||||
}
|
}
|
||||||
validateSelectedIcon(ValidateIconAnimations::None);
|
validateSelectedIcon(ValidateIconAnimations::None);
|
||||||
updateContentHeight();
|
updateContentHeight();
|
||||||
|
@ -3833,7 +3831,7 @@ void EmojiPan::onInstallSet(quint64 setId) {
|
||||||
auto it = sets.constFind(setId);
|
auto it = sets.constFind(setId);
|
||||||
if (it != sets.cend()) {
|
if (it != sets.cend()) {
|
||||||
MTP::send(MTPmessages_InstallStickerSet(Stickers::inputSetId(*it), MTP_bool(false)), rpcDone(&EmojiPan::installSetDone), rpcFail(&EmojiPan::installSetFail, setId));
|
MTP::send(MTPmessages_InstallStickerSet(Stickers::inputSetId(*it), MTP_bool(false)), rpcDone(&EmojiPan::installSetDone), rpcFail(&EmojiPan::installSetFail, setId));
|
||||||
s_inner.installedLocally(setId);
|
s_inner->installedLocally(setId);
|
||||||
Stickers::installLocally(setId);
|
Stickers::installLocally(setId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3848,7 +3846,7 @@ bool EmojiPan::installSetFail(uint64 setId, const RPCError &error) {
|
||||||
if (MTP::isDefaultHandledError(error)) {
|
if (MTP::isDefaultHandledError(error)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
s_inner.notInstalledLocally(setId);
|
s_inner->notInstalledLocally(setId);
|
||||||
Stickers::undoInstallLocally(setId);
|
Stickers::undoInstallLocally(setId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3908,12 +3906,12 @@ void EmojiPan::onDelayedHide() {
|
||||||
|
|
||||||
void EmojiPan::clearInlineBot() {
|
void EmojiPan::clearInlineBot() {
|
||||||
inlineBotChanged();
|
inlineBotChanged();
|
||||||
e_switch.updateText();
|
e_switch->updateText();
|
||||||
e_switch.moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
e_switch->moveToRight(st::buttonRadius, 0, st::emojiPanWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmojiPan::hideOnNoInlineResults() {
|
bool EmojiPan::hideOnNoInlineResults() {
|
||||||
return _inlineBot && !_emojiShown && s_inner.inlineResultsShown() && (_shownFromInlineQuery || _inlineBot->username != cInlineGifBotUsername());
|
return _inlineBot && !_emojiShown && s_inner->inlineResultsShown() && (_shownFromInlineQuery || _inlineBot->username != cInlineGifBotUsername());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPan::inlineBotChanged() {
|
void EmojiPan::inlineBotChanged() {
|
||||||
|
@ -3933,8 +3931,8 @@ void EmojiPan::inlineBotChanged() {
|
||||||
delete i.value();
|
delete i.value();
|
||||||
}
|
}
|
||||||
_inlineCache.clear();
|
_inlineCache.clear();
|
||||||
s_inner.inlineBotChanged();
|
s_inner->inlineBotChanged();
|
||||||
s_inner.hideInlineRowsPanel();
|
s_inner->hideInlineRowsPanel();
|
||||||
|
|
||||||
Notify::inlineBotRequesting(false);
|
Notify::inlineBotRequesting(false);
|
||||||
}
|
}
|
||||||
|
@ -4042,11 +4040,11 @@ void EmojiPan::onInlineRequest() {
|
||||||
void EmojiPan::onEmptyInlineRows() {
|
void EmojiPan::onEmptyInlineRows() {
|
||||||
if (_shownFromInlineQuery || hideOnNoInlineResults()) {
|
if (_shownFromInlineQuery || hideOnNoInlineResults()) {
|
||||||
hideAnimated();
|
hideAnimated();
|
||||||
s_inner.clearInlineRowsPanel();
|
s_inner->clearInlineRowsPanel();
|
||||||
} else if (!_inlineBot) {
|
} else if (!_inlineBot) {
|
||||||
s_inner.hideInlineRowsPanel();
|
s_inner->hideInlineRowsPanel();
|
||||||
} else {
|
} else {
|
||||||
s_inner.clearInlineRowsPanel();
|
s_inner->clearInlineRowsPanel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4060,7 +4058,7 @@ bool EmojiPan::refreshInlineRows(int32 *added) {
|
||||||
_inlineNextOffset = i.value()->nextOffset;
|
_inlineNextOffset = i.value()->nextOffset;
|
||||||
}
|
}
|
||||||
if (!entry) prepareCache();
|
if (!entry) prepareCache();
|
||||||
int32 result = s_inner.refreshInlineRows(_inlineBot, entry, false);
|
int32 result = s_inner->refreshInlineRows(_inlineBot, entry, false);
|
||||||
if (added) *added = result;
|
if (added) *added = result;
|
||||||
return (entry != nullptr);
|
return (entry != nullptr);
|
||||||
}
|
}
|
||||||
|
@ -4068,10 +4066,10 @@ bool EmojiPan::refreshInlineRows(int32 *added) {
|
||||||
int32 EmojiPan::showInlineRows(bool newResults) {
|
int32 EmojiPan::showInlineRows(bool newResults) {
|
||||||
int32 added = 0;
|
int32 added = 0;
|
||||||
bool clear = !refreshInlineRows(&added);
|
bool clear = !refreshInlineRows(&added);
|
||||||
if (newResults) s_scroll.scrollToY(0);
|
if (newResults) s_scroll->scrollToY(0);
|
||||||
|
|
||||||
e_switch.updateText(s_inner.inlineResultsShown() ? _inlineBot->username : QString());
|
e_switch->updateText(s_inner->inlineResultsShown() ? _inlineBot->username : QString());
|
||||||
e_switch.moveToRight(0, 0, st::emojiPanWidth);
|
e_switch->moveToRight(0, 0, st::emojiPanWidth);
|
||||||
|
|
||||||
bool hidden = isHidden();
|
bool hidden = isHidden();
|
||||||
if (!hidden && !clear) {
|
if (!hidden && !clear) {
|
||||||
|
@ -4097,7 +4095,7 @@ int32 EmojiPan::showInlineRows(bool newResults) {
|
||||||
|
|
||||||
void EmojiPan::recountContentMaxHeight() {
|
void EmojiPan::recountContentMaxHeight() {
|
||||||
if (_shownFromInlineQuery) {
|
if (_shownFromInlineQuery) {
|
||||||
_contentMaxHeight = qMin(s_inner.countHeight(true), int(st::emojiPanMaxHeight));
|
_contentMaxHeight = qMin(s_inner->countHeight(true), int(st::emojiPanMaxHeight));
|
||||||
} else {
|
} else {
|
||||||
_contentMaxHeight = st::emojiPanMaxHeight;
|
_contentMaxHeight = st::emojiPanMaxHeight;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ class Result;
|
||||||
} // namespace InlineBots
|
} // namespace InlineBots
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
class ScrollArea;
|
||||||
class IconButton;
|
class IconButton;
|
||||||
class LinkButton;
|
class LinkButton;
|
||||||
class RoundButton;
|
class RoundButton;
|
||||||
|
@ -123,7 +124,7 @@ class EmojiPanInner : public TWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EmojiPanInner();
|
EmojiPanInner(QWidget *parent);
|
||||||
|
|
||||||
void setMaxHeight(int32 h);
|
void setMaxHeight(int32 h);
|
||||||
void paintEvent(QPaintEvent *e) override;
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
@ -217,7 +218,7 @@ class StickerPanInner : public TWidget, private base::Subscriber {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StickerPanInner();
|
StickerPanInner(QWidget *parent);
|
||||||
|
|
||||||
void setMaxHeight(int32 h);
|
void setMaxHeight(int32 h);
|
||||||
void paintEvent(QPaintEvent *e) override;
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
@ -681,14 +682,14 @@ private:
|
||||||
bool _emojiShown = true;
|
bool _emojiShown = true;
|
||||||
bool _shownFromInlineQuery = false;
|
bool _shownFromInlineQuery = false;
|
||||||
|
|
||||||
ScrollArea e_scroll;
|
ChildWidget<Ui::ScrollArea> e_scroll;
|
||||||
internal::EmojiPanInner e_inner;
|
ChildWidget<internal::EmojiPanInner> e_inner;
|
||||||
QVector<internal::EmojiPanel*> e_panels;
|
QVector<internal::EmojiPanel*> e_panels;
|
||||||
internal::EmojiSwitchButton e_switch;
|
ChildWidget<internal::EmojiSwitchButton> e_switch;
|
||||||
ScrollArea s_scroll;
|
ChildWidget<Ui::ScrollArea> s_scroll;
|
||||||
internal::StickerPanInner s_inner;
|
ChildWidget<internal::StickerPanInner> s_inner;
|
||||||
QVector<internal::EmojiPanel*> s_panels;
|
QVector<internal::EmojiPanel*> s_panels;
|
||||||
internal::EmojiSwitchButton s_switch;
|
ChildWidget<internal::EmojiSwitchButton> s_switch;
|
||||||
|
|
||||||
uint64 _displayingSetId = 0;
|
uint64 _displayingSetId = 0;
|
||||||
uint64 _removingSetId = 0;
|
uint64 _removingSetId = 0;
|
||||||
|
|
|
@ -34,7 +34,7 @@ stickersTrendingHeader: 45px;
|
||||||
stickersTrendingSkip: 15px;
|
stickersTrendingSkip: 15px;
|
||||||
|
|
||||||
stickersTrendingHeaderFont: semiboldFont;
|
stickersTrendingHeaderFont: semiboldFont;
|
||||||
stickersTrendingHeaderFg: windowTextFg;
|
stickersTrendingHeaderFg: windowFg;
|
||||||
stickersTrendingHeaderTop: 0px;
|
stickersTrendingHeaderTop: 0px;
|
||||||
stickersTrendingSubheaderFont: normalFont;
|
stickersTrendingSubheaderFont: normalFont;
|
||||||
stickersTrendingSubheaderFg: #777777;
|
stickersTrendingSubheaderFg: #777777;
|
||||||
|
@ -68,7 +68,7 @@ stickersFeaturedInstalled: icon {{ "mediaview_save_check", lightButtonFg }};
|
||||||
stickersMaxHeight: 440px;
|
stickersMaxHeight: 440px;
|
||||||
stickersPadding: margins(19px, 17px, 19px, 17px);
|
stickersPadding: margins(19px, 17px, 19px, 17px);
|
||||||
stickersSize: size(64px, 64px);
|
stickersSize: size(64px, 64px);
|
||||||
stickersScroll: flatScroll(boxScroll) {
|
stickersScroll: FlatScroll(boxScroll) {
|
||||||
round: 2px;
|
round: 2px;
|
||||||
deltax: 7px;
|
deltax: 7px;
|
||||||
deltat: 23px;
|
deltat: 23px;
|
||||||
|
@ -86,7 +86,7 @@ stickersTrendingActive: icon {{ "emoji_trending", #58b2ed }};
|
||||||
stickersSettingsUnreadSize: 17px;
|
stickersSettingsUnreadSize: 17px;
|
||||||
stickersSettingsUnreadPosition: point(4px, 5px);
|
stickersSettingsUnreadPosition: point(4px, 5px);
|
||||||
|
|
||||||
emojiScroll: flatScroll(solidScroll) {
|
emojiScroll: FlatScroll(defaultSolidScroll) {
|
||||||
deltat: 48px;
|
deltat: 48px;
|
||||||
}
|
}
|
||||||
emojiRecent: icon {{ "emoji_recent", #b3b3b3 }};
|
emojiRecent: icon {{ "emoji_recent", #b3b3b3 }};
|
||||||
|
|
|
@ -1678,18 +1678,20 @@ GameData::GameData(const GameId &id, const uint64 &accessHash, const QString &sh
|
||||||
, document(document) {
|
, document(document) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerOpenClickHandler::onClickImpl() const {
|
ClickHandlerPtr peerOpenClickHandler(PeerData *peer) {
|
||||||
if (App::main()) {
|
return MakeShared<LambdaClickHandler>([peer] {
|
||||||
if (peer() && peer()->isChannel() && App::main()->historyPeer() != peer()) {
|
if (App::main()) {
|
||||||
if (!peer()->asChannel()->isPublic() && !peer()->asChannel()->amIn()) {
|
if (peer && peer->isChannel() && App::main()->historyPeer() != peer) {
|
||||||
Ui::showLayer(new InformBox(lang((peer()->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible)));
|
if (!peer->asChannel()->isPublic() && !peer->asChannel()->amIn()) {
|
||||||
|
Ui::showLayer(new InformBox(lang((peer->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible)));
|
||||||
|
} else {
|
||||||
|
Ui::showPeerHistory(peer, ShowAtUnreadMsgId, Ui::ShowWay::Forward);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::showPeerHistory(peer(), ShowAtUnreadMsgId, Ui::ShowWay::Forward);
|
Ui::showPeerProfile(peer);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Ui::showPeerProfile(peer());
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgId clientMsgId() {
|
MsgId clientMsgId() {
|
||||||
|
|
|
@ -215,25 +215,7 @@ inline const QString &emptyUsername() {
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PeerClickHandler : public LeftButtonClickHandler {
|
ClickHandlerPtr peerOpenClickHandler(PeerData *peer);
|
||||||
public:
|
|
||||||
PeerClickHandler(PeerData *peer) : _peer(peer) {
|
|
||||||
}
|
|
||||||
PeerData *peer() const {
|
|
||||||
return _peer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
PeerData *_peer;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class PeerOpenClickHandler : public PeerClickHandler {
|
|
||||||
public:
|
|
||||||
using PeerClickHandler::PeerClickHandler;
|
|
||||||
protected:
|
|
||||||
void onClickImpl() const override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class UserData;
|
class UserData;
|
||||||
class ChatData;
|
class ChatData;
|
||||||
|
@ -339,7 +321,7 @@ public:
|
||||||
|
|
||||||
const ClickHandlerPtr &openLink() {
|
const ClickHandlerPtr &openLink() {
|
||||||
if (!_openLink) {
|
if (!_openLink) {
|
||||||
_openLink.reset(new PeerOpenClickHandler(this));
|
_openLink = peerOpenClickHandler(this);
|
||||||
}
|
}
|
||||||
return _openLink;
|
return _openLink;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "ui/scrollarea.h"
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "ui/widgets/multi_select.h"
|
#include "ui/widgets/multi_select.h"
|
||||||
#include "boxes/contactsbox.h"
|
#include "boxes/contactsbox.h"
|
||||||
#include "countries.h"
|
#include "countries.h"
|
||||||
|
@ -126,7 +126,7 @@ void CountryInput::paintEvent(QPaintEvent *e) {
|
||||||
p.drawPixmap(_arrowRect.x(), _arrowRect.top(), _arrow);
|
p.drawPixmap(_arrowRect.x(), _arrowRect.top(), _arrow);
|
||||||
|
|
||||||
p.setFont(_st.font);
|
p.setFont(_st.font);
|
||||||
p.setPen(st::windowTextFg);
|
p.setPen(st::windowFg);
|
||||||
|
|
||||||
p.drawText(rect().marginsRemoved(_st.textMrg), _text, QTextOption(_st.align));
|
p.drawText(rect().marginsRemoved(_st.textMrg), _text, QTextOption(_st.align));
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/scrollarea.h"
|
|
||||||
#include "ui/effects/rect_shadow.h"
|
#include "ui/effects/rect_shadow.h"
|
||||||
#include "boxes/abstractbox.h"
|
#include "boxes/abstractbox.h"
|
||||||
#include "styles/style_intro.h"
|
#include "styles/style_intro.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const style::textStyle *_textStyle = nullptr;
|
const style::TextStyle *_textStyle = nullptr;
|
||||||
|
|
||||||
void initDefault() {
|
void initDefault() {
|
||||||
_textStyle = &st::defaultTextStyle;
|
_textStyle = &st::defaultTextStyle;
|
||||||
|
@ -44,11 +44,11 @@ inline int32 countBlockHeight(const ITextBlock *b, const style::font &font) {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
const style::textStyle *textstyleCurrent() {
|
const style::TextStyle *textstyleCurrent() {
|
||||||
return _textStyle;
|
return _textStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void textstyleSet(const style::textStyle *style) {
|
void textstyleSet(const style::TextStyle *style) {
|
||||||
_textStyle = style ? style : &st::defaultTextStyle;
|
_textStyle = style ? style : &st::defaultTextStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,8 +264,8 @@ const QRegularExpression &reHashtag();
|
||||||
const QRegularExpression &reBotCommand();
|
const QRegularExpression &reBotCommand();
|
||||||
|
|
||||||
// text style
|
// text style
|
||||||
const style::textStyle *textstyleCurrent();
|
const style::TextStyle *textstyleCurrent();
|
||||||
void textstyleSet(const style::textStyle *style);
|
void textstyleSet(const style::TextStyle *style);
|
||||||
inline void textstyleRestore() {
|
inline void textstyleRestore() {
|
||||||
textstyleSet(nullptr);
|
textstyleSet(nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi
|
||||||
if (length) {
|
if (length) {
|
||||||
style::font blockFont = font;
|
style::font blockFont = font;
|
||||||
if (!flags && lnkIndex) {
|
if (!flags && lnkIndex) {
|
||||||
// should use textStyle lnkFlags somehow... not supported
|
// should use TextStyle lnkFlags somehow... not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & TextBlockFPre) || (flags & TextBlockFCode)) {
|
if ((flags & TextBlockFPre) || (flags & TextBlockFCode)) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ void FlatButton::paintEvent(QPaintEvent *e) {
|
||||||
p.setRenderHint(QPainter::TextAntialiasing);
|
p.setRenderHint(QPainter::TextAntialiasing);
|
||||||
p.setPen(anim::pen(_st.color, _st.overColor, a_over.current()));
|
p.setPen(anim::pen(_st.color, _st.overColor, a_over.current()));
|
||||||
|
|
||||||
int32 top = (_state & StateOver) ? ((_state & StateDown) ? _st.downTextTop : _st.overTextTop) : _st.textTop;
|
auto top = (_state & StateDown) ? _st.downTextTop : ((_state & StateOver) ? _st.overTextTop : _st.textTop);
|
||||||
r.setTop(top);
|
r.setTop(top);
|
||||||
|
|
||||||
p.drawText(r, _text, style::al_top);
|
p.drawText(r, _text, style::al_top);
|
||||||
|
@ -259,7 +259,7 @@ void RoundButton::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
auto over = (_state & StateOver);
|
auto over = (_state & StateOver);
|
||||||
auto down = (_state & StateDown);
|
auto down = (_state & StateDown);
|
||||||
if (over) {
|
if (over || down) {
|
||||||
App::roundRect(p, myrtlrect(rounded), _st.textBgOver, ImageRoundRadius::Small);
|
App::roundRect(p, myrtlrect(rounded), _st.textBgOver, ImageRoundRadius::Small);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,6 +360,7 @@ void IconButton::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto down = (_state & StateDown);
|
||||||
auto over = _a_over.current(getms(), (_state & StateOver) ? 1. : 0.);
|
auto over = _a_over.current(getms(), (_state & StateOver) ? 1. : 0.);
|
||||||
auto overIcon = [this] {
|
auto overIcon = [this] {
|
||||||
if (_iconOverrideOver) {
|
if (_iconOverrideOver) {
|
||||||
|
@ -377,7 +378,7 @@ void IconButton::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
return &_st.icon;
|
return &_st.icon;
|
||||||
};
|
};
|
||||||
auto icon = (over == 1.) ? overIcon() : justIcon();
|
auto icon = (over == 1. || down) ? overIcon() : justIcon();
|
||||||
auto position = (_state & StateDown) ? _st.iconPositionDown : _st.iconPosition;
|
auto position = (_state & StateDown) ? _st.iconPositionDown : _st.iconPosition;
|
||||||
if (position.x() < 0) {
|
if (position.x() < 0) {
|
||||||
position.setX((width() - icon->width()) / 2);
|
position.setX((width() - icon->width()) / 2);
|
||||||
|
|
|
@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "ui/widgets/inner_dropdown.h"
|
#include "ui/widgets/inner_dropdown.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui/scrollarea.h"
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
#include "profile/profile_members_widget.h"
|
#include "profile/profile_members_widget.h"
|
||||||
#include "ui/effects/panel_animation.h"
|
#include "ui/effects/panel_animation.h"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue