Mercurial > minori
comparison src/gui/window.cc @ 249:6b2441c776dd
*: merge
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 24 Jan 2024 20:18:59 -0500 |
parents | 06d6c351925c |
children | c130f47f6f48 |
comparison
equal
deleted
inserted
replaced
248:cf47a8f687c0 | 249:6b2441c776dd |
---|---|
41 | 41 |
42 #include <iostream> | 42 #include <iostream> |
43 | 43 |
44 #ifdef MACOSX | 44 #ifdef MACOSX |
45 # include "sys/osx/dark_theme.h" | 45 # include "sys/osx/dark_theme.h" |
46 # include "sys/osx/permissions.h" | |
46 #elif defined(WIN32) | 47 #elif defined(WIN32) |
47 # include "sys/win32/dark_theme.h" | 48 # include "sys/win32/dark_theme.h" |
48 #endif | 49 #endif |
49 | 50 |
50 enum class Pages { | 51 enum class Pages { |
64 Track::Media::GetCurrentlyPlaying(files); | 65 Track::Media::GetCurrentlyPlaying(files); |
65 emit Done(files); | 66 emit Done(files); |
66 } | 67 } |
67 | 68 |
68 MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { | 69 MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { |
69 setWindowIcon(QIcon(":/favicon.png")); | 70 setWindowIcon(QIcon(":/icons/favicon.png")); |
70 | 71 |
71 main_widget.reset(new QWidget(this)); | 72 main_widget.reset(new QWidget(this)); |
72 new QHBoxLayout(main_widget.get()); | 73 new QHBoxLayout(main_widget.get()); |
73 | 74 |
74 AddMainWidgets(); | 75 AddMainWidgets(); |
75 | |
76 setCentralWidget(main_widget.get()); | 76 setCentralWidget(main_widget.get()); |
77 | 77 |
78 CreateBars(); | 78 CreateBars(); |
79 | 79 |
80 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING))); | 80 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING))); |
111 if (!thread.get() || thread->isRunning()) | 111 if (!thread.get() || thread->isRunning()) |
112 return; | 112 return; |
113 | 113 |
114 thread->start(); | 114 thread->start(); |
115 }); | 115 }); |
116 | |
117 #ifdef MACOSX | |
118 if (!osx::AskForPermissions()) | |
119 return; | |
120 #endif | |
116 | 121 |
117 timer->start(5000); | 122 timer->start(5000); |
118 } | 123 } |
119 | 124 |
120 void MainWindow::AddMainWidgets() { | 125 void MainWindow::AddMainWidgets() { |