mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
escape key handling
This commit is contained in:
59
.github/workflows/release.yml
vendored
Normal file
59
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Create Release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-${{ github.ref_name }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_release:
|
||||||
|
name: 📦 Create GitHub Release
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Fetch full history for changelog generation
|
||||||
|
|
||||||
|
# Generate changelog
|
||||||
|
- name: Generate Changelog
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
# Get the previous tag
|
||||||
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
|
echo "No previous tag found, using all commits"
|
||||||
|
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" | head -50)
|
||||||
|
else
|
||||||
|
echo "Generating changelog from $PREVIOUS_TAG to HEAD"
|
||||||
|
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the changelog with proper formatting
|
||||||
|
cat > CHANGELOG.md << EOF
|
||||||
|
## What's Changed
|
||||||
|
|
||||||
|
$CHANGELOG
|
||||||
|
|
||||||
|
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${{ github.ref_name }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Set output for use in release step
|
||||||
|
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
cat CHANGELOG.md >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# Create GitHub Release
|
||||||
|
- name: Create GitHub Release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
|
release_name: Release ${{ github.ref_name }}
|
||||||
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||||
@@ -334,6 +334,13 @@ DankModal {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
anchors.margins: Theme.spacingL
|
||||||
spacing: Theme.spacingL
|
spacing: Theme.spacingL
|
||||||
|
focus: true
|
||||||
|
Keys.onPressed: function(event) {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
hide();
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -185,15 +185,28 @@ PanelWindow {
|
|||||||
|
|
||||||
FocusScope {
|
FocusScope {
|
||||||
id: focusScope
|
id: focusScope
|
||||||
|
objectName: "modalFocusScope"
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: root.visible // Only active when the modal is visible
|
visible: root.visible // Only active when the modal is visible
|
||||||
|
focus: root.visible
|
||||||
Keys.onEscapePressed: (event) => {
|
Keys.onEscapePressed: (event) => {
|
||||||
if (root.closeOnEscapeKey) {
|
if (root.closeOnEscapeKey) {
|
||||||
root.visible = false;
|
root.visible = false;
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
Qt.callLater(function() {
|
||||||
|
focusScope.forceActiveFocus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expose the focusScope for external access
|
||||||
|
property alias modalFocusScope: focusScope
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,14 @@ DankModal {
|
|||||||
signal closingModal()
|
signal closingModal()
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible)
|
if (!visible) {
|
||||||
closingModal();
|
if (settingsVisible) {
|
||||||
|
settingsVisible = false;
|
||||||
}
|
}
|
||||||
|
closingModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
visible: settingsVisible
|
visible: settingsVisible
|
||||||
width: 750
|
width: 750
|
||||||
height: 750
|
height: 750
|
||||||
@@ -27,12 +31,6 @@ DankModal {
|
|||||||
settingsVisible = false;
|
settingsVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FocusScope {
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: settingsModal.settingsVisible
|
|
||||||
Keys.onEscapePressed: settingsModal.settingsVisible = false
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
content: Component {
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -194,12 +194,12 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onOpened() {
|
function onSpotlightOpenChanged() {
|
||||||
|
if (spotlightModal.spotlightOpen) {
|
||||||
|
Qt.callLater(function() {
|
||||||
searchField.forceActiveFocus();
|
searchField.forceActiveFocus();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDialogClosed() {
|
|
||||||
searchField.clearFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
target: spotlightModal
|
target: spotlightModal
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ PanelWindow {
|
|||||||
implicitHeight: 600
|
implicitHeight: 600
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: calendarVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -188,6 +188,13 @@ PanelWindow {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingM
|
anchors.margins: Theme.spacingM
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
focus: true
|
||||||
|
Keys.onPressed: function(event) {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
calendarVisible = false;
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ PanelWindow {
|
|||||||
implicitHeight: 500
|
implicitHeight: 500
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: controlCenterVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -84,6 +84,27 @@ PanelWindow {
|
|||||||
border.width: 1
|
border.width: 1
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
smooth: true
|
smooth: true
|
||||||
|
focus: true
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (controlCenterVisible)
|
||||||
|
forceActiveFocus();
|
||||||
|
}
|
||||||
|
Keys.onPressed: function(event) {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
controlCenterVisible = false;
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onControlCenterVisibleChanged() {
|
||||||
|
if (controlCenterVisible)
|
||||||
|
Qt.callLater(function() {
|
||||||
|
parent.forceActiveFocus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ PanelWindow {
|
|||||||
implicitHeight: Math.min(Screen.height * 0.8, 400)
|
implicitHeight: Math.min(Screen.height * 0.8, 400)
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: notificationHistoryVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -106,6 +106,29 @@ PanelWindow {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
anchors.margins: Theme.spacingL
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
focus: true
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (notificationHistoryVisible)
|
||||||
|
forceActiveFocus();
|
||||||
|
}
|
||||||
|
Keys.onPressed: function(event) {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
notificationHistoryVisible = false;
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onNotificationHistoryVisibleChanged() {
|
||||||
|
if (notificationHistoryVisible)
|
||||||
|
Qt.callLater(function() {
|
||||||
|
contentColumn.forceActiveFocus();
|
||||||
|
});
|
||||||
|
else
|
||||||
|
contentColumn.focus = false;
|
||||||
|
}
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
|
||||||
NotificationHeader {
|
NotificationHeader {
|
||||||
id: notificationHeader
|
id: notificationHeader
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ PanelWindow {
|
|||||||
implicitHeight: 600
|
implicitHeight: 600
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
@@ -135,6 +135,27 @@ PanelWindow {
|
|||||||
clip: true
|
clip: true
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
smooth: true
|
smooth: true
|
||||||
|
focus: true
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (processListPopout.isVisible)
|
||||||
|
forceActiveFocus();
|
||||||
|
}
|
||||||
|
Keys.onPressed: function(event) {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
processListPopout.hide();
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onIsVisibleChanged() {
|
||||||
|
if (processListPopout.isVisible)
|
||||||
|
Qt.callLater(function() {
|
||||||
|
dropdownContent.forceActiveFocus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
target: processListPopout
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -554,6 +554,7 @@ ScrollView {
|
|||||||
Prefs.setProfileImage(path);
|
Prefs.setProfileImage(path);
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
onDialogClosed: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -574,6 +575,7 @@ ScrollView {
|
|||||||
Prefs.setWallpaperPath(path);
|
Prefs.setWallpaperPath(path);
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
onDialogClosed: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ PanelWindow {
|
|||||||
implicitHeight: 300
|
implicitHeight: 300
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: batteryPopupVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -124,6 +124,27 @@ PanelWindow {
|
|||||||
border.width: 1
|
border.width: 1
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
smooth: true
|
smooth: true
|
||||||
|
focus: true
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (batteryPopupVisible)
|
||||||
|
forceActiveFocus();
|
||||||
|
}
|
||||||
|
Keys.onPressed: function(event) {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
batteryPopupVisible = false;
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onBatteryPopupVisibleChanged() {
|
||||||
|
if (batteryPopupVisible)
|
||||||
|
Qt.callLater(function() {
|
||||||
|
parent.forceActiveFocus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
Reference in New Issue
Block a user