mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 15:45:12 +00:00
Replace gsl::not_null<T*> with just not_null<T*>.
This commit is contained in:
@@ -52,7 +52,7 @@ const style::TextStyle &BotKeyboard::Style::textStyle() const {
|
||||
return st::botKbStyle;
|
||||
}
|
||||
|
||||
void BotKeyboard::Style::repaint(gsl::not_null<const HistoryItem*> item) const {
|
||||
void BotKeyboard::Style::repaint(not_null<const HistoryItem*> item) const {
|
||||
_parent->update();
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,7 @@ private:
|
||||
|
||||
void startPaint(Painter &p) const override;
|
||||
const style::TextStyle &textStyle() const override;
|
||||
void repaint(gsl::not_null<const HistoryItem*> item) const override;
|
||||
void repaint(not_null<const HistoryItem*> item) const override;
|
||||
|
||||
protected:
|
||||
void paintButtonBg(Painter &p, const QRect &rect, float64 howMuchOver) const override;
|
||||
|
@@ -35,7 +35,7 @@ constexpr auto kEmojiPanelRowsPerPage = Ui::Emoji::kPanelRowsPerPage;
|
||||
|
||||
class EmojiListWidget::Footer : public TabbedSelector::InnerFooter {
|
||||
public:
|
||||
Footer(gsl::not_null<EmojiListWidget*> parent);
|
||||
Footer(not_null<EmojiListWidget*> parent);
|
||||
|
||||
void setCurrentSectionIcon(Section section);
|
||||
|
||||
@@ -46,12 +46,12 @@ private:
|
||||
void prepareSection(int &left, int top, int _width, Ui::IconButton *sectionIcon, Section section);
|
||||
void setActiveSection(Section section);
|
||||
|
||||
gsl::not_null<EmojiListWidget*> _pan;
|
||||
not_null<EmojiListWidget*> _pan;
|
||||
std::array<object_ptr<Ui::IconButton>, kEmojiSectionCount> _sections;
|
||||
|
||||
};
|
||||
|
||||
EmojiListWidget::Footer::Footer(gsl::not_null<EmojiListWidget*> parent) : InnerFooter(parent)
|
||||
EmojiListWidget::Footer::Footer(not_null<EmojiListWidget*> parent) : InnerFooter(parent)
|
||||
, _pan(parent)
|
||||
, _sections { {
|
||||
object_ptr<Ui::IconButton>(this, st::emojiCategoryRecent),
|
||||
@@ -302,7 +302,7 @@ void EmojiColorPicker::drawVariant(Painter &p, int variant) {
|
||||
p.drawPixmapLeft(w.x() + (st::emojiPanSize.width() - (esize / cIntRetinaFactor())) / 2, w.y() + (st::emojiPanSize.height() - (esize / cIntRetinaFactor())) / 2, width(), App::emojiLarge(), QRect(_variants[variant]->x() * esize, _variants[variant]->y() * esize, esize, esize));
|
||||
}
|
||||
|
||||
EmojiListWidget::EmojiListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Inner(parent, controller)
|
||||
EmojiListWidget::EmojiListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller)
|
||||
, _picker(this) {
|
||||
resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight());
|
||||
|
||||
|
@@ -88,7 +88,7 @@ class EmojiListWidget : public TabbedSelector::Inner {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EmojiListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
EmojiListWidget(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
using Section = Ui::Emoji::Section;
|
||||
|
||||
|
@@ -37,14 +37,14 @@ constexpr auto kRowLimit = 5;
|
||||
|
||||
class SuggestionsWidget::Row {
|
||||
public:
|
||||
Row(gsl::not_null<EmojiPtr> emoji, const QString &label, const QString &replacement);
|
||||
Row(not_null<EmojiPtr> emoji, const QString &label, const QString &replacement);
|
||||
Row(const Row &other) = delete;
|
||||
Row &operator=(const Row &other) = delete;
|
||||
Row(Row &&other) = default;
|
||||
Row &operator=(Row &&other) = default;
|
||||
~Row();
|
||||
|
||||
gsl::not_null<EmojiPtr> emoji() const {
|
||||
not_null<EmojiPtr> emoji() const {
|
||||
return _emoji;
|
||||
}
|
||||
const QString &label() const {
|
||||
@@ -64,14 +64,14 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
gsl::not_null<EmojiPtr> _emoji;
|
||||
not_null<EmojiPtr> _emoji;
|
||||
QString _label;
|
||||
QString _replacement;
|
||||
std::unique_ptr<RippleAnimation> _ripple;
|
||||
|
||||
};
|
||||
|
||||
SuggestionsWidget::Row::Row(gsl::not_null<EmojiPtr> emoji, const QString &label, const QString &replacement)
|
||||
SuggestionsWidget::Row::Row(not_null<EmojiPtr> emoji, const QString &label, const QString &replacement)
|
||||
: _emoji(emoji)
|
||||
, _label(label)
|
||||
, _replacement(replacement) {
|
||||
@@ -359,7 +359,7 @@ void SuggestionsWidget::leaveEventHook(QEvent *e) {
|
||||
return TWidget::leaveEventHook(e);
|
||||
}
|
||||
|
||||
SuggestionsController::SuggestionsController(QWidget *parent, gsl::not_null<QTextEdit*> field) : QObject(nullptr)
|
||||
SuggestionsController::SuggestionsController(QWidget *parent, not_null<QTextEdit*> field) : QObject(nullptr)
|
||||
, _field(field)
|
||||
, _container(parent, st::emojiSuggestionsDropdown)
|
||||
, _suggestions(_container->setOwnedWidget(object_ptr<Ui::Emoji::SuggestionsWidget>(parent, st::emojiSuggestionsMenu))) {
|
||||
|
@@ -65,7 +65,7 @@ private:
|
||||
void triggerSelectedRow();
|
||||
void triggerRow(const Row &row);
|
||||
|
||||
gsl::not_null<const style::Menu*> _st;
|
||||
not_null<const style::Menu*> _st;
|
||||
|
||||
QString _query;
|
||||
std::vector<Row> _rows;
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
|
||||
class SuggestionsController : public QObject, private base::Subscriber {
|
||||
public:
|
||||
SuggestionsController(QWidget *parent, gsl::not_null<QTextEdit*> field);
|
||||
SuggestionsController(QWidget *parent, not_null<QTextEdit*> field);
|
||||
|
||||
void raise();
|
||||
|
||||
|
@@ -45,7 +45,7 @@ constexpr auto kSearchBotUsername = str_const("gif");
|
||||
|
||||
class GifsListWidget::Footer : public TabbedSelector::InnerFooter {
|
||||
public:
|
||||
Footer(gsl::not_null<GifsListWidget*> parent);
|
||||
Footer(not_null<GifsListWidget*> parent);
|
||||
|
||||
void stealFocus();
|
||||
void returnFocus();
|
||||
@@ -59,7 +59,7 @@ protected:
|
||||
void processPanelHideFinished() override;
|
||||
|
||||
private:
|
||||
gsl::not_null<GifsListWidget*> _pan;
|
||||
not_null<GifsListWidget*> _pan;
|
||||
|
||||
object_ptr<Ui::InputField> _field;
|
||||
object_ptr<Ui::CrossButton> _cancel;
|
||||
@@ -68,7 +68,7 @@ private:
|
||||
|
||||
};
|
||||
|
||||
GifsListWidget::Footer::Footer(gsl::not_null<GifsListWidget*> parent) : InnerFooter(parent)
|
||||
GifsListWidget::Footer::Footer(not_null<GifsListWidget*> parent) : InnerFooter(parent)
|
||||
, _pan(parent)
|
||||
, _field(this, st::gifsSearchField, langFactory(lng_gifs_search))
|
||||
, _cancel(this, st::gifsSearchCancel) {
|
||||
@@ -120,7 +120,7 @@ void GifsListWidget::Footer::processPanelHideFinished() {
|
||||
//_field->setText(QString());
|
||||
}
|
||||
|
||||
GifsListWidget::GifsListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Inner(parent, controller)
|
||||
GifsListWidget::GifsListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller)
|
||||
, _section(Section::Gifs) {
|
||||
resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight());
|
||||
|
||||
|
@@ -44,7 +44,7 @@ class GifsListWidget : public TabbedSelector::Inner, public InlineBots::Layout::
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GifsListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
GifsListWidget(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
void refreshRecent() override;
|
||||
void preloadImages() override;
|
||||
|
@@ -111,7 +111,7 @@ std::unique_ptr<QMimeData> MimeDataFromTextWithEntities(const TextWithEntities &
|
||||
return result;
|
||||
}
|
||||
|
||||
MessageField::MessageField(QWidget *parent, gsl::not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory, const QString &val) : Ui::FlatTextarea(parent, st, std::move(placeholderFactory), val)
|
||||
MessageField::MessageField(QWidget *parent, not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory, const QString &val) : Ui::FlatTextarea(parent, st, std::move(placeholderFactory), val)
|
||||
, _controller(controller) {
|
||||
setMinHeight(st::historySendSize.height() - 2 * st::historySendPadding);
|
||||
setMaxHeight(st::historyComposeFieldMaxHeight);
|
||||
|
@@ -37,7 +37,7 @@ class MessageField final : public Ui::FlatTextarea {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MessageField(QWidget *parent, gsl::not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory = base::lambda<QString()>(), const QString &val = QString());
|
||||
MessageField(QWidget *parent, not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory = base::lambda<QString()>(), const QString &val = QString());
|
||||
|
||||
bool hasSendText() const;
|
||||
|
||||
@@ -58,7 +58,7 @@ protected:
|
||||
void insertFromMimeData(const QMimeData *source) override;
|
||||
|
||||
private:
|
||||
gsl::not_null<Window::Controller*> _controller;
|
||||
not_null<Window::Controller*> _controller;
|
||||
base::lambda<bool(const QMimeData *data)> _insertFromMimeDataHook;
|
||||
|
||||
};
|
||||
|
@@ -183,7 +183,7 @@ void MarkFeaturedAsRead(uint64 setId) {
|
||||
FeaturedReaderInstance->scheduleRead(setId);
|
||||
}
|
||||
|
||||
bool IsFaved(gsl::not_null<DocumentData*> document) {
|
||||
bool IsFaved(not_null<DocumentData*> document) {
|
||||
auto it = Global::StickerSets().constFind(FavedSetId);
|
||||
return (it != Global::StickerSets().cend()) && it->stickers.contains(document);
|
||||
}
|
||||
@@ -209,8 +209,8 @@ void CheckFavedLimit(Set &set) {
|
||||
|
||||
void PushFavedToFront(
|
||||
Set &set,
|
||||
gsl::not_null<DocumentData*> document,
|
||||
const std::vector<gsl::not_null<EmojiPtr>> &emojiList) {
|
||||
not_null<DocumentData*> document,
|
||||
const std::vector<not_null<EmojiPtr>> &emojiList) {
|
||||
set.stickers.push_front(document);
|
||||
for (auto emoji : emojiList) {
|
||||
set.emoji[emoji].push_front(document);
|
||||
@@ -236,9 +236,9 @@ void MoveFavedToFront(Set &set, int index) {
|
||||
}
|
||||
}
|
||||
|
||||
void RequestSetToPushFaved(gsl::not_null<DocumentData*> document);
|
||||
void RequestSetToPushFaved(not_null<DocumentData*> document);
|
||||
|
||||
void SetIsFaved(gsl::not_null<DocumentData*> document, base::optional<std::vector<gsl::not_null<EmojiPtr>>> emojiList = base::none) {
|
||||
void SetIsFaved(not_null<DocumentData*> document, base::optional<std::vector<not_null<EmojiPtr>>> emojiList = base::none) {
|
||||
auto &sets = Global::RefStickerSets();
|
||||
auto it = sets.find(FavedSetId);
|
||||
if (it == sets.end()) {
|
||||
@@ -263,8 +263,8 @@ void SetIsFaved(gsl::not_null<DocumentData*> document, base::optional<std::vecto
|
||||
App::main()->onStickersInstalled(FavedSetId);
|
||||
}
|
||||
|
||||
void RequestSetToPushFaved(gsl::not_null<DocumentData*> document) {
|
||||
auto addAnyway = [document](std::vector<gsl::not_null<EmojiPtr>> list) {
|
||||
void RequestSetToPushFaved(not_null<DocumentData*> document) {
|
||||
auto addAnyway = [document](std::vector<not_null<EmojiPtr>> list) {
|
||||
if (list.empty()) {
|
||||
if (auto sticker = document->sticker()) {
|
||||
if (auto emoji = Ui::Emoji::Find(sticker->alt)) {
|
||||
@@ -276,7 +276,7 @@ void RequestSetToPushFaved(gsl::not_null<DocumentData*> document) {
|
||||
};
|
||||
MTP::send(MTPmessages_GetStickerSet(document->sticker()->set), rpcDone([document, addAnyway](const MTPmessages_StickerSet &result) {
|
||||
Expects(result.type() == mtpc_messages_stickerSet);
|
||||
auto list = std::vector<gsl::not_null<EmojiPtr>>();
|
||||
auto list = std::vector<not_null<EmojiPtr>>();
|
||||
auto &d = result.c_messages_stickerSet();
|
||||
list.reserve(d.vpacks.v.size());
|
||||
for_const (auto &mtpPack, d.vpacks.v) {
|
||||
@@ -301,7 +301,7 @@ void RequestSetToPushFaved(gsl::not_null<DocumentData*> document) {
|
||||
}));
|
||||
}
|
||||
|
||||
void SetIsNotFaved(gsl::not_null<DocumentData*> document) {
|
||||
void SetIsNotFaved(not_null<DocumentData*> document) {
|
||||
auto &sets = Global::RefStickerSets();
|
||||
auto it = sets.find(FavedSetId);
|
||||
if (it == sets.end()) {
|
||||
@@ -330,7 +330,7 @@ void SetIsNotFaved(gsl::not_null<DocumentData*> document) {
|
||||
Auth().data().stickersUpdated().notify(true);
|
||||
}
|
||||
|
||||
void SetFaved(gsl::not_null<DocumentData*> document, bool faved) {
|
||||
void SetFaved(not_null<DocumentData*> document, bool faved) {
|
||||
if (faved) {
|
||||
SetIsFaved(document);
|
||||
} else {
|
||||
@@ -629,7 +629,7 @@ void GifsReceived(const QVector<MTPDocument> &items, int32 hash) {
|
||||
Auth().data().savedGifsUpdated().notify();
|
||||
}
|
||||
|
||||
StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji) {
|
||||
StickerPack GetListByEmoji(not_null<EmojiPtr> emoji) {
|
||||
auto original = emoji->original();
|
||||
auto result = StickerPack();
|
||||
auto setsToRequest = QMap<uint64, uint64>();
|
||||
@@ -673,8 +673,8 @@ StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji) {
|
||||
return result;
|
||||
}
|
||||
|
||||
base::optional<std::vector<gsl::not_null<EmojiPtr>>> GetEmojiListFromSet(
|
||||
gsl::not_null<DocumentData*> document) {
|
||||
base::optional<std::vector<not_null<EmojiPtr>>> GetEmojiListFromSet(
|
||||
not_null<DocumentData*> document) {
|
||||
if (auto sticker = document->sticker()) {
|
||||
auto &inputSet = sticker->set;
|
||||
if (inputSet.type() != mtpc_inputStickerSetID) {
|
||||
@@ -685,7 +685,7 @@ base::optional<std::vector<gsl::not_null<EmojiPtr>>> GetEmojiListFromSet(
|
||||
if (it == sets.cend()) {
|
||||
return base::none;
|
||||
}
|
||||
auto result = std::vector<gsl::not_null<EmojiPtr>>();
|
||||
auto result = std::vector<not_null<EmojiPtr>>();
|
||||
for (auto i = it->emoji.cbegin(), e = it->emoji.cend(); i != e; ++i) {
|
||||
if (i->contains(document)) {
|
||||
result.push_back(i.key());
|
||||
|
@@ -31,17 +31,17 @@ bool ApplyArchivedResultFake(); // For testing.
|
||||
void InstallLocally(uint64 setId);
|
||||
void UndoInstallLocally(uint64 setId);
|
||||
void MarkFeaturedAsRead(uint64 setId);
|
||||
bool IsFaved(gsl::not_null<DocumentData*> document);
|
||||
void SetFaved(gsl::not_null<DocumentData*> document, bool faved);
|
||||
bool IsFaved(not_null<DocumentData*> document);
|
||||
void SetFaved(not_null<DocumentData*> document, bool faved);
|
||||
|
||||
void SetsReceived(const QVector<MTPStickerSet> &data, int32 hash);
|
||||
void SpecialSetReceived(uint64 setId, const QString &setTitle, const QVector<MTPDocument> &items, int32 hash, const QVector<MTPStickerPack> &packs = QVector<MTPStickerPack>());
|
||||
void FeaturedSetsReceived(const QVector<MTPStickerSetCovered> &data, const QVector<MTPlong> &unread, int32 hash);
|
||||
void GifsReceived(const QVector<MTPDocument> &items, int32 hash);
|
||||
|
||||
StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji);
|
||||
base::optional<std::vector<gsl::not_null<EmojiPtr>>> GetEmojiListFromSet(
|
||||
gsl::not_null<DocumentData*> document);
|
||||
StickerPack GetListByEmoji(not_null<EmojiPtr> emoji);
|
||||
base::optional<std::vector<not_null<EmojiPtr>>> GetEmojiListFromSet(
|
||||
not_null<DocumentData*> document);
|
||||
|
||||
Set *FeedSet(const MTPDstickerSet &data);
|
||||
Set *FeedSetFull(const MTPmessages_StickerSet &data);
|
||||
|
@@ -60,7 +60,7 @@ struct StickerIcon {
|
||||
|
||||
class StickersListWidget::Footer : public TabbedSelector::InnerFooter, private base::Subscriber {
|
||||
public:
|
||||
Footer(gsl::not_null<StickersListWidget*> parent);
|
||||
Footer(not_null<StickersListWidget*> parent);
|
||||
|
||||
void preloadImages();
|
||||
void validateSelectedIcon(uint64 setId, ValidateIconAnimations animations);
|
||||
@@ -88,7 +88,7 @@ private:
|
||||
void paintStickerSettingsIcon(Painter &p) const;
|
||||
void paintFeaturedStickerSetsBadge(Painter &p, int iconLeft) const;
|
||||
|
||||
gsl::not_null<StickersListWidget*> _pan;
|
||||
not_null<StickersListWidget*> _pan;
|
||||
|
||||
static constexpr auto kVisibleIconsCount = 8;
|
||||
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
|
||||
};
|
||||
|
||||
StickersListWidget::Footer::Footer(gsl::not_null<StickersListWidget*> parent) : InnerFooter(parent)
|
||||
StickersListWidget::Footer::Footer(not_null<StickersListWidget*> parent) : InnerFooter(parent)
|
||||
, _pan(parent)
|
||||
, _a_icons(animation(this, &Footer::step_icons)) {
|
||||
setMouseTracking(true);
|
||||
@@ -434,7 +434,7 @@ void StickersListWidget::Footer::step_icons(TimeMs ms, bool timer) {
|
||||
}
|
||||
}
|
||||
|
||||
StickersListWidget::StickersListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Inner(parent, controller)
|
||||
StickersListWidget::StickersListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller)
|
||||
, _section(Section::Stickers)
|
||||
, _megagroupSetAbout(st::emojiPanWidth - st::emojiScroll.width - st::emojiPanHeaderLeft)
|
||||
, _addText(lang(lng_stickers_featured_add).toUpper())
|
||||
|
@@ -39,7 +39,7 @@ class StickersListWidget : public TabbedSelector::Inner, private base::Subscribe
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StickersListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
StickersListWidget(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
void refreshRecent() override;
|
||||
void preloadImages() override;
|
||||
|
@@ -34,10 +34,10 @@ constexpr auto kDelayedHideTimeoutMs = 3000;
|
||||
|
||||
} // namespace
|
||||
|
||||
TabbedPanel::TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TabbedPanel(parent, controller, object_ptr<TabbedSelector>(nullptr, controller)) {
|
||||
TabbedPanel::TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller) : TabbedPanel(parent, controller, object_ptr<TabbedSelector>(nullptr, controller)) {
|
||||
}
|
||||
|
||||
TabbedPanel::TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : TWidget(parent)
|
||||
TabbedPanel::TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : TWidget(parent)
|
||||
, _controller(controller)
|
||||
, _selector(std::move(selector)) {
|
||||
_selector->setParent(this);
|
||||
|
@@ -39,8 +39,8 @@ class TabbedPanel : public TWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
|
||||
TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
|
||||
|
||||
object_ptr<TabbedSelector> takeSelector();
|
||||
QPointer<TabbedSelector> getSelector() const;
|
||||
@@ -106,7 +106,7 @@ private:
|
||||
bool preventAutoHide() const;
|
||||
void updateContentHeight();
|
||||
|
||||
gsl::not_null<Window::Controller*> _controller;
|
||||
not_null<Window::Controller*> _controller;
|
||||
object_ptr<TabbedSelector> _selector;
|
||||
|
||||
int _contentMaxHeight = 0;
|
||||
|
@@ -25,10 +25,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
namespace ChatHelpers {
|
||||
|
||||
TabbedSection::TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TabbedSection(parent, controller, object_ptr<TabbedSelector>(this, controller)) {
|
||||
TabbedSection::TabbedSection(QWidget *parent, not_null<Window::Controller*> controller) : TabbedSection(parent, controller, object_ptr<TabbedSelector>(this, controller)) {
|
||||
}
|
||||
|
||||
TabbedSection::TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : Window::AbstractSectionWidget(parent, controller)
|
||||
TabbedSection::TabbedSection(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : Window::AbstractSectionWidget(parent, controller)
|
||||
, _selector(std::move(selector)) {
|
||||
resize(st::emojiPanWidth, st::emojiPanMaxHeight);
|
||||
|
||||
|
@@ -28,8 +28,8 @@ class TabbedSelector;
|
||||
|
||||
class TabbedSection : public Window::AbstractSectionWidget {
|
||||
public:
|
||||
TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
|
||||
TabbedSection(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
TabbedSection(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
|
||||
|
||||
void beforeHiding();
|
||||
void afterShown();
|
||||
|
@@ -285,7 +285,7 @@ void TabbedSelector::Tab::saveScrollTop() {
|
||||
_scrollTop = widget()->getVisibleTop();
|
||||
}
|
||||
|
||||
TabbedSelector::TabbedSelector(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
TabbedSelector::TabbedSelector(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
, _tabsSlider(this, st::emojiTabs)
|
||||
, _topShadow(this, st::shadowFg)
|
||||
, _bottomShadow(this, st::shadowFg)
|
||||
@@ -669,15 +669,15 @@ void TabbedSelector::switchTab() {
|
||||
Auth().saveDataDelayed(kSaveChosenTabTimeout);
|
||||
}
|
||||
|
||||
gsl::not_null<EmojiListWidget*> TabbedSelector::emoji() const {
|
||||
not_null<EmojiListWidget*> TabbedSelector::emoji() const {
|
||||
return static_cast<EmojiListWidget*>(getTab(SelectorTab::Emoji)->widget().get());
|
||||
}
|
||||
|
||||
gsl::not_null<StickersListWidget*> TabbedSelector::stickers() const {
|
||||
not_null<StickersListWidget*> TabbedSelector::stickers() const {
|
||||
return static_cast<StickersListWidget*>(getTab(SelectorTab::Stickers)->widget().get());
|
||||
}
|
||||
|
||||
gsl::not_null<GifsListWidget*> TabbedSelector::gifs() const {
|
||||
not_null<GifsListWidget*> TabbedSelector::gifs() const {
|
||||
return static_cast<GifsListWidget*>(getTab(SelectorTab::Gifs)->widget().get());
|
||||
}
|
||||
|
||||
@@ -697,7 +697,7 @@ void TabbedSelector::scrollToY(int y) {
|
||||
_topShadow->update();
|
||||
}
|
||||
|
||||
TabbedSelector::Inner::Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
TabbedSelector::Inner::Inner(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
, _controller(controller) {
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ class TabbedSelector : public TWidget, private base::Subscriber {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TabbedSelector(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
TabbedSelector(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
void setRoundRadius(int radius);
|
||||
void refreshStickers();
|
||||
@@ -123,10 +123,10 @@ private:
|
||||
SelectorTab type() const {
|
||||
return _type;
|
||||
}
|
||||
gsl::not_null<Inner*> widget() const {
|
||||
not_null<Inner*> widget() const {
|
||||
return _weak;
|
||||
}
|
||||
gsl::not_null<InnerFooter*> footer() const {
|
||||
not_null<InnerFooter*> footer() const {
|
||||
return _footer;
|
||||
}
|
||||
|
||||
@@ -164,21 +164,21 @@ private:
|
||||
void setWidgetToScrollArea();
|
||||
void createTabsSlider();
|
||||
void switchTab();
|
||||
gsl::not_null<Tab*> getTab(SelectorTab type) {
|
||||
not_null<Tab*> getTab(SelectorTab type) {
|
||||
return &_tabs[static_cast<int>(type)];
|
||||
}
|
||||
gsl::not_null<const Tab*> getTab(SelectorTab type) const {
|
||||
not_null<const Tab*> getTab(SelectorTab type) const {
|
||||
return &_tabs[static_cast<int>(type)];
|
||||
}
|
||||
gsl::not_null<Tab*> currentTab() {
|
||||
not_null<Tab*> currentTab() {
|
||||
return getTab(_currentTabType);
|
||||
}
|
||||
gsl::not_null<const Tab*> currentTab() const {
|
||||
not_null<const Tab*> currentTab() const {
|
||||
return getTab(_currentTabType);
|
||||
}
|
||||
gsl::not_null<EmojiListWidget*> emoji() const;
|
||||
gsl::not_null<StickersListWidget*> stickers() const;
|
||||
gsl::not_null<GifsListWidget*> gifs() const;
|
||||
not_null<EmojiListWidget*> emoji() const;
|
||||
not_null<StickersListWidget*> stickers() const;
|
||||
not_null<GifsListWidget*> gifs() const;
|
||||
|
||||
int _roundRadius = 0;
|
||||
int _footerTop = 0;
|
||||
@@ -205,7 +205,7 @@ class TabbedSelector::Inner : public TWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
Inner(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
void setVisibleTopBottom(int visibleTop, int visibleBottom) override;
|
||||
|
||||
@@ -235,7 +235,7 @@ signals:
|
||||
void disableScroll(bool disabled);
|
||||
|
||||
protected:
|
||||
gsl::not_null<Window::Controller*> controller() const {
|
||||
not_null<Window::Controller*> controller() const {
|
||||
return _controller;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
gsl::not_null<Window::Controller*> _controller;
|
||||
not_null<Window::Controller*> _controller;
|
||||
|
||||
int _visibleTop = 0;
|
||||
int _visibleBottom = 0;
|
||||
|
Reference in New Issue
Block a user