Skip to content

Commit

Permalink
feat: Disable homepage
Browse files Browse the repository at this point in the history
1.Disable homepage
2.Update weight

pms: TASK-361721
  • Loading branch information
caixr23 authored and deepin-bot[bot] committed Dec 13, 2024
1 parent 667dbe4 commit f4c8d52
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 10 deletions.
5 changes: 3 additions & 2 deletions qml/DccWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ D.ApplicationWindow {
id: rootLayout
SwipeView {
id: stackView
currentIndex: 0
currentIndex: 1
interactive: false
HomePage {
id: homePage
visible: false
}
SecondPage {
id: secondPage
visible: false
// visible: false
}
Timer {
id: hideTimer
Expand Down
8 changes: 8 additions & 0 deletions qml/SecondPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,16 @@ SplitView {
Layout.margins: 10
implicitHeight: 16
implicitWidth: 16
visible: DccApp.activeObject.parentName.length !== 0 && DccApp.activeObject.parentName !== "root"
onClicked: DccApp.toBack()
}
Item {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.margins: 10
implicitHeight: 16
implicitWidth: 16
visible: !breakBut.visible
}

Crumb {
implicitHeight: parent.implicitHeight
Expand Down
2 changes: 1 addition & 1 deletion qml/plugins_v1.0/device/device.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ DccObject {
parentName: "root"
displayName: qsTr("device")
icon: "hardware"
weight: 60
weight: 40
}
2 changes: 1 addition & 1 deletion qml/plugins_v1.0/system/system.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DccObject {
parentName: "root"
displayName: qsTr("system")
icon: "commoninfo"
weight: 30
weight: 10

DccTitleObject {
name: "common"
Expand Down
13 changes: 11 additions & 2 deletions src/dde-control-center/dccmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ DccManager::DccManager(QObject *parent)
initConfig();
connect(m_plugins, &PluginManager::addObject, this, &DccManager::addObject, Qt::QueuedConnection);
connect(qApp, &QCoreApplication::aboutToQuit, this, &DccManager::onQuit);
showPage("system");
}

DccManager::~DccManager()
Expand Down Expand Up @@ -468,6 +469,13 @@ void DccManager::doShowPage(DccObject *obj, const QString &cmd)
if (m_plugins->isDeleting() || !obj) {
return;
}
// 禁用首页
if (obj == m_root) {
if (m_root->getChildren().isEmpty()) {
return;
}
obj = m_root->getChildren().first();
}
if (m_activeObject == obj && cmd.isEmpty()) {
return;
}
Expand Down Expand Up @@ -631,12 +639,13 @@ void DccManager::onObjectRemoved(DccObject *obj)
m_searchModel->removeSearchData(o, QString());
objs.append(o->getChildren());
}

DccObject *parentObj = m_root;
for (auto &&o : m_currentObjects) {
if (o == obj) {
doShowPage(m_root, QString());
doShowPage(parentObj, QString());
break;
}
parentObj = o;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugin-accounts/qml/accounts.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ DccObject {
displayName: qsTr("Account")
description: qsTr("Account manager")
icon: "dcc_nav_accounts"
weight: 10
weight: 60
}

2 changes: 1 addition & 1 deletion src/plugin-deepinid/qml/deepinid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DccObject {
displayName: DccApp.uosEdition() === DccApp.UosCommunity ? qsTr("deepin ID") : qsTr("UOS ID")
description: qsTr("Cloud services")
icon: "deepinid"
weight: 20
weight: 70

visible: false
DccDBusInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-personalization/qml/personalization.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ DccObject {
parentName: "root"
displayName: qsTr("Personalization")
icon: "personalization"
weight: 70
weight: 30
}
2 changes: 1 addition & 1 deletion src/plugin-power/qml/power.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DccObject {
displayName: qsTr("power")
description: qsTr("Power saving settings, screen and suspend")
icon: "power"
weight: 40
weight: 50

visible: false
DccDBusInterface {
Expand Down

0 comments on commit f4c8d52

Please sign in to comment.