move add stream button to header
This commit is contained in:
+3
-1
@@ -21,7 +21,9 @@ qt_add_executable(llink
|
||||
|
||||
qt_add_resources(llink
|
||||
PREFIX_PATH "/"
|
||||
FILES ./assets/icons/mono/basic/menu.svg
|
||||
FILES
|
||||
assets/icons/mono/basic/menu-rec.svg
|
||||
assets/icons/mono/basic/plus.svg
|
||||
)
|
||||
|
||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||
|
||||
+11
-5
@@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include <QToolButton>
|
||||
#include <QSvgWidget>
|
||||
#include <QMouseEvent>
|
||||
#include <QPushButton>
|
||||
@@ -22,20 +23,23 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
QVBoxLayout *layout = new QVBoxLayout(centralWidget);
|
||||
|
||||
QHBoxLayout *headerLayout = new QHBoxLayout(centralWidget);
|
||||
m_handleBar = new QSvgWidget(":/assets/icons/mono/basic/menu.svg", centralWidget);
|
||||
m_handleBar->setFixedSize(QSize(10, 10));
|
||||
m_handleBar = new QSvgWidget(QStringLiteral(":/assets/icons/mono/basic/menu-rec.svg"), centralWidget);
|
||||
m_handleBar->setFixedSize(QSize(20, 20));
|
||||
m_handleBar->setCursor(Qt::OpenHandCursor);
|
||||
QLabel *label = new QLabel("STREAMS", centralWidget);
|
||||
QToolButton *addButton = new QToolButton(centralWidget);
|
||||
addButton->setIcon(QIcon(QStringLiteral(":/assets/icons/mono/basic/plus.svg")));
|
||||
|
||||
headerLayout->addWidget(m_handleBar);
|
||||
headerLayout->addWidget(label);
|
||||
headerLayout->addStretch();
|
||||
headerLayout->addWidget(addButton);
|
||||
|
||||
QListWidget *listWidget = new QListWidget(centralWidget);
|
||||
listWidget->addItems(QStringList{"echo-1", "beta-2", "dustin-anson", "priority-pickle"});
|
||||
|
||||
QPushButton *button = new QPushButton("+ new stream", centralWidget);
|
||||
|
||||
layout->addLayout(headerLayout);
|
||||
layout->addWidget(listWidget);
|
||||
layout->addWidget(button);
|
||||
|
||||
const QScreen *screen = QGuiApplication::primaryScreen();
|
||||
const QRect screenSize = screen->geometry();
|
||||
@@ -59,6 +63,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
dragging = true;
|
||||
dragPosition = event->globalPosition().toPoint() - frameGeometry().topLeft();
|
||||
setCursor(Qt::ClosedHandCursor);
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
@@ -75,6 +80,7 @@ void MainWindow::mouseMoveEvent(QMouseEvent *event)
|
||||
void MainWindow::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
dragging = false;
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
||||
Reference in New Issue
Block a user