1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

welcome: add IPC targets and button on about page

This commit is contained in:
bbedward
2026-01-04 21:45:02 -05:00
parent d23fc9f2df
commit 145a974b6d
5 changed files with 102 additions and 2 deletions

View File

@@ -829,7 +829,11 @@ Item {
Connections {
target: FirstLaunchService
function onGreeterRequested() {
greeterLoader.active = true;
if (greeterLoader.active && greeterLoader.item) {
greeterLoader.item.show();
} else {
greeterLoader.active = true;
}
}
}
}

View File

@@ -894,6 +894,26 @@ Item {
target: "clipboard"
}
IpcHandler {
function open(): string {
FirstLaunchService.showWelcome();
return "WELCOME_OPEN_SUCCESS";
}
function doctor(): string {
FirstLaunchService.showDoctor();
return "WELCOME_DOCTOR_SUCCESS";
}
function page(pageNum: string): string {
const num = parseInt(pageNum) || 0;
FirstLaunchService.showGreeter(num);
return `WELCOME_PAGE_SUCCESS: ${num}`;
}
target: "welcome"
}
IpcHandler {
function toggleOverlay(instanceId: string): string {
if (!instanceId)

View File

@@ -53,7 +53,12 @@ FloatingWindow {
}
function show() {
currentPage = 0;
currentPage = FirstLaunchService.requestedStartPage || 0;
visible = true;
}
function showAtPage(page) {
currentPage = page;
visible = true;
}

View File

@@ -713,6 +713,63 @@ Item {
}
}
StyledRect {
width: parent.width
height: toolsSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
border.width: 0
Column {
id: toolsSection
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "build"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: I18n.tr("Tools")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
spacing: Theme.spacingS
DankButton {
text: I18n.tr("Show Welcome")
iconName: "waving_hand"
backgroundColor: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.08)
textColor: Theme.surfaceText
onClicked: FirstLaunchService.showWelcome()
}
DankButton {
text: I18n.tr("System Check")
iconName: "vital_signs"
backgroundColor: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.08)
textColor: Theme.surfaceText
onClicked: FirstLaunchService.showDoctor()
}
}
}
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
text: `<a href="https://github.com/AvengeMedia/DankMaterialShell/blob/master/LICENSE" style="text-decoration:none; color:${Theme.surfaceVariantText};">MIT License</a>`

View File

@@ -17,12 +17,26 @@ Singleton {
property bool isFirstLaunch: false
property bool checkComplete: false
property bool greeterDismissed: false
property int requestedStartPage: 0
readonly property bool shouldShowGreeter: checkComplete && isFirstLaunch && !greeterDismissed
signal greeterRequested
signal greeterCompleted
function showGreeter(startPage) {
requestedStartPage = startPage || 0;
greeterRequested();
}
function showWelcome() {
showGreeter(0);
}
function showDoctor() {
showGreeter(1);
}
Component.onCompleted: {
checkFirstLaunch();
}