mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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,
|
int pinnedIconTop,
|
||||||
bool narrow) {
|
bool narrow) {
|
||||||
auto initial = right;
|
auto initial = right;
|
||||||
if (const auto used = PaintRightButton(p, context)) {
|
if (badgesState.unread
|
||||||
return used - st::dialogsUnreadPadding;
|
|
||||||
} else if (badgesState.unread
|
|
||||||
&& !badgesState.unreadCounter
|
&& !badgesState.unreadCounter
|
||||||
&& context.st->unreadMarkDiameter > 0) {
|
&& context.st->unreadMarkDiameter > 0) {
|
||||||
const auto d = context.st->unreadMarkDiameter;
|
const auto d = context.st->unreadMarkDiameter;
|
||||||
|
@ -188,6 +186,8 @@ int PaintBadges(
|
||||||
: QString::number(badgesState.unreadCounter);
|
: QString::number(badgesState.unreadCounter);
|
||||||
const auto badge = PaintUnreadBadge(p, counter, right, top, st);
|
const auto badge = PaintUnreadBadge(p, counter, right, top, st);
|
||||||
right -= badge.width() + st.padding;
|
right -= badge.width() + st.padding;
|
||||||
|
} else if (const auto used = PaintRightButton(p, context)) {
|
||||||
|
return used - st::dialogsUnreadPadding;
|
||||||
} else if (displayPinnedIcon) {
|
} else if (displayPinnedIcon) {
|
||||||
const auto &icon = ThreeStateIcon(
|
const auto &icon = ThreeStateIcon(
|
||||||
st::dialogsPinnedIcon,
|
st::dialogsPinnedIcon,
|
||||||
|
|
|
@ -261,7 +261,7 @@ bool RecentRow::refreshBadge() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize RecentRow::rightActionSize() const {
|
QSize RecentRow::rightActionSize() const {
|
||||||
if (_mainAppText) {
|
if (_mainAppText && _badgeSize.isEmpty()) {
|
||||||
return QSize(
|
return QSize(
|
||||||
_mainAppText->maxWidth() + _mainAppText->minHeight(),
|
_mainAppText->maxWidth() + _mainAppText->minHeight(),
|
||||||
st::dialogRowOpenBotHeight);
|
st::dialogRowOpenBotHeight);
|
||||||
|
@ -270,7 +270,7 @@ QSize RecentRow::rightActionSize() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QMargins RecentRow::rightActionMargins() const {
|
QMargins RecentRow::rightActionMargins() const {
|
||||||
if (_mainAppText) {
|
if (_mainAppText && _badgeSize.isEmpty()) {
|
||||||
return QMargins(
|
return QMargins(
|
||||||
0,
|
0,
|
||||||
st::dialogRowOpenBotRecentTop,
|
st::dialogRowOpenBotRecentTop,
|
||||||
|
@ -292,7 +292,7 @@ void RecentRow::rightActionPaint(
|
||||||
int outerWidth,
|
int outerWidth,
|
||||||
bool selected,
|
bool selected,
|
||||||
bool actionSelected) {
|
bool actionSelected) {
|
||||||
if (_mainAppText) {
|
if (_mainAppText && _badgeSize.isEmpty()) {
|
||||||
const auto size = RecentRow::rightActionSize();
|
const auto size = RecentRow::rightActionSize();
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(actionSelected
|
p.setBrush(actionSelected
|
||||||
|
@ -335,13 +335,13 @@ void RecentRow::rightActionPaint(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecentRow::rightActionDisabled() const {
|
bool RecentRow::rightActionDisabled() const {
|
||||||
return !_mainAppText;
|
return !_mainAppText || !_badgeSize.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecentRow::rightActionAddRipple(
|
void RecentRow::rightActionAddRipple(
|
||||||
QPoint point,
|
QPoint point,
|
||||||
Fn<void()> updateCallback) {
|
Fn<void()> updateCallback) {
|
||||||
if (!_mainAppText) {
|
if (!_mainAppText || !_badgeSize.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!_actionRipple) {
|
if (!_actionRipple) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue