summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoanna Hulboj <joanna.hulboj@isode.com>2017-02-03 10:19:53 (GMT)
committerTobias Markmann <tm@ayena.de>2017-02-09 11:39:12 (GMT)
commitd81f9e750627a83c12afeb4718eb12bbb53f5270 (patch)
treea4bab5e20c5e5154941955a4da89a6ba49a6f574 /Swift/QtUI/QtChatTabs.cpp
parent5fb2281fc8e6beab84f5e2b1117455a65d2ab3de (diff)
downloadswift-d81f9e750627a83c12afeb4718eb12bbb53f5270.zip
swift-d81f9e750627a83c12afeb4718eb12bbb53f5270.tar.bz2
Fix mouse movement when resizing trellis layout.
Test-Information: From view menu choose "Change Layout", move mouse to resize trellis. Trellis resizing works fine. Change-Id: I112c0bd84dc57abb3bb95f825f74b2efa1f8e183
Diffstat (limited to 'Swift/QtUI/QtChatTabs.cpp')
-rw-r--r--Swift/QtUI/QtChatTabs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp
index de9d2d2..ad95a07 100644
--- a/Swift/QtUI/QtChatTabs.cpp
+++ b/Swift/QtUI/QtChatTabs.cpp
@@ -355,61 +355,61 @@ void QtChatTabs::handleTabTitleUpdated(QWidget* widget) {
if (tab) {
unreads.push_back(std::pair<std::string, int>(Q2PSTRING(tab->windowTitle()), tab->getCount()));
}
}
std::string current(Q2PSTRING(qobject_cast<QtTabbable*>(dynamicGrid_->currentWidget())->windowTitle()));
ChatMessageSummarizer summary;
QString title = summary.getSummary(current, unreads).c_str();
setWindowTitle(title);
emit onTitleChanged(title);
}
void QtChatTabs::flash() {
#ifndef SWIFTEN_PLATFORM_MACOSX
QApplication::alert(this, 0);
#endif
}
void QtChatTabs::handleOpenLayoutChangeDialog() {
disconnect(gridSelectionDialog_, SIGNAL(currentGridSizeChanged(QSize)), dynamicGrid_, SLOT(setDimensions(QSize)));
gridSelectionDialog_->setCurrentGridSize(dynamicGrid_->getDimension());
int screen = QApplication::desktop()->screenNumber(QCursor::pos());
QPoint center = QApplication::desktop()->screenGeometry(screen).center();
gridSelectionDialog_->move(center);
connect(gridSelectionDialog_, SIGNAL(currentGridSizeChanged(QSize)), dynamicGrid_, SLOT(setDimensions(QSize)));
gridSelectionDialog_->show();
QPoint pos(gridSelectionDialog_->getFrameSize().width() / 2, gridSelectionDialog_->getFrameSize().height() / 2);
- QCursor::setPos(gridSelectionDialog_->windowHandle()->screen(), gridSelectionDialog_->mapToGlobal(QPoint(gridSelectionDialog_->width(), gridSelectionDialog_->height()) - pos));
+ QCursor::setPos(gridSelectionDialog_->windowHandle()->screen(), gridSelectionDialog_->mapToGlobal(QPoint(gridSelectionDialog_->width(), (gridSelectionDialog_->height() - gridSelectionDialog_->getDescriptionTextHeight())) - pos));
}
void QtChatTabs::storeTabPositions() {
// save size
QByteArray gridSizeData;
QDataStream dataStreamGridSize(&gridSizeData, QIODevice::ReadWrite);
dataStreamGridSize << dynamicGrid_->getDimension();
settingsProvider_->storeSetting(QtUISettingConstants::TRELLIS_GRID_SIZE, Q2PSTRING(QString(gridSizeData.toBase64())));
// save positions
QByteArray tabPositionsData;
QDataStream dataStreamTabPositions(&tabPositionsData, QIODevice::ReadWrite);
dynamicGrid_->updateTabPositions();
dataStreamTabPositions << dynamicGrid_->getTabPositions();
settingsProvider_->storeSetting(QtUISettingConstants::TRELLIS_GRID_POSITIONS, Q2PSTRING(QString(tabPositionsData.toBase64())));
}
void QtChatTabs::resizeEvent(QResizeEvent*) {
emit geometryChanged();
}
void QtChatTabs::moveEvent(QMoveEvent*) {
emit geometryChanged();
}
void QtChatTabs::checkForFirstShow() {
if (!isVisible()) {
#ifndef Q_OS_MAC
showMinimized();
#else