|
@@ -1,8 +1,6 @@
|
|
|
#include "outlinepopup.h"
|
|
|
|
|
|
-#include <QVBoxLayout>
|
|
|
#include <QToolButton>
|
|
|
-#include <QWidgetAction>
|
|
|
|
|
|
#include <core/global.h>
|
|
|
#include <utils/widgetutils.h>
|
|
@@ -11,8 +9,7 @@
|
|
|
using namespace vnotex;
|
|
|
|
|
|
OutlinePopup::OutlinePopup(QToolButton *p_btn, QWidget *p_parent)
|
|
|
- : QMenu(p_parent),
|
|
|
- m_button(p_btn)
|
|
|
+ : ButtonPopup(p_btn, p_parent)
|
|
|
{
|
|
|
setupUI();
|
|
|
|
|
@@ -26,13 +23,7 @@ void OutlinePopup::setupUI()
|
|
|
{
|
|
|
m_viewer = new OutlineViewer(tr("Outline"), this);
|
|
|
m_viewer->setMinimumSize(320, 384);
|
|
|
-
|
|
|
- auto act = new QWidgetAction(this);
|
|
|
- // @act will own @p_widget.
|
|
|
- act->setDefaultWidget(m_viewer);
|
|
|
- addAction(act);
|
|
|
-
|
|
|
-
|
|
|
+ addWidget(m_viewer);
|
|
|
}
|
|
|
|
|
|
void OutlinePopup::setOutlineProvider(const QSharedPointer<OutlineProvider> &p_provider)
|
|
@@ -42,7 +33,7 @@ void OutlinePopup::setOutlineProvider(const QSharedPointer<OutlineProvider> &p_p
|
|
|
|
|
|
void OutlinePopup::showEvent(QShowEvent* p_event)
|
|
|
{
|
|
|
- QMenu::showEvent(p_event);
|
|
|
+ ButtonPopup::showEvent(p_event);
|
|
|
|
|
|
// Move it to be right-aligned.
|
|
|
if (m_button->isVisible()) {
|