mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Add click actions
This commit is contained in:
10
taskbar.js
10
taskbar.js
@@ -544,12 +544,10 @@ var taskbar = Utils.defineClass({
|
||||
appIcon._draggable.connect('drag-begin',
|
||||
Lang.bind(this, function() {
|
||||
appIcon.actor.opacity = 50;
|
||||
this._disableWindowPreview();
|
||||
}));
|
||||
appIcon._draggable.connect('drag-end',
|
||||
Lang.bind(this, function() {
|
||||
appIcon.actor.opacity = 255;
|
||||
this._enableWindowPreview();
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -607,14 +605,6 @@ var taskbar = Utils.defineClass({
|
||||
return item;
|
||||
},
|
||||
|
||||
_enableWindowPreview: function() {
|
||||
this.previewMenu.enable();
|
||||
},
|
||||
|
||||
_disableWindowPreview: function() {
|
||||
this.previewMenu.disable();
|
||||
},
|
||||
|
||||
// Return an array with the "proper" appIcons currently in the taskbar
|
||||
_getAppIcons: function() {
|
||||
// Only consider children which are "proper" icons and which are not
|
||||
|
||||
@@ -258,12 +258,12 @@ var PreviewMenu = Utils.defineClass({
|
||||
|
||||
switch (event.get_scroll_direction()) {
|
||||
case Clutter.ScrollDirection.UP:
|
||||
delta = -increment;
|
||||
delta = -increment;
|
||||
break;
|
||||
case Clutter.ScrollDirection.SMOOTH:
|
||||
let [dx, dy] = event.get_scroll_delta();
|
||||
delta = dy * increment;
|
||||
delta += dx * increment;
|
||||
let [dx, dy] = event.get_scroll_delta();
|
||||
delta = dy * increment;
|
||||
delta += dx * increment;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -447,6 +447,7 @@ var Preview = Utils.defineClass({
|
||||
|
||||
closeButton.connect('clicked', () => this._onCloseBtnClick());
|
||||
this.connect('notify::hover', () => this._onHoverChanged());
|
||||
this.connect('button-release-event', (actor, e) => this._onButtonReleaseEvent(e));
|
||||
|
||||
this.add_actor(this._previewBin);
|
||||
this.add_child(this._closeButtonBin);
|
||||
@@ -486,6 +487,22 @@ var Preview = Utils.defineClass({
|
||||
this.window.delete(global.get_current_time());
|
||||
},
|
||||
|
||||
_onButtonReleaseEvent: function(e) {
|
||||
switch (e.get_button()) {
|
||||
case 1: // Left click
|
||||
Main.activateWindow(this.window);
|
||||
this._previewMenu.close();
|
||||
break;
|
||||
case 2: // Middle click
|
||||
if (this._previewMenu._dtpSettings.get_boolean('preview-middle-click-close')) {
|
||||
this._onCloseBtnClick();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return Clutter.EVENT_STOP;
|
||||
},
|
||||
|
||||
_addClone: function(newClone, animateSize) {
|
||||
let currentClones = this._previewBin.get_children();
|
||||
let newCloneOpts = getTweenOpts({ opacity: 255 });
|
||||
|
||||
Reference in New Issue
Block a user