KDE/kdebase/workspace/libs/plasma
Loïc Marteau
loic.marteau at gmail.com
Thu Aug 28 21:55:26 CEST 2008
hi all !
in the patch i'm working (really sorry to be late, i have a big
professional event to deal with and i'm a little stressed by this)
i have started to handle this by using a signal.
emit popupActivate()
Kickoff need it to call reset so the last search from the user is
reseted when kickoff is re-popuped
Perahps Davide you have add this for the same thing ?!
I will rework on the patch newt week.
I really do not have any personal problem to remove the signal and use
popupEvent instead.
My two only motivations is to see in general the better code possible
implemented for plasma and be personally better in qt hacking :
It is a perhaps stupid question but is it a difference between using a
signal or a virtual method for such case ?
Best regards
Loic
Davide Bettio wrote:
> SVN commit 854047 by bettio:
>
> Added popupEvent.
> CCMAIL:plasma-devel at kde.org
>
>
> M +9 -0 popupapplet.cpp
> M +6 -0 popupapplet.h
>
>
> --- trunk/KDE/kdebase/workspace/libs/plasma/popupapplet.cpp #854046:854047
> @@ -243,6 +243,7 @@
> void PopupApplet::showPopup(uint popupDuration)
> {
> if (d->dialog && (formFactor() == Horizontal || formFactor() == Vertical)) {
> + popupEvent(true);
> d->dialog->move(popupPosition(d->dialog->size()));
> d->dialog->show();
>
> @@ -264,10 +265,16 @@
> void PopupApplet::hidePopup()
> {
> if (d->dialog && (formFactor() == Horizontal || formFactor() == Vertical)) {
> + popupEvent(false);
> d->dialog->hide();
> }
> }
>
> +void PopupApplet::popupEvent(bool)
> +{
> +
> +}
> +
> void PopupApplet::widgetGeometryChanged()
> {
> if (graphicsWidget() && layout()) {
> @@ -284,6 +291,8 @@
> void PopupAppletPrivate::togglePopup()
> {
> if (dialog) {
> + q->popupEvent(!dialog->isVisible());
> +
> if (dialog->isVisible()) {
> dialog->hide();
> } else {
> --- trunk/KDE/kdebase/workspace/libs/plasma/popupapplet.h #854046:854047
> @@ -88,6 +88,12 @@
> */
> void showPopup(uint displayTime = 0);
>
> + /**
> + * This event handler can be reimplemented in a subclass to receive an event before the popup is showed or hidden.
> + * @arg show true if the popup is going to be showed, false if the popup is going to be hiden.
> + */
> + virtual void popupEvent(bool show);
> +
> public Q_SLOTS:
> /**
> * Hides the popup.
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>
More information about the Plasma-devel
mailing list