1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 17:33:50 +03:00

config option for task title tooltips

This commit is contained in:
Michail Vourlakos 2017-07-26 18:52:11 +03:00
parent 35b4cc56b5
commit 8abc2e517a
6 changed files with 51 additions and 10 deletions

View File

@ -208,6 +208,9 @@
<entry name="showOnlyCurrentActivity" type="Bool">
<default>true</default>
</entry>
<entry name="titleTooltips" type="Bool">
<default>false</default>
</entry>
<entry name="indicateAudioStreams" type="Bool">
<default>true</default>
</entry>

View File

@ -245,6 +245,7 @@ DragDrop.DropArea {
property bool smartLaunchersEnabled: plasmoid.configuration.smartLaunchersEnabled
property bool threeColorsWindows: plasmoid.configuration.threeColorsWindows
property bool titleTooltips: plasmoid.configuration.titleTooltips
readonly property int latteInternalSeparatorPos: latteApplet ? latteApplet.internalSeparatorPos : -1
readonly property bool hasInternalSeparator: latteApplet ? latteApplet.hasInternalSeparator : false

View File

@ -85,6 +85,7 @@ PlasmaComponents.ContextMenu {
openRelative();
windowsPreviewDlg.contextMenu = true;
windowsPreviewDlg.hide();
titleTooltipDlg.hide();
}
function newMenuItem(parent) {

View File

@ -145,6 +145,7 @@ Item {
property bool showWindowActions: latteDock ? latteDock.showWindowActions : plasmoid.configuration.showWindowActions
property bool smartLaunchersEnabled: latteDock ? latteDock.smartLaunchersEnabled : plasmoid.configuration.smartLaunchersEnabled
property bool threeColorsWindows: latteDock ? latteDock.threeColorsWindows : plasmoid.configuration.threeColorsWindows
property bool titleTooltips: latteDock ? latteDock.titleTooltips : false
property int directRenderAnimationTime: latteDock ? latteDock.directRenderAnimationTime : 0
property int dockHoveredIndex : latteDock ? latteDock.hoveredIndex : -1
@ -447,9 +448,13 @@ Item {
visible: false
property Item activeItem: null
property string title: ""
property Item activeItem: null
property Item activeItemTooltipParent: null
property string activeItemText: ""
Component.onCompleted: {
root.clearZoomSignal.connect(titleTooltipDlg.hide);
}
@ -459,16 +464,30 @@ Item {
}
function show(taskItem, text){
if (activeItem !== taskItem) {
activeItem = taskItem;
visualParent = taskItem.tooltipVisualParent;
titleTooltipDlg.title = text;
if (!root.titleTooltips || root.contextMenu){
return;
}
if (!visible) {
visible = true;
if (activeItem !== taskItem) {
activeItem = taskItem;
activeItemTooltipParent = taskItem.tooltipVisualParent;
activeItemText = text;
}
showTitleTooltipTimer.start();
}
function update() {
title = activeItemText;
visualParent = activeItemTooltipParent;
visible = true;
}
}
Timer {
id: showTitleTooltipTimer
interval: 100
onTriggered: titleTooltipDlg.update();
}
/////END: Title Tooltip///////////

View File

@ -538,10 +538,8 @@ MouseArea{
return;
}
titleTooltipDlg.show(mainItemContainer, model.AppName);
if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){
icList.hoveredIndex = index;
if (!inBlockingAnimation) {

View File

@ -114,7 +114,26 @@ PlasmaComponents.Page {
checked: plasmoid.configuration.showToolTips
onClicked: {
plasmoid.configuration.showToolTips = checked
plasmoid.configuration.showToolTips = checked;
// if (checked && titleTooltipsChk.checked) {
// plasmoid.configuration.titleTooltips = false;
// }
}
}
PlasmaComponents.CheckBox {
id: titleTooltipsChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show task name tooltips on hovering")
checked: plasmoid.configuration.titleTooltips
onClicked: {
plasmoid.configuration.titleTooltips = checked;
// if (checked && showPreviewsChk.checked) {
// plasmoid.configuration.showToolTips = false;
// }
}
}