welcome app: more bar options, extra info on closing

This commit is contained in:
end-4
2025-08-08 20:47:20 +07:00
parent db66b85e61
commit 61e4f59aa0
+100 -43
View File
@@ -26,16 +26,24 @@ ApplicationWindow {
property real contentPadding: 8 property real contentPadding: 8
property bool showNextTime: false property bool showNextTime: false
visible: true visible: true
onClosing: Qt.quit() onClosing: {
Quickshell.execDetached([
"notify-send",
Translation.tr("Welcome app"),
Translation.tr("Enjoy! You can reopen the welcome app any time with <tt>Super+Shift+Alt+/</tt>. To open the settings app, hit <tt>Super+I</tt>"),
"-a", "Shell"
])
Qt.quit()
}
title: Translation.tr("illogical-impulse Welcome") title: Translation.tr("illogical-impulse Welcome")
Component.onCompleted: { Component.onCompleted: {
MaterialThemeLoader.reapplyTheme() MaterialThemeLoader.reapplyTheme();
} }
minimumWidth: 600 minimumWidth: 600
minimumHeight: 400 minimumHeight: 400
width: 800 width: 900
height: 650 height: 650
color: Appearance.m3colors.m3background color: Appearance.m3colors.m3background
@@ -57,7 +65,8 @@ ApplicationWindow {
margins: contentPadding margins: contentPadding
} }
Item { // Titlebar Item {
// Titlebar
visible: Config.options?.windows.showTitlebar visible: Config.options?.windows.showTitlebar
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: Math.max(welcomeText.implicitHeight, windowControlsRow.implicitHeight) implicitHeight: Math.max(welcomeText.implicitHeight, windowControlsRow.implicitHeight)
@@ -70,7 +79,7 @@ ApplicationWindow {
leftMargin: 12 leftMargin: 12
} }
color: Appearance.colors.colOnLayer0 color: Appearance.colors.colOnLayer0
text: Translation.tr("Yooooo hi there") text: Translation.tr("Hi there! First things first...")
font.pixelSize: Appearance.font.pixelSize.title font.pixelSize: Appearance.font.pixelSize.title
font.family: Appearance.font.family.title font.family: Appearance.font.family.title
} }
@@ -89,9 +98,9 @@ ApplicationWindow {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
onCheckedChanged: { onCheckedChanged: {
if (checked) { if (checked) {
Quickshell.execDetached(["rm", root.firstRunFilePath]) Quickshell.execDetached(["rm", root.firstRunFilePath]);
} else { } else {
Quickshell.execDetached(["bash", "-c", `echo '${StringUtils.shellSingleQuoteEscape(root.firstRunFileContent)}' > '${StringUtils.shellSingleQuoteEscape(root.firstRunFilePath)}'`]) Quickshell.execDetached(["bash", "-c", `echo '${StringUtils.shellSingleQuoteEscape(root.firstRunFileContent)}' > '${StringUtils.shellSingleQuoteEscape(root.firstRunFilePath)}'`]);
} }
} }
} }
@@ -109,7 +118,8 @@ ApplicationWindow {
} }
} }
} }
Rectangle { // Content container Rectangle {
// Content container
color: Appearance.m3colors.m3surfaceContainerLow color: Appearance.m3colors.m3surfaceContainerLow
radius: Appearance.rounding.windowRounding - root.contentPadding radius: Appearance.rounding.windowRounding - root.contentPadding
implicitHeight: contentColumn.implicitHeight implicitHeight: contentColumn.implicitHeight
@@ -117,25 +127,54 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
ContentPage { ContentPage {
id: contentColumn id: contentColumn
anchors.fill: parent anchors.fill: parent
ContentSection { ContentSection {
title: Translation.tr("Bar style") title: Translation.tr("Bar")
ConfigSelectionArray { ContentSubsection {
currentValue: Config.options.bar.cornerStyle title: "Corner style"
configOptionName: "bar.cornerStyle"
onSelected: (newValue) => { ConfigSelectionArray {
Config.options.bar.cornerStyle = newValue; // Update local copy currentValue: Config.options.bar.cornerStyle
configOptionName: "bar.cornerStyle"
onSelected: newValue => {
Config.options.bar.cornerStyle = newValue; // Update local copy
}
options: [
{
displayName: Translation.tr("Hug"),
value: 0
},
{
displayName: Translation.tr("Float"),
value: 1
},
{
displayName: Translation.tr("Plain rectangle"),
value: 2
}
]
}
}
ConfigRow {
ConfigSwitch {
text: Translation.tr("Automatically hide")
checked: Config.options.bar.autoHide.enable
onCheckedChanged: {
Config.options.bar.autoHide.enable = checked;
}
}
ConfigSwitch {
text: Translation.tr("Place at the bottom")
checked: Config.options.bar.bottom
onCheckedChanged: {
Config.options.bar.bottom = checked;
}
} }
options: [
{ displayName: Translation.tr("Hug"), value: 0 },
{ displayName: Translation.tr("Float"), value: 1 },
{ displayName: Translation.tr("Plain rectangle"), value: 2 }
]
} }
} }
@@ -161,7 +200,7 @@ ApplicationWindow {
materialIcon: "wallpaper" materialIcon: "wallpaper"
mainText: konachanWallProc.running ? Translation.tr("Be patient...") : Translation.tr("Random: Konachan") mainText: konachanWallProc.running ? Translation.tr("Be patient...") : Translation.tr("Random: Konachan")
onClicked: { onClicked: {
console.log(konachanWallProc.command.join(" ")) console.log(konachanWallProc.command.join(" "));
konachanWallProc.running = true; konachanWallProc.running = true;
} }
StyledToolTip { StyledToolTip {
@@ -174,7 +213,7 @@ ApplicationWindow {
content: Translation.tr("Pick wallpaper image on your system") content: Translation.tr("Pick wallpaper image on your system")
} }
onClicked: { onClicked: {
Quickshell.execDetached([`${Directories.wallpaperSwitchScriptPath}`]) Quickshell.execDetached([`${Directories.wallpaperSwitchScriptPath}`]);
} }
mainContentComponent: Component { mainContentComponent: Component {
RowLayout { RowLayout {
@@ -217,38 +256,56 @@ ApplicationWindow {
title: Translation.tr("Policies") title: Translation.tr("Policies")
ConfigRow { ConfigRow {
ColumnLayout { // Weeb policy Layout.fillWidth: true
ContentSubsectionLabel {
text: Translation.tr("Weeb") ContentSubsection {
} title: "Weeb"
ConfigSelectionArray { ConfigSelectionArray {
currentValue: Config.options.policies.weeb currentValue: Config.options.policies.weeb
configOptionName: "policies.weeb" configOptionName: "policies.weeb"
onSelected: (newValue) => { onSelected: newValue => {
Config.options.policies.weeb = newValue; Config.options.policies.weeb = newValue;
} }
options: [ options: [
{ displayName: Translation.tr("No"), value: 0 }, {
{ displayName: Translation.tr("Yes"), value: 1 }, displayName: Translation.tr("No"),
{ displayName: Translation.tr("Closet"), value: 2 } value: 0
},
{
displayName: Translation.tr("Yes"),
value: 1
},
{
displayName: Translation.tr("Closet"),
value: 2
}
] ]
} }
} }
ColumnLayout { // AI policy ContentSubsection {
ContentSubsectionLabel { title: "AI"
text: Translation.tr("AI")
}
ConfigSelectionArray { ConfigSelectionArray {
currentValue: Config.options.policies.ai currentValue: Config.options.policies.ai
configOptionName: "policies.ai" configOptionName: "policies.ai"
onSelected: (newValue) => { onSelected: newValue => {
Config.options.policies.ai = newValue; Config.options.policies.ai = newValue;
} }
options: [ options: [
{ displayName: Translation.tr("No"), value: 0 }, {
{ displayName: Translation.tr("Yes"), value: 1 }, displayName: Translation.tr("No"),
{ displayName: Translation.tr("Local only"), value: 2 } value: 0
},
{
displayName: Translation.tr("Yes"),
value: 1
},
{
displayName: Translation.tr("Local only"),
value: 2
}
] ]
} }
} }
@@ -265,7 +322,7 @@ ApplicationWindow {
RippleButtonWithIcon { RippleButtonWithIcon {
materialIcon: "keyboard_alt" materialIcon: "keyboard_alt"
onClicked: { onClicked: {
Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "cheatsheet", "toggle"]) Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "cheatsheet", "toggle"]);
} }
mainContentComponent: Component { mainContentComponent: Component {
RowLayout { RowLayout {
@@ -296,14 +353,14 @@ ApplicationWindow {
materialIcon: "help" materialIcon: "help"
mainText: Translation.tr("Usage") mainText: Translation.tr("Usage")
onClicked: { onClicked: {
Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/") Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/02usage/");
} }
} }
RippleButtonWithIcon { RippleButtonWithIcon {
materialIcon: "construction" materialIcon: "construction"
mainText: Translation.tr("Configuration") mainText: Translation.tr("Configuration")
onClicked: { onClicked: {
Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/03config/") Qt.openUrlExternally("https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/03config/");
} }
} }
} }
@@ -320,14 +377,14 @@ ApplicationWindow {
nerdIcon: "󰊤" nerdIcon: "󰊤"
mainText: Translation.tr("GitHub") mainText: Translation.tr("GitHub")
onClicked: { onClicked: {
Qt.openUrlExternally("https://github.com/end-4/dots-hyprland") Qt.openUrlExternally("https://github.com/end-4/dots-hyprland");
} }
} }
RippleButtonWithIcon { RippleButtonWithIcon {
materialIcon: "favorite" materialIcon: "favorite"
mainText: "Funny number" mainText: "Funny number"
onClicked: { onClicked: {
Qt.openUrlExternally("https://github.com/sponsors/end-4") Qt.openUrlExternally("https://github.com/sponsors/end-4");
} }
} }
} }