Miam-Player  0.8.0
A nice music player
addressbarbutton.h
Go to the documentation of this file.
1 #ifndef ADDRESSBARBUTTON_H
2 #define ADDRESSBARBUTTON_H
3 
4 #include <QDir>
5 #include <QPushButton>
6 
8 
10 class AddressBar;
11 
18 class MIAMTABPLAYLISTS_LIBRARY AddressBarButton : public QPushButton
19 {
20  Q_OBJECT
21 private:
22  QDir _path;
23 
24  QRect _textRect;
25  QRect _arrowRect;
26  bool _atLeastOneSubDir;
27  bool _highlighted;
28  bool _isAbsoluteRoot;
29 
30  AddressBar *_addressBar;
31 
32 public:
33  explicit AddressBarButton(const QDir &newPath, AddressBar *parent, bool isAbsoluteRoot = false);
34 
35  inline const QDir & path() const { return _path; }
36 
37  void setHighlighted(bool b);
38 
39  inline bool isHighlighted() const { return _highlighted; }
40 
41  inline QRect arrowRect() const { return _arrowRect; }
42 
43 protected:
45  virtual void mouseMoveEvent(QMouseEvent *) override;
46 
48  virtual void mousePressEvent(QMouseEvent *) override;
49 
51  virtual void paintEvent(QPaintEvent *) override;
52 
53 signals:
54  void aboutToShowMenu();
55 
56  void triggerLineEdit();
57 };
58 
59 #endif // ADDRESSBARBUTTON_H
const QDir & path() const
Definition: addressbarbutton.h:35
QRect arrowRect() const
Definition: addressbarbutton.h:41
The AddressBar class is the place where subfolders (instance of AddressBarButton) will be appended...
Definition: addressbar.h:26
bool isHighlighted() const
Definition: addressbarbutton.h:39
The AddressBarButton class represents a part of a long path.
Definition: addressbarbutton.h:18
#define MIAMTABPLAYLISTS_LIBRARY
Definition: miamtabplaylists_global.hpp:8