mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-26 14:32:52 -05:00
bunch of cleanups
This commit is contained in:
@@ -221,6 +221,7 @@ PanelWindow {
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppSearchService
|
||||
function onApplicationsChanged() {
|
||||
console.log("AppLauncher: DesktopEntries.applicationsChanged signal received");
|
||||
// Update categories when applications change
|
||||
@@ -231,8 +232,6 @@ PanelWindow {
|
||||
}));
|
||||
updateFilteredModel();
|
||||
}
|
||||
|
||||
target: DesktopEntries
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
||||
@@ -868,15 +868,6 @@ PanelWindow {
|
||||
else
|
||||
console.warn("ClipboardHistory: Failed to load clipboard history");
|
||||
}
|
||||
// Handle keyboard shortcuts
|
||||
Keys.onPressed: (event) => {
|
||||
if (event.key === Qt.Key_Escape)
|
||||
clipboardHistory.hide();
|
||||
|
||||
}
|
||||
Component.onCompleted: {
|
||||
focus = true;
|
||||
}
|
||||
|
||||
stdout: SplitParser {
|
||||
splitMarker: "\n"
|
||||
|
||||
@@ -123,7 +123,7 @@ Item {
|
||||
radius: 6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: 10
|
||||
opacity: networkTab.changingNetworkPreference ? 0.6 : 1
|
||||
opacity: NetworkService.changingPreference ? 0.6 : 1
|
||||
visible: NetworkService.networkStatus !== "ethernet" && NetworkService.wifiAvailable && NetworkService.wifiEnabled
|
||||
|
||||
Row {
|
||||
@@ -133,17 +133,17 @@ Item {
|
||||
DankIcon {
|
||||
id: ethernetPreferenceIcon
|
||||
|
||||
name: networkTab.changingNetworkPreference ? "sync" : ""
|
||||
name: NetworkService.changingPreference ? "sync" : ""
|
||||
size: Theme.fontSizeSmall
|
||||
color: networkTab.networkStatus === "ethernet" ? Theme.background : Theme.primary
|
||||
visible: networkTab.changingNetworkPreference
|
||||
visible: NetworkService.changingPreference
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
rotation: networkTab.changingNetworkPreference ? ethernetPreferenceIcon.rotation : 0
|
||||
rotation: NetworkService.changingPreference ? ethernetPreferenceIcon.rotation : 0
|
||||
|
||||
RotationAnimation {
|
||||
target: ethernetPreferenceIcon
|
||||
property: "rotation"
|
||||
running: networkTab.changingNetworkPreference
|
||||
running: NetworkService.changingPreference
|
||||
from: 0
|
||||
to: 360
|
||||
duration: 1000
|
||||
@@ -153,7 +153,7 @@ Item {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: networkTab.changingNetworkPreference ? "Switching..." : (networkTab.networkStatus === "ethernet" ? "" : "Prefer over WiFi")
|
||||
text: NetworkService.changingPreference ? "Switching..." : (networkTab.networkStatus === "ethernet" ? "" : "Prefer over WiFi")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: networkTab.networkStatus === "ethernet" ? Theme.background : Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -167,7 +167,7 @@ Item {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
propagateComposedEvents: false
|
||||
enabled: !networkTab.changingNetworkPreference
|
||||
enabled: !NetworkService.changingPreference
|
||||
onClicked: {
|
||||
console.log("*** ETHERNET PREFERENCE BUTTON CLICKED ***");
|
||||
if (networkTab.networkStatus !== "ethernet") {
|
||||
@@ -356,7 +356,7 @@ Item {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.spacingL + 48 + Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
opacity: networkTab.changingNetworkPreference ? 0.6 : 1
|
||||
opacity: NetworkService.changingPreference ? 0.6 : 1
|
||||
visible: NetworkService.networkStatus !== "wifi" && NetworkService.ethernetConnected && NetworkService.wifiEnabled
|
||||
|
||||
Row {
|
||||
@@ -366,17 +366,17 @@ Item {
|
||||
DankIcon {
|
||||
id: wifiPreferenceIcon
|
||||
|
||||
name: networkTab.changingNetworkPreference ? "sync" : ""
|
||||
name: NetworkService.changingPreference ? "sync" : ""
|
||||
size: Theme.fontSizeSmall
|
||||
color: networkTab.networkStatus === "wifi" ? Theme.background : Theme.primary
|
||||
visible: networkTab.changingNetworkPreference
|
||||
visible: NetworkService.changingPreference
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
rotation: networkTab.changingNetworkPreference ? wifiPreferenceIcon.rotation : 0
|
||||
rotation: NetworkService.changingPreference ? wifiPreferenceIcon.rotation : 0
|
||||
|
||||
RotationAnimation {
|
||||
target: wifiPreferenceIcon
|
||||
property: "rotation"
|
||||
running: networkTab.changingNetworkPreference
|
||||
running: NetworkService.changingPreference
|
||||
from: 0
|
||||
to: 360
|
||||
duration: 1000
|
||||
@@ -386,7 +386,7 @@ Item {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: NetworkService.changingNetworkPreference ? "Switching..." : "Prefer over Ethernet"
|
||||
text: NetworkService.changingPreference ? "Switching..." : "Prefer over Ethernet"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: NetworkService.networkStatus === "wifi" ? Theme.background : Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -400,7 +400,7 @@ Item {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
propagateComposedEvents: false
|
||||
enabled: !networkTab.changingNetworkPreference
|
||||
enabled: !NetworkService.changingPreference
|
||||
onClicked: {
|
||||
console.log("Force WiFi preference clicked");
|
||||
if (NetworkService.networkStatus !== "wifi")
|
||||
|
||||
@@ -373,78 +373,41 @@ PanelWindow {
|
||||
border.width: 1
|
||||
clip: true
|
||||
|
||||
readonly property bool hasNotificationImage: modelData.latestNotification.image && modelData.latestNotification.image !== ""
|
||||
|
||||
IconImage {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 6
|
||||
anchors.margins: 2
|
||||
source: {
|
||||
// Don't try to load icons for screenshots - let fallback handle them
|
||||
const isScreenshot = modelData.latestNotification.isScreenshot;
|
||||
|
||||
if (isScreenshot) {
|
||||
return "";
|
||||
// Priority 1: Use notification image if available
|
||||
if (parent.hasNotificationImage) {
|
||||
return modelData.latestNotification.cleanImage;
|
||||
}
|
||||
|
||||
// Priority 2: Use appIcon - handle URLs directly, use iconPath for icon names
|
||||
if (modelData.latestNotification.appIcon) {
|
||||
const appIcon = modelData.latestNotification.appIcon;
|
||||
if (appIcon.startsWith("file://") || appIcon.startsWith("http://") || appIcon.startsWith("https://")) {
|
||||
return appIcon;
|
||||
}
|
||||
return Quickshell.iconPath(appIcon, "");
|
||||
}
|
||||
|
||||
if (modelData.latestNotification.appIcon && modelData.latestNotification.appIcon !== "")
|
||||
return Quickshell.iconPath(modelData.latestNotification.appIcon, "");
|
||||
|
||||
return "";
|
||||
}
|
||||
visible: status === Image.Ready
|
||||
onStatusChanged: {
|
||||
if (status === Image.Error || status === Image.Null || source === "")
|
||||
fallbackIcon.visible = true;
|
||||
else if (status === Image.Ready)
|
||||
fallbackIcon.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: fallbackIcon
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: true
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
readonly property bool isScreenshot: modelData.latestNotification.isScreenshot
|
||||
readonly property bool hasNotificationImage: modelData.latestNotification.image && modelData.latestNotification.image !== ""
|
||||
|
||||
// Priority 1: Notification image using Quickshell IconImage
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 2
|
||||
radius: 20
|
||||
clip: true
|
||||
visible: parent.hasNotificationImage && centerNotificationImage.status === Image.Ready
|
||||
color: "transparent"
|
||||
|
||||
IconImage {
|
||||
id: centerNotificationImage
|
||||
anchors.fill: parent
|
||||
source: modelData.latestNotification.image || ""
|
||||
}
|
||||
}
|
||||
|
||||
// Priority 2: Material Symbols icon for screenshots without notification images
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "screenshot_monitor"
|
||||
size: 20
|
||||
color: Theme.primaryText
|
||||
visible: parent.isScreenshot && !parent.hasNotificationImage
|
||||
}
|
||||
|
||||
// Priority 3: Fallback to first letter for other notifications
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !parent.hasNotificationImage && !parent.isScreenshot
|
||||
text: {
|
||||
const appName = modelData.appName || "?";
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
font.pixelSize: 20
|
||||
font.weight: Font.Bold
|
||||
color: Theme.primaryText
|
||||
visible: !parent.hasNotificationImage && (!modelData.latestNotification.appIcon || modelData.latestNotification.appIcon === "")
|
||||
text: {
|
||||
const appName = modelData.appName || "?";
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
font.pixelSize: 20
|
||||
font.weight: Font.Bold
|
||||
color: Theme.primaryText
|
||||
}
|
||||
|
||||
}
|
||||
@@ -828,35 +791,32 @@ PanelWindow {
|
||||
|
||||
readonly property bool hasNotificationImage: modelData.image && modelData.image !== ""
|
||||
|
||||
// Priority 1: Notification image using Quickshell IconImage
|
||||
Rectangle {
|
||||
IconImage {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
radius: 14
|
||||
clip: true
|
||||
visible: parent.hasNotificationImage && centerIndividualNotificationImage.status === Image.Ready
|
||||
color: "transparent"
|
||||
|
||||
IconImage {
|
||||
id: centerIndividualNotificationImage
|
||||
anchors.fill: parent
|
||||
source: modelData.image || ""
|
||||
source: {
|
||||
// Priority 1: Use notification image if available
|
||||
if (parent.hasNotificationImage) {
|
||||
return modelData.cleanImage;
|
||||
}
|
||||
|
||||
// Priority 2: Use appIcon - handle URLs directly, use iconPath for icon names
|
||||
if (modelData.appIcon) {
|
||||
const appIcon = modelData.appIcon;
|
||||
if (appIcon.startsWith("file://") || appIcon.startsWith("http://") || appIcon.startsWith("https://")) {
|
||||
return appIcon;
|
||||
}
|
||||
return Quickshell.iconPath(appIcon, "");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
visible: status === Image.Ready
|
||||
}
|
||||
|
||||
// Priority 2: Material Symbols icon for screenshots without notification images
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "screenshot_monitor"
|
||||
size: 12
|
||||
color: Theme.primaryText
|
||||
visible: modelData.isScreenshot && !parent.hasNotificationImage
|
||||
}
|
||||
|
||||
// Priority 3: Fallback text
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !parent.hasNotificationImage && !modelData.isScreenshot
|
||||
visible: !parent.hasNotificationImage && (!modelData.appIcon || modelData.appIcon === "")
|
||||
text: {
|
||||
const appName = modelData.appName || "?";
|
||||
return appName.charAt(0).toUpperCase();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -79,7 +79,7 @@ PanelWindow {
|
||||
Scale {
|
||||
id: scaleTransform
|
||||
|
||||
origin.x: parent.width * 0.85 // Scale from top-right
|
||||
origin.x: dropdownContent.width * 0.85 // Scale from top-right
|
||||
origin.y: 0
|
||||
xScale: processListDropdown.isVisible ? 1 : 0.95
|
||||
yScale: processListDropdown.isVisible ? 1 : 0.8
|
||||
|
||||
@@ -239,6 +239,7 @@ PanelWindow {
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppSearchService
|
||||
function onReadyChanged() {
|
||||
if (AppSearchService.ready) {
|
||||
var allCategories = AppSearchService.getAllCategories().filter((cat) => {
|
||||
@@ -254,11 +255,10 @@ PanelWindow {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
target: DesktopEntries
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppSearchService
|
||||
function onApplicationsChanged() {
|
||||
console.log("SpotlightLauncher: DesktopEntries.applicationsChanged signal received");
|
||||
// Update categories when applications change
|
||||
@@ -278,8 +278,6 @@ PanelWindow {
|
||||
console.log("SpotlightLauncher: AppSearchService not ready, skipping update");
|
||||
}
|
||||
}
|
||||
|
||||
target: DesktopEntries
|
||||
}
|
||||
|
||||
// Dimmed overlay background
|
||||
|
||||
@@ -134,7 +134,7 @@ PanelWindow {
|
||||
|
||||
LauncherButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
isActive: launcher.isVisible
|
||||
isActive: appLauncher.isVisible
|
||||
onClicked: {
|
||||
appLauncher.toggle();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user