diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b206c4..6fb3512 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,12 +17,14 @@ qt_add_executable(llink main.cpp src/MainWindow.cpp src/MainWindow.h + src/VerticalLabel.cpp + src/VerticalLabel.h ) qt_add_resources(llink PREFIX_PATH "/" FILES - assets/icons/mono/basic/menu-rec.svg + assets/icons/mono/basic/menu.svg assets/icons/mono/basic/plus.svg assets/logo.png ) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 2312401..b041b73 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -8,19 +8,20 @@ #include #include #include -#include #include #include #include #include #include +#include "VerticalLabel.h" -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_trayIcon(nullptr) { this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAttribute(Qt::WA_AcceptTouchEvents, true); this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool); - this->resize(QSize(150, 150)); + this->resize(QSize(150, 200)); QWidget *centralWidget = new QWidget(this); centralWidget->setObjectName("glass"); @@ -49,29 +50,54 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) } )"); - QVBoxLayout *layout = new QVBoxLayout(centralWidget); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); + QHBoxLayout *mainLayout = new QHBoxLayout(centralWidget); + mainLayout->setContentsMargins(0, 0, 0, 0); + mainLayout->setSpacing(0); - QHBoxLayout *headerLayout = new QHBoxLayout(); - m_handleBar = new QSvgWidget(QStringLiteral(":/assets/icons/mono/basic/menu-rec.svg"), centralWidget); - m_handleBar->setFixedSize(QSize(20, 20)); + // Left sidebar - slim vertical strip + QVBoxLayout *sidebarLayout = new QVBoxLayout(); + sidebarLayout->setContentsMargins(2, 4, 2, 4); + sidebarLayout->setSpacing(4); + + m_handleBar = new QSvgWidget(QStringLiteral(":/assets/icons/mono/basic/menu.svg"), centralWidget); + m_handleBar->setFixedSize(QSize(16, 16)); m_handleBar->setCursor(Qt::OpenHandCursor); - QLabel *label = new QLabel("STREAMS", centralWidget); - label->setStyleSheet("font-weight: bold;"); + + // Rotated 90° "STREAMS" label + VerticalLabel *label = new VerticalLabel("STREAMS", centralWidget); + label->setStyleSheet("font-weight: bold; font-size: 10px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.9);"); + QToolButton *addButton = new QToolButton(centralWidget); connect(addButton, &QToolButton::clicked, this, []() { qDebug() << "addButtonClicked"; }); addButton->setIcon(QIcon(QStringLiteral(":/assets/icons/mono/basic/plus.svg"))); + addButton->setFixedSize(16, 16); + addButton->setIconSize(QSize(12, 12)); - headerLayout->addWidget(m_handleBar); - headerLayout->addWidget(label); - headerLayout->addStretch(); - headerLayout->addWidget(addButton); + sidebarLayout->addWidget(m_handleBar, 0, Qt::AlignHCenter); + sidebarLayout->addWidget(label, 1, Qt::AlignHCenter); + sidebarLayout->addWidget(addButton, 0, Qt::AlignHCenter); + + // Vertical separator + QFrame *separator = new QFrame(centralWidget); + separator->setStyleSheet("background-color: rgba(255, 255, 255, 0.1);"); + separator->setFrameShape(QFrame::VLine); + separator->setFixedWidth(1); + + // Right side with list + QVBoxLayout *contentLayout = new QVBoxLayout(); + contentLayout->setContentsMargins(0, 0, 0, 0); + contentLayout->setSpacing(0); QListWidget *listWidget = new QListWidget(centralWidget); - listWidget->addItems(QStringList{"justin, axio", "peter", "peter, faber", "daniel, justin, kim"}); + listWidget->addItems(QStringList{ + "[j,a] what are we going to...", + "[p] going to it", + "[p, f] change the ui", + "[d,j,k] drop off the money", + }); + listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); QListWidgetItem *item = new QListWidgetItem(listWidget); item->setCheckState(Qt::Checked); item->setText("do this"); @@ -97,22 +123,23 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) )"); listWidget->viewport()->setStyleSheet("background: transparent;"); - layout->addLayout(headerLayout); + QLabel *actionLabel = new QLabel("Hold space"); + actionLabel->setStyleSheet("color: lightgrey;"); + actionLabel->setAlignment(Qt::AlignHCenter); - QFrame *separator = new QFrame(centralWidget); - separator->setStyleSheet("background-color: rgba(255, 255, 255, 0.1);"); - separator->setFrameShape(QFrame::HLine); - separator->setFixedHeight(1); - layout->addWidget(separator); + contentLayout->addWidget(listWidget); + contentLayout->addWidget(actionLabel); - layout->addWidget(listWidget); + mainLayout->addLayout(sidebarLayout); + mainLayout->addWidget(separator); + mainLayout->addLayout(contentLayout, 1); const QScreen *screen = QGuiApplication::primaryScreen(); const QRect screenSize = screen->geometry(); qDebug() << "Width of window: " << this->width(); qDebug() << "Height of window: " << this->height(); - int x = screenSize.right() - this->width(); + int x = screenSize.left(); int y = (screenSize.bottom() / 2) - (this->height() / 2); this->move(x, y); diff --git a/src/VerticalLabel.cpp b/src/VerticalLabel.cpp new file mode 100644 index 0000000..798726c --- /dev/null +++ b/src/VerticalLabel.cpp @@ -0,0 +1,32 @@ +// +// Created by arjun-flowylabs on 1/13/2026. +// + +#include "VerticalLabel.h" +VerticalLabel::VerticalLabel(const QString &text, QWidget *parent) : QLabel(text, parent) +{ + +} + +QSize VerticalLabel::sizeHint() const +{ + QSize s = QLabel::sizeHint(); + return QSize(s.height(), s.width()); +} + +QSize VerticalLabel::minimumSizeHint() const +{ + QSize s = QLabel::minimumSizeHint(); + return QSize(s.height(), s.width()); +} + +void VerticalLabel::paintEvent(QPaintEvent *) +{ + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.setPen(palette().color(QPalette::WindowText)); + painter.setFont(font()); + painter.translate(0, height()); + painter.rotate(-90); + painter.drawText(QRect(0, 0, height(), width()), Qt::AlignCenter, text()); +} diff --git a/src/VerticalLabel.h b/src/VerticalLabel.h new file mode 100644 index 0000000..2100d94 --- /dev/null +++ b/src/VerticalLabel.h @@ -0,0 +1,24 @@ +// +// Created by arjun-flowylabs on 1/13/2026. +// + +#ifndef LLINK_VERTICALLABEL_H +#define LLINK_VERTICALLABEL_H + +#include +#include + +class VerticalLabel : public QLabel +{ + public: + explicit VerticalLabel(const QString &text, QWidget *parent = nullptr); + + QSize sizeHint() const override; + + QSize minimumSizeHint() const override; + + protected: + void paintEvent(QPaintEvent *) override; +}; + +#endif // LLINK_VERTICALLABEL_H