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
pull/4/head
Michail Vourlakos 6 years ago
parent e2cf406ade
commit 50c5303b54

@ -275,10 +275,7 @@
<choice name="Global"/> <choice name="Global"/>
</choices> </choices>
<default>0</default> <default>0</default>
</entry> </entry>
<entry name="smartLaunchersEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="showWindowActions" type="Bool"> <entry name="showWindowActions" type="Bool">
<default>false</default> <default>false</default>
</entry> </entry>
@ -302,7 +299,13 @@
<entry name="titleTooltips" type="Bool"> <entry name="titleTooltips" type="Bool">
<default>true</default> <default>true</default>
</entry> </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> <default>true</default>
</entry> </entry>
<entry name="mouseWheelActions" type="Bool"> <entry name="mouseWheelActions" type="Bool">

@ -135,7 +135,6 @@ DragDrop.DropArea {
property bool dockIsShownCompletely: !(dockIsHidden || inSlidingIn || inSlidingOut) && !root.editMode property bool dockIsShownCompletely: !(dockIsHidden || inSlidingIn || inSlidingOut) && !root.editMode
property bool immutable: plasmoid.immutable 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 inFullJustify: (plasmoid.configuration.panelPosition === Latte.Types.Justify) && (plasmoid.configuration.maxLength===100)
property bool inSlidingIn: visibilityManager ? visibilityManager.inSlidingIn : false property bool inSlidingIn: visibilityManager ? visibilityManager.inSlidingIn : false
property bool inSlidingOut: visibilityManager ? visibilityManager.inSlidingOut : false property bool inSlidingOut: visibilityManager ? visibilityManager.inSlidingOut : false
@ -393,13 +392,17 @@ DragDrop.DropArea {
!plasmoid.configuration.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition !plasmoid.configuration.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition
property bool showGlow: plasmoid.configuration.showGlow || plasmoid.configuration.glowOption!==Latte.Types.GlowNone property bool showGlow: plasmoid.configuration.showGlow || plasmoid.configuration.glowOption!==Latte.Types.GlowNone
property bool glow3D: plasmoid.configuration.glow3D 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 showWindowActions: plasmoid.configuration.showWindowActions
property bool showWindowsOnlyFromLaunchers: plasmoid.configuration.showWindowsOnlyFromLaunchers property bool showWindowsOnlyFromLaunchers: plasmoid.configuration.showWindowsOnlyFromLaunchers
property bool showOnlyCurrentScreen: plasmoid.configuration.showOnlyCurrentScreen property bool showOnlyCurrentScreen: plasmoid.configuration.showOnlyCurrentScreen
property bool showOnlyCurrentDesktop: plasmoid.configuration.showOnlyCurrentDesktop property bool showOnlyCurrentDesktop: plasmoid.configuration.showOnlyCurrentDesktop
property bool showOnlyCurrentActivity: plasmoid.configuration.showOnlyCurrentActivity property bool showOnlyCurrentActivity: plasmoid.configuration.showOnlyCurrentActivity
property bool smartLaunchersEnabled: plasmoid.configuration.smartLaunchersEnabled
property bool threeColorsWindows: plasmoid.configuration.threeColorsWindows property bool threeColorsWindows: plasmoid.configuration.threeColorsWindows
property bool titleTooltips: plasmoid.configuration.titleTooltips property bool titleTooltips: plasmoid.configuration.titleTooltips
property bool unifiedGlobalShortcuts: plasmoid.configuration.unifiedGlobalShortcuts property bool unifiedGlobalShortcuts: plasmoid.configuration.unifiedGlobalShortcuts

@ -53,9 +53,6 @@
</choices> </choices>
<default>0</default> <default>0</default>
</entry> </entry>
<entry name="smartLaunchersEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="showBarLine" type="Bool"> <entry name="showBarLine" type="Bool">
<default>true</default> <default>true</default>
</entry> </entry>
@ -107,7 +104,13 @@
<entry name="showWindowActions" type="Bool"> <entry name="showWindowActions" type="Bool">
<default>false</default> <default>false</default>
</entry> </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> <default>true</default>
</entry> </entry>
<entry name="previewsDelay" type="Int"> <entry name="previewsDelay" type="Int">

@ -39,7 +39,7 @@ Item {
property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked
property alias cfg_highlightWindows: highlightWindowsChk.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_showToolTips: showPreviewsChk.checked
property alias cfg_showWindowActions: windowActionsChk.checked property alias cfg_showWindowActions: windowActionsChk.checked
@ -79,7 +79,7 @@ Item {
} }
CheckBox { CheckBox {
id: smartLaunchersChk id: showInfoBadgeChk
Layout.fillWidth: true Layout.fillWidth: true
text: i18n("Show progress information for tasks") text: i18n("Show progress information for tasks")
} }

@ -153,12 +153,15 @@ Item {
property bool groupTasksByDefault: latteView ? latteView.groupTasksByDefault: true property bool groupTasksByDefault: latteView ? latteView.groupTasksByDefault: true
property bool highlightWindows: latteView ? latteView.hoverAction === Latte.Types.HighlightWindows || latteView.hoverAction === Latte.Types.PreviewAndHighlightWindows : property bool highlightWindows: latteView ? latteView.hoverAction === Latte.Types.HighlightWindows || latteView.hoverAction === Latte.Types.PreviewAndHighlightWindows :
plasmoid.configuration.highlightWindows plasmoid.configuration.highlightWindows
property bool indicateAudioStreams: latteView ? latteView.indicateAudioStreams : plasmoid.configuration.indicateAudioStreams
property bool mouseWheelActions: latteView ? latteView.mouseWheelActions : true property bool mouseWheelActions: latteView ? latteView.mouseWheelActions : true
property bool reverseLinesPosition: latteView ? latteView.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition property bool reverseLinesPosition: latteView ? latteView.reverseLinesPosition : plasmoid.configuration.reverseLinesPosition
property bool dotsOnActive: latteView ? latteView.dotsOnActive : plasmoid.configuration.dotsOnActive property bool dotsOnActive: latteView ? latteView.dotsOnActive : plasmoid.configuration.dotsOnActive
property bool showGlow: latteView ? latteView.showGlow : plasmoid.configuration.showGlow property bool showGlow: latteView ? latteView.showGlow : plasmoid.configuration.showGlow
property bool glow3D: latteView ? latteView.glow3D : false 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 showOnlyCurrentScreen: latteView ? latteView.showOnlyCurrentScreen : plasmoid.configuration.showOnlyCurrentScreen
property bool showOnlyCurrentDesktop: latteView ? latteView.showOnlyCurrentDesktop : plasmoid.configuration.showOnlyCurrentDesktop property bool showOnlyCurrentDesktop: latteView ? latteView.showOnlyCurrentDesktop : plasmoid.configuration.showOnlyCurrentDesktop
property bool showOnlyCurrentActivity: latteView ? latteView.showOnlyCurrentActivity : plasmoid.configuration.showOnlyCurrentActivity property bool showOnlyCurrentActivity: latteView ? latteView.showOnlyCurrentActivity : plasmoid.configuration.showOnlyCurrentActivity
@ -166,7 +169,7 @@ Item {
plasmoid.configuration.showToolTips plasmoid.configuration.showToolTips
property bool showWindowActions: latteView ? latteView.showWindowActions : plasmoid.configuration.showWindowActions property bool showWindowActions: latteView ? latteView.showWindowActions : plasmoid.configuration.showWindowActions
property bool showWindowsOnlyFromLaunchers: latteView ? latteView.showWindowsOnlyFromLaunchers : false 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 threeColorsWindows: latteView ? latteView.threeColorsWindows : plasmoid.configuration.threeColorsWindows
property bool titleTooltips: latteView ? latteView.titleTooltips : false property bool titleTooltips: latteView ? latteView.titleTooltips : false
property alias windowPreviewIsShown: windowsPreviewDlg.visible property alias windowPreviewIsShown: windowsPreviewDlg.visible
@ -923,7 +926,7 @@ Item {
Loader { Loader {
id: pulseAudio id: pulseAudio
source: "PulseAudio.qml" source: "PulseAudio.qml"
active: root.indicateAudioStreams active: root.showAudioBadge
} }
ParabolicManager{ ParabolicManager{

@ -61,7 +61,7 @@ Item{
property int shadowSize : root.appShadowSize 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 readonly property variant iconDecoration: decoration
property QtObject buffers: null property QtObject buffers: null
property QtObject smartLauncherItem: null property QtObject smartLauncherItem: null
@ -287,14 +287,15 @@ Item{
active: opacityN > 0 active: opacityN > 0
asynchronous: true 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 property bool showInfo: (root.showInfoBadge && taskIcon.smartLauncherItem && !taskItem.isSeparator
&& (taskIcon.smartLauncherItem.countVisible || taskIcon.smartLauncherItem.progressVisible && (taskIcon.smartLauncherItem.countVisible || taskItem.badgeIndicator > 0))
|| taskItem.badgeIndicator > 0))
property bool showAudio: taskItem.hasAudioStream && taskItem.playingAudio && property bool showProgress: root.showProgressBadge && taskIcon.smartLauncherItem && !taskItem.isSeparator
!taskItem.isSeparator && taskIcon.smartLauncherItem.progressVisible
property bool showAudio: root.showAudioBadge && taskItem.hasAudioStream && taskItem.playingAudio && !taskItem.isSeparator
Behavior on opacityN { Behavior on opacityN {
NumberAnimation { duration: root.durationTime*2*units.longDuration } NumberAnimation { duration: root.durationTime*2*units.longDuration }
@ -325,7 +326,7 @@ Item{
width: Math.max(infoBadge.contentWidth, parent.width / 2) width: Math.max(infoBadge.contentWidth, parent.width / 2)
height: parent.height / 2 height: parent.height / 2
radius: parent.height radius: parent.height
visible: badgesLoader.showProgress visible: badgesLoader.showInfo || badgesLoader.showProgress
//! Removes any remainings from the icon around the roundness at the corner //! Removes any remainings from the icon around the roundness at the corner
Rectangle{ Rectangle{
@ -428,7 +429,7 @@ Item{
id: infoBadge id: infoBadge
anchors.fill:parent anchors.fill:parent
opacity: badgesLoader.opacityN opacity: badgesLoader.opacityN
visible: badgesLoader.showProgress visible: badgesLoader.showInfo || badgesLoader.showProgress
} }
AudioStream{ AudioStream{

@ -61,17 +61,26 @@ Item {
border.color: root.minimizedDotColor border.color: root.minimizedDotColor
minimumWidth: 0.8 * parent.height minimumWidth: 0.8 * parent.height
height: 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 fullCircle: true
showNumber: true showNumber: true
textWithBackgroundColor: ( (taskItem.badgeIndicator > 0) /*textWithBackgroundColor: ( (taskItem.badgeIndicator > 0)
|| (taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible) ) || (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible) )
&& proportion>0 && proportion>0*/
textWithBackgroundColor: false
proportion: { proportion: {
if (taskItem.badgeIndicator > 0 || if (taskItem.badgeIndicator > 0 ||
(taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible)) { (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible)) {
return 100; return 100;
} }

@ -188,7 +188,7 @@ MouseArea{
////// Audio streams ////// ////// Audio streams //////
property Item audioStreamOverlay property Item audioStreamOverlay
property var audioStreams: [] 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) { readonly property bool playingAudio: hasAudioStream && audioStreams.some(function (item) {
return !item.corked return !item.corked
}) })
@ -1387,7 +1387,7 @@ MouseArea{
//trying to fix #440, showing the audio icon indicator to irrelevant tasks //trying to fix #440, showing the audio icon indicator to irrelevant tasks
//after dragging an existent task with audio //after dragging an existent task with audio
onDragSourceChanged: taskItem.updateAudioStreams() onDragSourceChanged: taskItem.updateAudioStreams()
onIndicateAudioStreamsChanged: taskItem.updateAudioStreams() onShowAudioBadgeChanged: taskItem.updateAudioStreams()
} }
Connections { Connections {

@ -70,46 +70,67 @@ PlasmaComponents.Page {
} }
PlasmaComponents.CheckBox { PlasmaComponents.CheckBox {
id: audioIndicatorChk id: dotsOnActive
Layout.leftMargin: units.smallSpacing * 2 Layout.leftMargin: units.smallSpacing * 2
text: i18n("Indicator for audio streams") text: i18n("Show an extra dot for grouped windows when active")
checked: plasmoid.configuration.indicateAudioStreams checked: plasmoid.configuration.dotsOnActive
tooltip: i18n("Audio indicator from which the user can mute/unmute an app") tooltip: i18n("Grouped windows show both a line and a dot when \none of them is active and the Line Active Indicator \nis enabled")
visible: dialog.highLevel visible: dialog.highLevel
enabled: plasmoid.configuration.activeIndicatorType === Latte.Types.LineIndicator
onClicked: { onClicked: {
plasmoid.configuration.indicateAudioStreams = checked plasmoid.configuration.dotsOnActive = checked
} }
} }
}
//! 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 { PlasmaComponents.CheckBox {
id: smartLaunchersChk
Layout.leftMargin: units.smallSpacing * 2 Layout.leftMargin: units.smallSpacing * 2
text: i18n("Progress information for tasks") text: i18n("Unread messages from tasks")
checked: plasmoid.configuration.smartLaunchersEnabled checked: plasmoid.configuration.showInfoBadge
tooltip: i18n("Show a beautiful progress animation e.g. when copying \nfiles with Dolphin") tooltip: i18n("Show unread messages or information from tasks")
onClicked: { onClicked: {
plasmoid.configuration.smartLaunchersEnabled = checked plasmoid.configuration.showInfoBadge = checked
} }
} }
PlasmaComponents.CheckBox { PlasmaComponents.CheckBox {
id: dotsOnActive
Layout.leftMargin: units.smallSpacing * 2 Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show an extra dot for grouped windows when active") text: i18n("Progress information for tasks")
checked: plasmoid.configuration.dotsOnActive checked: plasmoid.configuration.showProgressBadge
tooltip: i18n("Grouped windows show both a line and a dot when \none of them is active and the Line Active Indicator \nis enabled") tooltip: i18n("Show a progress animation for tasks e.g. when copying files with Dolphin")
visible: dialog.highLevel
enabled: plasmoid.configuration.activeIndicatorType === Latte.Types.LineIndicator
onClicked: { onClicked: {
plasmoid.configuration.dotsOnActive = checked 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: Tasks Appearance //! END: Badges
//! BEGIN: Tasks Interaction //! BEGIN: Tasks Interaction
ColumnLayout { ColumnLayout {

Loading…
Cancel
Save