mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show members list in PanelMode::Wide.
This commit is contained in:
parent
c93ddf6aac
commit
eb8f709943
15 changed files with 231 additions and 121 deletions
|
@ -729,10 +729,6 @@ termsAgePadding: margins(22px, 16px, 16px, 0px);
|
||||||
|
|
||||||
themesSmallSkip: 10px;
|
themesSmallSkip: 10px;
|
||||||
themesBackgroundSize: 120px;
|
themesBackgroundSize: 120px;
|
||||||
themesScroll: ScrollArea(defaultScrollArea) {
|
|
||||||
bottomsh: 0px;
|
|
||||||
topsh: 0px;
|
|
||||||
}
|
|
||||||
themesMenuToggle: IconButton(defaultIconButton) {
|
themesMenuToggle: IconButton(defaultIconButton) {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
|
|
|
@ -529,7 +529,7 @@ QString PeerListRow::generateShortName() {
|
||||||
: peer()->shortName();
|
: peer()->shortName();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Data::CloudImageView> PeerListRow::ensureUserpicView() {
|
std::shared_ptr<Data::CloudImageView> &PeerListRow::ensureUserpicView() {
|
||||||
if (!_userpic) {
|
if (!_userpic) {
|
||||||
_userpic = peer()->createUserpicView();
|
_userpic = peer()->createUserpicView();
|
||||||
}
|
}
|
||||||
|
@ -588,11 +588,14 @@ void PeerListRow::paintStatusText(
|
||||||
_status.drawLeftElided(p, x, y, availableWidth, outerWidth);
|
_status.drawLeftElided(p, x, y, availableWidth, outerWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename UpdateCallback>
|
template <typename MaskGenerator, typename UpdateCallback>
|
||||||
void PeerListRow::addRipple(const style::PeerListItem &st, QSize size, QPoint point, UpdateCallback updateCallback) {
|
void PeerListRow::addRipple(const style::PeerListItem &st, MaskGenerator &&maskGenerator, QPoint point, UpdateCallback &&updateCallback) {
|
||||||
if (!_ripple) {
|
if (!_ripple) {
|
||||||
auto mask = Ui::RippleAnimation::rectMask(size);
|
auto mask = maskGenerator();
|
||||||
_ripple = std::make_unique<Ui::RippleAnimation>(st.button.ripple, std::move(mask), std::move(updateCallback));
|
if (mask.isNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_ripple = std::make_unique<Ui::RippleAnimation>(st.button.ripple, std::move(mask), std::forward<UpdateCallback>(updateCallback));
|
||||||
}
|
}
|
||||||
_ripple->add(point);
|
_ripple->add(point);
|
||||||
}
|
}
|
||||||
|
@ -1241,9 +1244,16 @@ void PeerListContent::mousePressEvent(QMouseEvent *e) {
|
||||||
row->addActionRipple(point, std::move(updateCallback));
|
row->addActionRipple(point, std::move(updateCallback));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
auto size = QSize(width(), _rowHeight);
|
|
||||||
auto point = mapFromGlobal(QCursor::pos()) - QPoint(0, getRowTop(_selected.index));
|
auto point = mapFromGlobal(QCursor::pos()) - QPoint(0, getRowTop(_selected.index));
|
||||||
row->addRipple(_st.item, size, point, std::move(updateCallback));
|
if (_mode == Mode::Custom) {
|
||||||
|
row->addRipple(_st.item, _controller->customRowRippleMaskGenerator(), point, std::move(updateCallback));
|
||||||
|
} else {
|
||||||
|
const auto maskGenerator = [&] {
|
||||||
|
return Ui::RippleAnimation::rectMask(
|
||||||
|
QSize(width(), _rowHeight));
|
||||||
|
};
|
||||||
|
row->addRipple(_st.item, maskGenerator, point, std::move(updateCallback));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (anim::Disabled()) {
|
if (anim::Disabled()) {
|
||||||
|
@ -1779,7 +1789,11 @@ void PeerListContent::selectByMouse(QPoint globalPosition) {
|
||||||
auto in = parentWidget()->rect().contains(parentWidget()->mapFromGlobal(globalPosition));
|
auto in = parentWidget()->rect().contains(parentWidget()->mapFromGlobal(globalPosition));
|
||||||
auto selected = Selected();
|
auto selected = Selected();
|
||||||
auto rowsPointY = point.y() - rowsTop();
|
auto rowsPointY = point.y() - rowsTop();
|
||||||
selected.index.value = (in && rowsPointY >= 0 && rowsPointY < shownRowsCount() * _rowHeight) ? (rowsPointY / _rowHeight) : -1;
|
selected.index.value = (in
|
||||||
|
&& rowsPointY >= 0
|
||||||
|
&& rowsPointY < shownRowsCount() * _rowHeight)
|
||||||
|
? (rowsPointY / _rowHeight)
|
||||||
|
: -1;
|
||||||
if (selected.index.value >= 0) {
|
if (selected.index.value >= 0) {
|
||||||
const auto row = getRow(selected.index);
|
const auto row = getRow(selected.index);
|
||||||
if (row->disabled()
|
if (row->disabled()
|
||||||
|
@ -1787,7 +1801,7 @@ void PeerListContent::selectByMouse(QPoint globalPosition) {
|
||||||
&& !_controller->customRowSelectionPoint(
|
&& !_controller->customRowSelectionPoint(
|
||||||
row,
|
row,
|
||||||
point.x(),
|
point.x(),
|
||||||
rowsPointY))) {
|
rowsPointY - (selected.index.value * _rowHeight)))) {
|
||||||
selected = Selected();
|
selected = Selected();
|
||||||
} else if (!customMode) {
|
} else if (!customMode) {
|
||||||
if (getActiveActionRect(row, selected.index).contains(point)) {
|
if (getActiveActionRect(row, selected.index).contains(point)) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::shared_ptr<Data::CloudImageView> ensureUserpicView();
|
[[nodiscard]] std::shared_ptr<Data::CloudImageView> &ensureUserpicView();
|
||||||
|
|
||||||
[[nodiscard]] virtual QString generateName();
|
[[nodiscard]] virtual QString generateName();
|
||||||
[[nodiscard]] virtual QString generateShortName();
|
[[nodiscard]] virtual QString generateShortName();
|
||||||
|
@ -172,12 +172,12 @@ public:
|
||||||
void finishCheckedAnimation();
|
void finishCheckedAnimation();
|
||||||
void invalidatePixmapsCache();
|
void invalidatePixmapsCache();
|
||||||
|
|
||||||
template <typename UpdateCallback>
|
template <typename MaskGenerator, typename UpdateCallback>
|
||||||
void addRipple(
|
void addRipple(
|
||||||
const style::PeerListItem &st,
|
const style::PeerListItem &st,
|
||||||
QSize size,
|
MaskGenerator &&maskGenerator,
|
||||||
QPoint point,
|
QPoint point,
|
||||||
UpdateCallback updateCallback);
|
UpdateCallback &&updateCallback);
|
||||||
void stopLastRipple();
|
void stopLastRipple();
|
||||||
void paintRipple(Painter &p, int x, int y, int outerWidth);
|
void paintRipple(Painter &p, int x, int y, int outerWidth);
|
||||||
void paintUserpic(
|
void paintUserpic(
|
||||||
|
@ -451,21 +451,23 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
[[nodiscard]] virtual int customRowHeight() {
|
[[nodiscard]] virtual int customRowHeight() {
|
||||||
Unexpected("Unimplemented PeerListController::customRowHeight.");
|
Unexpected("PeerListController::customRowHeight.");
|
||||||
}
|
}
|
||||||
virtual void customRowPaint(
|
virtual void customRowPaint(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
crl::time now,
|
crl::time now,
|
||||||
not_null<PeerListRow*> row,
|
not_null<PeerListRow*> row,
|
||||||
bool selected) {
|
bool selected) {
|
||||||
Unexpected("Unimplemented PeerListController::customRowPaint.");
|
Unexpected("PeerListController::customRowPaint.");
|
||||||
}
|
}
|
||||||
[[nodiscard]] virtual bool customRowSelectionPoint(
|
[[nodiscard]] virtual bool customRowSelectionPoint(
|
||||||
not_null<PeerListRow*> row,
|
not_null<PeerListRow*> row,
|
||||||
int x,
|
int x,
|
||||||
int y) {
|
int y) {
|
||||||
Unexpected(
|
Unexpected("PeerListController::customRowSelectionPoint.");
|
||||||
"Unimplemented PeerListController::customRowSelectionPoint.");
|
}
|
||||||
|
[[nodiscard]] virtual Fn<QImage()> customRowRippleMaskGenerator() {
|
||||||
|
Unexpected("PeerListController::customRowRippleMaskGenerator.");
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] virtual rpl::producer<int> onlineCountValue() const;
|
[[nodiscard]] virtual rpl::producer<int> onlineCountValue() const;
|
||||||
|
|
|
@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/text/text_utilities.h"
|
#include "ui/text/text_utilities.h"
|
||||||
#include "ui/effects/ripple_animation.h"
|
#include "ui/effects/ripple_animation.h"
|
||||||
#include "ui/effects/cross_line.h"
|
#include "ui/effects/cross_line.h"
|
||||||
|
#include "ui/round_rect.h"
|
||||||
#include "core/application.h" // Core::App().domain, Core::App().activeWindow.
|
#include "core/application.h" // Core::App().domain, Core::App().activeWindow.
|
||||||
#include "main/main_domain.h" // Core::App().domain().activate.
|
#include "main/main_domain.h" // Core::App().domain().activate.
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
@ -97,6 +98,7 @@ public:
|
||||||
Painter &p,
|
Painter &p,
|
||||||
QRect rect,
|
QRect rect,
|
||||||
IconState state) = 0;
|
IconState state) = 0;
|
||||||
|
virtual void rowPaintWideBackground(Painter &p, bool selected) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Row final : public PeerListRow {
|
class Row final : public PeerListRow {
|
||||||
|
@ -174,7 +176,15 @@ public:
|
||||||
bool selected,
|
bool selected,
|
||||||
bool actionSelected) override;
|
bool actionSelected) override;
|
||||||
|
|
||||||
auto generatePaintUserpicCallback() -> PaintRoundImageCallback override;
|
PaintRoundImageCallback generatePaintUserpicCallback() override;
|
||||||
|
void paintComplexUserpic(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
PanelMode mode,
|
||||||
|
bool selected = false);
|
||||||
|
|
||||||
void paintStatusText(
|
void paintStatusText(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
|
@ -243,6 +253,20 @@ private:
|
||||||
void ensureUserpicCache(
|
void ensureUserpicCache(
|
||||||
std::shared_ptr<Data::CloudImageView> &view,
|
std::shared_ptr<Data::CloudImageView> &view,
|
||||||
int size);
|
int size);
|
||||||
|
bool paintVideo(Painter &p, int x, int y, int size, PanelMode mode);
|
||||||
|
[[nodiscard]] static std::tuple<int, int, int> UserpicInWideMode(
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int size);
|
||||||
|
void paintBlobs(Painter &p, int x, int y, int size, PanelMode mode);
|
||||||
|
void paintScaledUserpic(
|
||||||
|
Painter &p,
|
||||||
|
std::shared_ptr<Data::CloudImageView> &userpic,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
PanelMode mode);
|
||||||
|
|
||||||
const not_null<RowDelegate*> _delegate;
|
const not_null<RowDelegate*> _delegate;
|
||||||
State _state = State::Inactive;
|
State _state = State::Inactive;
|
||||||
|
@ -305,6 +329,7 @@ public:
|
||||||
Painter &p,
|
Painter &p,
|
||||||
QRect rect,
|
QRect rect,
|
||||||
IconState state) override;
|
IconState state) override;
|
||||||
|
void rowPaintWideBackground(Painter &p, bool selected) override;
|
||||||
|
|
||||||
int customRowHeight() override;
|
int customRowHeight() override;
|
||||||
void customRowPaint(
|
void customRowPaint(
|
||||||
|
@ -316,6 +341,7 @@ public:
|
||||||
not_null<PeerListRow*> row,
|
not_null<PeerListRow*> row,
|
||||||
int x,
|
int x,
|
||||||
int y) override;
|
int y) override;
|
||||||
|
Fn<QImage()> customRowRippleMaskGenerator() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
[[nodiscard]] std::unique_ptr<Row> createRowForMe();
|
[[nodiscard]] std::unique_ptr<Row> createRowForMe();
|
||||||
|
@ -383,6 +409,8 @@ private:
|
||||||
|
|
||||||
Ui::CrossLineAnimation _inactiveCrossLine;
|
Ui::CrossLineAnimation _inactiveCrossLine;
|
||||||
Ui::CrossLineAnimation _coloredCrossLine;
|
Ui::CrossLineAnimation _coloredCrossLine;
|
||||||
|
Ui::RoundRect _wideRoundRectSelected;
|
||||||
|
Ui::RoundRect _wideRoundRect;
|
||||||
|
|
||||||
rpl::lifetime _lifetime;
|
rpl::lifetime _lifetime;
|
||||||
|
|
||||||
|
@ -653,78 +681,142 @@ void Row::ensureUserpicCache(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Row::generatePaintUserpicCallback() -> PaintRoundImageCallback {
|
bool Row::paintVideo(Painter &p, int x, int y, int size, PanelMode mode) {
|
||||||
auto userpic = ensureUserpicView();
|
if (!_videoTrackShown) {
|
||||||
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
|
return false;
|
||||||
const auto videoSize = _videoTrackShown
|
}
|
||||||
? _videoTrackShown->frameSize()
|
const auto guard = gsl::finally([&] {
|
||||||
: QSize();
|
_videoTrackShown->markFrameShown();
|
||||||
if (!videoSize.isEmpty()) {
|
});
|
||||||
const auto resize = (videoSize.width() > videoSize.height())
|
const auto videoSize = _videoTrackShown->frameSize();
|
||||||
? QSize(videoSize.width() * size / videoSize.height(), size)
|
if (videoSize.isEmpty()) {
|
||||||
: QSize(size, videoSize.height() * size / videoSize.width());
|
return false;
|
||||||
const auto request = Webrtc::FrameRequest{
|
}
|
||||||
.resize = resize * cIntRetinaFactor(),
|
const auto resize = (videoSize.width() > videoSize.height())
|
||||||
.outer = QSize(size, size) * cIntRetinaFactor(),
|
? QSize(videoSize.width() * size / videoSize.height(), size)
|
||||||
};
|
: QSize(size, videoSize.height() * size / videoSize.width());
|
||||||
const auto frame = _videoTrackShown->frame(request);
|
const auto request = Webrtc::FrameRequest{
|
||||||
auto copy = frame; // #TODO calls optimize.
|
.resize = resize * cIntRetinaFactor(),
|
||||||
copy.detach();
|
.outer = QSize(size, size) * cIntRetinaFactor(),
|
||||||
Images::prepareCircle(copy);
|
|
||||||
p.drawImage(
|
|
||||||
QRect(QPoint(x, y), copy.size() / cIntRetinaFactor()),
|
|
||||||
copy);
|
|
||||||
_videoTrackShown->markFrameShown();
|
|
||||||
return;
|
|
||||||
} else if (_videoTrackShown) {
|
|
||||||
// We could skip the first notification.
|
|
||||||
_videoTrackShown->markFrameShown();
|
|
||||||
}
|
|
||||||
if (_blobsAnimation) {
|
|
||||||
const auto mutedByMe = (_state == State::MutedByMe);
|
|
||||||
const auto shift = QPointF(x + size / 2., y + size / 2.);
|
|
||||||
auto hq = PainterHighQualityEnabler(p);
|
|
||||||
p.translate(shift);
|
|
||||||
const auto brush = mutedByMe
|
|
||||||
? st::groupCallMemberMutedIcon->b
|
|
||||||
: anim::brush(
|
|
||||||
st::groupCallMemberInactiveStatus,
|
|
||||||
st::groupCallMemberActiveStatus,
|
|
||||||
_speakingAnimation.value(_speaking ? 1. : 0.));
|
|
||||||
_blobsAnimation->blobs.paint(p, brush);
|
|
||||||
p.translate(-shift);
|
|
||||||
p.setOpacity(1.);
|
|
||||||
|
|
||||||
const auto enter = _blobsAnimation->enter;
|
|
||||||
const auto &minScale = kUserpicMinScale;
|
|
||||||
const auto scaleUserpic = minScale
|
|
||||||
+ (1. - minScale) * _blobsAnimation->blobs.currentLevel();
|
|
||||||
const auto scale = scaleUserpic * enter + 1. * (1. - enter);
|
|
||||||
if (scale == 1.) {
|
|
||||||
peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
|
|
||||||
} else {
|
|
||||||
ensureUserpicCache(userpic, size);
|
|
||||||
|
|
||||||
PainterHighQualityEnabler hq(p);
|
|
||||||
|
|
||||||
auto target = QRect(
|
|
||||||
x + (1 - kWideScale) / 2 * size,
|
|
||||||
y + (1 - kWideScale) / 2 * size,
|
|
||||||
kWideScale * size,
|
|
||||||
kWideScale * size);
|
|
||||||
auto shrink = anim::interpolate(
|
|
||||||
(1 - kWideScale) / 2 * size,
|
|
||||||
0,
|
|
||||||
scale);
|
|
||||||
auto margins = QMargins(shrink, shrink, shrink, shrink);
|
|
||||||
p.drawImage(
|
|
||||||
target.marginsAdded(margins),
|
|
||||||
_blobsAnimation->userpicCache);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
const auto frame = _videoTrackShown->frame(request);
|
||||||
|
auto copy = frame; // #TODO calls optimize.
|
||||||
|
copy.detach();
|
||||||
|
if (mode == PanelMode::Default) {
|
||||||
|
Images::prepareCircle(copy);
|
||||||
|
} else {
|
||||||
|
Images::prepareRound(copy, ImageRoundRadius::Large);
|
||||||
|
}
|
||||||
|
p.drawImage(
|
||||||
|
QRect(QPoint(x, y), copy.size() / cIntRetinaFactor()),
|
||||||
|
copy);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<int, int, int> Row::UserpicInWideMode(int x, int y, int size) {
|
||||||
|
const auto useSize = st::groupCallMembersList.item.photoSize;
|
||||||
|
const auto skip = (size - useSize) / 2;
|
||||||
|
return { x + skip, y + skip, useSize };
|
||||||
|
}
|
||||||
|
|
||||||
|
void Row::paintBlobs(Painter &p, int x, int y, int size, PanelMode mode) {
|
||||||
|
if (!_blobsAnimation) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mode == PanelMode::Wide) {
|
||||||
|
std::tie(x, y, size) = UserpicInWideMode(x, y, size);
|
||||||
|
}
|
||||||
|
const auto mutedByMe = (_state == State::MutedByMe);
|
||||||
|
const auto shift = QPointF(x + size / 2., y + size / 2.);
|
||||||
|
auto hq = PainterHighQualityEnabler(p);
|
||||||
|
p.translate(shift);
|
||||||
|
const auto brush = mutedByMe
|
||||||
|
? st::groupCallMemberMutedIcon->b
|
||||||
|
: anim::brush(
|
||||||
|
st::groupCallMemberInactiveStatus,
|
||||||
|
st::groupCallMemberActiveStatus,
|
||||||
|
_speakingAnimation.value(_speaking ? 1. : 0.));
|
||||||
|
_blobsAnimation->blobs.paint(p, brush);
|
||||||
|
p.translate(-shift);
|
||||||
|
p.setOpacity(1.);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Row::paintScaledUserpic(
|
||||||
|
Painter &p,
|
||||||
|
std::shared_ptr<Data::CloudImageView> &userpic,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
PanelMode mode) {
|
||||||
|
if (mode == PanelMode::Wide) {
|
||||||
|
std::tie(x, y, size) = UserpicInWideMode(x, y, size);
|
||||||
|
}
|
||||||
|
if (!_blobsAnimation) {
|
||||||
|
peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto enter = _blobsAnimation->enter;
|
||||||
|
const auto &minScale = kUserpicMinScale;
|
||||||
|
const auto scaleUserpic = minScale
|
||||||
|
+ (1. - minScale) * _blobsAnimation->blobs.currentLevel();
|
||||||
|
const auto scale = scaleUserpic * enter + 1. * (1. - enter);
|
||||||
|
if (scale == 1.) {
|
||||||
|
peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ensureUserpicCache(userpic, size);
|
||||||
|
|
||||||
|
PainterHighQualityEnabler hq(p);
|
||||||
|
|
||||||
|
auto target = QRect(
|
||||||
|
x + (1 - kWideScale) / 2 * size,
|
||||||
|
y + (1 - kWideScale) / 2 * size,
|
||||||
|
kWideScale * size,
|
||||||
|
kWideScale * size);
|
||||||
|
auto shrink = anim::interpolate(
|
||||||
|
(1 - kWideScale) / 2 * size,
|
||||||
|
0,
|
||||||
|
scale);
|
||||||
|
auto margins = QMargins(shrink, shrink, shrink, shrink);
|
||||||
|
p.drawImage(
|
||||||
|
target.marginsAdded(margins),
|
||||||
|
_blobsAnimation->userpicCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto Row::generatePaintUserpicCallback() -> PaintRoundImageCallback {
|
||||||
|
return [=](Painter &p, int x, int y, int outerWidth, int size) {
|
||||||
|
paintComplexUserpic(p, x, y, outerWidth, size, PanelMode::Default);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void Row::paintComplexUserpic(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
PanelMode mode,
|
||||||
|
bool selected) {
|
||||||
|
if (mode == PanelMode::Wide) {
|
||||||
|
if (paintVideo(p, x, y, size, mode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_delegate->rowPaintWideBackground(p, selected);
|
||||||
|
paintRipple(p, x, y, outerWidth);
|
||||||
|
}
|
||||||
|
paintBlobs(p, x, y, size, mode);
|
||||||
|
if (mode == PanelMode::Default && paintVideo(p, x, y, size, mode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
paintScaledUserpic(
|
||||||
|
p,
|
||||||
|
ensureUserpicView(),
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
outerWidth,
|
||||||
|
size,
|
||||||
|
mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Row::statusIconWidth() const {
|
int Row::statusIconWidth() const {
|
||||||
|
@ -976,7 +1068,9 @@ MembersController::MembersController(
|
||||||
, _menuParent(menuParent)
|
, _menuParent(menuParent)
|
||||||
, _raisedHandStatusRemoveTimer([=] { scheduleRaisedHandStatusRemove(); })
|
, _raisedHandStatusRemoveTimer([=] { scheduleRaisedHandStatusRemove(); })
|
||||||
, _inactiveCrossLine(st::groupCallMemberInactiveCrossLine)
|
, _inactiveCrossLine(st::groupCallMemberInactiveCrossLine)
|
||||||
, _coloredCrossLine(st::groupCallMemberColoredCrossLine) {
|
, _coloredCrossLine(st::groupCallMemberColoredCrossLine)
|
||||||
|
, _wideRoundRectSelected(ImageRoundRadius::Large, st::groupCallMembersBgOver)
|
||||||
|
, _wideRoundRect(ImageRoundRadius::Large, st::groupCallMembersBg) {
|
||||||
setupListChangeViewers();
|
setupListChangeViewers();
|
||||||
|
|
||||||
style::PaletteChanged(
|
style::PaletteChanged(
|
||||||
|
@ -1605,6 +1699,12 @@ void MembersController::rowPaintIcon(
|
||||||
_inactiveCrossLine.paint(p, left, top, crossProgress, iconColor);
|
_inactiveCrossLine.paint(p, left, top, crossProgress, iconColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MembersController::rowPaintWideBackground(Painter &p, bool selected) {
|
||||||
|
(selected ? _wideRoundRectSelected : _wideRoundRect).paint(
|
||||||
|
p,
|
||||||
|
{ QPoint(), st::groupCallNarrowSize });
|
||||||
|
}
|
||||||
|
|
||||||
int MembersController::customRowHeight() {
|
int MembersController::customRowHeight() {
|
||||||
return st::groupCallNarrowSize.height() + st::groupCallNarrowRowSkip;
|
return st::groupCallNarrowSize.height() + st::groupCallNarrowRowSkip;
|
||||||
}
|
}
|
||||||
|
@ -1615,6 +1715,15 @@ void MembersController::customRowPaint(
|
||||||
not_null<PeerListRow*> row,
|
not_null<PeerListRow*> row,
|
||||||
bool selected) {
|
bool selected) {
|
||||||
const auto real = static_cast<Row*>(row.get());
|
const auto real = static_cast<Row*>(row.get());
|
||||||
|
const auto width = st::groupCallNarrowSize.width();
|
||||||
|
real->paintComplexUserpic(
|
||||||
|
p,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
width,
|
||||||
|
width,
|
||||||
|
PanelMode::Wide,
|
||||||
|
selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MembersController::customRowSelectionPoint(
|
bool MembersController::customRowSelectionPoint(
|
||||||
|
@ -1624,6 +1733,14 @@ bool MembersController::customRowSelectionPoint(
|
||||||
return y < st::groupCallNarrowSize.height();
|
return y < st::groupCallNarrowSize.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Fn<QImage()> MembersController::customRowRippleMaskGenerator() {
|
||||||
|
return [] {
|
||||||
|
return Ui::RippleAnimation::roundRectMask(
|
||||||
|
st::groupCallNarrowSize,
|
||||||
|
st::roundRadiusLarge);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
auto MembersController::kickParticipantRequests() const
|
auto MembersController::kickParticipantRequests() const
|
||||||
-> rpl::producer<not_null<PeerData*>>{
|
-> rpl::producer<not_null<PeerData*>>{
|
||||||
return _kickParticipantRequests.events();
|
return _kickParticipantRequests.events();
|
||||||
|
@ -1938,7 +2055,7 @@ Members::Members(
|
||||||
not_null<GroupCall*> call)
|
not_null<GroupCall*> call)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _call(call)
|
, _call(call)
|
||||||
, _scroll(this, st::defaultSolidScroll)
|
, _scroll(this)
|
||||||
, _listController(std::make_unique<MembersController>(call, parent)) {
|
, _listController(std::make_unique<MembersController>(call, parent)) {
|
||||||
setupAddMember(call);
|
setupAddMember(call);
|
||||||
setupList();
|
setupList();
|
||||||
|
|
|
@ -248,10 +248,6 @@ emojiSuggestionsPadding: margins(emojiColorsPadding, 0px, emojiColorsPadding, 0p
|
||||||
emojiSuggestionsFadeAfter: 20px;
|
emojiSuggestionsFadeAfter: 20px;
|
||||||
|
|
||||||
mentionHeight: 40px;
|
mentionHeight: 40px;
|
||||||
mentionScroll: ScrollArea(defaultScrollArea) {
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: 0px;
|
|
||||||
}
|
|
||||||
mentionPadding: margins(8px, 5px, 8px, 5px);
|
mentionPadding: margins(8px, 5px, 8px, 5px);
|
||||||
mentionTop: 11px;
|
mentionTop: 11px;
|
||||||
mentionFont: linkFont;
|
mentionFont: linkFont;
|
||||||
|
|
|
@ -140,7 +140,7 @@ FieldAutocomplete::FieldAutocomplete(
|
||||||
not_null<Window::SessionController*> controller)
|
not_null<Window::SessionController*> controller)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _controller(controller)
|
, _controller(controller)
|
||||||
, _scroll(this, st::mentionScroll) {
|
, _scroll(this) {
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
_scroll->setGeometry(rect());
|
_scroll->setGeometry(rect());
|
||||||
|
@ -759,7 +759,7 @@ void FieldAutocomplete::Inner::paintEvent(QPaintEvent *e) {
|
||||||
auto htagwidth = width()
|
auto htagwidth = width()
|
||||||
- st::mentionPadding.right()
|
- st::mentionPadding.right()
|
||||||
- htagleft
|
- htagleft
|
||||||
- st::mentionScroll.width;
|
- st::defaultScrollArea.width;
|
||||||
|
|
||||||
if (!_srows->empty()) {
|
if (!_srows->empty()) {
|
||||||
int32 rows = rowscount(_srows->size(), _stickersPerRow);
|
int32 rows = rowscount(_srows->size(), _stickersPerRow);
|
||||||
|
|
|
@ -51,10 +51,6 @@ dialogsSkip: 8px;
|
||||||
|
|
||||||
dialogsWidthDuration: 120;
|
dialogsWidthDuration: 120;
|
||||||
dialogsTextWidthMin: 150px;
|
dialogsTextWidthMin: 150px;
|
||||||
dialogsScroll: ScrollArea(defaultScrollArea) {
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dialogsTextPalette: TextPalette(defaultTextPalette) {
|
dialogsTextPalette: TextPalette(defaultTextPalette) {
|
||||||
linkFg: dialogsTextFgService;
|
linkFg: dialogsTextFgService;
|
||||||
|
|
|
@ -174,7 +174,7 @@ Widget::Widget(
|
||||||
object_ptr<Ui::IconButton>(this, st::dialogsCalendar))
|
object_ptr<Ui::IconButton>(this, st::dialogsCalendar))
|
||||||
, _cancelSearch(_searchControls, st::dialogsCancelSearch)
|
, _cancelSearch(_searchControls, st::dialogsCancelSearch)
|
||||||
, _lockUnlock(_searchControls, st::dialogsLock)
|
, _lockUnlock(_searchControls, st::dialogsLock)
|
||||||
, _scroll(this, st::dialogsScroll)
|
, _scroll(this)
|
||||||
, _scrollToTop(_scroll, st::dialogsToUp)
|
, _scrollToTop(_scroll, st::dialogsToUp)
|
||||||
, _singleMessageSearch(&controller->session()) {
|
, _singleMessageSearch(&controller->session()) {
|
||||||
_inner = _scroll->setOwnedWidget(object_ptr<InnerWidget>(this, controller));
|
_inner = _scroll->setOwnedWidget(object_ptr<InnerWidget>(this, controller));
|
||||||
|
|
|
@ -37,11 +37,6 @@ infoToggle: InfoToggle {
|
||||||
rippleAreaPadding: 8px;
|
rippleAreaPadding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
infoScroll: ScrollArea(defaultScrollArea) {
|
|
||||||
bottomsh: 0px;
|
|
||||||
topsh: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
infoMediaSearch: SearchFieldRow {
|
infoMediaSearch: SearchFieldRow {
|
||||||
height: 44px;
|
height: 44px;
|
||||||
padding: margins(8px, 6px, 8px, 6px);
|
padding: margins(8px, 6px, 8px, 6px);
|
||||||
|
|
|
@ -37,7 +37,7 @@ ContentWidget::ContentWidget(
|
||||||
not_null<Controller*> controller)
|
not_null<Controller*> controller)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _controller(controller)
|
, _controller(controller)
|
||||||
, _scroll(this, st::infoScroll) {
|
, _scroll(this) {
|
||||||
using namespace rpl::mappers;
|
using namespace rpl::mappers;
|
||||||
|
|
||||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||||
|
|
|
@ -61,9 +61,6 @@ passportPasswordForgotBottom: 36px;
|
||||||
passportPanelScroll: ScrollArea(defaultScrollArea) {
|
passportPanelScroll: ScrollArea(defaultScrollArea) {
|
||||||
deltat: 6px;
|
deltat: 6px;
|
||||||
deltab: 6px;
|
deltab: 6px;
|
||||||
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
passportPanelAuthorize: RoundButton(passportPasswordSubmit) {
|
passportPanelAuthorize: RoundButton(passportPasswordSubmit) {
|
||||||
|
|
|
@ -217,7 +217,7 @@ IntroWidget::IntroWidget(
|
||||||
not_null<Window::Controller*> window)
|
not_null<Window::Controller*> window)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _wrap(this)
|
, _wrap(this)
|
||||||
, _scroll(Ui::CreateChild<Ui::ScrollArea>(_wrap.data(), st::infoScroll))
|
, _scroll(Ui::CreateChild<Ui::ScrollArea>(_wrap.data()))
|
||||||
, _topShadow(this) {
|
, _topShadow(this) {
|
||||||
_wrap->setAttribute(Qt::WA_OpaquePaintEvent);
|
_wrap->setAttribute(Qt::WA_OpaquePaintEvent);
|
||||||
_wrap->paintRequest(
|
_wrap->paintRequest(
|
||||||
|
|
|
@ -407,9 +407,7 @@ void Autocomplete::setupContent() {
|
||||||
rpl::single(qsl("Search for templates"))), // #TODO hard_lang
|
rpl::single(qsl("Search for templates"))), // #TODO hard_lang
|
||||||
st::autocompleteSearchPadding);
|
st::autocompleteSearchPadding);
|
||||||
const auto input = inputWrap->entity();
|
const auto input = inputWrap->entity();
|
||||||
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(
|
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(this);
|
||||||
this,
|
|
||||||
st::mentionScroll);
|
|
||||||
|
|
||||||
const auto inner = scroll->setOwnedWidget(object_ptr<Inner>(scroll));
|
const auto inner = scroll->setOwnedWidget(object_ptr<Inner>(scroll));
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ historyScroll: ScrollArea(defaultScrollArea) {
|
||||||
deltat: 3px;
|
deltat: 3px;
|
||||||
deltab: 3px;
|
deltab: 3px;
|
||||||
|
|
||||||
topsh: 0px;
|
|
||||||
bottomsh: -1px;
|
bottomsh: -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -649,7 +649,7 @@ Editor::Editor(
|
||||||
const Data::CloudTheme &cloud)
|
const Data::CloudTheme &cloud)
|
||||||
: _window(window)
|
: _window(window)
|
||||||
, _cloud(cloud)
|
, _cloud(cloud)
|
||||||
, _scroll(this, st::themesScroll)
|
, _scroll(this)
|
||||||
, _close(this, st::defaultMultiSelect.fieldCancel)
|
, _close(this, st::defaultMultiSelect.fieldCancel)
|
||||||
, _menuToggle(this, st::themesMenuToggle)
|
, _menuToggle(this, st::themesMenuToggle)
|
||||||
, _select(this, st::defaultMultiSelect, tr::lng_country_ph())
|
, _select(this, st::defaultMultiSelect, tr::lng_country_ph())
|
||||||
|
|
Loading…
Add table
Reference in a new issue