mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
welcome: add IPC targets and button on about page
This commit is contained in:
@@ -829,7 +829,11 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: FirstLaunchService
|
target: FirstLaunchService
|
||||||
function onGreeterRequested() {
|
function onGreeterRequested() {
|
||||||
greeterLoader.active = true;
|
if (greeterLoader.active && greeterLoader.item) {
|
||||||
|
greeterLoader.item.show();
|
||||||
|
} else {
|
||||||
|
greeterLoader.active = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -894,6 +894,26 @@ Item {
|
|||||||
target: "clipboard"
|
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 {
|
IpcHandler {
|
||||||
function toggleOverlay(instanceId: string): string {
|
function toggleOverlay(instanceId: string): string {
|
||||||
if (!instanceId)
|
if (!instanceId)
|
||||||
|
|||||||
@@ -53,7 +53,12 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
currentPage = 0;
|
currentPage = FirstLaunchService.requestedStartPage || 0;
|
||||||
|
visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function showAtPage(page) {
|
||||||
|
currentPage = page;
|
||||||
visible = true;
|
visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
StyledText {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
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>`
|
text: `<a href="https://github.com/AvengeMedia/DankMaterialShell/blob/master/LICENSE" style="text-decoration:none; color:${Theme.surfaceVariantText};">MIT License</a>`
|
||||||
|
|||||||
@@ -17,12 +17,26 @@ Singleton {
|
|||||||
property bool isFirstLaunch: false
|
property bool isFirstLaunch: false
|
||||||
property bool checkComplete: false
|
property bool checkComplete: false
|
||||||
property bool greeterDismissed: false
|
property bool greeterDismissed: false
|
||||||
|
property int requestedStartPage: 0
|
||||||
|
|
||||||
readonly property bool shouldShowGreeter: checkComplete && isFirstLaunch && !greeterDismissed
|
readonly property bool shouldShowGreeter: checkComplete && isFirstLaunch && !greeterDismissed
|
||||||
|
|
||||||
signal greeterRequested
|
signal greeterRequested
|
||||||
signal greeterCompleted
|
signal greeterCompleted
|
||||||
|
|
||||||
|
function showGreeter(startPage) {
|
||||||
|
requestedStartPage = startPage || 0;
|
||||||
|
greeterRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
function showWelcome() {
|
||||||
|
showGreeter(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showDoctor() {
|
||||||
|
showGreeter(1);
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
checkFirstLaunch();
|
checkFirstLaunch();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user