mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 15:45:12 +00:00
new flat boxes started
This commit is contained in:
@@ -1772,9 +1772,9 @@ void EmojiPanel::updateText() {
|
||||
}
|
||||
} else {
|
||||
QString switchText = lang((_setId != NoneStickerSetId) ? lng_switch_emoji : lng_switch_stickers);
|
||||
availw -= st::emojiSwitchSkip + st::emojiPanHeaderFont->m.width(switchText);
|
||||
availw -= st::emojiSwitchSkip + st::emojiPanHeaderFont->width(switchText);
|
||||
}
|
||||
_text = st::emojiPanHeaderFont->m.elidedText(_fullText, Qt::ElideRight, availw);
|
||||
_text = st::emojiPanHeaderFont->elided(_fullText, availw);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -1805,7 +1805,7 @@ void EmojiPanel::paintEvent(QPaintEvent *e) {
|
||||
|
||||
EmojiSwitchButton::EmojiSwitchButton(QWidget *parent, bool toStickers) : Button(parent),
|
||||
_toStickers(toStickers), _text(lang(_toStickers ? lng_switch_stickers : lng_switch_emoji)),
|
||||
_textWidth(st::emojiPanHeaderFont->m.width(_text)) {
|
||||
_textWidth(st::emojiPanHeaderFont->width(_text)) {
|
||||
int32 w = st::emojiSwitchSkip + _textWidth + (st::emojiSwitchSkip - st::emojiSwitchImgSkip);
|
||||
setCursor(style::cur_pointer);
|
||||
resize(w, st::emojiPanHeader);
|
||||
@@ -2613,7 +2613,7 @@ void EmojiPan::onRemoveSet(quint64 setId) {
|
||||
StickerSets::const_iterator it = cStickerSets().constFind(setId);
|
||||
if (it != cStickerSets().cend() && !(it->flags & MTPDstickerSet_flag_official)) {
|
||||
_removingSetId = it->id;
|
||||
ConfirmBox *box = new ConfirmBox(lng_stickers_remove_pack(lt_sticker_pack, it->title));
|
||||
ConfirmBox *box = new ConfirmBox(lng_stickers_remove_pack(lt_sticker_pack, it->title), lang(lng_box_remove));
|
||||
connect(box, SIGNAL(confirmed()), this, SLOT(onRemoveSetSure()));
|
||||
connect(box, SIGNAL(destroyed(QObject*)), this, SLOT(onDelayedHide()));
|
||||
App::wnd()->showLayer(box);
|
||||
@@ -2662,7 +2662,7 @@ MentionsInner::MentionsInner(MentionsDropdown *parent, MentionRows *rows, Hashta
|
||||
void MentionsInner::paintEvent(QPaintEvent *e) {
|
||||
QPainter p(this);
|
||||
|
||||
int32 atwidth = st::mentionFont->m.width('@'), hashwidth = st::mentionFont->m.width('#');
|
||||
int32 atwidth = st::mentionFont->width('@'), hashwidth = st::mentionFont->width('#');
|
||||
int32 mentionleft = 2 * st::mentionPadding.left() + st::mentionPhotoSize;
|
||||
int32 mentionwidth = width() - mentionleft - 2 * st::mentionPadding.right();
|
||||
int32 htagleft = st::btnAttachPhoto.width + st::taMsgField.textMrg.left() - st::dlgShadow, htagwidth = width() - st::mentionPadding.right() - htagleft - st::mentionScroll.width;
|
||||
@@ -2683,19 +2683,19 @@ void MentionsInner::paintEvent(QPaintEvent *e) {
|
||||
if (!_rows->isEmpty()) {
|
||||
UserData *user = _rows->at(i);
|
||||
QString first = (_parent->filter().size() < 2) ? QString() : ('@' + user->username.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('@' + user->username) : user->username.mid(_parent->filter().size() - 1);
|
||||
int32 firstwidth = st::mentionFont->m.width(first), secondwidth = st::mentionFont->m.width(second), unamewidth = firstwidth + secondwidth, namewidth = user->nameText.maxWidth();
|
||||
int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second), unamewidth = firstwidth + secondwidth, namewidth = user->nameText.maxWidth();
|
||||
if (mentionwidth < unamewidth + namewidth) {
|
||||
namewidth = (mentionwidth * namewidth) / (namewidth + unamewidth);
|
||||
unamewidth = mentionwidth - namewidth;
|
||||
if (firstwidth < unamewidth + st::mentionFont->elidew) {
|
||||
if (firstwidth < unamewidth) {
|
||||
first = st::mentionFont->m.elidedText(first, Qt::ElideRight, unamewidth);
|
||||
first = st::mentionFont->elided(first, unamewidth);
|
||||
} else if (!second.isEmpty()) {
|
||||
first = st::mentionFont->m.elidedText(first + second, Qt::ElideRight, unamewidth);
|
||||
first = st::mentionFont->elided(first + second, unamewidth);
|
||||
second = QString();
|
||||
}
|
||||
} else {
|
||||
second = st::mentionFont->m.elidedText(second, Qt::ElideRight, unamewidth - firstwidth);
|
||||
second = st::mentionFont->elided(second, unamewidth - firstwidth);
|
||||
}
|
||||
}
|
||||
user->photo->load();
|
||||
@@ -2712,13 +2712,13 @@ void MentionsInner::paintEvent(QPaintEvent *e) {
|
||||
} else if (!_hrows->isEmpty()) {
|
||||
QString hrow = _hrows->at(i);
|
||||
QString first = (_parent->filter().size() < 2) ? QString() : ('#' + hrow.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('#' + hrow) : hrow.mid(_parent->filter().size() - 1);
|
||||
int32 firstwidth = st::mentionFont->m.width(first), secondwidth = st::mentionFont->m.width(second);
|
||||
int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second);
|
||||
if (htagwidth < firstwidth + secondwidth) {
|
||||
if (htagwidth < firstwidth + st::mentionFont->elidew) {
|
||||
first = st::mentionFont->m.elidedText(first + second, Qt::ElideRight, htagwidth);
|
||||
first = st::mentionFont->elided(first + second, htagwidth);
|
||||
second = QString();
|
||||
} else {
|
||||
second = st::mentionFont->m.elidedText(second, Qt::ElideRight, htagwidth - firstwidth);
|
||||
second = st::mentionFont->elided(second, htagwidth - firstwidth);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2747,13 +2747,13 @@ void MentionsInner::paintEvent(QPaintEvent *e) {
|
||||
|
||||
int32 addleft = 0, widthleft = mentionwidth;
|
||||
QString first = (_parent->filter().size() < 2) ? QString() : ('/' + toHighlight.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('/' + toHighlight) : toHighlight.mid(_parent->filter().size() - 1);
|
||||
int32 firstwidth = st::mentionFont->m.width(first), secondwidth = st::mentionFont->m.width(second);
|
||||
int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second);
|
||||
if (widthleft < firstwidth + secondwidth) {
|
||||
if (widthleft < firstwidth + st::mentionFont->elidew) {
|
||||
first = st::mentionFont->m.elidedText(first + second, Qt::ElideRight, widthleft);
|
||||
first = st::mentionFont->elided(first + second, widthleft);
|
||||
second = QString();
|
||||
} else {
|
||||
second = st::mentionFont->m.elidedText(second, Qt::ElideRight, widthleft - firstwidth);
|
||||
second = st::mentionFont->elided(second, widthleft - firstwidth);
|
||||
}
|
||||
}
|
||||
p.setFont(st::mentionFont->f);
|
||||
|
Reference in New Issue
Block a user