fix: stop click when dragging over notebook buttons (#6266)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2025-06-15 13:00:57 +02:00
committed by GitHub
parent 62c93d1d98
commit 04ba83b90f
6 changed files with 41 additions and 51 deletions
+3 -8
View File
@@ -13,22 +13,17 @@ class NotebookButton : public Button
Q_OBJECT
public:
enum Icon {
None,
enum class Type : std::uint8_t {
Plus,
};
explicit NotebookButton(Notebook *parent);
void setIcon(Icon icon);
Icon getIcon() const;
NotebookButton(Type type_, Notebook *parent);
protected:
void paintContent(QPainter &painter) override;
void themeChangedEvent() override;
void dragEnterEvent(QDragEnterEvent *) override;
void dragLeaveEvent(QDragLeaveEvent *) override;
void dropEvent(QDropEvent *) override;
void hideEvent(QHideEvent *) override;
@@ -37,7 +32,7 @@ protected:
private:
Notebook *parent_ = nullptr;
QPoint mousePos_;
Icon icon_ = None;
Type type = Type::Plus;
};
} // namespace chatterino