add: dock background
This commit is contained in:
parent
099dcefec8
commit
bdbcae2895
2 changed files with 18 additions and 10 deletions
20
src/dock.cpp
20
src/dock.cpp
|
@ -9,10 +9,19 @@ void Dock::createDockWindows(QApplication* app) {
|
||||||
qDebug() << "Creating dock window for screen:" << screen->name();
|
qDebug() << "Creating dock window for screen:" << screen->name();
|
||||||
|
|
||||||
QWidget* container = new QWidget(nullptr, Qt::FramelessWindowHint | Qt::Tool);
|
QWidget* container = new QWidget(nullptr, Qt::FramelessWindowHint | Qt::Tool);
|
||||||
container->setAttribute(Qt::WA_TranslucentBackground);
|
// container->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
container->setAttribute(Qt::WA_NoSystemBackground);
|
// container->setAttribute(Qt::WA_NoSystemBackground);
|
||||||
container->setWindowFlag(Qt::WindowStaysOnTopHint);
|
container->setWindowFlag(Qt::WindowStaysOnTopHint);
|
||||||
|
container->setObjectName("rootWindow");
|
||||||
|
container->setAutoFillBackground(true);
|
||||||
container->resize(screen->geometry().size().width() / 2, 60);
|
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));
|
QLabel* label = new QLabel(QString("✨ Dock %1 ✨").arg(i));
|
||||||
label->setAlignment(Qt::AlignCenter);
|
label->setAlignment(Qt::AlignCenter);
|
||||||
|
@ -20,13 +29,14 @@ void Dock::createDockWindows(QApplication* app) {
|
||||||
QLabel {
|
QLabel {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 18px;
|
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(label);
|
||||||
|
layout->addWidget(button);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
QRect screenRect = screen->geometry();
|
QRect screenRect = screen->geometry();
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -20,11 +21,8 @@
|
||||||
|
|
||||||
class Dock {
|
class Dock {
|
||||||
private:
|
private:
|
||||||
/// @brief Stores all dock windows
|
/// @brief QWidget dock windows
|
||||||
QList<QWindow*> m_dockWindows;
|
QList<QWidget*> m_dockWindows;
|
||||||
|
|
||||||
/// @brief QWidget container for dock windows
|
|
||||||
QList<QWidget*> m_dockWindowContainters;
|
|
||||||
|
|
||||||
/// @brief Stores all configuration windows
|
/// @brief Stores all configuration windows
|
||||||
QList<QWindow*> m_configWindows;
|
QList<QWindow*> m_configWindows;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue