mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Removed display of right button for bots when there is unread badge.
This commit is contained in:
parent
cdd7ff5c6d
commit
9822c56f1a
2 changed files with 8 additions and 8 deletions
|
@ -144,9 +144,7 @@ int PaintBadges(
|
|||
int pinnedIconTop,
|
||||
bool narrow) {
|
||||
auto initial = right;
|
||||
if (const auto used = PaintRightButton(p, context)) {
|
||||
return used - st::dialogsUnreadPadding;
|
||||
} else if (badgesState.unread
|
||||
if (badgesState.unread
|
||||
&& !badgesState.unreadCounter
|
||||
&& context.st->unreadMarkDiameter > 0) {
|
||||
const auto d = context.st->unreadMarkDiameter;
|
||||
|
@ -188,6 +186,8 @@ int PaintBadges(
|
|||
: QString::number(badgesState.unreadCounter);
|
||||
const auto badge = PaintUnreadBadge(p, counter, right, top, st);
|
||||
right -= badge.width() + st.padding;
|
||||
} else if (const auto used = PaintRightButton(p, context)) {
|
||||
return used - st::dialogsUnreadPadding;
|
||||
} else if (displayPinnedIcon) {
|
||||
const auto &icon = ThreeStateIcon(
|
||||
st::dialogsPinnedIcon,
|
||||
|
|
|
@ -261,7 +261,7 @@ bool RecentRow::refreshBadge() {
|
|||
}
|
||||
|
||||
QSize RecentRow::rightActionSize() const {
|
||||
if (_mainAppText) {
|
||||
if (_mainAppText && _badgeSize.isEmpty()) {
|
||||
return QSize(
|
||||
_mainAppText->maxWidth() + _mainAppText->minHeight(),
|
||||
st::dialogRowOpenBotHeight);
|
||||
|
@ -270,7 +270,7 @@ QSize RecentRow::rightActionSize() const {
|
|||
}
|
||||
|
||||
QMargins RecentRow::rightActionMargins() const {
|
||||
if (_mainAppText) {
|
||||
if (_mainAppText && _badgeSize.isEmpty()) {
|
||||
return QMargins(
|
||||
0,
|
||||
st::dialogRowOpenBotRecentTop,
|
||||
|
@ -292,7 +292,7 @@ void RecentRow::rightActionPaint(
|
|||
int outerWidth,
|
||||
bool selected,
|
||||
bool actionSelected) {
|
||||
if (_mainAppText) {
|
||||
if (_mainAppText && _badgeSize.isEmpty()) {
|
||||
const auto size = RecentRow::rightActionSize();
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(actionSelected
|
||||
|
@ -335,13 +335,13 @@ void RecentRow::rightActionPaint(
|
|||
}
|
||||
|
||||
bool RecentRow::rightActionDisabled() const {
|
||||
return !_mainAppText;
|
||||
return !_mainAppText || !_badgeSize.isEmpty();
|
||||
}
|
||||
|
||||
void RecentRow::rightActionAddRipple(
|
||||
QPoint point,
|
||||
Fn<void()> updateCallback) {
|
||||
if (!_mainAppText) {
|
||||
if (!_mainAppText || !_badgeSize.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (!_actionRipple) {
|
||||
|
|
Loading…
Add table
Reference in a new issue