mirror of
https://gitgud.io/wackyideas/aerothemeplasma.git
synced 2024-08-15 00:43:43 +00:00
Polish SevenTasks tooltip instances
This commit is contained in:
parent
4457db451a
commit
0f3434122f
3 changed files with 5108 additions and 64 deletions
5050
Plasma/KDE_Plasma_Theme/Seven-Black/solid/widgets/tooltip.svg
Executable file
5050
Plasma/KDE_Plasma_Theme/Seven-Black/solid/widgets/tooltip.svg
Executable file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 142 KiB |
|
@ -20,7 +20,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
|
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
|
||||||
|
|
||||||
ColumnLayout {
|
Item {
|
||||||
id: tooltipInstance
|
id: tooltipInstance
|
||||||
property var submodelIndex
|
property var submodelIndex
|
||||||
property int flatIndex: isGroup && index != undefined ? index : 0
|
property int flatIndex: isGroup && index != undefined ? index : 0
|
||||||
|
@ -59,35 +59,16 @@ ColumnLayout {
|
||||||
readonly property string artist: currentMetadata["xesam:artist"] || ""
|
readonly property string artist: currentMetadata["xesam:artist"] || ""
|
||||||
readonly property string albumArt: currentMetadata["mpris:artUrl"] || ""
|
readonly property string albumArt: currentMetadata["mpris:artUrl"] || ""
|
||||||
|
|
||||||
spacing: isWin ? PlasmaCore.Units.smallSpacing * 2 : 0
|
width: columnLayout.width
|
||||||
|
height: columnLayout.height
|
||||||
|
|
||||||
|
// This component tracks the mouse and highlights the tooltip when it's hovered over or clicked on.
|
||||||
// text labels + close button
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: header
|
|
||||||
// match spacing of DefaultToolTip.qml in plasma-framework
|
|
||||||
//spacing: isWin ? PlasmaCore.Units.smallSpacing : 0 //isWin ? PlasmaCore.Units.smallSpacing : PlasmaCore.Units.largeSpacing
|
|
||||||
spacing: 0
|
|
||||||
// This number controls the overall size of the window tooltips
|
|
||||||
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 12
|
|
||||||
Layout.minimumWidth: isWin ? Layout.maximumWidth : 0
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
// match margins of DefaultToolTip.qml in plasma-framework
|
|
||||||
Layout.margins: isWin ? 0 : PlasmaCore.Units.smallSpacing / 2
|
|
||||||
// There's no PlasmaComponents3 version
|
|
||||||
|
|
||||||
// This component tracks the mouse and highlights the tooltip when it's hovered over or clicked on.
|
|
||||||
ToolTipWindowMouseArea {
|
ToolTipWindowMouseArea {
|
||||||
id: hoverHandler
|
id: hoverHandler
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
height: {
|
anchors.fill: parent;
|
||||||
if(playerControls.visible)
|
anchors.margins: PlasmaCore.Units.smallSpacing / 2
|
||||||
return tooltipInstance.height - parent.height;
|
anchors.bottomMargin: PlasmaCore.Units.smallSpacing / 2 + (playerControls.visible ? playerControls.height : 0)
|
||||||
else
|
|
||||||
return tooltipInstance.height;
|
|
||||||
}
|
|
||||||
width: header.width
|
|
||||||
rootTask: parentTask
|
rootTask: parentTask
|
||||||
modelIndex: submodelIndex
|
modelIndex: submodelIndex
|
||||||
winId: thumbnailSourceItem.winId
|
winId: thumbnailSourceItem.winId
|
||||||
|
@ -105,10 +86,7 @@ ColumnLayout {
|
||||||
right: parent.right;
|
right: parent.right;
|
||||||
bottom: parent.bottom;
|
bottom: parent.bottom;
|
||||||
|
|
||||||
bottomMargin: PlasmaCore.Units.smallSpacing + ((playerControls.visible) ? -header.height : 0);
|
bottomMargin: -(playerControls.visible ? playerControls.height : 0);
|
||||||
leftMargin: PlasmaCore.Units.smallSpacing
|
|
||||||
rightMargin: PlasmaCore.Units.smallSpacing
|
|
||||||
topMargin: PlasmaCore.Units.smallSpacing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The currently active window has a blue tinted version of the same texture.
|
// The currently active window has a blue tinted version of the same texture.
|
||||||
|
@ -122,6 +100,25 @@ ColumnLayout {
|
||||||
opacity: isWin ? (hoverHandler.containsPress ? 1.0 : ( (hoverHandler.opacityHover || closeButton.hovered) ? ((activeWindow) ? 1.0 : 0.7) : (activeWindow ? 0.7 : 0) )) : 0;
|
opacity: isWin ? (hoverHandler.containsPress ? 1.0 : ( (hoverHandler.opacityHover || closeButton.hovered) ? ((activeWindow) ? 1.0 : 0.7) : (activeWindow ? 0.7 : 0) )) : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
|
||||||
|
id: columnLayout
|
||||||
|
spacing: isWin ? PlasmaCore.Units.smallSpacing * 2 : 0
|
||||||
|
// text labels + close button
|
||||||
|
RowLayout {
|
||||||
|
id: header
|
||||||
|
// match spacing of DefaultToolTip.qml in plasma-framework
|
||||||
|
//spacing: isWin ? PlasmaCore.Units.smallSpacing : 0 //isWin ? PlasmaCore.Units.smallSpacing : PlasmaCore.Units.largeSpacing
|
||||||
|
spacing: 0
|
||||||
|
// This number controls the overall size of the window tooltips
|
||||||
|
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 12
|
||||||
|
Layout.minimumWidth: isWin ? Layout.maximumWidth : 0
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
// match margins of DefaultToolTip.qml in plasma-framework
|
||||||
|
Layout.margins: isWin ? 0 : PlasmaCore.Units.smallSpacing / 2
|
||||||
|
// There's no PlasmaComponents3 version
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// The icon in the corner of the tooltip.
|
// The icon in the corner of the tooltip.
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
|
@ -466,7 +463,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function generateTitle() {
|
function generateTitle() {
|
||||||
if (!isWin) {
|
if (!isWin) {
|
||||||
return genericName != undefined ? genericName : "";
|
return genericName != undefined ? genericName : "";
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
|
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
|
||||||
|
|
||||||
ColumnLayout {
|
Item {
|
||||||
id: tooltipInstance
|
id: tooltipInstance
|
||||||
property var submodelIndex
|
property var submodelIndex
|
||||||
property int flatIndex: isGroup && index != undefined ? index : 0
|
property int flatIndex: isGroup && index != undefined ? index : 0
|
||||||
|
@ -59,35 +59,16 @@ ColumnLayout {
|
||||||
readonly property string artist: currentMetadata["xesam:artist"] || ""
|
readonly property string artist: currentMetadata["xesam:artist"] || ""
|
||||||
readonly property string albumArt: currentMetadata["mpris:artUrl"] || ""
|
readonly property string albumArt: currentMetadata["mpris:artUrl"] || ""
|
||||||
|
|
||||||
spacing: isWin ? PlasmaCore.Units.smallSpacing * 2 : 0
|
width: columnLayout.width
|
||||||
|
height: columnLayout.height
|
||||||
|
|
||||||
|
// This component tracks the mouse and highlights the tooltip when it's hovered over or clicked on.
|
||||||
// text labels + close button
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: header
|
|
||||||
// match spacing of DefaultToolTip.qml in plasma-framework
|
|
||||||
//spacing: isWin ? PlasmaCore.Units.smallSpacing : 0 //isWin ? PlasmaCore.Units.smallSpacing : PlasmaCore.Units.largeSpacing
|
|
||||||
spacing: 0
|
|
||||||
// This number controls the overall size of the window tooltips
|
|
||||||
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 12
|
|
||||||
Layout.minimumWidth: isWin ? Layout.maximumWidth : 0
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
// match margins of DefaultToolTip.qml in plasma-framework
|
|
||||||
Layout.margins: isWin ? 0 : PlasmaCore.Units.smallSpacing / 2
|
|
||||||
// There's no PlasmaComponents3 version
|
|
||||||
|
|
||||||
// This component tracks the mouse and highlights the tooltip when it's hovered over or clicked on.
|
|
||||||
ToolTipWindowMouseArea {
|
ToolTipWindowMouseArea {
|
||||||
id: hoverHandler
|
id: hoverHandler
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
height: {
|
anchors.fill: parent;
|
||||||
if(playerControls.visible)
|
anchors.margins: PlasmaCore.Units.smallSpacing / 2
|
||||||
return tooltipInstance.height - parent.height;
|
anchors.bottomMargin: PlasmaCore.Units.smallSpacing / 2 + (playerControls.visible ? playerControls.height : 0)
|
||||||
else
|
|
||||||
return tooltipInstance.height;
|
|
||||||
}
|
|
||||||
width: header.width
|
|
||||||
rootTask: parentTask
|
rootTask: parentTask
|
||||||
modelIndex: submodelIndex
|
modelIndex: submodelIndex
|
||||||
winId: thumbnailSourceItem.winId
|
winId: thumbnailSourceItem.winId
|
||||||
|
@ -105,10 +86,7 @@ ColumnLayout {
|
||||||
right: parent.right;
|
right: parent.right;
|
||||||
bottom: parent.bottom;
|
bottom: parent.bottom;
|
||||||
|
|
||||||
bottomMargin: PlasmaCore.Units.smallSpacing + ((playerControls.visible) ? -header.height : 0);
|
bottomMargin: -(playerControls.visible ? playerControls.height : 0);
|
||||||
leftMargin: PlasmaCore.Units.smallSpacing
|
|
||||||
rightMargin: PlasmaCore.Units.smallSpacing
|
|
||||||
topMargin: PlasmaCore.Units.smallSpacing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The currently active window has a blue tinted version of the same texture.
|
// The currently active window has a blue tinted version of the same texture.
|
||||||
|
@ -122,6 +100,25 @@ ColumnLayout {
|
||||||
opacity: isWin ? (hoverHandler.containsPress ? 1.0 : ( (hoverHandler.opacityHover || closeButton.hovered) ? ((activeWindow) ? 1.0 : 0.7) : (activeWindow ? 0.7 : 0) )) : 0;
|
opacity: isWin ? (hoverHandler.containsPress ? 1.0 : ( (hoverHandler.opacityHover || closeButton.hovered) ? ((activeWindow) ? 1.0 : 0.7) : (activeWindow ? 0.7 : 0) )) : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
|
||||||
|
id: columnLayout
|
||||||
|
spacing: isWin ? PlasmaCore.Units.smallSpacing * 2 : 0
|
||||||
|
// text labels + close button
|
||||||
|
RowLayout {
|
||||||
|
id: header
|
||||||
|
// match spacing of DefaultToolTip.qml in plasma-framework
|
||||||
|
//spacing: isWin ? PlasmaCore.Units.smallSpacing : 0 //isWin ? PlasmaCore.Units.smallSpacing : PlasmaCore.Units.largeSpacing
|
||||||
|
spacing: 0
|
||||||
|
// This number controls the overall size of the window tooltips
|
||||||
|
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 12
|
||||||
|
Layout.minimumWidth: isWin ? Layout.maximumWidth : 0
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
// match margins of DefaultToolTip.qml in plasma-framework
|
||||||
|
Layout.margins: isWin ? 0 : PlasmaCore.Units.smallSpacing / 2
|
||||||
|
// There's no PlasmaComponents3 version
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// The icon in the corner of the tooltip.
|
// The icon in the corner of the tooltip.
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
|
@ -466,7 +463,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function generateTitle() {
|
function generateTitle() {
|
||||||
if (!isWin) {
|
if (!isWin) {
|
||||||
return genericName != undefined ? genericName : "";
|
return genericName != undefined ? genericName : "";
|
||||||
|
|
Loading…
Reference in a new issue