mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-28 03:21:38 +03:00
improve names for globalshortcuts qml calls
This commit is contained in:
parent
aa2b607fb8
commit
fef791d8e1
@ -258,7 +258,7 @@ bool GlobalShortcuts::activatePlasmaTaskManagerEntryAtContainment(const Plasma::
|
|||||||
metaObject->indexOfMethod("activateTaskAtIndex(QVariant)") :
|
metaObject->indexOfMethod("activateTaskAtIndex(QVariant)") :
|
||||||
metaObject->indexOfMethod("newInstanceForTaskAtIndex(QVariant)");
|
metaObject->indexOfMethod("newInstanceForTaskAtIndex(QVariant)");
|
||||||
|
|
||||||
int methodIndex2 = metaObject->indexOfMethod("setShowTasksNumbers(QVariant)");
|
int methodIndex2 = metaObject->indexOfMethod("setShowTaskShortcutBadges(QVariant)");
|
||||||
|
|
||||||
if (methodIndex == -1 || (methodIndex2 == -1 && meta.pluginId() == "org.kde.latte.plasmoid")) {
|
if (methodIndex == -1 || (methodIndex2 == -1 && meta.pluginId() == "org.kde.latte.plasmoid")) {
|
||||||
continue;
|
continue;
|
||||||
@ -311,7 +311,7 @@ bool GlobalShortcuts::activateLatteEntryAtContainment(const Latte::View *view, i
|
|||||||
metaObject->indexOfMethod("activateEntryAtIndex(QVariant)") :
|
metaObject->indexOfMethod("activateEntryAtIndex(QVariant)") :
|
||||||
metaObject->indexOfMethod("newInstanceForEntryAtIndex(QVariant)");
|
metaObject->indexOfMethod("newInstanceForEntryAtIndex(QVariant)");
|
||||||
|
|
||||||
int methodIndex2 = metaObject->indexOfMethod("setShowAppletsNumbers(QVariant,QVariant,QVariant)");
|
int methodIndex2 = metaObject->indexOfMethod("setShowAppletShortcutBadges(QVariant,QVariant,QVariant)");
|
||||||
|
|
||||||
if (methodIndex == -1 || (methodIndex2 == -1)) {
|
if (methodIndex == -1 || (methodIndex2 == -1)) {
|
||||||
continue;
|
continue;
|
||||||
@ -449,7 +449,7 @@ bool GlobalShortcuts::isCapableToShowAppletsNumbers(Latte::View *view)
|
|||||||
// is pretty much trial and error.
|
// is pretty much trial and error.
|
||||||
|
|
||||||
// Also, "var" arguments are treated as QVariant in QMetaObject
|
// Also, "var" arguments are treated as QVariant in QMetaObject
|
||||||
int methodIndex = metaObject->indexOfMethod("setShowAppletsNumbers(QVariant,QVariant,QVariant)");
|
int methodIndex = metaObject->indexOfMethod("setShowAppletShortcutBadges(QVariant,QVariant,QVariant)");
|
||||||
|
|
||||||
if (methodIndex == -1) {
|
if (methodIndex == -1) {
|
||||||
continue;
|
continue;
|
||||||
@ -497,7 +497,7 @@ void GlobalShortcuts::showViews()
|
|||||||
// is pretty much trial and error.
|
// is pretty much trial and error.
|
||||||
|
|
||||||
// Also, "var" arguments are treated as QVariant in QMetaObject
|
// Also, "var" arguments are treated as QVariant in QMetaObject
|
||||||
int methodIndex = metaObject->indexOfMethod("setShowAppletsNumbers(QVariant,QVariant,QVariant)");
|
int methodIndex = metaObject->indexOfMethod("setShowAppletShortcutBadges(QVariant,QVariant,QVariant)");
|
||||||
|
|
||||||
if (methodIndex == -1) {
|
if (methodIndex == -1) {
|
||||||
continue;
|
continue;
|
||||||
@ -538,7 +538,7 @@ void GlobalShortcuts::showViews()
|
|||||||
// is pretty much trial and error.
|
// is pretty much trial and error.
|
||||||
|
|
||||||
// Also, "var" arguments are treated as QVariant in QMetaObject
|
// Also, "var" arguments are treated as QVariant in QMetaObject
|
||||||
int methodIndex = metaObject->indexOfMethod("setShowAppletsNumbers(QVariant,QVariant,QVariant)");
|
int methodIndex = metaObject->indexOfMethod("setShowAppletShortcutBadges(QVariant,QVariant,QVariant)");
|
||||||
|
|
||||||
if (methodIndex == -1) {
|
if (methodIndex == -1) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -397,8 +397,8 @@ Item {
|
|||||||
|
|
||||||
function pseudoIndexBelongsToLatteApplet(index) {
|
function pseudoIndexBelongsToLatteApplet(index) {
|
||||||
if (root.latteApplet) {
|
if (root.latteApplet) {
|
||||||
var lastTaskIndex = root.latteApplet.tasksNumbersBase + root.latteApplet.parabolicManager.countRealTasks;
|
var lastTaskIndex = root.latteApplet.tasksBaseIndex + root.latteApplet.parabolicManager.countRealTasks;
|
||||||
return (index>root.latteApplet.tasksNumbersBase && index<=lastTaskIndex);
|
return (index>root.latteApplet.tasksBaseIndex && index<=lastTaskIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -377,7 +377,7 @@ Item {
|
|||||||
|
|
||||||
onSignalActivateEntryAtIndex: {
|
onSignalActivateEntryAtIndex: {
|
||||||
if (parabolicManager.pseudoIndexBelongsToLatteApplet(entryIndex) && appletItem.isLattePlasmoid) {
|
if (parabolicManager.pseudoIndexBelongsToLatteApplet(entryIndex) && appletItem.isLattePlasmoid) {
|
||||||
latteApplet.activateTaskAtIndex(entryIndex - latteApplet.tasksNumbersBase);
|
latteApplet.activateTaskAtIndex(entryIndex - latteApplet.tasksBaseIndex);
|
||||||
} else if (root.unifiedGlobalShortcuts && (entryIndex === parabolicManager.pseudoAppletIndex(appletItem.index))) {
|
} else if (root.unifiedGlobalShortcuts && (entryIndex === parabolicManager.pseudoAppletIndex(appletItem.index))) {
|
||||||
latteView.toggleAppletExpanded(applet.id);
|
latteView.toggleAppletExpanded(applet.id);
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ Item {
|
|||||||
|
|
||||||
onSignalNewInstanceForEntryAtIndex: {
|
onSignalNewInstanceForEntryAtIndex: {
|
||||||
if (parabolicManager.pseudoIndexBelongsToLatteApplet(entryIndex) && appletItem.isLattePlasmoid) {
|
if (parabolicManager.pseudoIndexBelongsToLatteApplet(entryIndex) && appletItem.isLattePlasmoid) {
|
||||||
latteApplet.newInstanceForTaskAtIndex(entryIndex - latteApplet.tasksNumbersBase);
|
latteApplet.newInstanceForTaskAtIndex(entryIndex - latteApplet.tasksBaseIndex);
|
||||||
} else if (root.unifiedGlobalShortcuts && (entryIndex === parabolicManager.pseudoAppletIndex(appletItem.index))) {
|
} else if (root.unifiedGlobalShortcuts && (entryIndex === parabolicManager.pseudoAppletIndex(appletItem.index))) {
|
||||||
latteView.toggleAppletExpanded(applet.id);
|
latteView.toggleAppletExpanded(applet.id);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ Loader{
|
|||||||
id: appletNumberLoader
|
id: appletNumberLoader
|
||||||
|
|
||||||
active: appletItem.canShowAppletNumberBadge &&
|
active: appletItem.canShowAppletNumberBadge &&
|
||||||
(root.showAppletsNumbers || (root.showMetaBadge && applet.id===applicationLauncherId))
|
(root.showAppletShortcutBadges || (root.showMetaBadge && applet.id===applicationLauncherId))
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
visible: badgeString!==""
|
visible: badgeString!==""
|
||||||
@ -47,11 +47,11 @@ Loader{
|
|||||||
property:"badgeString"
|
property:"badgeString"
|
||||||
value: {
|
value: {
|
||||||
//! don't change value on hiding/releasing
|
//! don't change value on hiding/releasing
|
||||||
if (!root.showMetaBadge && !root.showAppletsNumbers) {
|
if (!root.showMetaBadge && !root.showAppletShortcutBadges) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root.showAppletsNumbers) {
|
if (root.showAppletShortcutBadges) {
|
||||||
var plasmaShortcut = universalSettings.appletShortcutBadge(applet.id);
|
var plasmaShortcut = universalSettings.appletShortcutBadge(applet.id);
|
||||||
|
|
||||||
if (plasmaShortcut !== "") {
|
if (plasmaShortcut !== "") {
|
||||||
|
@ -98,7 +98,7 @@ DragDrop.DropArea {
|
|||||||
&& Latte.WindowSystem.compositingActive
|
&& Latte.WindowSystem.compositingActive
|
||||||
&& !root.editMode
|
&& !root.editMode
|
||||||
&& (latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowTouching || hasExpandedApplet
|
&& (latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowTouching || hasExpandedApplet
|
||||||
|| showAppletsNumbers || showMetaBadge))
|
|| showAppletShortcutBadges || showMetaBadge))
|
||||||
|| !Latte.WindowSystem.compositingActive
|
|| !Latte.WindowSystem.compositingActive
|
||||||
|
|
||||||
property bool forceTransparentPanel: root.backgroundOnlyOnMaximized
|
property bool forceTransparentPanel: root.backgroundOnlyOnMaximized
|
||||||
@ -149,7 +149,7 @@ DragDrop.DropArea {
|
|||||||
property bool normalState : false
|
property bool normalState : false
|
||||||
property bool onlyAddingStarup: true //is used for the initialization phase in startup where there aren't removals, this variable provides a way to grow icon size
|
property bool onlyAddingStarup: true //is used for the initialization phase in startup where there aren't removals, this variable provides a way to grow icon size
|
||||||
property bool shrinkThickMargins: plasmoid.configuration.shrinkThickMargins
|
property bool shrinkThickMargins: plasmoid.configuration.shrinkThickMargins
|
||||||
property bool showAppletsNumbers: false
|
property bool showAppletShortcutBadges: false
|
||||||
property bool showMetaBadge: false
|
property bool showMetaBadge: false
|
||||||
property int applicationLauncherId: -1
|
property int applicationLauncherId: -1
|
||||||
property bool solidStylePanel: Latte.WindowSystem.compositingActive ? plasmoid.configuration.solidPanel : true
|
property bool solidStylePanel: Latte.WindowSystem.compositingActive ? plasmoid.configuration.solidPanel : true
|
||||||
@ -1179,14 +1179,14 @@ DragDrop.DropArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! this is called from globalshortcuts c++ side
|
//! this is called from globalshortcuts c++ side
|
||||||
function setShowAppletsNumbers(showNumbers, showMeta, applicationLauncher){
|
function setShowAppletShortcutBadges(showBadges, showMeta, applicationLauncher){
|
||||||
if (latteApplet) {
|
if (latteApplet) {
|
||||||
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
|
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
|
||||||
latteApplet.setTasksNumbersBase(base - 1);
|
latteApplet.setTasksBaseIndex(base - 1);
|
||||||
latteApplet.setShowTasksNumbers(showNumbers);
|
latteApplet.setShowTaskShortcutBadges(showBadges);
|
||||||
}
|
}
|
||||||
|
|
||||||
showAppletsNumbers = showNumbers;
|
showAppletShortcutBadges = showBadges;
|
||||||
showMetaBadge = showMeta;
|
showMetaBadge = showMeta;
|
||||||
applicationLauncherId = applicationLauncher;
|
applicationLauncherId = applicationLauncher;
|
||||||
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
|
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
|
||||||
@ -1200,7 +1200,7 @@ DragDrop.DropArea {
|
|||||||
|
|
||||||
if (latteApplet) {
|
if (latteApplet) {
|
||||||
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
|
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
|
||||||
latteApplet.setTasksNumbersBase(base - 1);
|
latteApplet.setTasksBaseIndex(base - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
|
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
|
||||||
@ -1215,7 +1215,7 @@ DragDrop.DropArea {
|
|||||||
|
|
||||||
if (latteApplet) {
|
if (latteApplet) {
|
||||||
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
|
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
|
||||||
latteApplet.setTasksNumbersBase(base - 1);
|
latteApplet.setTasksBaseIndex(base - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
|
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
|
||||||
|
@ -354,7 +354,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pseudoIndex + root.tasksNumbersBase;
|
return pseudoIndex + root.tasksBaseIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! first available task index found after consequent internal separators or hidden tasks in the start
|
//! first available task index found after consequent internal separators or hidden tasks in the start
|
||||||
|
@ -71,8 +71,8 @@ Item {
|
|||||||
property bool initializationStep: false //true
|
property bool initializationStep: false //true
|
||||||
property bool isHovered: false
|
property bool isHovered: false
|
||||||
property bool showBarLine: plasmoid.configuration.showBarLine
|
property bool showBarLine: plasmoid.configuration.showBarLine
|
||||||
property bool showTasksNumbers: false
|
property bool showTaskShortcutBadges: false
|
||||||
property int tasksNumbersBase: 0
|
property int tasksBaseIndex: 0
|
||||||
property bool useThemePanel: plasmoid.configuration.useThemePanel
|
property bool useThemePanel: plasmoid.configuration.useThemePanel
|
||||||
property bool taskInAnimation: noTasksInAnimation > 0 ? true : false
|
property bool taskInAnimation: noTasksInAnimation > 0 ? true : false
|
||||||
property bool transparentPanel: plasmoid.configuration.transparentPanel
|
property bool transparentPanel: plasmoid.configuration.transparentPanel
|
||||||
@ -1800,14 +1800,14 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! show/hide tasks numbered badges e.g. from global shortcuts
|
//! show/hide tasks numbered badges e.g. from global shortcuts
|
||||||
function setShowTasksNumbers(showNumbers){
|
function setShowTaskShortcutBadges(showBadges){
|
||||||
showTasksNumbers = showNumbers;
|
showTaskShortcutBadges = showBadges;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! setup the tasks first index based on the fact that this is a plasmoid
|
//! setup the tasks first index based on the fact that this is a plasmoid
|
||||||
//! and applets could exist before it
|
//! and applets could exist before it
|
||||||
function setTasksNumbersBase(base){
|
function setTasksBaseIndex(base){
|
||||||
tasksNumbersBase = base;
|
tasksBaseIndex = base;
|
||||||
}
|
}
|
||||||
|
|
||||||
function previewContainsMouse() {
|
function previewContainsMouse() {
|
||||||
|
@ -571,19 +571,19 @@ Item{
|
|||||||
|
|
||||||
/// START Task Number
|
/// START Task Number
|
||||||
Loader{
|
Loader{
|
||||||
id: taskNumberLoader
|
id: taskShorcutBadge
|
||||||
anchors.fill: iconImageBuffer
|
anchors.fill: iconImageBuffer
|
||||||
active: root.showTasksNumbers && !taskItem.isSeparator && fixedIndex>=0 && fixedIndex<20
|
active: root.showTaskShortcutBadges && !taskItem.isSeparator && fixedIndex>=0 && fixedIndex<20
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
visible: badgeString !== ""
|
visible: badgeString !== ""
|
||||||
|
|
||||||
property int fixedIndex:-1
|
property int fixedIndex:-1
|
||||||
property string badgeString: (taskNumberLoader.fixedIndex>=1 && taskNumberLoader.fixedIndex<20 && root.badgesForActivate.length===19) ?
|
property string badgeString: (taskShorcutBadge.fixedIndex>=1 && taskShorcutBadge.fixedIndex<20 && root.badgesForActivate.length===19) ?
|
||||||
root.badgesForActivate[taskNumberLoader.fixedIndex-1] : ""
|
root.badgesForActivate[taskShorcutBadge.fixedIndex-1] : ""
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
onShowTasksNumbersChanged: taskNumberLoader.fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
|
onShowTaskShortcutBadgesChanged: taskShorcutBadge.fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
|
Component.onCompleted: fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
|
||||||
@ -610,7 +610,7 @@ Item{
|
|||||||
height: Math.max(24, 0.4 * (wrapper.mScale * root.iconSize))
|
height: Math.max(24, 0.4 * (wrapper.mScale * root.iconSize))
|
||||||
|
|
||||||
border.color: root.minimizedDotColor
|
border.color: root.minimizedDotColor
|
||||||
textValue: taskNumberLoader.badgeString
|
textValue: taskShorcutBadge.badgeString
|
||||||
|
|
||||||
showNumber: false
|
showNumber: false
|
||||||
showText: true
|
showText: true
|
||||||
@ -620,7 +620,7 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//END of task number (showTasksNumbers)
|
//END of TaskShortcutBadge
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualAddItem{
|
VisualAddItem{
|
||||||
|
Loading…
Reference in New Issue
Block a user