add: dock background

This commit is contained in:
lily 2025-04-16 23:16:55 -04:00
parent 099dcefec8
commit bdbcae2895
Signed by: lily
GPG key ID: 601F3263FBCBC4B9
2 changed files with 18 additions and 10 deletions

View file

@ -9,10 +9,19 @@ void Dock::createDockWindows(QApplication* app) {
qDebug() << "Creating dock window for screen:" << screen->name();
QWidget* container = new QWidget(nullptr, Qt::FramelessWindowHint | Qt::Tool);
container->setAttribute(Qt::WA_TranslucentBackground);
container->setAttribute(Qt::WA_NoSystemBackground);
// container->setAttribute(Qt::WA_TranslucentBackground);
// container->setAttribute(Qt::WA_NoSystemBackground);
container->setWindowFlag(Qt::WindowStaysOnTopHint);
container->setObjectName("rootWindow");
container->setAutoFillBackground(true);
container->resize(screen->geometry().size().width() / 2, 60);
container->setStyleSheet(R"(
#rootWindow {
background-color: rgba(0,0,0,0.6);
}
)");
this->m_dockWindows.push_front(container);
QLabel* label = new QLabel(QString("✨ Dock %1 ✨").arg(i));
label->setAlignment(Qt::AlignCenter);
@ -20,13 +29,14 @@ void Dock::createDockWindows(QApplication* app) {
QLabel {
color: white;
font-size: 18px;
background-color: rgba(0, 0, 0, 180);
border-radius: 10px;
}
)");
QVBoxLayout* layout = new QVBoxLayout(container);
QPushButton* button = new QPushButton(QString("Start"));
QHBoxLayout* layout = new QHBoxLayout(container);
layout->addWidget(label);
layout->addWidget(button);
layout->setContentsMargins(0, 0, 0, 0);
QRect screenRect = screen->geometry();

View file

@ -7,6 +7,7 @@
#include <QVBoxLayout>
#include <QTimer>
#include <QLabel>
#include <QPushButton>
#include <filesystem>
#include <fstream>
@ -20,11 +21,8 @@
class Dock {
private:
/// @brief Stores all dock windows
QList<QWindow*> m_dockWindows;
/// @brief QWidget container for dock windows
QList<QWidget*> m_dockWindowContainters;
/// @brief QWidget dock windows
QList<QWidget*> m_dockWindows;
/// @brief Stores all configuration windows
QList<QWindow*> m_configWindows;