Index: app/mainwindow.h =================================================================== --- app/mainwindow.h +++ app/mainwindow.h @@ -54,6 +54,8 @@ Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.yakuake") + friend class TitleBar; + public: explicit MainWindow(QWidget* parent = 0); ~MainWindow(); Index: app/titlebar.h =================================================================== --- app/titlebar.h +++ app/titlebar.h @@ -24,6 +24,7 @@ #include +#include class MainWindow; @@ -55,6 +56,7 @@ protected: void resizeEvent(QResizeEvent*) override; void paintEvent(QPaintEvent*) override; + void mouseMoveEvent(QMouseEvent*) override; private: Index: app/titlebar.cpp =================================================================== --- app/titlebar.cpp +++ app/titlebar.cpp @@ -138,6 +138,27 @@ painter.end(); } +void TitleBar::mouseMoveEvent(QMouseEvent* event) +{ + if (event->buttons() == Qt::LeftButton) { + MainWindow* parent = (MainWindow*)this->parent(); + + int maxHeight = parent->getDesktopGeometry().height(); + int newHeight = event->globalY() / (maxHeight / 100); + + if (newHeight > 100) { + newHeight = 100; + } + if (newHeight < 10) { + newHeight = 10; + } + + parent->setWindowHeight(newHeight); + } else { + QWidget::mouseMoveEvent(event); + } +} + void TitleBar::updateMask() { const QPixmap& leftCornerImage = m_skin->titleBarLeftCornerImage();