diff --git a/CMakeLists.txt b/CMakeLists.txt index 262494c..22c94d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -set(PROJECT_NAME cyber-dock) +set(PROJECT_NAME cutefish-dock) project(${PROJECT_NAME}) set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/qml/main.qml b/qml/main.qml index ad667d2..1c45cd4 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -169,7 +169,7 @@ Item { layoutDirection: Qt.RightToLeft interactive: false model: trayModel - spacing: Meui.Units.smallSpacing + spacing: Meui.Units.smallSpacing / 2 clip: true StatusNotifierModel { diff --git a/src/applicationmodel.cpp b/src/applicationmodel.cpp index c627e29..61dbf83 100644 --- a/src/applicationmodel.cpp +++ b/src/applicationmodel.cpp @@ -27,9 +27,6 @@ ApplicationModel::ApplicationModel(QObject *parent) , m_iface(XWindowInterface::instance()) , m_sysAppMonitor(SystemAppMonitor::self()) { - m_sysAppMonitor->moveToThread(qApp->thread()); - this->moveToThread(qApp->thread()); - connect(m_iface, &XWindowInterface::windowAdded, this, &ApplicationModel::onWindowAdded); connect(m_iface, &XWindowInterface::windowRemoved, this, &ApplicationModel::onWindowRemoved); connect(m_iface, &XWindowInterface::activeChanged, this, &ApplicationModel::onActiveChanged); diff --git a/src/main.cpp b/src/main.cpp index 5176704..aaacd54 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,11 +26,26 @@ #include "applicationmodel.h" #include "mainwindow.h" +#include "volumemanager.h" +#include "battery.h" +#include "brightness.h" +#include "controlcenterdialog.h" +#include "statusnotifier/statusnotifiermodel.h" +#include "appearance.h" + int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); + qmlRegisterType("Cyber.Dock", 1, 0, "DockSettings"); + qmlRegisterType("Cyber.Dock", 1, 0, "Volume"); + qmlRegisterType("Cyber.Dock", 1, 0, "Battery"); + qmlRegisterType("Cyber.Dock", 1, 0, "Brightness"); + qmlRegisterType("Cyber.Dock", 1, 0, "ControlCenterDialog"); + qmlRegisterType("Cyber.Dock", 1, 0, "StatusNotifierModel"); + qmlRegisterType("Cyber.Dock", 1, 0, "Appearance"); + QString qmFilePath = QString("%1/%2.qm").arg("/usr/share/cyber-dock/translations/").arg(QLocale::system().name()); if (QFile::exists(qmFilePath)) { QTranslator *translator = new QTranslator(QApplication::instance()); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a5fbd0b..68fd5ba 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -18,18 +18,12 @@ */ #include "mainwindow.h" -#include "iconthemeimageprovider.h" #include "processprovider.h" -#include "volumemanager.h" -#include "battery.h" -#include "brightness.h" -#include "controlcenterdialog.h" -#include "statusnotifier/statusnotifiermodel.h" -#include "appearance.h" #include #include +#include #include #include #include @@ -45,15 +39,7 @@ MainWindow::MainWindow(QQuickView *parent) , m_appModel(new ApplicationModel) , m_fakeWindow(nullptr) { - qmlRegisterType("Cyber.Dock", 1, 0, "DockSettings"); - qmlRegisterType("Cyber.Dock", 1, 0, "Volume"); - qmlRegisterType("Cyber.Dock", 1, 0, "Battery"); - qmlRegisterType("Cyber.Dock", 1, 0, "Brightness"); - qmlRegisterType("Cyber.Dock", 1, 0, "ControlCenterDialog"); - qmlRegisterType("Cyber.Dock", 1, 0, "StatusNotifierModel"); - qmlRegisterType("Cyber.Dock", 1, 0, "Appearance"); - - setDefaultAlphaBuffer(false); + // setDefaultAlphaBuffer(false); setColor(Qt::transparent); setFlags(Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); @@ -66,7 +52,6 @@ MainWindow::MainWindow(QQuickView *parent) engine()->rootContext()->setContextProperty("mainWindow", this); setResizeMode(QQuickView::SizeRootObjectToView); - // setClearBeforeRendering(true); setScreen(qApp->primaryScreen()); setSource(QUrl(QStringLiteral("qrc:/qml/main.qml"))); setVisible(true);