|
Krita Source Code Documentation
|
#include <KisPopupButton.h>
Inheritance diagram for KisPopupButton:Classes | |
| struct | Private |
Public Slots | |
| void | hidePopupWidget () |
| void | setPopupWidgetDetached (bool detach) |
| void | setPopupWidgetVisible (bool visible) |
| void | showPopupWidget () |
Signals | |
| void | sigPopupWidgetShown () |
Public Member Functions | |
| void | adjustPositionAndShow () |
| adjustPosition adjusts the position of the popup widget based on the position of this button and the size of the widget | |
| bool | isPopupWidgetVisible () |
| KisPopupButton (QWidget *parent) | |
| void | setArrowVisible (bool v) |
| void | setPopupWidget (QWidget *widget) |
| ~KisPopupButton () override | |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
| void | paintPopupArrow () |
Private Slots | |
| void | slotMenuAboutToHide () |
Private Attributes | |
| Private *const | m_d |
This class is a convenience class for a button that when clicked displays a popup widget.
Definition at line 18 of file KisPopupButton.h.
| KisPopupButton::KisPopupButton | ( | QWidget * | parent | ) |
Definition at line 117 of file KisPopupButton.cpp.
References showPopupWidget().
|
override |
Definition at line 125 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, and m_d.
| void KisPopupButton::adjustPositionAndShow | ( | ) |
adjustPosition adjusts the position of the popup widget based on the position of this button and the size of the widget
On non-wayland platforms we first show the widget and only then apply geometry, otherwise the settings are not applied properly
Definition at line 220 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, KisPopupButton::Private::isDetachedGeometrySet, KisPopupButton::Private::isPopupDetached, kisEnsureInRect(), and m_d.
|
slot |
Definition at line 177 of file KisPopupButton.cpp.
References setPopupWidgetVisible().
| bool KisPopupButton::isPopupWidgetVisible | ( | ) |
Definition at line 194 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, m_d, and KisPopupButton::Private::popupWidget.
|
overrideprotected |
Definition at line 199 of file KisPopupButton.cpp.
References KisPopupButton::Private::arrowVisible, m_d, and paintPopupArrow().
|
protected |
Definition at line 207 of file KisPopupButton.cpp.
References p.
| void KisPopupButton::setArrowVisible | ( | bool | v | ) |
This function allows to show or hide the arrow.
| v | set to true to draw the arrow, else set to false |
Definition at line 295 of file KisPopupButton.cpp.
References KisPopupButton::Private::arrowVisible, m_d, and v.
| void KisPopupButton::setPopupWidget | ( | QWidget * | widget | ) |
Set the popup widget, the KisPopupButton becomes the owner and parent of the widget.
If a widget does already have a parent, then this parent becomes a parent of the internal popup frame. That might be useful for popup buttons attaches to actions, which may be not visible or attached to anything, e.g the "Docker Box" action.
Definition at line 144 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, KisPopupButton::Private::isPopupDetached, m_d, KisPopupButton::Private::popupWidget, sigPopupWidgetShown(), and slotMenuAboutToHide().
|
slot |
Set whether the popup is detached as a dialog.
| v | set to true to cause the popup to be detached |
Definition at line 131 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, KisPopupButton::Private::isPopupDetached, isPopupWidgetVisible(), m_d, KisPopupButton::Private::popupWidget, and setPopupWidgetVisible().
|
slot |
Definition at line 182 of file KisPopupButton.cpp.
References adjustPositionAndShow(), KisPopupButton::Private::frame, m_d, KisPopupButton::Private::popupWidget, and sigPopupWidgetShown().
|
slot |
Definition at line 172 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, m_d, and setPopupWidgetVisible().
|
signal |
|
privateslot |
Definition at line 304 of file KisPopupButton.cpp.
References KisPopupButton::Private::frame, m_d, and KisPopupButton::Private::popupWidget.
|
private |
Definition at line 82 of file KisPopupButton.h.