1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Also add the new files to the git index...

This commit is contained in:
Franz Fellner 2012-09-15 17:54:12 +02:00
parent f3221c70d6
commit eb2256e2cf
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#include <QLayout>
#include "locationbarpopup.h"
LocationBarPopup::LocationBarPopup(QWidget* parent)
: QFrame(parent, Qt::Popup)
, m_alignment(Qt::AlignRight)
{
setAttribute(Qt::WA_DeleteOnClose);
setFrameStyle(QFrame::Panel | QFrame::Raised);
setLineWidth(1);
setMidLineWidth(2);
}
void LocationBarPopup::showAt(QWidget* parent)
{
layout()->invalidate();
layout()->activate();
QPoint p = parent->mapToGlobal(QPoint(0, 0));
if (m_alignment == Qt::AlignRight) {
p.setX(p.x() + parent->width() - width());
}
p.setY(p.y() + parent->height());
move(p);
show();
}

View File

@ -0,0 +1,24 @@
#ifndef QUPZILLA_LOCATION_BAR_POPUP
#define QUPZILLA_LOCATION_BAR_POPUP
#include <QFrame>
class LocationBarPopup : public QFrame
{
public:
LocationBarPopup(QWidget* parent);
void showAt(QWidget* parent);
void setPopupAlignment(Qt::Alignment alignment) {
m_alignment = alignment;
}
Qt::Alignment popupAlignment() const {
return m_alignment;
}
private:
Qt::Alignment m_alignment;
};
#endif