remove some api duplication

This commit is contained in:
Aaron Seigo 2011-07-30 20:05:46 +02:00
parent c872553117
commit a665c17a6c
2 changed files with 10 additions and 23 deletions

View File

@ -50,6 +50,7 @@
#include "private/animator_p.h" #include "private/animator_p.h"
#include "private/applet_p.h" #include "private/applet_p.h"
#include "private/containment_p.h" #include "private/containment_p.h"
#include "private/tooltipmanager_p.h"
#include "tooltipmanager.h" #include "tooltipmanager.h"
#include "view.h" #include "view.h"
@ -68,7 +69,7 @@ Corona::Corona(QObject *parent)
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Corona ctor start"; kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Corona ctor start";
#endif #endif
d->init(); d->init();
ToolTipManager::self()->m_corona = this; ToolTipManager::self()->d->corona = this;
//setViewport(new QGLWidget(QGLFormat(QGL::StencilBuffer | QGL::AlphaChannel))); //setViewport(new QGLWidget(QGLFormat(QGL::StencilBuffer | QGL::AlphaChannel)));
} }
@ -450,11 +451,6 @@ QRegion Corona::availableScreenRegion(int id) const
return QRegion(screenGeometry(id)); return QRegion(screenGeometry(id));
} }
QPoint Corona::popupPosition(const QGraphicsItem *item, const QSize &s)
{
return popupPosition(item, s, Qt::AlignLeft);
}
QPoint Corona::popupPosition(const QGraphicsItem *item, const QSize &s, Qt::AlignmentFlag alignment) QPoint Corona::popupPosition(const QGraphicsItem *item, const QSize &s, Qt::AlignmentFlag alignment)
{ {
// TODO: merge both methods (also these in Applet) into one (with optional alignment) when we can break compatibility // TODO: merge both methods (also these in Applet) into one (with optional alignment) when we can break compatibility

View File

@ -173,25 +173,16 @@ public:
*/ */
virtual QRegion availableScreenRegion(int id) const; virtual QRegion availableScreenRegion(int id) const;
/**
* Recommended position for a popup window like a menu or a tooltip
* given its size
* @param item the item that the popup should appear adjacent to (an applet, say)
* @param size size of the popup
* @returns reccomended position
*/
QPoint popupPosition(const QGraphicsItem *item, const QSize &size);
/** /**
* @since 4.4 * @since 4.4
* Recommended position for a popup window like a menu or a tooltip * Recommended position for a popup window like a menu or a tooltip
* given its size * given its size
* @param item the item that the popup should appear adjacent to (an applet, say) * @param item the item that the popup should appear adjacent to (an applet, say)
* @param size size of the popup * @param size size of the popup
* @param alignment alignment of the popup, valid flags are Qt::AlignLeft, Qt::AlignRight and Qt::AlignCenter * @param alignment alignment of the popup, valid flags are Qt::AlignLeft, Qt::AlignRight and Qt::AlignCenter
* @returns reccomended position * @returns reccomended position
*/ */
QPoint popupPosition(const QGraphicsItem *item, const QSize &size, Qt::AlignmentFlag alignment); QPoint popupPosition(const QGraphicsItem *item, const QSize &size, Qt::AlignmentFlag alignment = Qt::AlignCenter);
/** /**
* This method is useful in order to retrieve the list of available * This method is useful in order to retrieve the list of available