mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-26 23:21:37 +03:00
create separate Badges section for Tasks
--the user can now choose what badges prefers for Tasks. The current supported are Information/ Progress/Audio BUG: 400539
This commit is contained in:
parent
e2cf406ade
commit
50c5303b54
@ -275,10 +275,7 @@
|
||||
<choice name="Global"/>
|
||||
</choices>
|
||||
<default>0</default>
|
||||
</entry>
|
||||
<entry name="smartLaunchersEnabled" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
</entry>
|
||||
<entry name="showWindowActions" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
@ -302,7 +299,13 @@
|
||||
<entry name="titleTooltips" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="indicateAudioStreams" type="Bool">
|
||||
<entry name="showInfoBadge" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="showProgressBadge" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="showAudioBadge" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="mouseWheelActions" type="Bool">
|
||||
|
@ -135,7 +135,6 @@ DragDrop.DropArea {
|
||||
|
||||
property bool dockIsShownCompletely: !(dockIsHidden || inSlidingIn || inSlidingOut) && !root.editMode
|
||||
property bool immutable: plasmoid.immutable
|
||||
property bool indicateAudioStreams: plasmoid.configuration.indicateAudioStreams
|
||||
property bool inFullJustify: (plasmoid.configuration.panelPosition === Latte.Types.Justify) && (plasmoid.configuration.maxLength===100)
|
||||
property bool inSlidingIn: visibilityManager ? visibilityManager.inSlidingIn : false
|
||||
property bool inSlidingOut: visibilityManager ? visibilityManager.inSlidingOut : false
|
||||
@ -393,13 +392,17 @@ DragDrop.DropArea {
|
||||
!plasmoid.configuration.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition
|
||||
property bool showGlow: plasmoid.configuration.showGlow || plasmoid.configuration.glowOption!==Latte.Types.GlowNone
|
||||
property bool glow3D: plasmoid.configuration.glow3D
|
||||
|
||||
property bool showInfoBadge: plasmoid.configuration.showInfoBadge
|
||||
property bool showProgressBadge: plasmoid.configuration.showProgressBadge
|
||||
property bool showAudioBadge: plasmoid.configuration.showAudioBadge
|
||||
|
||||
property bool showWindowActions: plasmoid.configuration.showWindowActions
|
||||
property bool showWindowsOnlyFromLaunchers: plasmoid.configuration.showWindowsOnlyFromLaunchers
|
||||
property bool showOnlyCurrentScreen: plasmoid.configuration.showOnlyCurrentScreen
|
||||
property bool showOnlyCurrentDesktop: plasmoid.configuration.showOnlyCurrentDesktop
|
||||
property bool showOnlyCurrentActivity: plasmoid.configuration.showOnlyCurrentActivity
|
||||
|
||||
property bool smartLaunchersEnabled: plasmoid.configuration.smartLaunchersEnabled
|
||||
property bool threeColorsWindows: plasmoid.configuration.threeColorsWindows
|
||||
property bool titleTooltips: plasmoid.configuration.titleTooltips
|
||||
property bool unifiedGlobalShortcuts: plasmoid.configuration.unifiedGlobalShortcuts
|
||||
|
@ -53,9 +53,6 @@
|
||||
</choices>
|
||||
<default>0</default>
|
||||
</entry>
|
||||
<entry name="smartLaunchersEnabled" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="showBarLine" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
@ -107,7 +104,13 @@
|
||||
<entry name="showWindowActions" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="indicateAudioStreams" type="Bool">
|
||||
<entry name="showInfoBadge" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="showProgressBadge" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="showAudioBadge" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="previewsDelay" type="Int">
|
||||
|
@ -39,7 +39,7 @@ Item {
|
||||
property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked
|
||||
|
||||
property alias cfg_highlightWindows: highlightWindowsChk.checked
|
||||
property alias cfg_smartLaunchersEnabled: smartLaunchersChk.checked
|
||||
property alias cfg_showInfoBadge: showInfoBadgeChk.checked
|
||||
property alias cfg_showToolTips: showPreviewsChk.checked
|
||||
property alias cfg_showWindowActions: windowActionsChk.checked
|
||||
|
||||
@ -79,7 +79,7 @@ Item {
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: smartLaunchersChk
|
||||
id: showInfoBadgeChk
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Show progress information for tasks")
|
||||
}
|
||||
|
@ -153,12 +153,15 @@ Item {
|
||||
property bool groupTasksByDefault: latteView ? latteView.groupTasksByDefault: true
|
||||
property bool highlightWindows: latteView ? latteView.hoverAction === Latte.Types.HighlightWindows || latteView.hoverAction === Latte.Types.PreviewAndHighlightWindows :
|
||||
plasmoid.configuration.highlightWindows
|
||||
property bool indicateAudioStreams: latteView ? latteView.indicateAudioStreams : plasmoid.configuration.indicateAudioStreams
|
||||
property bool mouseWheelActions: latteView ? latteView.mouseWheelActions : true
|
||||
property bool reverseLinesPosition: latteView ? latteView.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition
|
||||
property bool dotsOnActive: latteView ? latteView.dotsOnActive : plasmoid.configuration.dotsOnActive
|
||||
property bool showGlow: latteView ? latteView.showGlow : plasmoid.configuration.showGlow
|
||||
property bool glow3D: latteView ? latteView.glow3D : false
|
||||
|
||||
property bool showInfoBadge: latteView ? latteView.showInfoBadge : plasmoid.configuration.showInfoBadge
|
||||
property bool showProgressBadge: latteView ? latteView.showProgressBadge : plasmoid.configuration.showInfoBadge
|
||||
property bool showAudioBadge: latteView ? latteView.showAudioBadge : plasmoid.configuration.showAudioBadge
|
||||
property bool showOnlyCurrentScreen: latteView ? latteView.showOnlyCurrentScreen : plasmoid.configuration.showOnlyCurrentScreen
|
||||
property bool showOnlyCurrentDesktop: latteView ? latteView.showOnlyCurrentDesktop : plasmoid.configuration.showOnlyCurrentDesktop
|
||||
property bool showOnlyCurrentActivity: latteView ? latteView.showOnlyCurrentActivity : plasmoid.configuration.showOnlyCurrentActivity
|
||||
@ -166,7 +169,7 @@ Item {
|
||||
plasmoid.configuration.showToolTips
|
||||
property bool showWindowActions: latteView ? latteView.showWindowActions : plasmoid.configuration.showWindowActions
|
||||
property bool showWindowsOnlyFromLaunchers: latteView ? latteView.showWindowsOnlyFromLaunchers : false
|
||||
property bool smartLaunchersEnabled: latteView ? latteView.smartLaunchersEnabled : plasmoid.configuration.smartLaunchersEnabled
|
||||
|
||||
property bool threeColorsWindows: latteView ? latteView.threeColorsWindows : plasmoid.configuration.threeColorsWindows
|
||||
property bool titleTooltips: latteView ? latteView.titleTooltips : false
|
||||
property alias windowPreviewIsShown: windowsPreviewDlg.visible
|
||||
@ -923,7 +926,7 @@ Item {
|
||||
Loader {
|
||||
id: pulseAudio
|
||||
source: "PulseAudio.qml"
|
||||
active: root.indicateAudioStreams
|
||||
active: root.showAudioBadge
|
||||
}
|
||||
|
||||
ParabolicManager{
|
||||
|
@ -61,7 +61,7 @@ Item{
|
||||
|
||||
property int shadowSize : root.appShadowSize
|
||||
|
||||
readonly property bool smartLauncherEnabled: ((taskItem.isStartup === false) && (root.smartLaunchersEnabled))
|
||||
readonly property bool smartLauncherEnabled: ((taskItem.isStartup === false) && (root.showInfoBadge || root.showProgressBadge))
|
||||
readonly property variant iconDecoration: decoration
|
||||
property QtObject buffers: null
|
||||
property QtObject smartLauncherItem: null
|
||||
@ -287,14 +287,15 @@ Item{
|
||||
active: opacityN > 0
|
||||
asynchronous: true
|
||||
|
||||
property real opacityN: showProgress || showAudio ? 1 : 0
|
||||
property real opacityN: showInfo || showProgress || showAudio ? 1 : 0
|
||||
|
||||
property bool showProgress: (taskIcon.smartLauncherEnabled && taskIcon.smartLauncherItem && !taskItem.isSeparator
|
||||
&& (taskIcon.smartLauncherItem.countVisible || taskIcon.smartLauncherItem.progressVisible
|
||||
|| taskItem.badgeIndicator > 0))
|
||||
property bool showInfo: (root.showInfoBadge && taskIcon.smartLauncherItem && !taskItem.isSeparator
|
||||
&& (taskIcon.smartLauncherItem.countVisible || taskItem.badgeIndicator > 0))
|
||||
|
||||
property bool showAudio: taskItem.hasAudioStream && taskItem.playingAudio &&
|
||||
!taskItem.isSeparator
|
||||
property bool showProgress: root.showProgressBadge && taskIcon.smartLauncherItem && !taskItem.isSeparator
|
||||
&& taskIcon.smartLauncherItem.progressVisible
|
||||
|
||||
property bool showAudio: root.showAudioBadge && taskItem.hasAudioStream && taskItem.playingAudio && !taskItem.isSeparator
|
||||
|
||||
Behavior on opacityN {
|
||||
NumberAnimation { duration: root.durationTime*2*units.longDuration }
|
||||
@ -325,7 +326,7 @@ Item{
|
||||
width: Math.max(infoBadge.contentWidth, parent.width / 2)
|
||||
height: parent.height / 2
|
||||
radius: parent.height
|
||||
visible: badgesLoader.showProgress
|
||||
visible: badgesLoader.showInfo || badgesLoader.showProgress
|
||||
|
||||
//! Removes any remainings from the icon around the roundness at the corner
|
||||
Rectangle{
|
||||
@ -428,7 +429,7 @@ Item{
|
||||
id: infoBadge
|
||||
anchors.fill:parent
|
||||
opacity: badgesLoader.opacityN
|
||||
visible: badgesLoader.showProgress
|
||||
visible: badgesLoader.showInfo || badgesLoader.showProgress
|
||||
}
|
||||
|
||||
AudioStream{
|
||||
|
@ -61,17 +61,26 @@ Item {
|
||||
border.color: root.minimizedDotColor
|
||||
minimumWidth: 0.8 * parent.height
|
||||
height: 0.8 * parent.height
|
||||
numberValue: taskItem.badgeIndicator > 0 ? taskItem.badgeIndicator : taskIcon.smartLauncherItem.count
|
||||
numberValue: {
|
||||
if (taskItem.badgeIndicator > 0) {
|
||||
return taskItem.badgeIndicator;
|
||||
} else if (taskIcon.smartLauncherItem) {
|
||||
return taskIcon.smartLauncherItem.count;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
fullCircle: true
|
||||
showNumber: true
|
||||
|
||||
textWithBackgroundColor: ( (taskItem.badgeIndicator > 0)
|
||||
|| (taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible) )
|
||||
&& proportion>0
|
||||
/*textWithBackgroundColor: ( (taskItem.badgeIndicator > 0)
|
||||
|| (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible) )
|
||||
&& proportion>0*/
|
||||
textWithBackgroundColor: false
|
||||
|
||||
proportion: {
|
||||
if (taskItem.badgeIndicator > 0 ||
|
||||
(taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible)) {
|
||||
(taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible)) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ MouseArea{
|
||||
////// Audio streams //////
|
||||
property Item audioStreamOverlay
|
||||
property var audioStreams: []
|
||||
readonly property bool hasAudioStream: root.indicateAudioStreams && audioStreams.length > 0 && !isLauncher
|
||||
readonly property bool hasAudioStream: root.showAudioBadge && audioStreams.length > 0 && !isLauncher
|
||||
readonly property bool playingAudio: hasAudioStream && audioStreams.some(function (item) {
|
||||
return !item.corked
|
||||
})
|
||||
@ -1387,7 +1387,7 @@ MouseArea{
|
||||
//trying to fix #440, showing the audio icon indicator to irrelevant tasks
|
||||
//after dragging an existent task with audio
|
||||
onDragSourceChanged: taskItem.updateAudioStreams()
|
||||
onIndicateAudioStreamsChanged: taskItem.updateAudioStreams()
|
||||
onShowAudioBadgeChanged: taskItem.updateAudioStreams()
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
@ -69,31 +69,6 @@ PlasmaComponents.Page {
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: audioIndicatorChk
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Indicator for audio streams")
|
||||
checked: plasmoid.configuration.indicateAudioStreams
|
||||
tooltip: i18n("Audio indicator from which the user can mute/unmute an app")
|
||||
visible: dialog.highLevel
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.indicateAudioStreams = checked
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: smartLaunchersChk
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Progress information for tasks")
|
||||
checked: plasmoid.configuration.smartLaunchersEnabled
|
||||
tooltip: i18n("Show a beautiful progress animation e.g. when copying \nfiles with Dolphin")
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.smartLaunchersEnabled = checked
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: dotsOnActive
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
@ -111,6 +86,52 @@ PlasmaComponents.Page {
|
||||
}
|
||||
//! END: Tasks Appearance
|
||||
|
||||
//! BEGIN: Badges
|
||||
ColumnLayout {
|
||||
spacing: units.smallSpacing
|
||||
Layout.topMargin: units.smallSpacing
|
||||
Layout.rightMargin: units.smallSpacing * 2
|
||||
visible: dialog.highLevel
|
||||
|
||||
LatteExtraControls.Header {
|
||||
text: i18n("Badges")
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Unread messages from tasks")
|
||||
checked: plasmoid.configuration.showInfoBadge
|
||||
tooltip: i18n("Show unread messages or information from tasks")
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.showInfoBadge = checked
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Progress information for tasks")
|
||||
checked: plasmoid.configuration.showProgressBadge
|
||||
tooltip: i18n("Show a progress animation for tasks e.g. when copying files with Dolphin")
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.showProgressBadge = checked
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Audio playing from tasks")
|
||||
checked: plasmoid.configuration.showAudioBadge
|
||||
tooltip: i18n("Show audio playing from tasks, the user is able to mute/unmute or change the volume")
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.showAudioBadge = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
//! END: Badges
|
||||
|
||||
//! BEGIN: Tasks Interaction
|
||||
ColumnLayout {
|
||||
spacing: units.smallSpacing
|
||||
|
Loading…
Reference in New Issue
Block a user