Skip to content

Commit f37ff23

Browse files
committed
ui update
1 parent 0663324 commit f37ff23

4 files changed

Lines changed: 10 additions & 80 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ target_link_libraries(SteamLuaPatcher PRIVATE
9595
Qt6::Gui
9696
Qt6::Widgets
9797
Qt6::Network
98-
dwmapi
9998
)
10099

101100
# Static build configuration

src/mainwindow.cpp

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@
1212
#include "utils/paths.h"
1313
#include "config.h"
1414

15-
#ifdef Q_OS_WIN
16-
#include <dwmapi.h>
17-
#ifndef DWMWA_SYSTEMBACKDROP_TYPE
18-
#define DWMWA_SYSTEMBACKDROP_TYPE 38
19-
#endif
20-
#ifndef DWMSBT_MAINWINDOW
21-
#define DWMSBT_MAINWINDOW 2
22-
#define DWMSBT_TRANSIENTWINDOW 3
23-
#endif
24-
#endif
25-
2615
#include <QVBoxLayout>
2716
#include <QHBoxLayout>
2817
#include <QPainter>
@@ -116,16 +105,6 @@ MainWindow::MainWindow(QWidget* parent)
116105
setWindowIcon(QIcon(iconPath));
117106
}
118107

119-
#ifdef Q_OS_WIN
120-
HWND hwnd = (HWND)this->winId();
121-
int backdrop = DWMSBT_TRANSIENTWINDOW; // Acrylic frosted glass
122-
DwmSetWindowAttribute(hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &backdrop, sizeof(backdrop));
123-
#endif
124-
125-
// Frameless glass window
126-
setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
127-
setAttribute(Qt::WA_TranslucentBackground);
128-
129108
initUI();
130109

131110
m_debounceTimer = new QTimer(this);
@@ -150,40 +129,9 @@ MainWindow::~MainWindow() {
150129
void MainWindow::paintEvent(QPaintEvent* event) {
151130
Q_UNUSED(event);
152131
QPainter painter(this);
153-
// Use the semi-transparent surface color to let Mica/Acrylic bleed through
154132
painter.fillRect(rect(), Colors::toQColor(Colors::SURFACE));
155133
}
156134

157-
// ── Window Dragging Implementation ──
158-
void MainWindow::mousePressEvent(QMouseEvent *event) {
159-
if (event->button() == Qt::LeftButton) {
160-
// Only allow drag from the top header area (approx 60px)
161-
if (event->pos().y() <= 60) {
162-
m_dragging = true;
163-
m_dragPosition = event->globalPosition().toPoint() - frameGeometry().topLeft();
164-
event->accept();
165-
return;
166-
}
167-
}
168-
QMainWindow::mousePressEvent(event);
169-
}
170-
171-
void MainWindow::mouseMoveEvent(QMouseEvent *event) {
172-
if (event->buttons() & Qt::LeftButton && m_dragging) {
173-
move(event->globalPosition().toPoint() - m_dragPosition);
174-
event->accept();
175-
return;
176-
}
177-
QMainWindow::mouseMoveEvent(event);
178-
}
179-
180-
void MainWindow::mouseReleaseEvent(QMouseEvent *event) {
181-
if (event->button() == Qt::LeftButton) {
182-
m_dragging = false;
183-
}
184-
QMainWindow::mouseReleaseEvent(event);
185-
}
186-
187135
void MainWindow::dragEnterEvent(QDragEnterEvent* event) {
188136
if (event->mimeData()->hasUrls()) {
189137
QList<QUrl> urls = event->mimeData()->urls();
@@ -279,16 +227,6 @@ void MainWindow::initUI() {
279227
).arg(Colors::ON_SURFACE));
280228
headerLayout->addWidget(title);
281229
headerLayout->addStretch();
282-
283-
// Custom window controls since we are frameless
284-
MaterialIconButton* closeBtn = new MaterialIconButton(
285-
MaterialIcons::Delete, Colors::toQColor(Colors::ON_SURFACE), 28);
286-
// Hack: re-use an icon visually close to an X or window close if we don't have a close icon.
287-
// For now, let's use a simple distinct color and click handler.
288-
closeBtn->setToolTip("Close");
289-
connect(closeBtn, &QPushButton::clicked, this, &QMainWindow::close);
290-
headerLayout->addWidget(closeBtn);
291-
292230
sidebarLayout->addLayout(headerLayout);
293231
sidebarLayout->addSpacing(20);
294232

src/mainwindow.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class MainWindow : public QMainWindow {
4747
void paintEvent(QPaintEvent* event) override;
4848
void dragEnterEvent(QDragEnterEvent* event) override;
4949
void dropEvent(QDropEvent* event) override;
50-
void mousePressEvent(QMouseEvent *event) override;
51-
void mouseMoveEvent(QMouseEvent *event) override;
52-
void mouseReleaseEvent(QMouseEvent *event) override;
5350

5451
private slots:
5552
void onSyncDone(QList<GameInfo> games);
@@ -134,13 +131,9 @@ private slots:
134131
QList<QNetworkReply*> m_activeNameFetches;
135132
bool m_fetchingNames;
136133
int m_nameFetchSearchId;
137-
138134
// Thumbnail cache
139135
QMap<QString, QPixmap> m_thumbnailCache;
140136
QSet<QString> m_activeThumbnailDownloads;
141-
// Window Dragging
142-
bool m_dragging = false;
143-
QPoint m_dragPosition;
144137
};
145138

146139
#endif // MAINWINDOW_H

src/utils/colors.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#include "colors.h"
22

3-
// Pure Black Theme - Surface colors (Updated for Glassmorphism #AARRGGBB)
4-
const QString Colors::SURFACE = "#40000000"; // 25% black
5-
const QString Colors::SURFACE_DIM = "#20000000"; // 12% black
6-
const QString Colors::SURFACE_BRIGHT = "#301A1A1A";
7-
const QString Colors::SURFACE_CONTAINER = "#500A0A0A";
8-
const QString Colors::SURFACE_CONTAINER_HIGH = "#60141414";
9-
const QString Colors::SURFACE_CONTAINER_HIGHEST = "#701E1E1E";
10-
const QString Colors::SURFACE_VARIANT = "#502A2A2A";
3+
// Pure Black Theme - Surface colors
4+
const QString Colors::SURFACE = "#000000";
5+
const QString Colors::SURFACE_DIM = "#000000";
6+
const QString Colors::SURFACE_BRIGHT = "#1A1A1A";
7+
const QString Colors::SURFACE_CONTAINER = "#0A0A0A";
8+
const QString Colors::SURFACE_CONTAINER_HIGH = "#141414";
9+
const QString Colors::SURFACE_CONTAINER_HIGHEST = "#1E1E1E";
10+
const QString Colors::SURFACE_VARIANT = "#2A2A2A";
1111
const QString Colors::ON_SURFACE = "#E6E1E5";
1212
const QString Colors::ON_SURFACE_VARIANT = "#CAC4D0";
13-
const QString Colors::OUTLINE = "#706E6E6E";
14-
const QString Colors::OUTLINE_VARIANT = "#402A2A2A";
13+
const QString Colors::OUTLINE = "#6E6E6E";
14+
const QString Colors::OUTLINE_VARIANT = "#2A2A2A";
1515

1616
// Primary (Purple) - unchanged
1717
const QString Colors::PRIMARY = "#D0BCFF";

0 commit comments

Comments
 (0)