qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
notificationscrollarea.h
Go to the documentation of this file.
1 /*
2  Copyright © 2015-2019 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
23 #include <QHash>
24 
27 
29 {
30 public:
31  explicit NotificationScrollArea(QWidget* parent = nullptr);
32 
33 public slots:
34  void trackWidget(GenericChatroomWidget* widget);
35  void updateVisualTracking();
37 
38 protected:
39  void resizeEvent(QResizeEvent* event) final;
40 
41 private slots:
42  void findNextWidget();
43  void findPreviousWidget();
44 
45 private:
46  enum Visibility : uint8_t
47  {
51  };
52  Visibility widgetVisible(QWidget* widget) const;
53  void recalculateTopEdge();
54  void recalculateBottomEdge();
55 
59  size_t referencesAbove = 0;
60  size_t referencesBelow = 0;
61 };
AdjustingScrollArea
Definition: adjustingscrollarea.h:24
NotificationScrollArea::findNextWidget
void findNextWidget()
Definition: notificationscrollarea.cpp:116
NotificationScrollArea::referencesAbove
size_t referencesAbove
Definition: notificationscrollarea.h:59
NotificationScrollArea
Definition: notificationscrollarea.h:28
NotificationScrollArea::recalculateBottomEdge
void recalculateBottomEdge()
Definition: notificationscrollarea.cpp:194
NotificationEdgeWidget
Definition: notificationedgewidget.h:26
NotificationScrollArea::Visible
@ Visible
Definition: notificationscrollarea.h:48
NotificationScrollArea::findPreviousWidget
void findPreviousWidget()
Definition: notificationscrollarea.cpp:146
NotificationScrollArea::updateVisualTracking
void updateVisualTracking()
Delete notification bar from visible elements on scroll area.
Definition: notificationscrollarea.cpp:70
adjustingscrollarea.h
QHash< GenericChatroomWidget *, Visibility >
NotificationScrollArea::Visibility
Visibility
Definition: notificationscrollarea.h:46
NotificationScrollArea::widgetVisible
Visibility widgetVisible(QWidget *widget) const
Definition: notificationscrollarea.cpp:176
NotificationScrollArea::topEdge
NotificationEdgeWidget * topEdge
Definition: notificationscrollarea.h:57
NotificationScrollArea::trackedWidgets
QHash< GenericChatroomWidget *, Visibility > trackedWidgets
Definition: notificationscrollarea.h:56
NotificationScrollArea::Above
@ Above
Definition: notificationscrollarea.h:49
NotificationScrollArea::recalculateTopEdge
void recalculateTopEdge()
Definition: notificationscrollarea.cpp:188
NotificationScrollArea::bottomEdge
NotificationEdgeWidget * bottomEdge
Definition: notificationscrollarea.h:58
NotificationScrollArea::resizeEvent
void resizeEvent(QResizeEvent *event) final
Definition: notificationscrollarea.cpp:106
NotificationScrollArea::Below
@ Below
Definition: notificationscrollarea.h:50
GenericChatroomWidget
Definition: genericchatroomwidget.h:32
NotificationScrollArea::trackWidget
void trackWidget(GenericChatroomWidget *widget)
Definition: notificationscrollarea.cpp:34
NotificationScrollArea::updateTracking
void updateTracking(GenericChatroomWidget *widget)
Delete notification bar from visible elements and widget on scroll area.
Definition: notificationscrollarea.cpp:79
NotificationScrollArea::NotificationScrollArea
NotificationScrollArea(QWidget *parent=nullptr)
Definition: notificationscrollarea.cpp:25
NotificationScrollArea::referencesBelow
size_t referencesBelow
Definition: notificationscrollarea.h:60