Commit df1f3b2e authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Fix size for now

parent 5367c141
......@@ -237,26 +237,12 @@ void KateCommandBar::updateViewGeometry()
// width: 2.4 of editor, height: 1/2 of editor
const QSize viewMaxSize(centralSize.width() / 2.4, centralSize.height() / 2);
const int rowHeight = m_treeView->sizeHintForRow(0) == -1 ? 0 : m_treeView->sizeHintForRow(0);
const int width = viewMaxSize.width();
const QSize viewSize(std::max(300, width), // never go below this
std::min(std::max(rowHeight * m_model->rowCount() + 2, rowHeight * 6), viewMaxSize.height()));
// Position should be central over window
const int xPos = std::max(0, (centralSize.width() - viewSize.width()) / 2);
const int yPos = std::max(0, (centralSize.height() - viewSize.height()) * 1 / 4);
const int xPos = std::max(0, (centralSize.width() - viewMaxSize.width()) / 2);
const int yPos = std::max(0, (centralSize.height() - viewMaxSize.height()) * 1 / 4);
const QPoint p(xPos, yPos);
move(p + parentWidget()->pos());
this->setFixedSize(viewSize);
QPointer<QPropertyAnimation> animation = new QPropertyAnimation(this, "size");
animation->setDuration(150);
animation->setStartValue(this->size());
animation->setEndValue(viewSize);
animation->start();
this->setFixedSize(viewMaxSize);
}
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