Sayonara Player
MenuButton.h
1 /* MenuButton.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef MENUBUTTON_H
22 #define MENUBUTTON_H
23 
24 #include <QPushButton>
25 #include "Helper/Settings/SayonaraClass.h"
26 
27 
34 class MenuButton :
35  public QPushButton,
36  protected SayonaraClass
37 {
38  Q_OBJECT
39 
40 signals:
41  void sig_triggered(QPoint);
42 
43 protected:
44  virtual void mouseReleaseEvent(QMouseEvent *e) override;
45  virtual void mousePressEvent(QMouseEvent* e) override;
46  virtual void enterEvent(QEvent* e) override;
47  virtual void leaveEvent(QEvent* e) override;
48 
53  virtual void show_menu(QPoint pos);
54 
60  virtual bool prove_enabled();
61 
65  void set_std_icon();
66 
67 public:
68  explicit MenuButton(QWidget* parent=nullptr);
69  virtual ~MenuButton();
70 
71  void set_show_title(bool show_title);
72 
73 protected slots:
74  void _sl_skin_changed();
75  void _sl_language_changed();
76 };
77 
78 #endif // MENUBUTTON_H
virtual bool prove_enabled()
subclasses should reimplement this function. This method should return false if the button should be ...
void set_std_icon()
sets the icon depending on the skin
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
virtual void show_menu(QPoint pos)
subclasses should call this function and show their menu
The MenuButton class. A button that sends a signal when clicked. This Class is meant for inheritance...
Definition: MenuButton.h:34