mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Removed actions button from profile top bar in section for stories.
This commit is contained in:
@@ -419,7 +419,8 @@ infoProfileTopBarHeightMax: 180px + infoLayerTopBarHeight;
|
||||
infoProfileTopBarTitleTop: 113px;
|
||||
infoProfileTopBarStatusTop: 134px;
|
||||
infoProfileTopBarPhotoTop: 24px;
|
||||
infoProfileTopBarPhotoBgShift: 60px;
|
||||
infoProfileTopBarPhotoBgShift: 55px;
|
||||
infoProfileTopBarPhotoBgNoActionsShift: 30px;
|
||||
infoProfileTopBarPhotoSize: 80px;
|
||||
infoProfileTopBarLastSeenSkip: 8px;
|
||||
|
||||
@@ -448,6 +449,8 @@ infoProfileTopBarActionButtonsSpace: 10px;
|
||||
infoProfileTopBarStep2: infoProfileTopBarHeightMax - infoLayerTopBarHeight;
|
||||
infoProfileTopBarStep1: infoProfileTopBarStep2 - infoProfileTopBarActionButtonsHeight;
|
||||
|
||||
infoProfileTopBarNoActionsHeightMax: infoProfileTopBarHeightMax - infoProfileTopBarActionButtonSize;
|
||||
|
||||
infoProfileTopBarActionMessage: icon{{ "profile/message-22x22", windowBoldFg }};
|
||||
infoProfileTopBarActionMute: icon{{ "profile/mute-22x22", windowBoldFg }};
|
||||
infoProfileTopBarActionUnmute: icon{{ "profile/unmute-22x22", windowBoldFg }};
|
||||
|
||||
@@ -75,7 +75,10 @@ void FlexibleScrollHelper::setupScrollHandling() {
|
||||
|
||||
const auto singleStep = _scroll->verticalScrollBar()->singleStep()
|
||||
* QApplication::wheelScrollLines();
|
||||
const auto step1 = st::infoProfileTopBarStep1;
|
||||
const auto step1 = (_pinnedToTop->maximumHeight()
|
||||
< st::infoProfileTopBarHeightMax)
|
||||
? (st::infoProfileTopBarStep2 + st::lineWidth)
|
||||
: st::infoProfileTopBarStep1;
|
||||
const auto step2 = st::infoProfileTopBarStep2;
|
||||
// const auto stepDepreciation = singleStep
|
||||
// - st::infoProfileTopBarActionButtonsHeight;
|
||||
|
||||
@@ -39,7 +39,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/notify/data_peer_notify_settings.h"
|
||||
#include "data/stickers/data_custom_emoji.h"
|
||||
#include "history/history.h"
|
||||
#include "info_profile_actions.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "info/info_memento.h"
|
||||
#include "info/profile/info_profile_badge_tooltip.h"
|
||||
@@ -192,6 +191,17 @@ TopBar::TopBar(
|
||||
VerifiedContentForPeer(_peer),
|
||||
nullptr,
|
||||
_gifPausedChecker))
|
||||
, _hasActions(descriptor.source != Source::Stories)
|
||||
, _minForProgress([&] {
|
||||
QWidget::setMinimumHeight(st::infoLayerTopBarHeight);
|
||||
QWidget::setMaximumHeight(_hasActions
|
||||
? st::infoProfileTopBarHeightMax
|
||||
: st::infoProfileTopBarNoActionsHeightMax);
|
||||
return QWidget::minimumHeight()
|
||||
+ (!_hasActions
|
||||
? 0
|
||||
: st::infoProfileTopBarActionButtonsHeight);
|
||||
}())
|
||||
, _title(this, Info::Profile::NameValue(_peer), _st.title)
|
||||
, _starsRating(_peer->isUser()
|
||||
? std::make_unique<Ui::StarsRating>(
|
||||
@@ -214,9 +224,6 @@ TopBar::TopBar(
|
||||
this,
|
||||
tr::lng_status_lastseen_when(),
|
||||
st::infoProfileCover.showLastSeen) {
|
||||
QWidget::setMinimumHeight(st::infoLayerTopBarHeight);
|
||||
QWidget::setMaximumHeight(st::infoProfileTopBarHeightMax);
|
||||
|
||||
const auto controller = descriptor.controller;
|
||||
|
||||
if (_peer->isMegagroup() || _peer->isChat()) {
|
||||
@@ -282,7 +289,9 @@ TopBar::TopBar(
|
||||
descriptor.backToggles.value(),
|
||||
descriptor.source);
|
||||
setupUserpicButton(controller);
|
||||
setupActions(controller);
|
||||
if (_hasActions) {
|
||||
setupActions(controller);
|
||||
}
|
||||
setupStoryOutline();
|
||||
if (_topic) {
|
||||
_topicIconView = std::make_unique<TopicIconView>(
|
||||
@@ -795,8 +804,7 @@ int TopBar::statusMostLeft() const {
|
||||
void TopBar::updateLabelsPosition() {
|
||||
_progress = [&] {
|
||||
const auto max = QWidget::maximumHeight();
|
||||
const auto min = QWidget::minimumHeight()
|
||||
+ st::infoProfileTopBarActionButtonsHeight;
|
||||
const auto min = _minForProgress;
|
||||
const auto p = (max > min)
|
||||
? ((height() - min) / float64(max - min))
|
||||
: 1.;
|
||||
@@ -1023,7 +1031,11 @@ void TopBar::paintEvent(QPaintEvent *e) {
|
||||
_cachedGradient = Ui::CreateTopBgGradient(
|
||||
QSize(width(), maximumHeight()),
|
||||
_peer,
|
||||
QPoint(0, -st::infoProfileTopBarPhotoBgShift));
|
||||
QPoint(
|
||||
0,
|
||||
_hasActions
|
||||
? -st::infoProfileTopBarPhotoBgShift
|
||||
: -st::infoProfileTopBarPhotoBgNoActionsShift));
|
||||
}
|
||||
if (!_hasBackground) {
|
||||
paintEdges(p);
|
||||
|
||||
@@ -181,6 +181,9 @@ private:
|
||||
const std::unique_ptr<Badge> _badge;
|
||||
const std::unique_ptr<Badge> _verified;
|
||||
|
||||
const bool _hasActions;
|
||||
const int _minForProgress;
|
||||
|
||||
std::unique_ptr<BadgeTooltip> _badgeTooltip;
|
||||
std::vector<std::unique_ptr<BadgeTooltip>> _badgeOldTooltips;
|
||||
uint64 _badgeCollectibleId = 0;
|
||||
|
||||
@@ -294,7 +294,6 @@ void InnerWidget::createProfileTop() {
|
||||
startTop();
|
||||
|
||||
using namespace Profile;
|
||||
AddCover(_top, _controller, _peer, nullptr, nullptr);
|
||||
AddDetails(_top, _controller, _peer, nullptr, nullptr, { v::null });
|
||||
|
||||
auto tracker = Ui::MultiSlideTracker();
|
||||
|
||||
Reference in New Issue
Block a user