mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
feat: add QR Generator launcher (#2941)
* feat: add QR Generator modal with auto-generate on input debounce - QRGeneratorModal with dual-buffer sequential fade animation - Auto-generate QR code on typing stop (200ms debounce) - Clear text button on input field - Escape key closes modal - Register modal in PopoutService and AppSearchService - Go backend for text QR code generation * fix: add QR Generator toggle to Launcher DMS settings * qr: also add qrg built in launcher plugin --------- Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
@@ -210,6 +210,19 @@ Singleton {
|
||||
defaultTrigger: "",
|
||||
isLauncher: false
|
||||
},
|
||||
"dms_qr_generator": {
|
||||
id: "dms_qr_generator",
|
||||
name: I18n.tr("QR Generator"),
|
||||
icon: "svg+corner:" + dmsLogoPath + "|qr_code",
|
||||
cornerIcon: "qr_code",
|
||||
comment: "DMS",
|
||||
action: "ipc:qr-generator",
|
||||
categories: ["Utility"],
|
||||
defaultTrigger: "qrg",
|
||||
isLauncher: true,
|
||||
viewMode: "list",
|
||||
viewModeEnforced: true
|
||||
},
|
||||
"dms_settings_search": {
|
||||
id: "dms_settings_search",
|
||||
name: I18n.tr("Settings Search"),
|
||||
@@ -244,7 +257,7 @@ Singleton {
|
||||
if (!SettingsData.getBuiltInPluginSetting(pluginId, "enabled", true))
|
||||
continue;
|
||||
const plugin = builtInPlugins[pluginId];
|
||||
if (plugin.isLauncher)
|
||||
if (plugin.isLauncher && !plugin.action)
|
||||
continue;
|
||||
apps.push({
|
||||
name: plugin.name,
|
||||
@@ -309,6 +322,20 @@ Singleton {
|
||||
}));
|
||||
}
|
||||
|
||||
if (pluginId === "dms_qr_generator") {
|
||||
const text = (query || "").toString().trim();
|
||||
return [
|
||||
{
|
||||
name: text.length > 0 ? text : I18n.tr("Enter text to encode"),
|
||||
icon: "material:qr_code",
|
||||
comment: I18n.tr("QR Generator"),
|
||||
action: "qr_generate:" + text,
|
||||
isBuiltInLauncher: true,
|
||||
builtInPluginId: pluginId
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
if (pluginId !== "dms_settings_search")
|
||||
return [];
|
||||
|
||||
@@ -340,14 +367,20 @@ Singleton {
|
||||
return false;
|
||||
|
||||
const parts = item.action.split(":");
|
||||
if (parts[0] !== "settings_nav")
|
||||
return false;
|
||||
|
||||
const tabIndex = parseInt(parts[1]);
|
||||
const section = parts.slice(2).join(":");
|
||||
SettingsSearchService.navigateToSection(section);
|
||||
PopoutService.openSettingsWithTabIndex(tabIndex);
|
||||
return true;
|
||||
switch (parts[0]) {
|
||||
case "settings_nav":
|
||||
{
|
||||
const tabIndex = parseInt(parts[1]);
|
||||
const section = parts.slice(2).join(":");
|
||||
SettingsSearchService.navigateToSection(section);
|
||||
PopoutService.openSettingsWithTabIndex(tabIndex);
|
||||
return true;
|
||||
}
|
||||
case "qr_generate":
|
||||
PopoutService.showQRGeneratorModal(parts.slice(1).join(":"));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getCoreApps(query) {
|
||||
@@ -378,6 +411,9 @@ Singleton {
|
||||
case "color-picker":
|
||||
PopoutService.showColorPicker();
|
||||
return true;
|
||||
case "qr-generator":
|
||||
PopoutService.showQRGeneratorModal();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ Singleton {
|
||||
property var wifiPasswordModalLoader: null
|
||||
property var wifiQRCodeModal: null
|
||||
property var wifiQRCodeModalLoader: null
|
||||
property var qrGeneratorModal: null
|
||||
property var qrGeneratorModalLoader: null
|
||||
property var polkitAuthModal: null
|
||||
property var polkitAuthModalLoader: null
|
||||
property var bluetoothPairingModal: null
|
||||
@@ -891,6 +893,13 @@ Singleton {
|
||||
wifiQRCodeModal.show(ssid);
|
||||
}
|
||||
|
||||
function showQRGeneratorModal(initialText) {
|
||||
if (qrGeneratorModalLoader)
|
||||
qrGeneratorModalLoader.active = true;
|
||||
if (qrGeneratorModal)
|
||||
qrGeneratorModal.show(initialText || "");
|
||||
}
|
||||
|
||||
function showHiddenNetworkModal() {
|
||||
if (wifiPasswordModalLoader)
|
||||
wifiPasswordModalLoader.active = true;
|
||||
|
||||
Reference in New Issue
Block a user