From 59df1899485a80667a48068af1049be2cea8498b Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 29 Jan 2021 20:06:08 +0200 Subject: [PATCH] remove all deprecated thin tooltips implementation --- .../contents/ui/abilities/ThinTooltip.qml | 2 +- .../abilities/privates/ThinTooltipPrivate.qml | 4 + .../package/contents/ui/applet/AppletItem.qml | 6 - containment/package/contents/ui/main.qml | 154 ------------------ plasmoid/package/contents/code/tools.js | 1 - plasmoid/package/contents/ui/main.qml | 1 - 6 files changed, 5 insertions(+), 163 deletions(-) diff --git a/containment/package/contents/ui/abilities/ThinTooltip.qml b/containment/package/contents/ui/abilities/ThinTooltip.qml index b5bdf4a01..d48012642 100644 --- a/containment/package/contents/ui/abilities/ThinTooltip.qml +++ b/containment/package/contents/ui/abilities/ThinTooltip.qml @@ -27,5 +27,5 @@ import "./privates" as Ability Ability.ThinTooltipPrivate { isEnabled: plasmoid.configuration.titleTooltips - showIsBlocked: showIsBlockedFromApplet || (view && view.contextMenuIsShown) + showIsBlocked: !myView.isShownFully || showIsBlockedFromApplet || (view && view.contextMenuIsShown) } diff --git a/containment/package/contents/ui/abilities/privates/ThinTooltipPrivate.qml b/containment/package/contents/ui/abilities/privates/ThinTooltipPrivate.qml index bea4dbbfc..6e7b3e60a 100644 --- a/containment/package/contents/ui/abilities/privates/ThinTooltipPrivate.qml +++ b/containment/package/contents/ui/abilities/privates/ThinTooltipPrivate.qml @@ -49,6 +49,10 @@ AbilityHost.ThinTooltip { for (var i=0; i=0; --i){ @@ -965,131 +936,6 @@ Item { } //END functions - /////BEGIN: Title Tooltip/////////// - PlasmaCore.Dialog{ - id: titleTooltipDialog - - type: PlasmaCore.Dialog.Tooltip - flags: Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus | Qt.ToolTip - - location: plasmoid.location - mainItem: RowLayout{ - Layout.fillWidth: true - Layout.fillHeight: true - PlasmaComponents.Label{ - id:titleLbl - Layout.leftMargin: 4 - Layout.rightMargin: 4 - Layout.topMargin: 2 - Layout.bottomMargin: 2 - text: titleTooltipDialog.title - } - } - - visible: false - - property string title: "" - - property bool activeItemHovered: false - property Item activeItem: null - property Item activeItemTooltipParent: null - property string activeItemText: "" - - - Component.onCompleted: { - parabolic.sglClearZoom.connect(titleTooltipDialog.hide); - } - - Component.onDestruction: { - parabolic.sglClearZoom.disconnect(titleTooltipDialog.hide); - } - - function hide(debug){ - if (!root.titleTooltips) - return; - - activeItemHovered = false; - hideTitleTooltipTimer.start(); - } - - function show(taskItem, text){ - if (!root.titleTooltips || (latteApplet && latteApplet.contextMenu)){ - return; - } - - activeItemHovered = true; - - if (activeItem !== taskItem) { - activeItem = taskItem; - activeItemTooltipParent = taskItem.tooltipVisualParent; - activeItemText = text; - } - - if (root.myView.isShownFully) { - showTitleTooltipTimer.start(); - } - - } - - function update() { - activeItemHovered = true - title = activeItemText; - visualParent = activeItemTooltipParent; - if (latteApplet && latteApplet.windowPreviewIsShown) { - latteApplet.hidePreview(); - } - - visible = true; - } - } - - Timer { - id: showTitleTooltipTimer - interval: 100 - onTriggered: { - if (latteView && latteView.visibility && latteView.visibility.containsMouse) { - titleTooltipDialog.update(); - } - - if (titleTooltipDialog.visible) { - titleTooltipCheckerToNotShowTimer.start(); - } - - if (debug.timersEnabled) { - console.log("containment timer: showTitleTooltipTimer called..."); - } - } - } - - Timer { - id: hideTitleTooltipTimer - interval: 200 - onTriggered: { - if (!titleTooltipDialog.activeItemHovered) { - titleTooltipDialog.visible = false; - } - - if (debug.timersEnabled) { - console.log("containment timer: hideTitleTooltipTimer called..."); - } - - } - } - - //! Timer to fix #811, rare cases that both a window preview and context menu are - //! shown - Timer { - id: titleTooltipCheckerToNotShowTimer - interval: 250 - - onTriggered: { - if (titleTooltipDialog.visible && latteApplet && (latteApplet.contextMenu || latteApplet.windowPreviewIsShown)) { - titleTooltipDialog.visible = false; - } - } - } - /////END: Title Tooltip/////////// - ///////////////BEGIN components Component { id: appletContainerComponent diff --git a/plasmoid/package/contents/code/tools.js b/plasmoid/package/contents/code/tools.js index 8635c2b36..81f2a6435 100644 --- a/plasmoid/package/contents/code/tools.js +++ b/plasmoid/package/contents/code/tools.js @@ -45,7 +45,6 @@ function activateTask(index, model, modifiers, task) { } else if (task.isGroupParent) { task.activateNextTask(); // if (backend.canPresentWindows()) { - //task.toolTipAreaItem.hideToolTip(); // backend.presentWindows(model.LegacyWinIdList); // } /*} else if (groupDialog.visible) { diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 6d0013c16..00b184821 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -151,7 +151,6 @@ Item { property bool showWindowActions: plasmoid.configuration.showWindowActions && !disableAllWindowsFunctionality property bool showWindowsOnlyFromLaunchers: plasmoid.configuration.showWindowsOnlyFromLaunchers && !disableAllWindowsFunctionality - property bool titleTooltips: latteView ? latteView.titleTooltips : false property alias windowPreviewIsShown: windowsPreviewDlg.visible property int leftClickAction: plasmoid.configuration.leftClickAction