mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-30 15:07:49 -04:00
notifications: no selection ring on modal open clipboard: match the notification header and add a settings butto
settings/interface: explicit window radius match option cc: restore dim in edit mode fixes #3623
This commit is contained in:
1 parent
f025a8d7b4
commit
5cfda4ebe7
9 files changed
+132
-63
No files matched your search
@@ -2,43 +2,70 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
|
||||
Row {
|
||||
Item {
|
||||
id: actions
|
||||
|
||||
required property var modal
|
||||
readonly property real sideWidth: Math.max(leading.width, trailing.width)
|
||||
|
||||
spacing: Theme.spacingS
|
||||
implicitWidth: leading.width + Theme.spacingXS + trailing.width
|
||||
implicitHeight: Theme.buttonHeightXS
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
iconName: "push_pin"
|
||||
buttonSize: Theme.buttonHeightXXS
|
||||
iconSize: Theme.iconSizeSmall
|
||||
iconColor: actions.modal.activeTab === "saved" ? Theme.onPrimary : Theme.onSurfaceVariant
|
||||
backgroundColor: actions.modal.activeTab === "saved" ? Theme.primary : "transparent"
|
||||
visible: actions.modal.pinnedCount > 0 || actions.modal.activeTab === "saved"
|
||||
tooltipText: actions.modal.activeTab === "saved" ? I18n.tr("Recent", "clipboard button tooltip, switches to recent entries") : I18n.tr("Saved", "clipboard button tooltip, switches to saved entries")
|
||||
onClicked: actions.modal.activeTab = actions.modal.activeTab === "saved" ? "recents" : "saved"
|
||||
Row {
|
||||
id: leading
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
iconName: "push_pin"
|
||||
iconColor: actions.modal.activeTab === "saved" ? Theme.onPrimary : Theme.onSurfaceVariant
|
||||
backgroundColor: actions.modal.activeTab === "saved" ? Theme.primary : "transparent"
|
||||
visible: actions.modal.pinnedCount > 0 || actions.modal.activeTab === "saved"
|
||||
tooltipText: actions.modal.activeTab === "saved" ? I18n.tr("Recent", "clipboard button tooltip, switches to recent entries") : I18n.tr("Saved", "clipboard button tooltip, switches to saved entries")
|
||||
onClicked: actions.modal.activeTab = actions.modal.activeTab === "saved" ? "recents" : "saved"
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
objectName: "keyboardHints"
|
||||
iconName: "info"
|
||||
iconColor: actions.modal.showKeyboardHints ? Theme.onSecondaryContainer : Theme.onSurfaceVariant
|
||||
backgroundColor: actions.modal.showKeyboardHints ? Theme.secondaryContainer : "transparent"
|
||||
tooltipText: I18n.tr("Keyboard shortcuts")
|
||||
onClicked: actions.modal.showKeyboardHints = !actions.modal.showKeyboardHints
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
objectName: "keyboardHints"
|
||||
iconName: "info"
|
||||
buttonSize: Theme.buttonHeightXXS
|
||||
iconSize: Theme.iconSizeSmall
|
||||
iconColor: actions.modal.showKeyboardHints ? Theme.onSecondaryContainer : Theme.onSurfaceVariant
|
||||
backgroundColor: actions.modal.showKeyboardHints ? Theme.secondaryContainer : "transparent"
|
||||
tooltipText: I18n.tr("Keyboard shortcuts")
|
||||
onClicked: actions.modal.showKeyboardHints = !actions.modal.showKeyboardHints
|
||||
}
|
||||
Row {
|
||||
id: trailing
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
iconName: "delete_sweep"
|
||||
buttonSize: Theme.buttonHeightXXS
|
||||
iconSize: Theme.iconSizeSmall
|
||||
tooltipText: actions.modal.clearsFilteredOnly ? I18n.tr("Clear Filtered", "clipboard modal: clear button tooltip while a search filter is active") : I18n.tr("Clear All")
|
||||
onClicked: actions.modal.confirmClearAll()
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
iconName: "settings"
|
||||
tooltipText: I18n.tr("Settings")
|
||||
onClicked: actions.modal.openSettings()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
iconName: "delete_sweep"
|
||||
iconColor: Theme.onSecondaryContainer
|
||||
backgroundColor: Theme.secondaryContainer
|
||||
tooltipText: actions.modal.clearsFilteredOnly ? I18n.tr("Clear Filtered", "clipboard modal: clear button tooltip while a search filter is active") : I18n.tr("Clear All")
|
||||
onClicked: actions.modal.confirmClearAll()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
Keys.forwardTo: [actions.modal.modalFocusScope]
|
||||
visible: !actions.modal.popout
|
||||
iconName: "close"
|
||||
tooltipText: I18n.tr("Close")
|
||||
onClicked: actions.modal.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,28 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
|
||||
DankWindowHeader {
|
||||
Item {
|
||||
id: header
|
||||
|
||||
required property var modal
|
||||
readonly property bool savedTab: modal.activeTab === "saved"
|
||||
|
||||
controls: null
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 0
|
||||
showDivider: false
|
||||
title: (modal.activeTab === "saved" ? I18n.tr("Clipboard Saved") : I18n.tr("Clipboard History")) + ` (${modal.activeTab === "saved" ? modal.pinnedEntries.length : modal.unpinnedEntries.length})`
|
||||
onCloseRequested: modal.hide()
|
||||
implicitHeight: actions.implicitHeight
|
||||
|
||||
ClipboardActions {
|
||||
id: actions
|
||||
anchors.fill: parent
|
||||
modal: header.modal
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
width: Math.max(0, parent.width - 2 * (actions.sideWidth + Theme.spacingM))
|
||||
text: (header.savedTab ? I18n.tr("Clipboard Saved") : I18n.tr("Clipboard History")) + ` (${header.savedTab ? header.modal.pinnedEntries.length : header.modal.unpinnedEntries.length})`
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Theme.fontWeightMedium
|
||||
color: Theme.surfaceText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,12 @@ FocusScope {
|
||||
requestClose(false);
|
||||
}
|
||||
|
||||
function openSettings() {
|
||||
const host = surfaceHost;
|
||||
requestClose(false);
|
||||
PopoutService.openSettingsWithTab("clipboard", host, () => host?.show());
|
||||
}
|
||||
|
||||
function pasteSelected() {
|
||||
const entry = selectedEntry();
|
||||
if (!entry)
|
||||
|
||||
@@ -24,22 +24,6 @@ DankModal {
|
||||
NotificationService.onOverlayOpen();
|
||||
open();
|
||||
modalKeyboardController.reset();
|
||||
if (modalKeyboardController && notificationListRef) {
|
||||
modalKeyboardController.listView = notificationListRef;
|
||||
modalKeyboardController.rebuildFlatNavigation();
|
||||
|
||||
Qt.callLater(() => {
|
||||
modalKeyboardController.keyboardNavigationActive = true;
|
||||
modalKeyboardController.selectedFlatIndex = 0;
|
||||
modalKeyboardController.updateSelectedIdFromIndex();
|
||||
if (notificationListRef) {
|
||||
notificationListRef.keyboardActive = true;
|
||||
notificationListRef.currentIndex = 0;
|
||||
}
|
||||
modalKeyboardController.selectionVersion++;
|
||||
modalKeyboardController.ensureVisible();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
@@ -227,6 +211,7 @@ DankModal {
|
||||
id: notificationHeader
|
||||
modal: true
|
||||
keyboardController: modalKeyboardController
|
||||
historyView: historyList
|
||||
transientSurfaceTracker: notificationModal.transientSurfaceTracker
|
||||
onCloseRequested: notificationModal.hide()
|
||||
onCurrentTabChanged: notificationModal.currentTab = currentTab
|
||||
|
||||
Reference in new issue
Block a user