Allow ChannelViews without a Split (#4747)
This commit is contained in:
@@ -75,7 +75,23 @@ public:
|
||||
Search,
|
||||
};
|
||||
|
||||
explicit ChannelView(BaseWidget *parent = nullptr, Split *split = nullptr,
|
||||
/// Creates a channel view without a split.
|
||||
/// In such a view, usercards and reply-threads can't be opened.
|
||||
///
|
||||
/// @param parent The parent of this widget. Can be `nullptr`.
|
||||
/// @param context The context in which this view is shown (e.g. as a usercard).
|
||||
/// @param messagesLimit The maximum amount of messages this view will display.
|
||||
explicit ChannelView(QWidget *parent, Context context = Context::None,
|
||||
size_t messagesLimit = 1000);
|
||||
|
||||
/// Creates a channel view in a split.
|
||||
///
|
||||
/// @param parent The parent of this widget.
|
||||
/// @param split The split containing this widget.
|
||||
/// @a split must be in the widget tree of @a parent.
|
||||
/// @param context The context in which this view is shown (e.g. as a usercard).
|
||||
/// @param messagesLimit The maximum amount of messages this view will display.
|
||||
explicit ChannelView(QWidget *parent, Split *split,
|
||||
Context context = Context::None,
|
||||
size_t messagesLimit = 1000);
|
||||
|
||||
@@ -192,6 +208,12 @@ protected:
|
||||
QPoint &relativePos, int &index);
|
||||
|
||||
private:
|
||||
struct InternalCtor {
|
||||
};
|
||||
|
||||
ChannelView(InternalCtor tag, QWidget *parent, Split *split,
|
||||
Context context, size_t messagesLimit);
|
||||
|
||||
void initializeLayout();
|
||||
void initializeScrollbar();
|
||||
void initializeSignals();
|
||||
@@ -270,7 +292,7 @@ private:
|
||||
ChannelPtr channel_ = nullptr;
|
||||
ChannelPtr underlyingChannel_ = nullptr;
|
||||
ChannelPtr sourceChannel_ = nullptr;
|
||||
Split *split_ = nullptr;
|
||||
Split *split_;
|
||||
|
||||
Scrollbar *scrollBar_;
|
||||
EffectLabel *goToBottom_{};
|
||||
|
||||
Reference in New Issue
Block a user