Allow badge in main menu button.
This commit is contained in:
parent
d31d94e8fb
commit
2a0d189ee2
2 changed files with 5 additions and 3 deletions
|
|
@ -473,7 +473,7 @@ void LayerStackWidget::closeLayer(not_null<LayerWidget*> layer) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (layer == _specialLayer) {
|
||||
if (layer == _specialLayer || layer == _mainMenu) {
|
||||
hideAll(anim::type::normal);
|
||||
} else if (layer == currentLayer()) {
|
||||
if (_layers.size() == 1) {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ const style::icon &SideBarButton::computeIcon() const {
|
|||
|
||||
void SideBarButton::validateIconCache() {
|
||||
Expects(_st.iconPosition.x() < 0);
|
||||
Expects(_st.iconPosition.y() >= 0);
|
||||
|
||||
if (!(_active ? _iconCacheActive : _iconCache).isNull()) {
|
||||
return;
|
||||
|
|
@ -173,7 +172,10 @@ void SideBarButton::validateIconCache() {
|
|||
- st::defaultScrollArea.width
|
||||
- (width() / 2)
|
||||
+ (icon.width() / 2)));
|
||||
const auto y = _st.badgePosition.y() - _st.iconPosition.y();
|
||||
const auto top = (_st.iconPosition.y() >= 0)
|
||||
? _st.iconPosition.y()
|
||||
: (height() - icon.height()) / 2;
|
||||
const auto y = _st.badgePosition.y() - top;
|
||||
const auto r = _st.badgeHeight / 2.;
|
||||
p.drawRoundedRect(x, y, _iconCacheBadgeWidth, _st.badgeHeight, r, r);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue