support title tooltips for tasks

pull/1/head
Michail Vourlakos 8 years ago
parent cc94677817
commit 35b4cc56b5

@ -186,7 +186,6 @@ Item {
property alias tasksCount: tasksModel.count
property alias hoveredIndex: icList.hoveredIndex
property QtObject altSessionAction : latteDock ? latteDock.altSessionAction : null
property QtObject currentLayout : latteDock && latteDock.universalLayoutManager && latteDock.universalLayoutManager.currentLayout ?
latteDock.universalLayoutManager.currentLayout : null
@ -429,7 +428,52 @@ Item {
}
}
/////Winwow previews///////////
/////BEGIN: Title Tooltip///////////
PlasmaCore.Dialog{
id: titleTooltipDlg
type: PlasmaCore.Dialog.Tooltip
flags: Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus | Qt.ToolTip
location: plasmoid.location
mainItem: Item{
width: titleLbl.width
height: titleLbl.height
PlasmaComponents.Label{
id:titleLbl
text: titleTooltipDlg.title
}
}
visible: false
property Item activeItem: null
property string title: ""
Component.onCompleted: {
root.clearZoomSignal.connect(titleTooltipDlg.hide);
}
function hide(debug){
visible = false;
}
function show(taskItem, text){
if (activeItem !== taskItem) {
activeItem = taskItem;
visualParent = taskItem.tooltipVisualParent;
titleTooltipDlg.title = text;
}
if (!visible) {
visible = true;
}
}
}
/////END: Title Tooltip///////////
/////Window previews///////////
ToolTipDelegate2 {
id: toolTipDelegate
@ -1441,6 +1485,10 @@ Item {
}
}
if (titleTooltipDlg.visible) {
titleTooltipDlg.hide();
}
return false;
}

@ -127,6 +127,8 @@ MouseArea{
property string launcherUrl: ""
property string launcherUrlWithIcon: ""
property Item tooltipVisualParent: wrapper.titleTooltipVisualParent
onModelLauncherUrlChanged: {
if (modelLauncherUrl !== "")
launcherUrl = modelLauncherUrl;
@ -536,6 +538,10 @@ MouseArea{
return;
}
titleTooltipDlg.show(mainItemContainer, model.AppName);
if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){
icList.hoveredIndex = index;
if (!inBlockingAnimation) {

@ -66,6 +66,7 @@ Item{
property QtObject buffers: null
property QtObject smartLauncherItem: null
property Item titleTooltipVisualParent: titleTooltipParent
/*Rectangle{
anchors.fill: parent
border.width: 1
@ -105,12 +106,7 @@ Item{
onTempColorChanged: tempColor.a = 0.35;
}
/* Rectangle{
anchors.fill: parent
border.width: 1
border.color: "red"
color: "transparent"
} */
TitleTooltipParent{ id: titleTooltipParent}
// KQuickControlAddons.QIconItem{
Item{

@ -1,3 +1,23 @@
/*
* Copyright 2016 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
@ -79,6 +99,8 @@ Item{
// property int index: mainItemContainer.Positioner.index
property real center: (width + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2
property Item titleTooltipVisualParent: taskIconItem.titleTooltipVisualParent
signal runLauncherAnimation();
/* Rectangle{
@ -126,7 +148,7 @@ Item{
}
}
TaskIconItem{}
TaskIconItem{ id: taskIconItem}
Loader{
id: secondIndicator

@ -0,0 +1,79 @@
/*
* Copyright 2017 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Item{
id: visual
width: root.zoomFactor * root.realSize
height: width
//border.width: 1
//border.color: "green"
//color: "transparent"
states:[
State{
name: "bottom"
when: root.position === PlasmaCore.Types.BottomPositioned
AnchorChanges{
target: visual;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: undefined;
anchors.right: undefined; anchors.left: undefined; anchors.top: undefined; anchors.bottom: parent.bottom;
}
},
State{
name: "top"
when: root.position === PlasmaCore.Types.TopPositioned
AnchorChanges{
target:visual;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: undefined;
anchors.right: undefined; anchors.left: undefined; anchors.top: parent.top; anchors.bottom: undefined;
}
},
State{
name: "left"
when: root.position === PlasmaCore.Types.LeftPositioned
AnchorChanges{
target: visual;
anchors.horizontalCenter: undefined;
anchors.verticalCenter: parent.verticalCenter;
anchors.right: undefined; anchors.left: parent.left; anchors.top: undefined; anchors.bottom: undefined;
}
},
State{
name: "right"
when: root.position === PlasmaCore.Types.RightPositioned
AnchorChanges{
target: visual;
anchors.horizontalCenter: undefined;
anchors.verticalCenter: parent.verticalCenter;
anchors.right: parent.right; anchors.left: undefined; anchors.top: undefined; anchors.bottom: undefined;
}
}
]
}
Loading…
Cancel
Save