Plasma
popupapplet.cpp
Go to the documentation of this file.
244 //99% of the times q->parentWidget() is the containment, but using it we can also manage the applet-in-applet case (i.e. systray)
245 //there are also cases where the parentlayoutitem is bigger than the containment (e.g. newspaper)
255 //check if someone did the nasty trick of applets in applets, in this case we always want to be collapsed
258 //this loop should be executed normally a single time, at most 2-3 times for quite complex containments
286 if (((!parentApplet || parentApplet->isContainment() ) && icon && (!icon->svg().isEmpty() || !icon->icon().isNull()) && ((f != Plasma::Vertical && f != Plasma::Horizontal)) ||
289 (!q->parentWidget() || (q->parentWidget()->size().width() >= minimum.width() && q->parentWidget()->size().height() >= minimum.height()))))) {
366 if (oldSize.width() < q->minimumSize().width() || oldSize.height() < q->minimumSize().height()) {
425 dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (gWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
432 dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (qWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
714 QObject::connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), q, SLOT(iconSizeChanged(int)));
960 reverse = (appletPos.y() + (q->size().height() / 2)) < (dialogPos.y() + (dialog->size().height() / 2));
963 reverse = (appletPos.x() + (q->size().width() / 2)) < (dialogPos.x() + (dialog->size().width() / 2));
975 popupPlacement = reverse ? Plasma::BottomPosedLeftAlignedPopup : Plasma::BottomPosedRightAlignedPopup;
virtual FormFactor formFactor() const
Returns the current form factor the applet is being displayed in.
Definition applet.cpp:1479
const Package * package() const
Accessor for the associated Package object if any.
Definition applet.cpp:691
void setAspectRatioMode(Plasma::AspectRatioMode)
Sets the preferred aspect ratio mode for placement and resizing.
Definition applet.cpp:1636
virtual Location location() const
Returns the location of the scene which is displaying applet.
Definition applet.cpp:1618
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Reimplemented from QGraphicsLayoutItem.
Definition applet.cpp:2509
void activate()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
void setMinimumResizeLimits(int left, int top, int right, int bottom)
Sets the minimum values that each of four sides of the rect may expand to or from.
Definition dialog.cpp:769
void setResizeHandleCorners(ResizeCorners corners)
Definition dialog.cpp:751
void setAspectRatioMode(Plasma::AspectRatioMode mode)
Sets the preferred aspect ratio mode for placement and resizing.
Definition dialog.cpp:877
void setGraphicsWidget(QGraphicsWidget *widget)
Sets a QGraphicsWidget to be shown as the content in this dialog.
Definition dialog.cpp:614
void animatedShow(Plasma::Direction direction)
Causes an animated show; requires compositing to work, otherwise the dialog will simply show.
Definition dialog.cpp:829
void animatedHide(Plasma::Direction direction)
Causes an animated hide; requires compositing to work, otherwise the dialog will simply hide.
Definition dialog.cpp:796
@ TopDownStacked
Draws no borders on the bottom extenderitem, but draws the left, bottom and right border on subsequen...
Definition extender.h:89
@ BottomUpStacked
Draws no borders on the topmost extenderitem, but draws the left, top and right border on subsequent ...
Definition extender.h:83
void setAppearance(Appearance appearance)
Use this function to instruct the extender on how to render its items.
Definition extender.cpp:329
QString filePath(const char *fileType, const QString &filename) const
Get the path to a given file.
Definition package.cpp:213
Allows applets to automatically 'collapse' into an icon when put in an panel, and is a convenient bas...
Definition popupapplet.h:53
void timerEvent(QTimerEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:607
Plasma::PopupPlacement popupPlacement() const
Definition popupapplet.cpp:655
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:558
virtual void popupEvent(bool show)
This event handler can be reimplemented in a subclass to receive an event before the popup is shown o...
Definition popupapplet.cpp:670
virtual QWidget * widget()
Implement either this function or graphicsWidget().
Definition popupapplet.cpp:127
bool eventFilter(QObject *watched, QEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:504
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:462
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:546
void dropEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:577
virtual QGraphicsWidget * graphicsWidget()
Implement either this function or widget().
Definition popupapplet.cpp:163
void setPopupAlignment(Qt::AlignmentFlag alignment)
Sets the default alignment of the popup relative to the applet.
Definition popupapplet.cpp:660
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:482
void setGraphicsWidget(QGraphicsWidget *widget)
Definition popupapplet.cpp:172
void setPassivePopup(bool passive)
Sets whether or not the dialog popup that gets created should be a "passive" popup that does not stea...
Definition popupapplet.cpp:677
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Reimplemented from QGraphicsLayoutItem.
Definition popupapplet.cpp:494
void showPopup(uint displayTime=0)
Shows the dialog showing the widget if the applet is in a panel.
Definition popupapplet.cpp:589
void hide(QGraphicsWidget *widget)
Hides the tooltip for a widget immediately.
Definition tooltipmanager.cpp:188
@ ConstrainedSquare
The applet is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square.
Definition plasma.h:215
@ InvalidAspectRatioMode
Unset mode used for dev convenience when there is a need to store the aspectRatioMode somewhere.
Definition plasma.h:209
Direction locationToInverseDirection(Location location)
Converts a location to the direction facing it.
Definition plasma.cpp:72
Direction locationToDirection(Location location)
Converts a location to a direction.
Definition plasma.cpp:51
PopupPlacement
The popup position enumeration relatively to his attached widget.
Definition plasma.h:137
@ BottomPosedRightAlignedPopup
Popup positioned on the bottom, aligned to the right of the widget.
Definition plasma.h:149
@ LeftPosedBottomAlignedPopup
Popup positioned on the left, aligned to the bottom of the widget.
Definition plasma.h:145
@ TopPosedRightAlignedPopup
Popup positioned on the top, aligned to the right of the widget.
Definition plasma.h:141
@ RightPosedTopAlignedPopup
Popup positioned on the right, aligned to the top of the wigdet.
Definition plasma.h:151
@ BottomPosedLeftAlignedPopup
Popup positioned on the bottom, aligned to the left of the wigdet.
Definition plasma.h:147
@ TopPosedLeftAlignedPopup
Popup positioned on the top, aligned to the left of the wigdet.
Definition plasma.h:139
@ LeftPosedTopAlignedPopup
Popup positioned on the left, aligned to the right of the wigdet.
Definition plasma.h:143
@ RightPosedBottomAlignedPopup
Popup positioned on the right, aligned to the bottom of the widget.
Definition plasma.h:153
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition plasma.h:64
@ Horizontal
The applet is constrained vertically, but can expand horizontally.
Definition plasma.h:75
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.