improve aesthetics with dark mode

This commit is contained in:
talksik
2026-01-13 08:49:51 -08:00
parent d82ad27b3c
commit b45385f943
3 changed files with 57 additions and 6 deletions
+54 -3
View File
@@ -17,12 +17,35 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
this->setAttribute(Qt::WA_TranslucentBackground, true);
this->setAttribute(Qt::WA_AcceptTouchEvents, true);
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
this->setFixedSize(QSize(150, 150));
this->resize(QSize(150, 175));
QWidget *centralWidget = new QWidget(this);
QVBoxLayout *layout = new QVBoxLayout(centralWidget);
centralWidget->setObjectName("glass");
centralWidget->setStyleSheet(R"(
#glass {
background: rgba(25, 25, 25, 0.5);
border: none;
border-radius: 0px;
}
QLabel {
color: rgba(255, 255, 255, 0.9);
}
QToolButton {
background: transparent;
border: none;
border-radius: 4px;
padding: 4px;
}
QToolButton:hover {
background: rgba(255, 255, 255, 0.1);
}
)");
QHBoxLayout *headerLayout = new QHBoxLayout(centralWidget);
QVBoxLayout *layout = new QVBoxLayout(centralWidget);
layout->setContentsMargins(0, 0, 0, 0);
layout->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));
m_handleBar->setCursor(Qt::OpenHandCursor);
@@ -37,8 +60,36 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
QListWidget *listWidget = new QListWidget(centralWidget);
listWidget->addItems(QStringList{"echo-1", "beta-2", "dustin-anson", "priority-pickle"});
listWidget->setStyleSheet(R"(
QListWidget {
background: transparent;
border: none;
color: white;
font-size: 14px;
outline: none;
}
QListWidget::item {
padding: 2px;
border-radius: 0px;
margin: 2px 0px;
}
QListWidget::item:hover {
background: rgba(255, 255, 255, 0.1);
}
QListWidget::item:selected {
background: rgba(255, 255, 255, 0.15);
}
)");
listWidget->viewport()->setStyleSheet("background: transparent;");
layout->addLayout(headerLayout);
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);
layout->addWidget(listWidget);
const QScreen *screen = QGuiApplication::primaryScreen();