1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

improve names for globalshortcuts qml calls

This commit is contained in:
Michail Vourlakos 2019-02-02 18:34:40 +02:00
parent aa2b607fb8
commit fef791d8e1
8 changed files with 34 additions and 34 deletions

View File

@ -258,7 +258,7 @@ bool GlobalShortcuts::activatePlasmaTaskManagerEntryAtContainment(const Plasma::
metaObject->indexOfMethod("activateTaskAtIndex(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")) {
continue;
@ -311,7 +311,7 @@ bool GlobalShortcuts::activateLatteEntryAtContainment(const Latte::View *view, i
metaObject->indexOfMethod("activateEntryAtIndex(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)) {
continue;
@ -449,7 +449,7 @@ bool GlobalShortcuts::isCapableToShowAppletsNumbers(Latte::View *view)
// is pretty much trial and error.
// 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) {
continue;
@ -497,7 +497,7 @@ void GlobalShortcuts::showViews()
// is pretty much trial and error.
// 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) {
continue;
@ -538,7 +538,7 @@ void GlobalShortcuts::showViews()
// is pretty much trial and error.
// 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) {
continue;

View File

@ -397,8 +397,8 @@ Item {
function pseudoIndexBelongsToLatteApplet(index) {
if (root.latteApplet) {
var lastTaskIndex = root.latteApplet.tasksNumbersBase + root.latteApplet.parabolicManager.countRealTasks;
return (index>root.latteApplet.tasksNumbersBase && index<=lastTaskIndex);
var lastTaskIndex = root.latteApplet.tasksBaseIndex + root.latteApplet.parabolicManager.countRealTasks;
return (index>root.latteApplet.tasksBaseIndex && index<=lastTaskIndex);
}
return false;

View File

@ -377,7 +377,7 @@ Item {
onSignalActivateEntryAtIndex: {
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))) {
latteView.toggleAppletExpanded(applet.id);
}
@ -385,7 +385,7 @@ Item {
onSignalNewInstanceForEntryAtIndex: {
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))) {
latteView.toggleAppletExpanded(applet.id);
}

View File

@ -26,7 +26,7 @@ Loader{
id: appletNumberLoader
active: appletItem.canShowAppletNumberBadge &&
(root.showAppletsNumbers || (root.showMetaBadge && applet.id===applicationLauncherId))
(root.showAppletShortcutBadges || (root.showMetaBadge && applet.id===applicationLauncherId))
asynchronous: true
visible: badgeString!==""
@ -47,11 +47,11 @@ Loader{
property:"badgeString"
value: {
//! don't change value on hiding/releasing
if (!root.showMetaBadge && !root.showAppletsNumbers) {
if (!root.showMetaBadge && !root.showAppletShortcutBadges) {
return;
}
if (root.showAppletsNumbers) {
if (root.showAppletShortcutBadges) {
var plasmaShortcut = universalSettings.appletShortcutBadge(applet.id);
if (plasmaShortcut !== "") {

View File

@ -98,7 +98,7 @@ DragDrop.DropArea {
&& Latte.WindowSystem.compositingActive
&& !root.editMode
&& (latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowTouching || hasExpandedApplet
|| showAppletsNumbers || showMetaBadge))
|| showAppletShortcutBadges || showMetaBadge))
|| !Latte.WindowSystem.compositingActive
property bool forceTransparentPanel: root.backgroundOnlyOnMaximized
@ -149,7 +149,7 @@ DragDrop.DropArea {
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 shrinkThickMargins: plasmoid.configuration.shrinkThickMargins
property bool showAppletsNumbers: false
property bool showAppletShortcutBadges: false
property bool showMetaBadge: false
property int applicationLauncherId: -1
property bool solidStylePanel: Latte.WindowSystem.compositingActive ? plasmoid.configuration.solidPanel : true
@ -1179,14 +1179,14 @@ DragDrop.DropArea {
}
//! this is called from globalshortcuts c++ side
function setShowAppletsNumbers(showNumbers, showMeta, applicationLauncher){
function setShowAppletShortcutBadges(showBadges, showMeta, applicationLauncher){
if (latteApplet) {
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
latteApplet.setTasksNumbersBase(base - 1);
latteApplet.setShowTasksNumbers(showNumbers);
latteApplet.setTasksBaseIndex(base - 1);
latteApplet.setShowTaskShortcutBadges(showBadges);
}
showAppletsNumbers = showNumbers;
showAppletShortcutBadges = showBadges;
showMetaBadge = showMeta;
applicationLauncherId = applicationLauncher;
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
@ -1200,7 +1200,7 @@ DragDrop.DropArea {
if (latteApplet) {
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
latteApplet.setTasksNumbersBase(base - 1);
latteApplet.setTasksBaseIndex(base - 1);
}
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();
@ -1215,7 +1215,7 @@ DragDrop.DropArea {
if (latteApplet) {
var base = unifiedGlobalShortcuts ? parabolicManager.pseudoAppletIndex(latteAppletPos) : 1;
latteApplet.setTasksNumbersBase(base - 1);
latteApplet.setTasksBaseIndex(base - 1);
}
root.latteApplet.parabolicManager.updateTasksEdgesIndexes();

View File

@ -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

View File

@ -71,8 +71,8 @@ Item {
property bool initializationStep: false //true
property bool isHovered: false
property bool showBarLine: plasmoid.configuration.showBarLine
property bool showTasksNumbers: false
property int tasksNumbersBase: 0
property bool showTaskShortcutBadges: false
property int tasksBaseIndex: 0
property bool useThemePanel: plasmoid.configuration.useThemePanel
property bool taskInAnimation: noTasksInAnimation > 0 ? true : false
property bool transparentPanel: plasmoid.configuration.transparentPanel
@ -1800,14 +1800,14 @@ Item {
}
//! show/hide tasks numbered badges e.g. from global shortcuts
function setShowTasksNumbers(showNumbers){
showTasksNumbers = showNumbers;
function setShowTaskShortcutBadges(showBadges){
showTaskShortcutBadges = showBadges;
}
//! setup the tasks first index based on the fact that this is a plasmoid
//! and applets could exist before it
function setTasksNumbersBase(base){
tasksNumbersBase = base;
function setTasksBaseIndex(base){
tasksBaseIndex = base;
}
function previewContainsMouse() {

View File

@ -571,19 +571,19 @@ Item{
/// START Task Number
Loader{
id: taskNumberLoader
id: taskShorcutBadge
anchors.fill: iconImageBuffer
active: root.showTasksNumbers && !taskItem.isSeparator && fixedIndex>=0 && fixedIndex<20
active: root.showTaskShortcutBadges && !taskItem.isSeparator && fixedIndex>=0 && fixedIndex<20
asynchronous: true
visible: badgeString !== ""
property int fixedIndex:-1
property string badgeString: (taskNumberLoader.fixedIndex>=1 && taskNumberLoader.fixedIndex<20 && root.badgesForActivate.length===19) ?
root.badgesForActivate[taskNumberLoader.fixedIndex-1] : ""
property string badgeString: (taskShorcutBadge.fixedIndex>=1 && taskShorcutBadge.fixedIndex<20 && root.badgesForActivate.length===19) ?
root.badgesForActivate[taskShorcutBadge.fixedIndex-1] : ""
Connections {
target: root
onShowTasksNumbersChanged: taskNumberLoader.fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
onShowTaskShortcutBadgesChanged: taskShorcutBadge.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))
border.color: root.minimizedDotColor
textValue: taskNumberLoader.badgeString
textValue: taskShorcutBadge.badgeString
showNumber: false
showText: true
@ -620,7 +620,7 @@ Item{
}
}
}
//END of task number (showTasksNumbers)
//END of TaskShortcutBadge
}
VisualAddItem{