mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Assign overlay numbers to apps instead of windows when ungrouped
This commit is contained in:
@@ -701,7 +701,7 @@ var taskbarAppIcon = new Lang.Class({
|
||||
this.icon.actor.get_theme_node().get_border_image());
|
||||
},
|
||||
|
||||
activate: function(button) {
|
||||
activate: function(button, handleAsGrouped) {
|
||||
if (this.windowPreview)
|
||||
this.windowPreview.requestCloseMenu();
|
||||
|
||||
@@ -746,7 +746,7 @@ var taskbarAppIcon = new Lang.Class({
|
||||
|
||||
// We customize the action only when the application is already running
|
||||
if (appIsRunning && !this.isLauncher) {
|
||||
if (this.window) {
|
||||
if (this.window && !handleAsGrouped) {
|
||||
//ungrouped applications behaviors
|
||||
switch (buttonAction) {
|
||||
case 'RAISE': case 'CYCLE': case 'CYCLE-MIN': case 'MINIMIZE':
|
||||
|
||||
19
overview.js
19
overview.js
@@ -146,21 +146,20 @@ var dtpOverview = new Lang.Class({
|
||||
|
||||
// Hotkeys
|
||||
_activateApp: function(appIndex) {
|
||||
let children = this.taskbar._box.get_children().filter(function(actor) {
|
||||
return actor.child &&
|
||||
actor.child._delegate &&
|
||||
actor.child._delegate.app;
|
||||
let seenApps = {};
|
||||
let apps = [];
|
||||
|
||||
this.taskbar._getAppIcons().forEach(function(appIcon) {
|
||||
if (!seenApps[appIcon.app]) {
|
||||
seenApps[appIcon.app] = 1;
|
||||
apps.push(appIcon);
|
||||
}
|
||||
});
|
||||
|
||||
// Apps currently in the taskbar
|
||||
let apps = children.map(function(actor) {
|
||||
return actor.child._delegate;
|
||||
});
|
||||
|
||||
// Activate with button = 1, i.e. same as left click
|
||||
let button = 1;
|
||||
if (appIndex < apps.length)
|
||||
apps[appIndex].activate(button);
|
||||
apps[appIndex].activate(button, true);
|
||||
},
|
||||
|
||||
_optionalHotKeys: function() {
|
||||
|
||||
21
taskbar.js
21
taskbar.js
@@ -882,21 +882,22 @@ var taskbar = new Lang.Class({
|
||||
},
|
||||
|
||||
_updateNumberOverlay: function() {
|
||||
let appIcons = this._getAppIcons();
|
||||
let counter = 1;
|
||||
appIcons.forEach(function(icon) {
|
||||
if (counter < 10){
|
||||
icon.setNumberOverlay(counter);
|
||||
let seenApps = {};
|
||||
let counter = 0;
|
||||
|
||||
this._getAppIcons().forEach(function(icon) {
|
||||
if (!seenApps[icon.app]) {
|
||||
seenApps[icon.app] = 1;
|
||||
counter++;
|
||||
}
|
||||
else if (counter == 10) {
|
||||
icon.setNumberOverlay(0);
|
||||
counter++;
|
||||
}
|
||||
else {
|
||||
|
||||
if (counter <= 10) {
|
||||
icon.setNumberOverlay(counter == 10 ? 0 : counter);
|
||||
} else {
|
||||
// No overlay after 10
|
||||
icon.setNumberOverlay(-1);
|
||||
}
|
||||
|
||||
icon.updateNumberOverlay();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user