mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 05:58:28 -04:00
launcher: add IPC feature-parity to spotlight-bar and improve list view
transitions
port 1.5
(cherry picked from commit 197d17ac4e)
This commit is contained in:
@@ -14,42 +14,68 @@ Singleton {
|
|||||||
readonly property bool enabled: Math.floor(Theme.currentAnimationBaseDuration * 0.4) >= 1
|
readonly property bool enabled: Math.floor(Theme.currentAnimationBaseDuration * 0.4) >= 1
|
||||||
|
|
||||||
readonly property Transition add: enabled ? _add : null
|
readonly property Transition add: enabled ? _add : null
|
||||||
readonly property Transition remove: enabled ? _remove : null
|
readonly property Transition remove: null
|
||||||
readonly property Transition displaced: enabled ? _displaced : null
|
readonly property Transition displaced: enabled ? _displaced : null
|
||||||
readonly property Transition move: enabled ? _move : null
|
readonly property Transition move: enabled ? _move : null
|
||||||
|
|
||||||
readonly property Transition _add: Transition {
|
readonly property int _staggerMs: Math.round(Theme.currentAnimationBaseDuration * 0.03)
|
||||||
DankAnim {
|
readonly property int _staggerCap: 8
|
||||||
property: "opacity"
|
|
||||||
from: 0
|
|
||||||
to: 1
|
|
||||||
duration: Theme.expressiveDurations.expressiveEffects
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property Transition _remove: Transition {
|
readonly property Transition _add: Transition {
|
||||||
DankAnim {
|
id: addTransition
|
||||||
property: "opacity"
|
|
||||||
to: 0
|
SequentialAnimation {
|
||||||
duration: Theme.expressiveDurations.fast
|
PropertyAction {
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedAccel
|
property: "opacity"
|
||||||
|
value: 0
|
||||||
|
}
|
||||||
|
PauseAnimation {
|
||||||
|
duration: Math.max(0, Math.min(addTransition.ViewTransition.index - (addTransition.ViewTransition.targetIndexes[0] ?? 0), root._staggerCap)) * root._staggerMs
|
||||||
|
}
|
||||||
|
ParallelAnimation {
|
||||||
|
DankAnim {
|
||||||
|
property: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: Theme.expressiveDurations.fast
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
|
}
|
||||||
|
DankAnim {
|
||||||
|
property: "y"
|
||||||
|
from: addTransition.ViewTransition.destination.y + Theme.spacingS
|
||||||
|
to: addTransition.ViewTransition.destination.y
|
||||||
|
duration: Theme.expressiveDurations.fast
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property Transition _displaced: Transition {
|
readonly property Transition _displaced: Transition {
|
||||||
DankAnim {
|
DankAnim {
|
||||||
property: "y"
|
property: "y"
|
||||||
duration: Theme.expressiveDurations.normal
|
duration: Theme.expressiveDurations.fast
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveEffects
|
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||||
|
}
|
||||||
|
DankAnim {
|
||||||
|
property: "opacity"
|
||||||
|
to: 1
|
||||||
|
duration: Theme.expressiveDurations.fast
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property Transition _move: Transition {
|
readonly property Transition _move: Transition {
|
||||||
DankAnim {
|
DankAnim {
|
||||||
property: "y"
|
property: "y"
|
||||||
duration: Theme.expressiveDurations.normal
|
duration: Theme.expressiveDurations.fast
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveEffects
|
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||||
|
}
|
||||||
|
DankAnim {
|
||||||
|
property: "opacity"
|
||||||
|
to: 1
|
||||||
|
duration: Theme.expressiveDurations.fast
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1499,6 +1499,30 @@ Item {
|
|||||||
return "SPOTLIGHT_BAR_TOGGLE_SUCCESS";
|
return "SPOTLIGHT_BAR_TOGGLE_SUCCESS";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openWith(mode: string): string {
|
||||||
|
if (!mode)
|
||||||
|
return "SPOTLIGHT_BAR_OPEN_FAILED: No mode specified";
|
||||||
|
PopoutService.openSpotlightBarWithMode(mode);
|
||||||
|
return `SPOTLIGHT_BAR_OPEN_SUCCESS: ${mode}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleWith(mode: string): string {
|
||||||
|
if (!mode)
|
||||||
|
return "SPOTLIGHT_BAR_TOGGLE_FAILED: No mode specified";
|
||||||
|
PopoutService.toggleSpotlightBarWithMode(mode);
|
||||||
|
return `SPOTLIGHT_BAR_TOGGLE_SUCCESS: ${mode}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openQuery(query: string): string {
|
||||||
|
PopoutService.openSpotlightBarWithQuery(query);
|
||||||
|
return "SPOTLIGHT_BAR_OPEN_QUERY_SUCCESS";
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleQuery(query: string): string {
|
||||||
|
PopoutService.toggleSpotlightBarWithQuery(query);
|
||||||
|
return "SPOTLIGHT_BAR_TOGGLE_QUERY_SUCCESS";
|
||||||
|
}
|
||||||
|
|
||||||
target: "spotlight-bar"
|
target: "spotlight-bar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ FocusScope {
|
|||||||
readonly property real _rowH: 64
|
readonly property real _rowH: 64
|
||||||
readonly property real _maxResultsH: Math.min(430, (parentModal?.screenHeight ?? 900) * 0.55)
|
readonly property real _maxResultsH: Math.min(430, (parentModal?.screenHeight ?? 900) * 0.55)
|
||||||
readonly property var _resultRows: _buildRows()
|
readonly property var _resultRows: _buildRows()
|
||||||
readonly property real _resultsContentH: _resultRows.length > 0 ? _resultRows.length * _rowH : _statusH
|
readonly property real _resultsContentH: _resultRows.length > 0 ? _resultRows.length * _rowH + resultsList.bottomInset : _statusH
|
||||||
readonly property real _resultsH: _hasQuery ? Math.min(_resultsContentH, _maxResultsH) : 0
|
readonly property real _resultsH: _hasQuery ? Math.min(_resultsContentH, _maxResultsH) : 0
|
||||||
readonly property int _fastDuration: 90
|
readonly property int _fastDuration: 90
|
||||||
readonly property int _resizeDuration: 110
|
readonly property int _resizeDuration: Theme.expressiveDurations.fast
|
||||||
readonly property bool _blurActive: Theme.blurForegroundLayers || Theme.transparentBlurLayers
|
readonly property bool _blurActive: Theme.blurForegroundLayers || Theme.transparentBlurLayers
|
||||||
readonly property real _searchSurfaceAlpha: {
|
readonly property real _searchSurfaceAlpha: {
|
||||||
if (Theme.transparentBlurLayers)
|
if (Theme.transparentBlurLayers)
|
||||||
@@ -57,13 +57,18 @@ FocusScope {
|
|||||||
const flat = searchController.flatModel || [];
|
const flat = searchController.flatModel || [];
|
||||||
const sections = searchController.sections || [];
|
const sections = searchController.sections || [];
|
||||||
const rows = [];
|
const rows = [];
|
||||||
|
const seen = {};
|
||||||
for (let i = 0; i < flat.length; i++) {
|
for (let i = 0; i < flat.length; i++) {
|
||||||
const entry = flat[i];
|
const entry = flat[i];
|
||||||
if (!entry || entry.isHeader || !entry.item)
|
if (!entry || entry.isHeader || !entry.item)
|
||||||
continue;
|
continue;
|
||||||
const section = sections[entry.sectionIndex] || null;
|
const section = sections[entry.sectionIndex] || null;
|
||||||
|
// Plugin item ids embed result content, so key them by slot position instead
|
||||||
|
const base = entry.item.pluginId ? (entry.sectionId + ":" + entry.indexInSection) : (entry.item.id || (entry.sectionId + ":" + (entry.item.name || entry.indexInSection)));
|
||||||
|
const bump = seen[base] || 0;
|
||||||
|
seen[base] = bump + 1;
|
||||||
rows.push({
|
rows.push({
|
||||||
"_rowId": entry.item.id || (entry.sectionId + ":" + entry.indexInSection + ":" + i),
|
"_rowId": bump ? base + "#" + bump : base,
|
||||||
"item": entry.item,
|
"item": entry.item,
|
||||||
"flatIndex": i,
|
"flatIndex": i,
|
||||||
"sectionTitle": section?.title || "",
|
"sectionTitle": section?.title || "",
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ Item {
|
|||||||
anchors.bottomMargin: root.bottomInset
|
anchors.bottomMargin: root.bottomInset
|
||||||
clip: true
|
clip: true
|
||||||
visible: root.rows.length > 0
|
visible: root.rows.length > 0
|
||||||
|
add: null
|
||||||
|
|
||||||
readonly property int rowHeight: 64
|
readonly property int rowHeight: 64
|
||||||
|
|
||||||
|
|||||||
@@ -671,6 +671,8 @@ Singleton {
|
|||||||
|
|
||||||
property bool _spotlightBarWantsOpen: false
|
property bool _spotlightBarWantsOpen: false
|
||||||
property bool _spotlightBarWantsToggle: false
|
property bool _spotlightBarWantsToggle: false
|
||||||
|
property string _spotlightBarPendingQuery: ""
|
||||||
|
property string _spotlightBarPendingMode: ""
|
||||||
|
|
||||||
function openSpotlightBar() {
|
function openSpotlightBar() {
|
||||||
if (spotlightBarModal) {
|
if (spotlightBarModal) {
|
||||||
@@ -682,6 +684,28 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openSpotlightBarWithQuery(query: string) {
|
||||||
|
if (spotlightBarModal) {
|
||||||
|
spotlightBarModal.showWithQuery(query);
|
||||||
|
} else if (spotlightBarModalLoader) {
|
||||||
|
_spotlightBarPendingQuery = query;
|
||||||
|
_spotlightBarWantsOpen = true;
|
||||||
|
_spotlightBarWantsToggle = false;
|
||||||
|
spotlightBarModalLoader.active = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openSpotlightBarWithMode(mode: string) {
|
||||||
|
if (spotlightBarModal) {
|
||||||
|
spotlightBarModal.showWithMode(mode);
|
||||||
|
} else if (spotlightBarModalLoader) {
|
||||||
|
_spotlightBarPendingMode = mode;
|
||||||
|
_spotlightBarWantsOpen = true;
|
||||||
|
_spotlightBarWantsToggle = false;
|
||||||
|
spotlightBarModalLoader.active = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function closeSpotlightBar() {
|
function closeSpotlightBar() {
|
||||||
spotlightBarModal?.hide();
|
spotlightBarModal?.hide();
|
||||||
}
|
}
|
||||||
@@ -696,15 +720,50 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleSpotlightBarWithMode(mode: string) {
|
||||||
|
if (spotlightBarModal) {
|
||||||
|
spotlightBarModal.toggleWithMode(mode);
|
||||||
|
} else if (spotlightBarModalLoader) {
|
||||||
|
_spotlightBarPendingMode = mode;
|
||||||
|
_spotlightBarWantsToggle = true;
|
||||||
|
_spotlightBarWantsOpen = false;
|
||||||
|
spotlightBarModalLoader.active = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSpotlightBarWithQuery(query: string) {
|
||||||
|
if (spotlightBarModal) {
|
||||||
|
spotlightBarModal.toggleWithQuery(query);
|
||||||
|
} else if (spotlightBarModalLoader) {
|
||||||
|
_spotlightBarPendingQuery = query;
|
||||||
|
_spotlightBarWantsOpen = true;
|
||||||
|
_spotlightBarWantsToggle = false;
|
||||||
|
spotlightBarModalLoader.active = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function _onSpotlightBarModalLoaded() {
|
function _onSpotlightBarModalLoaded() {
|
||||||
if (_spotlightBarWantsOpen) {
|
if (_spotlightBarWantsOpen) {
|
||||||
_spotlightBarWantsOpen = false;
|
_spotlightBarWantsOpen = false;
|
||||||
spotlightBarModal?.show();
|
if (_spotlightBarPendingQuery) {
|
||||||
|
spotlightBarModal?.showWithQuery(_spotlightBarPendingQuery);
|
||||||
|
_spotlightBarPendingQuery = "";
|
||||||
|
} else if (_spotlightBarPendingMode) {
|
||||||
|
spotlightBarModal?.showWithMode(_spotlightBarPendingMode);
|
||||||
|
_spotlightBarPendingMode = "";
|
||||||
|
} else {
|
||||||
|
spotlightBarModal?.show();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_spotlightBarWantsToggle) {
|
if (_spotlightBarWantsToggle) {
|
||||||
_spotlightBarWantsToggle = false;
|
_spotlightBarWantsToggle = false;
|
||||||
spotlightBarModal?.toggle();
|
if (_spotlightBarPendingMode) {
|
||||||
|
spotlightBarModal?.toggleWithMode(_spotlightBarPendingMode);
|
||||||
|
_spotlightBarPendingMode = "";
|
||||||
|
} else {
|
||||||
|
spotlightBarModal?.toggle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user