This commit is contained in:
Ly-sec
2025-11-18 20:41:20 +01:00
6 changed files with 62 additions and 16 deletions
+52 -4
View File
@@ -40,6 +40,50 @@ Rectangle {
readonly property bool onlySameOutput: (widgetSettings.onlySameOutput !== undefined) ? widgetSettings.onlySameOutput : widgetMetadata.onlySameOutput
readonly property bool onlyActiveWorkspaces: (widgetSettings.onlyActiveWorkspaces !== undefined) ? widgetSettings.onlyActiveWorkspaces : widgetMetadata.onlyActiveWorkspaces
// Context menu state
property var selectedWindow: null
property string selectedAppName: ""
NPopupContextMenu {
id: contextMenu
model: {
var items = [];
if (selectedWindow) {
items.push({
"label": I18n.tr("context-menu.activate-app", {
"app": selectedAppName
}),
"action": "activate",
"icon": "focus"
});
items.push({
"label": I18n.tr("context-menu.close-app", {
"app": selectedAppName
}),
"action": "close",
"icon": "x"
});
}
items.push({
"label": I18n.tr("context-menu.widget-settings"),
"action": "widget-settings",
"icon": "settings"
});
return items;
}
onTriggered: action => {
if (action === "activate" && selectedWindow) {
CompositorService.focusWindow(selectedWindow);
} else if (action === "close" && selectedWindow) {
CompositorService.closeWindow(selectedWindow);
} else if (action === "widget-settings") {
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
}
selectedWindow = null;
selectedAppName = "";
}
}
function updateHasWindow() {
try {
var total = CompositorService.windows.count || 0;
@@ -170,10 +214,14 @@ Rectangle {
Logger.e("Taskbar", "Failed to activate toplevel: " + error);
}
} else if (mouse.button === Qt.RightButton) {
try {
CompositorService.closeWindow(taskbarItem.modelData);
} catch (error) {
Logger.e("Taskbar", "Failed to close toplevel: " + error);
TooltipService.hide();
root.selectedWindow = taskbarItem.modelData;
root.selectedAppName = CompositorService.getCleanAppName(taskbarItem.modelData.appId, taskbarItem.modelData.title);
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
if (popupMenuWindow) {
const pos = BarService.getContextMenuPosition(taskbarItem, contextMenu.implicitWidth, contextMenu.implicitHeight);
contextMenu.openAtItem(taskbarItem, pos.x, pos.y);
popupMenuWindow.showContextMenu(contextMenu);
}
}
}
-4
View File
@@ -241,10 +241,6 @@ SmartPanel {
}
}
}
Item {
Layout.fillHeight: true
}
}
}
}
@@ -238,10 +238,6 @@ SmartPanel {
}
}
}
Item {
Layout.fillHeight: true
}
}
}
}
@@ -650,6 +650,7 @@ SmartPanel {
Loader {
id: weatherLoader
active: Settings.data.location.weatherEnabled && Settings.data.location.showCalendarWeather
visible: active
Layout.fillWidth: true
sourceComponent: WeatherCard {
+6 -4
View File
@@ -17,6 +17,8 @@ T.ScrollView {
property bool preventHorizontalScroll: horizontalPolicy === ScrollBar.AlwaysOff
property int boundsBehavior: Flickable.StopAtBounds
property int flickableDirection: Flickable.VerticalFlick
readonly property bool verticalScrollable: contentItem.contentHeight > contentItem.height
readonly property bool horizontalScrollable: contentItem.contentWidth > contentItem.width
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding)
@@ -65,7 +67,7 @@ T.ScrollView {
implicitHeight: 100
radius: root.handleRadius
color: parent.pressed ? root.handlePressedColor : parent.hovered ? root.handleHoverColor : root.handleColor
opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 1.0 : 0.0
opacity: parent.policy === ScrollBar.AlwaysOn ? 1.0 : root.verticalScrollable ? (parent.active ? 1.0 : 0.0) : 0.0
Behavior on opacity {
NumberAnimation {
@@ -84,7 +86,7 @@ T.ScrollView {
implicitWidth: root.handleWidth
implicitHeight: 100
color: root.trackColor
opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 0.3 : 0.0
opacity: parent.policy === ScrollBar.AlwaysOn ? 0.3 : root.verticalScrollable ? (parent.active ? 0.3 : 0.0) : 0.0
radius: root.handleRadius / 2
Behavior on opacity {
@@ -108,7 +110,7 @@ T.ScrollView {
implicitHeight: root.handleWidth
radius: root.handleRadius
color: parent.pressed ? root.handlePressedColor : parent.hovered ? root.handleHoverColor : root.handleColor
opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 1.0 : 0.0
opacity: parent.policy === ScrollBar.AlwaysOn ? 1.0 : root.horizontalScrollable ? (parent.active ? 1.0 : 0.0) : 0.0
Behavior on opacity {
NumberAnimation {
@@ -127,7 +129,7 @@ T.ScrollView {
implicitWidth: 100
implicitHeight: root.handleWidth
color: root.trackColor
opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 0.3 : 0.0
opacity: parent.policy === ScrollBar.AlwaysOn ? 0.3 : root.horizontalScrollable ? (parent.active ? 0.3 : 0.0) : 0.0
radius: root.handleRadius / 2
Behavior on opacity {
+3
View File
@@ -1,4 +1,5 @@
{
quickshell,
alejandra,
statix,
deadnix,
@@ -12,6 +13,8 @@
mkShellNoCC {
#it's faster than mkDerivation / mkShell
packages = [
quickshell
# nix
alejandra # formatter
statix # linter