Update
This commit is contained in:
parent
a2b98f661d
commit
a195f05080
5 changed files with 19 additions and 22 deletions
|
@ -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)
|
||||
|
|
|
@ -169,7 +169,7 @@ Item {
|
|||
layoutDirection: Qt.RightToLeft
|
||||
interactive: false
|
||||
model: trayModel
|
||||
spacing: Meui.Units.smallSpacing
|
||||
spacing: Meui.Units.smallSpacing / 2
|
||||
clip: true
|
||||
|
||||
StatusNotifierModel {
|
||||
|
|
|
@ -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);
|
||||
|
|
15
src/main.cpp
15
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<DockSettings>("Cyber.Dock", 1, 0, "DockSettings");
|
||||
qmlRegisterType<VolumeManager>("Cyber.Dock", 1, 0, "Volume");
|
||||
qmlRegisterType<Battery>("Cyber.Dock", 1, 0, "Battery");
|
||||
qmlRegisterType<Brightness>("Cyber.Dock", 1, 0, "Brightness");
|
||||
qmlRegisterType<ControlCenterDialog>("Cyber.Dock", 1, 0, "ControlCenterDialog");
|
||||
qmlRegisterType<StatusNotifierModel>("Cyber.Dock", 1, 0, "StatusNotifierModel");
|
||||
qmlRegisterType<Appearance>("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());
|
||||
|
|
|
@ -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 <QGuiApplication>
|
||||
#include <QScreen>
|
||||
|
||||
#include <QQmlEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlProperty>
|
||||
#include <QQuickItem>
|
||||
|
@ -45,15 +39,7 @@ MainWindow::MainWindow(QQuickView *parent)
|
|||
, m_appModel(new ApplicationModel)
|
||||
, m_fakeWindow(nullptr)
|
||||
{
|
||||
qmlRegisterType<DockSettings>("Cyber.Dock", 1, 0, "DockSettings");
|
||||
qmlRegisterType<VolumeManager>("Cyber.Dock", 1, 0, "Volume");
|
||||
qmlRegisterType<Battery>("Cyber.Dock", 1, 0, "Battery");
|
||||
qmlRegisterType<Brightness>("Cyber.Dock", 1, 0, "Brightness");
|
||||
qmlRegisterType<ControlCenterDialog>("Cyber.Dock", 1, 0, "ControlCenterDialog");
|
||||
qmlRegisterType<StatusNotifierModel>("Cyber.Dock", 1, 0, "StatusNotifierModel");
|
||||
qmlRegisterType<Appearance>("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);
|
||||
|
|
Loading…
Reference in a new issue