Commit ac8b307d authored by Julien Wintz's avatar Julien Wintz
Browse files

Tweaking view management framework.

parent b515ad47
......@@ -211,6 +211,7 @@ dtkViewLayoutItem::dtkViewLayoutItem(dtkViewLayoutItem *parent) : QFrame(parent)
d->proxy = new dtkViewLayoutItemProxy(this);
d->splitter = new QSplitter(this);
d->splitter->setHandleWidth(2);
d->splitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
d->splitter->addWidget(d->proxy);
......@@ -255,6 +256,8 @@ dtkViewLayoutItem::dtkViewLayoutItem(dtkViewLayoutItem *parent) : QFrame(parent)
d->vertc->setEnabled(false);
d->horzt->setEnabled(false);
d->maxmz->setEnabled(false);
this->setFocusPolicy(Qt::ClickFocus);
}
dtkViewLayoutItem::~dtkViewLayoutItem(void)
......@@ -643,10 +646,16 @@ void dtkViewLayoutItem::dropEvent(QDropEvent *event)
d->proxy->setView(view);
}
void dtkViewLayoutItem::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event);
this->onFocusedIn();
}
void dtkViewLayoutItem::notify(dtkViewWidget *view)
{
if (d->root == this)
emit focused(view);
emit focused(view);
}
//
......
......@@ -118,6 +118,7 @@ protected:
void dragMoveEvent(QDragMoveEvent *);
void dragLeaveEvent(QDragLeaveEvent *);
void dropEvent(QDropEvent *);
void mousePressEvent(QMouseEvent *);
private:
void notify(dtkViewWidget *view);
......
......@@ -40,5 +40,12 @@ QWidget *dtkViewWidget::inspector(void)
return NULL;
}
void dtkViewWidget::mousePressEvent(QMouseEvent *event)
{
dtkViewWidget::mousePressEvent(event);
emit focused();
}
//
// dtkViewWidget.cpp ends here
......@@ -34,6 +34,9 @@ public:
virtual QWidget *widget(void);
virtual QWidget *inspector(void);
protected:
void mousePressEvent(QMouseEvent *);
private:
class dtkViewWidgetPrivate *d;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment