move the dialog to make it still look attached to the panel/screen edge
when its size is synced with the graphicswidget one BUG:193100 svn path=/trunk/KDE/kdelibs/; revision=969468
This commit is contained in:
parent
8b7bb8b125
commit
fd1a5a98fc
15
dialog.cpp
15
dialog.cpp
@ -205,6 +205,21 @@ void DialogPrivate::adjustView()
|
||||
view->resize(graphicsWidget->size().toSize());
|
||||
view->centerOn(graphicsWidget);
|
||||
|
||||
//if the view resized and a border is disabled move the dialog to make sure it will still look attached to panel/screen edge
|
||||
qreal topHeight;
|
||||
qreal leftWidth;
|
||||
qreal rightWidth;
|
||||
qreal bottomHeight;
|
||||
|
||||
background->getMargins(leftWidth, topHeight, rightWidth, bottomHeight);
|
||||
|
||||
if (rightWidth == 0) {
|
||||
q->move(q->pos().x() + (prevSize.width() - q->size().width()), q->pos().y());
|
||||
}
|
||||
if (bottomHeight == 0) {
|
||||
q->move(q->pos().x(), q->pos().y() + (prevSize.height() - q->size().height()));
|
||||
}
|
||||
|
||||
if (q->size() != prevSize) {
|
||||
//the size of the dialog has changed, emit the signal:
|
||||
emit q->dialogResized();
|
||||
|
Loading…
x
Reference in New Issue
Block a user