Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b05d27246 | ||
|
|
30ab8c5841 | ||
|
|
23613f32c7 | ||
|
|
002b1b5d07 | ||
|
|
438bfe6b34 | ||
|
|
20094e43c5 | ||
|
|
bbc00e5c3d | ||
|
|
dd4ccca358 | ||
|
|
9a8704203b | ||
|
|
68629ea7a6 | ||
|
|
048e29f3ed | ||
|
|
4c313514ba | ||
|
|
deb70e5d5d | ||
|
|
e8fd6244b2 | ||
|
|
6055ad8866 |
3
COPYING
3
COPYING
@@ -1,8 +1,7 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. <http://fsf.org>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
37
NEWS
37
NEWS
@@ -1,11 +1,34 @@
|
||||
3.1.1 (unreleased)
|
||||
==================
|
||||
3.1.4
|
||||
=====
|
||||
|
||||
* New extensions: drive-menu, places-menu, native-window-placement,
|
||||
systemMonitor
|
||||
* Dock position is configurable
|
||||
* Compatibility with released Shell was broken, API usage
|
||||
was updated
|
||||
* New extension: a menu for changing workspace (workspace-indicator)
|
||||
* systemMonitor: lower the requirement on libgtop
|
||||
* auto-move-windows: open overview when last window on
|
||||
last workspace is closed
|
||||
* dock: implement autohiding, with various configurable
|
||||
effects
|
||||
* alternate-tab: more configurable implementations available
|
||||
* native-window-placement: don't rearrange the windows when
|
||||
the workspace switcher is shown/hidden
|
||||
* update for gnome-shell 3.1.4 API changes
|
||||
|
||||
3.1.3
|
||||
=====
|
||||
|
||||
* New extension: a menu for removable drives (drive-menu
|
||||
* New extensions: GNOME 2 like menus for apps and places
|
||||
(apps-menu, places-menu)
|
||||
* New extension: additional configurability for the window
|
||||
layout in the overview, including a mechanism similar to
|
||||
KDE4 (native-window-placement)
|
||||
* New extension: a message tray indicator for CPU and memory
|
||||
usage (uses libgtop) (systemMonitor)
|
||||
* user-theme: fixed resetting theme
|
||||
* user-theme: support themes installed in /usr/share/themes
|
||||
* alternative-status-menu: ported to gnome-shell master
|
||||
* dock: ported to gnome-shell master
|
||||
* dock: make position configurable (can be left or right)
|
||||
* Updated translations
|
||||
|
||||
3.0.2
|
||||
=====
|
||||
|
||||
15
configure.ac
15
configure.ac
@@ -1,5 +1,5 @@
|
||||
AC_PREREQ(2.63)
|
||||
AC_INIT([gnome-shell-extensions],[3.1.3],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=extensions])
|
||||
AC_INIT([gnome-shell-extensions],[3.1.4],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=extensions])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_AUX_DIR([config])
|
||||
@@ -22,7 +22,7 @@ dnl keep this in alphabetic order
|
||||
dnl by default, install only extensions that do not change completely the shell experience,
|
||||
dnl that don't require GSettings and that don't require external packages for typelibs
|
||||
dnl (so basically only menus, status icons, search providers, overview tabs, message tray sources, etc.)
|
||||
DEFAULT_EXTENSIONS="alternative-status-menu apps-menu dock drive-menu gajim places-menu windowsNavigator"
|
||||
DEFAULT_EXTENSIONS="alternative-status-menu apps-menu dock drive-menu gajim places-menu windowsNavigator workspace-indicator"
|
||||
ALL_EXTENSIONS="$DEFAULT_EXTENSIONS alternate-tab auto-move-windows example native-window-placement systemMonitor user-theme xrandr-indicator"
|
||||
AC_SUBST(ALL_EXTENSIONS, [$ALL_EXTENSIONS])
|
||||
AC_ARG_ENABLE([extensions],
|
||||
@@ -40,7 +40,7 @@ ENABLED_EXTENSIONS=
|
||||
for e in $enable_extensions; do
|
||||
case $e in
|
||||
systemMonitor)
|
||||
PKG_CHECK_MODULES(GTOP, libgtop-2.0 >= 2.28.4,
|
||||
PKG_CHECK_MODULES(GTOP, libgtop-2.0 >= 2.28.3,
|
||||
[ENABLED_EXTENSIONS="$ENABLED_EXTENSIONS $e"],
|
||||
[AC_MSG_WARN([libgtop-2.0 not found, disabling systemMonitor])])
|
||||
;;
|
||||
@@ -50,7 +50,7 @@ for e in $enable_extensions; do
|
||||
[AC_MSG_WARN([gnome-desktop-3.0 not found, disabling xrandr-indicator])])
|
||||
;;
|
||||
dnl keep this in alphabetic order
|
||||
alternate-tab|alternative-status-menu|apps-menu|auto-move-windows|dock|drive-menu|example|gajim|native-window-placement|places-menu|user-theme|windowsNavigator)
|
||||
alternate-tab|alternative-status-menu|apps-menu|auto-move-windows|dock|drive-menu|example|gajim|native-window-placement|places-menu|user-theme|windowsNavigator|workspace-indicator)
|
||||
ENABLED_EXTENSIONS="$ENABLED_EXTENSIONS $e"
|
||||
;;
|
||||
*)
|
||||
@@ -69,13 +69,14 @@ AC_CONFIG_FILES([
|
||||
extensions/dock/Makefile
|
||||
extensions/drive-menu/Makefile
|
||||
extensions/example/Makefile
|
||||
extensions/systemMonitor/Makefile
|
||||
extensions/windowsNavigator/Makefile
|
||||
extensions/gajim/Makefile
|
||||
extensions/native-window-placement/Makefile
|
||||
extensions/places-menu/Makefile
|
||||
extensions/xrandr-indicator/Makefile
|
||||
extensions/systemMonitor/Makefile
|
||||
extensions/user-theme/Makefile
|
||||
extensions/windowsNavigator/Makefile
|
||||
extensions/workspace-indicator/Makefile
|
||||
extensions/xrandr-indicator/Makefile
|
||||
extensions/Makefile
|
||||
Makefile
|
||||
po/Makefile.in
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
EXTENSION_ID = alternate-tab
|
||||
|
||||
include ../../extension.mk
|
||||
|
||||
gschemas_in = org.gnome.shell.extensions.alternate-tab.gschema.xml.in
|
||||
|
||||
@INTLTOOL_XML_NOMERGE_RULE@
|
||||
|
||||
gsettings_SCHEMAS = $(gschemas_in:.xml.in=.xml)
|
||||
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
CLEANFILES += $(gschemas_in:.xml.in=.valid) $(gsettings_SCHEMAS)
|
||||
EXTRA_DIST += $(gschemas_in)
|
||||
|
||||
@@ -1,16 +1,324 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Shell= imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
/* most of the code is borrowed from
|
||||
* > js/ui/altTab.js <
|
||||
* of the gnome-shell source code
|
||||
*/
|
||||
|
||||
const AltTab=imports.ui.altTab;
|
||||
const AltTab = imports.ui.altTab;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Lang = imports.lang;
|
||||
const Main = imports.ui.main;
|
||||
const Mainloop = imports.mainloop;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Tweener = imports.ui.tweener;
|
||||
const WindowManager = imports.ui.windowManager;
|
||||
|
||||
const Gettext = imports.gettext.domain('gnome-shell-extensions');
|
||||
const _ = Gettext.gettext;
|
||||
const N_ = function(e) { return e };
|
||||
|
||||
const POPUP_FADE_TIME = 0.1; // seconds
|
||||
|
||||
const SETTINGS_SCHEMA = 'org.gnome.shell.extensions.alternate-tab';
|
||||
const SETTINGS_BEHAVIOUR_KEY = 'behaviour';
|
||||
const SETTINGS_FIRST_TIME_KEY = 'first-time';
|
||||
|
||||
const MODES = {
|
||||
native: function() {
|
||||
Main.wm._startAppSwitcher();
|
||||
},
|
||||
all_thumbnails: function() {
|
||||
new AltTabPopup2();
|
||||
},
|
||||
workspace_icons: function() {
|
||||
new AltTabPopupW().show();
|
||||
}
|
||||
};
|
||||
|
||||
const MESSAGE = N_("This is the first time you use the Alternate Tab extension. \n\
|
||||
Please choose your preferred behaviour:\n\
|
||||
\n\
|
||||
All & Thumbnails:\n\
|
||||
This mode presents all applications from all workspaces in one selection \n\
|
||||
list. Instead of using the application icon of every window, it uses small \n\
|
||||
thumbnails resembling the window itself. \n\
|
||||
\n\
|
||||
Workspace & Icons:\n\
|
||||
This mode let's you switch between the applications of your current \n\
|
||||
workspace and gives you additionally the option to switch to the last used \n\
|
||||
application of your previous workspace. This is always the last symbol in \n\
|
||||
the list and is segregated by a separator/vertical line if available. \n\
|
||||
Every window is represented by its application icon. \n\
|
||||
\n\
|
||||
Native:\n\
|
||||
This mode is the native GNOME 3 behaviour or in other words: Clicking \n\
|
||||
native switches the Alternate Tab extension off. \n\
|
||||
");
|
||||
|
||||
function AltTabPopupW() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
AltTabPopupW.prototype = {
|
||||
__proto__ : AltTab.AltTabPopup.prototype,
|
||||
|
||||
show : function(backward, switch_group) {
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
let apps = tracker.get_running_apps ('');
|
||||
|
||||
if (!apps.length)
|
||||
return false;
|
||||
|
||||
if (!Main.pushModal(this.actor))
|
||||
return false;
|
||||
this._haveModal = true;
|
||||
|
||||
this.actor.connect('key-press-event', Lang.bind(this, this._keyPressEvent));
|
||||
this.actor.connect('key-release-event', Lang.bind(this, this._keyReleaseEvent));
|
||||
|
||||
this.actor.connect('button-press-event', Lang.bind(this, this._clickedOutside));
|
||||
this.actor.connect('scroll-event', Lang.bind(this, this._onScroll));
|
||||
|
||||
this._appSwitcher = new WindowSwitcher(apps, this);
|
||||
this.actor.add_actor(this._appSwitcher.actor);
|
||||
this._appSwitcher.connect('item-activated', Lang.bind(this, this._appActivated));
|
||||
this._appSwitcher.connect('item-entered', Lang.bind(this, this._appEntered));
|
||||
|
||||
this._appIcons = this._appSwitcher.icons;
|
||||
|
||||
// Make the initial selection
|
||||
if (switch_group) {
|
||||
if (backward) {
|
||||
this._select(0, this._appIcons[0].cachedWindows.length - 1);
|
||||
} else {
|
||||
if (this._appIcons[0].cachedWindows.length > 1)
|
||||
this._select(0, 1);
|
||||
else
|
||||
this._select(0, 0);
|
||||
}
|
||||
} else if (this._appIcons.length == 1) {
|
||||
this._select(0);
|
||||
} else if (backward) {
|
||||
this._select(this._appIcons.length - 1);
|
||||
} else {
|
||||
this._select(1);
|
||||
}
|
||||
|
||||
// There's a race condition; if the user released Alt before
|
||||
// we got the grab, then we won't be notified. (See
|
||||
// https://bugzilla.gnome.org/show_bug.cgi?id=596695 for
|
||||
// details.) So we check now. (Have to do this after updating
|
||||
// selection.)
|
||||
let [x, y, mods] = global.get_pointer();
|
||||
if (!(mods & Gdk.ModifierType.MOD1_MASK)) {
|
||||
this._finish();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.actor.opacity = 0;
|
||||
this.actor.show();
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 255,
|
||||
time: POPUP_FADE_TIME,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
|
||||
_finish : function() {
|
||||
let app = this._appIcons[this._currentApp];
|
||||
Main.activateWindow(app.cachedWindows[0]);
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function AppIcon(app, window) {
|
||||
this._init(app, window);
|
||||
}
|
||||
|
||||
AppIcon.prototype = {
|
||||
__proto__ : AltTab.AppIcon.prototype,
|
||||
|
||||
_init: function(app, window) {
|
||||
this.app = app;
|
||||
|
||||
this.cachedWindows = [];
|
||||
this.cachedWindows.push(window);
|
||||
|
||||
this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
|
||||
vertical: true });
|
||||
this.icon = null;
|
||||
this._iconBin = new St.Bin({ x_fill: true, y_fill: true });
|
||||
|
||||
this.actor.add(this._iconBin, { x_fill: false, y_fill: false } );
|
||||
|
||||
let title = window.get_title();
|
||||
if (title) {
|
||||
this.label = new St.Label({ text: title });
|
||||
let bin = new St.Bin({ x_align: St.Align.MIDDLE });
|
||||
bin.add_actor(this.label);
|
||||
this.actor.add(bin);
|
||||
}
|
||||
else {
|
||||
this.label = new St.Label({ text: this.app.get_name() });
|
||||
this.actor.add(this.label, { x_fill: false });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function WindowSwitcher(apps, altTabPopup) {
|
||||
this._init(apps, altTabPopup);
|
||||
}
|
||||
|
||||
WindowSwitcher.prototype = {
|
||||
__proto__ : AltTab.AppSwitcher.prototype,
|
||||
|
||||
_init : function(apps, altTabPopup) {
|
||||
AltTab.SwitcherList.prototype._init.call(this, true);
|
||||
|
||||
// Construct the AppIcons, sort by time, add to the popup
|
||||
let activeWorkspace = global.screen.get_active_workspace();
|
||||
let workspaceIcons = [];
|
||||
let otherIcons = [];
|
||||
for (let i = 0; i < apps.length; i++) {
|
||||
// Cache the window list now; we don't handle dynamic changes here,
|
||||
// and we don't want to be continually retrieving it
|
||||
let windows = apps[i].get_windows();
|
||||
|
||||
for(let j = 0; j < windows.length; j++) {
|
||||
let appIcon = new AppIcon(apps[i], windows[j]);
|
||||
if (this._isWindowOnWorkspace(windows[j], activeWorkspace)) {
|
||||
workspaceIcons.push(appIcon);
|
||||
}
|
||||
else {
|
||||
otherIcons.push(appIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
workspaceIcons.sort(Lang.bind(this, this._sortAppIcon));
|
||||
otherIcons.sort(Lang.bind(this, this._sortAppIcon));
|
||||
|
||||
if(otherIcons.length > 0) {
|
||||
let mostRecentOtherIcon = otherIcons[0];
|
||||
otherIcons = [];
|
||||
otherIcons.push(mostRecentOtherIcon);
|
||||
}
|
||||
|
||||
this.icons = [];
|
||||
this._arrows = [];
|
||||
for (let i = 0; i < workspaceIcons.length; i++)
|
||||
this._addIcon(workspaceIcons[i]);
|
||||
if (workspaceIcons.length > 0 && otherIcons.length > 0)
|
||||
this.addSeparator();
|
||||
for (let i = 0; i < otherIcons.length; i++)
|
||||
this._addIcon(otherIcons[i]);
|
||||
|
||||
this._curApp = -1;
|
||||
this._iconSize = 0;
|
||||
this._altTabPopup = altTabPopup;
|
||||
this._mouseTimeOutId = 0;
|
||||
},
|
||||
|
||||
|
||||
_isWindowOnWorkspace: function(w, workspace) {
|
||||
if (w.get_workspace() == workspace)
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
|
||||
_sortAppIcon : function(appIcon1, appIcon2) {
|
||||
let t1 = appIcon1.cachedWindows[0].get_user_time();
|
||||
let t2 = appIcon2.cachedWindows[0].get_user_time();
|
||||
if (t2 > t1) return 1;
|
||||
else return -1;
|
||||
}
|
||||
};
|
||||
|
||||
function AltTabSettingsDialog() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
AltTabSettingsDialog.prototype = {
|
||||
__proto__: ModalDialog.ModalDialog.prototype,
|
||||
|
||||
_init : function() {
|
||||
ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: null });
|
||||
|
||||
let mainContentBox = new St.BoxLayout({ style_class: 'polkit-dialog-main-layout',
|
||||
vertical: false });
|
||||
this.contentLayout.add(mainContentBox,
|
||||
{ x_fill: true,
|
||||
y_fill: true });
|
||||
|
||||
let messageBox = new St.BoxLayout({ style_class: 'polkit-dialog-message-layout',
|
||||
vertical: true });
|
||||
mainContentBox.add(messageBox,
|
||||
{ y_align: St.Align.START });
|
||||
|
||||
this._subjectLabel = new St.Label({ style_class: 'polkit-dialog-headline',
|
||||
text: _("Alt Tab Behaviour") });
|
||||
|
||||
messageBox.add(this._subjectLabel,
|
||||
{ y_fill: false,
|
||||
y_align: St.Align.START });
|
||||
|
||||
this._descriptionLabel = new St.Label({ style_class: 'polkit-dialog-description',
|
||||
text: Gettext.gettext(MESSAGE) });
|
||||
|
||||
messageBox.add(this._descriptionLabel,
|
||||
{ y_fill: true,
|
||||
y_align: St.Align.START });
|
||||
|
||||
|
||||
this.setButtons([
|
||||
{
|
||||
label: _("All & Thumbnails"),
|
||||
action: Lang.bind(this, function() {
|
||||
this.setBehaviour('all_thumbnails');
|
||||
this.close();
|
||||
})
|
||||
},
|
||||
{
|
||||
label: _("Workspace & Icons"),
|
||||
action: Lang.bind(this, function() {
|
||||
this.setBehaviour('workspace_icons');
|
||||
this.close();
|
||||
})
|
||||
},
|
||||
{
|
||||
label: _("Native"),
|
||||
action: Lang.bind(this, function() {
|
||||
this.setBehaviour('native');
|
||||
this.close();
|
||||
})
|
||||
},
|
||||
{
|
||||
label: _("Cancel"),
|
||||
action: Lang.bind(this, function() {
|
||||
this.close();
|
||||
}),
|
||||
key: Clutter.Escape
|
||||
}
|
||||
]);
|
||||
},
|
||||
|
||||
setBehaviour: function(behaviour) {
|
||||
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
||||
this._settings.set_string(SETTINGS_BEHAVIOUR_KEY, behaviour);
|
||||
this._settings.set_boolean(SETTINGS_FIRST_TIME_KEY, false);
|
||||
}
|
||||
};
|
||||
|
||||
function AltTabPopup2() {
|
||||
this._init();
|
||||
}
|
||||
@@ -41,6 +349,7 @@ AltTabPopup2.prototype = {
|
||||
|
||||
this.show();
|
||||
Main.uiGroup.add_actor(this.actor);
|
||||
this._select(0);
|
||||
},
|
||||
|
||||
show : function(backward) {
|
||||
@@ -54,9 +363,7 @@ AltTabPopup2.prototype = {
|
||||
|
||||
for (let w = windows.length-1; w >= 0; w--) {
|
||||
let win = windows[w].get_meta_window();
|
||||
if (win.window_type == 0) {
|
||||
normal_windows.push(win);
|
||||
}
|
||||
}
|
||||
normal_windows.sort(Lang.bind(this, this._sortWindows));
|
||||
|
||||
@@ -74,8 +381,10 @@ AltTabPopup2.prototype = {
|
||||
ap1 = new AltTab.AppIcon(apps[i]);
|
||||
}
|
||||
}
|
||||
ap1.cachedWindows = [win];
|
||||
appIcons.push(ap1);
|
||||
if (ap1 != null) {
|
||||
ap1.cachedWindows = [win];
|
||||
appIcons.push(ap1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!windows.length)
|
||||
@@ -93,13 +402,13 @@ AltTabPopup2.prototype = {
|
||||
|
||||
this._appSwitcher = new WindowList(windows);
|
||||
this._appSwitcher._altTabPopup=this;
|
||||
this._appSwitcher.highlight(0,false);
|
||||
this.actor.add_actor(this._appSwitcher.actor);
|
||||
this._appSwitcher.connect('item-activated', Lang.bind(this, this._appActivated));
|
||||
this._appSwitcher.connect('item-entered', Lang.bind(this, this._appEntered));
|
||||
|
||||
this._appIcons = appIcons;
|
||||
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
@@ -220,8 +529,10 @@ WindowList.prototype = {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ap1 != null) {
|
||||
ap1.cachedWindows = [win];
|
||||
this._addIcon(ap1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -230,8 +541,19 @@ WindowList.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
function main() {
|
||||
function main(metadata) {
|
||||
imports.gettext.bindtextdomain('gnome-shell-extensions', metadata.localedir);
|
||||
|
||||
Main.wm.setKeybindingHandler('switch_windows', function() {
|
||||
let alpopup = new AltTabPopup2();
|
||||
let settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
||||
|
||||
if(settings.get_boolean(SETTINGS_FIRST_TIME_KEY)) {
|
||||
new AltTabSettingsDialog().open();
|
||||
} else {
|
||||
let behaviour = settings.get_string(SETTINGS_BEHAVIOUR_KEY);
|
||||
if(behaviour in MODES) {
|
||||
MODES[behaviour]();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"uuid": "@uuid@",
|
||||
"name": "AlternateTab",
|
||||
"description": "A replacement for Alt-Tab, allows to cycle between windows and does not group by application",
|
||||
"original-author": "thomas.bouffon@gmail.com",
|
||||
"original-authors": [ "jw@bargsten.org", "thomas.bouffon@gmail.com" ],
|
||||
"shell-version": [ "@shell_current@" ],
|
||||
"localedir": "@LOCALEDIR@",
|
||||
"url": "@url@"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<schemalist gettext-domain="gnome-shell-extensions">
|
||||
<enum id="org.gnome.shell.extensions.alternate-tab.BehaviourMode">
|
||||
<value value="0" nick="native"/>
|
||||
<value value="1" nick="all_thumbnails"/>
|
||||
<value value="2" nick="workspace_icons"/>
|
||||
</enum>
|
||||
<schema id="org.gnome.shell.extensions.alternate-tab" path="/org/gnome/shell/extensions/alternate-tab/">
|
||||
<key name="behaviour" enum="org.gnome.shell.extensions.alternate-tab.BehaviourMode">
|
||||
<default>'native'</default>
|
||||
<_summary>The alt tab behaviour.</_summary>
|
||||
<_description>Sets the Alt-Tab behaviour. Possible values are: native, all_thumbnails and workspace_icons.</_description>
|
||||
</key>
|
||||
<key type="b" name="first-time">
|
||||
<default>true</default>
|
||||
<_summary>Indicates if Alternate Tab is newly installed</_summary>
|
||||
<_description>Ask the user for a default behaviour if true.</_description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
@@ -5,6 +5,7 @@ const Glib = imports.gi.GLib;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
|
||||
@@ -73,8 +74,17 @@ function main(extensionMeta) {
|
||||
let i;
|
||||
let emptyWorkspaces = new Array(Main._workspaces.length);
|
||||
|
||||
for (i = 0; i < Main._workspaces.length; i++)
|
||||
emptyWorkspaces[i] = true;
|
||||
for (i = 0; i < Main._workspaces.length; i++) {
|
||||
let lastRemoved = Main._workspaces[i]._lastRemovedWindow;
|
||||
if (lastRemoved &&
|
||||
(lastRemoved.get_window_type() == Meta.WindowType.SPLASHSCREEN ||
|
||||
lastRemoved.get_window_type() == Meta.WindowType.DIALOG ||
|
||||
lastRemoved.get_window_type() == Meta.WindowType.MODAL_DIALOG))
|
||||
emptyWorkspaces[i] = false;
|
||||
else
|
||||
emptyWorkspaces[i] = true;
|
||||
}
|
||||
|
||||
|
||||
let windows = global.get_window_actors();
|
||||
for (i = 0; i < windows.length; i++) {
|
||||
@@ -93,6 +103,19 @@ function main(extensionMeta) {
|
||||
emptyWorkspaces.push(false);
|
||||
}
|
||||
|
||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||
let activeIsLast = activeWorkspaceIndex == global.screen.n_workspaces - 2;
|
||||
let removingTrailWorkspaces = (emptyWorkspaces[activeWorkspaceIndex] &&
|
||||
activeIsLast);
|
||||
// Don't enter the overview when removing multiple empty workspaces at startup
|
||||
let showOverview = (removingTrailWorkspaces &&
|
||||
!emptyWorkspaces.every(function(x) { return x; }));
|
||||
|
||||
if (removingTrailWorkspaces) {
|
||||
// "Merge" the empty workspace we are removing with the one at the end
|
||||
Main.wm.blockAnimations();
|
||||
}
|
||||
|
||||
// Delete other empty workspaces; do it from the end to avoid index changes
|
||||
for (i = emptyWorkspaces.length - 2; i >= 0; i--) {
|
||||
if (emptyWorkspaces[i])
|
||||
@@ -100,6 +123,16 @@ function main(extensionMeta) {
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (removingTrailWorkspaces) {
|
||||
global.screen.get_workspace_by_index(global.screen.n_workspaces - 1).activate(global.get_current_time());
|
||||
|
||||
Main.wm.unblockAnimations();
|
||||
|
||||
if (!Main.overview.visible && showOverview)
|
||||
Main.overview.show();
|
||||
}
|
||||
|
||||
Main._checkWorkspacesId = 0;
|
||||
return false;
|
||||
|
||||
|
||||
@@ -29,6 +29,13 @@ const _ = Gettext.gettext;
|
||||
const DOCK_SETTINGS_SCHEMA = 'org.gnome.shell.extensions.dock';
|
||||
const DOCK_POSITION_KEY = 'position';
|
||||
const DOCK_SIZE_KEY = 'size';
|
||||
const DOCK_HIDE_KEY = 'autohide';
|
||||
const DOCK_EFFECTHIDE_KEY = 'hide-effect';
|
||||
const DOCK_AUTOHIDE_ANIMATION_TIME_KEY = 'hide-effect-duration';
|
||||
|
||||
|
||||
//hide
|
||||
//const autohide_animation_time = 0.3;
|
||||
|
||||
// Keep enums in sync with GSettings schemas
|
||||
const PositionMode = {
|
||||
@@ -36,10 +43,213 @@ const PositionMode = {
|
||||
RIGHT: 1
|
||||
};
|
||||
|
||||
const AutoHideEffect = {
|
||||
RESIZE: 0,
|
||||
RESCALE: 1
|
||||
};
|
||||
|
||||
let position = PositionMode.RIGHT;
|
||||
let dockicon_size = 48;
|
||||
let hideable = true;
|
||||
let hideDock = true;
|
||||
let hideEffect = AutoHideEffect.RESIZE;
|
||||
let autohide_animation_time = 0.3;
|
||||
const DND_RAISE_APP_TIMEOUT = 500;
|
||||
|
||||
/*************************************************************************************/
|
||||
/**** start resize's Dock functions *****************/
|
||||
/*************************************************************************************/
|
||||
function hideDock_size () {
|
||||
if (hideable){
|
||||
let monitor = Main.layoutManager.primaryMonitor
|
||||
let position_x = monitor.x;
|
||||
let height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
Tweener.addTween(this,{
|
||||
_item_size: 1,
|
||||
time: autohide_animation_time,
|
||||
transition: 'easeOutQuad',
|
||||
onUpdate: function () {
|
||||
height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
width = this._item_size + 4*this._spacing;
|
||||
switch (position) {
|
||||
case PositionMode.LEFT:
|
||||
position_x=monitor.x-2*this._spacing;
|
||||
break;
|
||||
case PositionMode.RIGHT:
|
||||
default:
|
||||
position_x = monitor.x + (monitor.width-1-this._item_size-2*this._spacing);
|
||||
}
|
||||
this.actor.set_position (position_x,monitor.y+(monitor.height-height)/2);
|
||||
this.actor.set_size(width,height);
|
||||
},
|
||||
});
|
||||
hideDock=true;
|
||||
}
|
||||
}
|
||||
|
||||
function showDock_size () {
|
||||
let monitor = Main.layoutManager.primaryMonitor;
|
||||
let height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
let position_x = monitor.x;
|
||||
|
||||
Tweener.addTween(this,{
|
||||
_item_size: dockicon_size,
|
||||
time: autohide_animation_time,
|
||||
transition: 'easeOutQuad',
|
||||
onUpdate: function () {
|
||||
height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
width = this._item_size + 4*this._spacing;
|
||||
switch (position) {
|
||||
case PositionMode.LEFT:
|
||||
position_x=monitor.x-2*this._spacing;
|
||||
break;
|
||||
case PositionMode.RIGHT:
|
||||
default:
|
||||
position_x=monitor.x + (monitor.width-this._item_size-2*this._spacing);
|
||||
}
|
||||
this.actor.set_position (position_x, monitor.y+(monitor.height-height)/2);
|
||||
this.actor.set_size(width,height);
|
||||
}
|
||||
});
|
||||
hideDock=false;
|
||||
}
|
||||
|
||||
function initShowDock_size () {
|
||||
this._item_size=1;
|
||||
this._showDock();
|
||||
}
|
||||
|
||||
function showEffectAddItem_size () {
|
||||
let primary = Main.layoutManager.primaryMonitor;
|
||||
let height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
Tweener.addTween(this.actor, {
|
||||
y: primary.y + (primary.height-height)/2,
|
||||
height: height,
|
||||
width: width,
|
||||
time: autohide_animation_time,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
/**** start rescale's Dock functions *****************/
|
||||
/**************************************************************************************/
|
||||
function hideDock_scale () {
|
||||
this._item_size = dockicon_size;
|
||||
let monitor = Main.layoutManager.primaryMonitor;
|
||||
let cornerX = 0;
|
||||
let height = this._nicons*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
switch (position) {
|
||||
case PositionMode.LEFT:
|
||||
cornerX=monitor.x;
|
||||
break;
|
||||
case PositionMode.RIGHT:
|
||||
default:
|
||||
cornerX = monitor.x + monitor.width-1;
|
||||
}
|
||||
|
||||
if (hideable) {
|
||||
Tweener.addTween(this.actor,{
|
||||
y: monitor.y + (monitor.height-height)/2,
|
||||
x: cornerX,
|
||||
height:height,
|
||||
width: width,
|
||||
scale_x: 0.025,
|
||||
time: autohide_animation_time,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
hideDock=true;
|
||||
}
|
||||
}
|
||||
|
||||
function showDock_scale () {
|
||||
this._item_size = dockicon_size;
|
||||
let monitor = Main.layoutManager.primaryMonitor;
|
||||
let position_x = monitor.x;
|
||||
let height = this._nicons*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
switch (position) {
|
||||
case PositionMode.LEFT:
|
||||
position_x=monitor.x-2*this._spacing;
|
||||
break;
|
||||
case PositionMode.RIGHT:
|
||||
default:
|
||||
position_x=monitor.x + (monitor.width-this._item_size-2*this._spacing);
|
||||
}
|
||||
Tweener.addTween(this.actor, {
|
||||
y: monitor.y + (monitor.height-height)/2,
|
||||
x: monitor.x + position_x,
|
||||
height: height,
|
||||
width: width,
|
||||
scale_x: 1,
|
||||
time: autohide_animation_time,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
hideDock=false;
|
||||
}
|
||||
|
||||
function initShowDock_scale () {
|
||||
let primary = Main.layoutManager.primaryMonitor;
|
||||
let height = this._nicons*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
this.actor.set_scale (0,0);
|
||||
this.actor.set_size (width,height);
|
||||
|
||||
// set the position of the dock
|
||||
switch (position) {
|
||||
case PositionMode.LEFT:
|
||||
this.actor.x = 0;
|
||||
// effect of creation of the dock
|
||||
Tweener.addTween(this.actor, {
|
||||
x: primary.x-2*this._spacing,
|
||||
y: primary.y + (primary.height-height)/2,
|
||||
time: autohide_animation_time * 3,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
break;
|
||||
case PositionMode.RIGHT:
|
||||
default:
|
||||
this.actor.x = primary.width-1;
|
||||
// effect of creation of the dock
|
||||
Tweener.addTween(this.actor, {
|
||||
x: primary.x + primary.width-this._item_size- 2*this._spacing,
|
||||
y: primary.y + (primary.height-height)/2,
|
||||
time: autohide_animation_time * 3,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
}
|
||||
Tweener.addTween(this.actor,{
|
||||
scale_x: 1,
|
||||
scale_y: 1,
|
||||
time: autohide_animation_time * 3,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
hideDock=false;
|
||||
}
|
||||
|
||||
function showEffectAddItem_scale () {
|
||||
let monitor = Main.layoutManager.primaryMonitor;
|
||||
let height = this._nicons*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
Tweener.addTween(this.actor, {
|
||||
y: monitor.y + (monitor.height-height)/2,
|
||||
height: height,
|
||||
width: width,
|
||||
time: autohide_animation_time,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
}
|
||||
|
||||
function Dock() {
|
||||
this._init();
|
||||
}
|
||||
@@ -56,12 +266,17 @@ Dock.prototype = {
|
||||
this._settings = new Gio.Settings({ schema: DOCK_SETTINGS_SCHEMA });
|
||||
position = this._settings.get_enum(DOCK_POSITION_KEY);
|
||||
dockicon_size = this._settings.get_int(DOCK_SIZE_KEY);
|
||||
hideDock = hideable = this._settings.get_boolean(DOCK_HIDE_KEY);
|
||||
hideEffect = this._settings.get_enum(DOCK_EFFECTHIDE_KEY);
|
||||
autohide_animation_time = this._settings.get_double(DOCK_AUTOHIDE_ANIMATION_TIME_KEY);
|
||||
//global.log("POSITION: " + position);
|
||||
//global.log("dockicon_size: " + dockicon_size);
|
||||
|
||||
|
||||
this._spacing = 4;
|
||||
this._item_size = dockicon_size;
|
||||
this._nicons = 0;
|
||||
this._selectFunctionsHide ();
|
||||
|
||||
this.actor = new St.BoxLayout({ name: 'dock', vertical: true, reactive: true });
|
||||
|
||||
@@ -90,6 +305,84 @@ Dock.prototype = {
|
||||
}));
|
||||
Main.chrome.addActor(this.actor);
|
||||
this.actor.lower_bottom();
|
||||
|
||||
//hidden
|
||||
this._settings.connect('changed::'+DOCK_POSITION_KEY, Lang.bind(this, function (){
|
||||
let primary = Main.layoutManager.primaryMonitor;
|
||||
position = this._settings.get_enum(DOCK_POSITION_KEY);
|
||||
this.actor.y=primary.y;
|
||||
this._redisplay();
|
||||
}));
|
||||
|
||||
this._settings.connect('changed::'+DOCK_SIZE_KEY, Lang.bind(this, function (){
|
||||
dockicon_size = this._settings.get_int(DOCK_SIZE_KEY);
|
||||
this._redisplay();
|
||||
}));
|
||||
|
||||
this._settings.connect('changed::'+DOCK_HIDE_KEY, Lang.bind(this, function (){
|
||||
hideable = this._settings.get_boolean(DOCK_HIDE_KEY);
|
||||
if (hideable){
|
||||
hideDock=false;
|
||||
this._hideDock();
|
||||
} else {
|
||||
hideDock=true;
|
||||
this._showDock();
|
||||
}
|
||||
}));
|
||||
|
||||
this._settings.connect('changed::'+DOCK_EFFECTHIDE_KEY, Lang.bind(this, function (){
|
||||
hideEffect = this._settings.get_enum(DOCK_EFFECTHIDE_KEY);
|
||||
this.actor.y=0;
|
||||
|
||||
switch (hideEffect) {
|
||||
case AutoHideEffect.RESCALE:
|
||||
this._item_size=dockicon_size;
|
||||
break;
|
||||
case AutoHideEffect.RESIZE:
|
||||
this.actor.set_scale (1,1);
|
||||
}
|
||||
this.actor.disconnect(leave_event);
|
||||
this.actor.disconnect(enter_event);
|
||||
|
||||
this._selectFunctionsHide ();
|
||||
|
||||
leave_event = this.actor.connect('leave-event', Lang.bind(this, this._hideDock));
|
||||
enter_event = this.actor.connect('enter-event', Lang.bind(this, this._showDock));
|
||||
this._redisplay();
|
||||
}));
|
||||
|
||||
this._settings.connect('changed::'+DOCK_AUTOHIDE_ANIMATION_TIME_KEY, Lang.bind(this,function (){
|
||||
autohide_animation_time = this._settings.get_double(DOCK_AUTOHIDE_ANIMATION_TIME_KEY);
|
||||
}));
|
||||
|
||||
let leave_event = this.actor.connect('leave-event', Lang.bind(this, this._hideDock));
|
||||
let enter_event = this.actor.connect('enter-event', Lang.bind(this, this._showDock));
|
||||
},
|
||||
|
||||
// fuctions hide
|
||||
_restoreHideDock: function(){
|
||||
hideable = this._settings.get_boolean(DOCK_HIDE_KEY);
|
||||
},
|
||||
|
||||
_disableHideDock: function (){
|
||||
hideable = false;
|
||||
},
|
||||
|
||||
_selectFunctionsHide: function () {
|
||||
switch (hideEffect) {
|
||||
case AutoHideEffect.RESCALE:
|
||||
this._hideDock = hideDock_scale;
|
||||
this._showDock = showDock_scale;
|
||||
this._initShowDock = initShowDock_scale;
|
||||
this._showEffectAddItem = showEffectAddItem_scale;
|
||||
break;
|
||||
case AutoHideEffect.RESIZE:
|
||||
default:
|
||||
this._hideDock = hideDock_size;
|
||||
this._showDock = showDock_size;
|
||||
this._initShowDock = initShowDock_size;
|
||||
this._showEffectAddItem = showEffectAddItem_size;
|
||||
}
|
||||
},
|
||||
|
||||
_appIdListToHash: function(apps) {
|
||||
@@ -119,7 +412,7 @@ Dock.prototype = {
|
||||
let nFavorites = 0;
|
||||
for (let id in favorites) {
|
||||
let app = favorites[id];
|
||||
let display = new DockIcon(app);
|
||||
let display = new DockIcon(app,this);
|
||||
this.addItem(display.actor);
|
||||
nFavorites++;
|
||||
icons++;
|
||||
@@ -129,10 +422,12 @@ Dock.prototype = {
|
||||
let app = running[i];
|
||||
if (app.get_id() in favorites)
|
||||
continue;
|
||||
let display = new DockIcon(app);
|
||||
let display = new DockIcon(app,this);
|
||||
icons++;
|
||||
this.addItem(display.actor);
|
||||
}
|
||||
this._nicons=icons;
|
||||
|
||||
if (this._placeholderText) {
|
||||
this._placeholderText.destroy();
|
||||
this._placeholderText = null;
|
||||
@@ -143,19 +438,25 @@ Dock.prototype = {
|
||||
this.actor.add_actor(this._placeholderText);
|
||||
}
|
||||
|
||||
let primary = global.get_primary_monitor();
|
||||
let primary = Main.layoutManager.primaryMonitor;
|
||||
let height = (icons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
let width = (icons)*(this._item_size + this._spacing) + 2*this._spacing;
|
||||
|
||||
switch (position) {
|
||||
case PositionMode.LEFT:
|
||||
this.actor.set_size(this._item_size + 4*this._spacing, height);
|
||||
this.actor.set_position(0-this._spacing-4, (primary.height-height)/2);
|
||||
break;
|
||||
case PositionMode.RIGHT:
|
||||
default:
|
||||
this.actor.set_size(this._item_size + 4*this._spacing, height);
|
||||
this.actor.set_position(primary.width-this._item_size-this._spacing-2, (primary.height-height)/2);
|
||||
let width = this._item_size + 4*this._spacing;
|
||||
|
||||
if (this.actor.y != primary.y) {
|
||||
if (hideable && hideDock) {
|
||||
this._hideDock();
|
||||
} else {
|
||||
if (dockicon_size == this._item_size) {
|
||||
// only add/delete icon
|
||||
this._showEffectAddItem ();
|
||||
} else {
|
||||
// change size icon
|
||||
this._showDock ();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// effect of creation
|
||||
this._initShowDock ();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -216,12 +517,12 @@ Dock.prototype = {
|
||||
};
|
||||
Signals.addSignalMethods(Dock.prototype);
|
||||
|
||||
function DockIcon(app) {
|
||||
this._init(app);
|
||||
function DockIcon(app, dock) {
|
||||
this._init(app, dock);
|
||||
}
|
||||
|
||||
DockIcon.prototype = {
|
||||
_init : function(app) {
|
||||
_init : function(app, dock) {
|
||||
this.app = app;
|
||||
this.actor = new St.Button({ style_class: 'dock-app',
|
||||
button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
|
||||
@@ -252,6 +553,7 @@ DockIcon.prototype = {
|
||||
this._stateChangedId = this.app.connect('notify::state',
|
||||
Lang.bind(this, this._onStateChanged));
|
||||
this._onStateChanged();
|
||||
this._dock=dock;
|
||||
},
|
||||
|
||||
_onDestroy: function() {
|
||||
@@ -327,14 +629,21 @@ DockIcon.prototype = {
|
||||
this._removeMenuTimeout();
|
||||
this.actor.fake_release();
|
||||
|
||||
this._dock._disableHideDock();
|
||||
|
||||
if (!this._menu) {
|
||||
this._menu = new DockIconMenu(this);
|
||||
this._menu.connect('activate-window', Lang.bind(this, function (menu, window) {
|
||||
this.activateWindow(window);
|
||||
}));
|
||||
this._menu.connect('popup', Lang.bind(this, function (menu, isPoppedUp) {
|
||||
if (!isPoppedUp)
|
||||
if (!isPoppedUp){
|
||||
//Restore value of autohidedock
|
||||
this._dock._restoreHideDock();
|
||||
this._dock._hideDock();
|
||||
|
||||
this._onMenuPoppedDown();
|
||||
}
|
||||
}));
|
||||
|
||||
this._menuManager.addMenu(this._menu, true);
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
<value nick='left' value='0'/>
|
||||
<value nick='right' value='1'/>
|
||||
</enum>
|
||||
<enum id='org.gnome.shell.extensions.dock.AutoHideEfect'>
|
||||
<value nick='resize' value='0'/>
|
||||
<value nick='rescale' value='1'/>
|
||||
</enum>
|
||||
|
||||
<schema id="org.gnome.shell.extensions.dock" path="/org/gnome/shell/extensions/dock/">
|
||||
<key name="position" enum="org.gnome.shell.extensions.dock.PositionMode">
|
||||
@@ -15,5 +19,19 @@
|
||||
<_summary>Icon size</_summary>
|
||||
<_description>Sets icon size of the dock.</_description>
|
||||
</key>
|
||||
<key name="autohide" type="b">
|
||||
<default>true</default>
|
||||
<_summary>Enable/disable autohide</_summary>
|
||||
</key>
|
||||
<key name="hide-effect" enum="org.gnome.shell.extensions.dock.AutoHideEfect">
|
||||
<default>'resize'</default>
|
||||
<_summary>Autohide effect</_summary>
|
||||
<_description>Sets the effect of the hide dock. Allowed values are 'resize' or 'rescale'</_description>
|
||||
</key>
|
||||
<key name="hide-effect-duration" type="d">
|
||||
<default>0.3</default>
|
||||
<_summary>Autohide duration</_summary>
|
||||
<_description>Sets the time duration of the autohide effect.</_description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
||||
@@ -9,7 +9,7 @@ const Main = imports.ui.main;
|
||||
|
||||
function _showHello() {
|
||||
let text = new St.Label({ style_class: 'helloworld-label', text: _("Hello, world!") });
|
||||
let monitor = global.get_primary_monitor();
|
||||
let monitor = Main.layoutManager.primaryMonitor;
|
||||
global.stage.add_actor(text);
|
||||
text.set_position(Math.floor (monitor.width / 2 - text.width / 2), Math.floor(monitor.height / 2 - text.height / 2));
|
||||
Mainloop.timeout_add(3000, function () { text.destroy(); });
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/* none used */
|
||||
|
||||
@@ -44,6 +44,7 @@ function injectToFunction(parent, name, func) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
const WORKSPACE_BORDER_GAP = 10; // gap between the workspace area and the workspace selector
|
||||
|
||||
|
||||
|
||||
@@ -137,8 +138,10 @@ function main() {
|
||||
return win2.metaWindow.get_stable_sequence() - win1.metaWindow.get_stable_sequence();
|
||||
});
|
||||
|
||||
// 2 * 10 px gaps at the border
|
||||
let area = new Rect(this._x + 10, this._y + 10, this._width - 20, this._height - 20);
|
||||
// Put a gap on the right edge of the workspace to separe it from the workspace selector
|
||||
let x_gap = WORKSPACE_BORDER_GAP;
|
||||
let y_gap = WORKSPACE_BORDER_GAP * this._height / this._width
|
||||
let area = new Rect(this._x, this._y, this._width - x_gap, this._height - y_gap);
|
||||
|
||||
let bounds = area.copy();
|
||||
|
||||
@@ -254,16 +257,14 @@ function main() {
|
||||
} while (overlap && loop_counter < WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS);
|
||||
|
||||
// Work out scaling by getting the most top-left and most bottom-right window coords.
|
||||
// The 20's and 10's are so that the windows don't touch the edge of the screen.
|
||||
// Most 20's and 10's are already calculated into area now.
|
||||
let scale;
|
||||
scale = Math.min(area.width / bounds.width,
|
||||
area.height / bounds.height,
|
||||
1.0);
|
||||
|
||||
// Make bounding rect fill the screen size for later steps
|
||||
bounds.x = bounds.x - (area.width - bounds.width * scale) / 2 - 10 / scale;
|
||||
bounds.y = bounds.y - (area.height - bounds.height * scale) / 2 - 10 / scale;
|
||||
bounds.x = bounds.x - (area.width - bounds.width * scale) / 2;
|
||||
bounds.y = bounds.y - (area.height - bounds.height * scale) / 2;
|
||||
bounds.width = area.width / scale;
|
||||
bounds.height = area.height / scale;
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/* none used */
|
||||
|
||||
3
extensions/workspace-indicator/Makefile.am
Normal file
3
extensions/workspace-indicator/Makefile.am
Normal file
@@ -0,0 +1,3 @@
|
||||
EXTENSION_ID = workspace-indicator
|
||||
|
||||
include ../../extension.mk
|
||||
102
extensions/workspace-indicator/extension.js
Normal file
102
extensions/workspace-indicator/extension.js
Normal file
@@ -0,0 +1,102 @@
|
||||
const Meta = imports.gi.Meta;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const Panel = imports.ui.panel;
|
||||
|
||||
const Main = imports.ui.main;
|
||||
|
||||
const Gettext = imports.gettext.domain('gnome-shell-extensions');
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
function WorkspaceIndicator() {
|
||||
this._init.apply(this, arguments);
|
||||
}
|
||||
|
||||
WorkspaceIndicator.prototype = {
|
||||
__proto__: PanelMenu.SystemStatusButton.prototype,
|
||||
|
||||
_init: function(){
|
||||
PanelMenu.SystemStatusButton.prototype._init.call(this, 'folder');
|
||||
|
||||
this._currentWorkspace = global.screen.get_active_workspace().index();
|
||||
this.statusLabel = new St.Label({ text: this._labelText() });
|
||||
this.actor.set_child(this.statusLabel);
|
||||
|
||||
this.workspacesItems = [];
|
||||
this._workspaceSection = new PopupMenu.PopupMenuSection();
|
||||
this.menu.addMenuItem(this._workspaceSection);
|
||||
global.screen.connect_after('workspace-added', Lang.bind(this,this._createWorkspacesSection));
|
||||
global.screen.connect_after('workspace-removed', Lang.bind(this,this._createWorkspacesSection));
|
||||
global.screen.connect_after('workspace-switched', Lang.bind(this,this._updateIndicator));
|
||||
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
|
||||
this._createWorkspacesSection();
|
||||
|
||||
//styling
|
||||
this.menu.actor.add_style_class_name('workspace-indicator-shorter');
|
||||
},
|
||||
|
||||
_updateIndicator: function() {
|
||||
this.workspacesItems[this._currentWorkspace].setShowDot(false);
|
||||
this._currentWorkspace = global.screen.get_active_workspace().index();
|
||||
this.workspacesItems[this._currentWorkspace].setShowDot(true);
|
||||
|
||||
this.statusLabel.set_text(this._labelText());
|
||||
},
|
||||
|
||||
_labelText : function(workspaceIndex) {
|
||||
if(workspaceIndex == undefined) {
|
||||
workspaceIndex = this._currentWorkspace;
|
||||
}
|
||||
return Meta.prefs_get_workspace_name(workspaceIndex);
|
||||
},
|
||||
|
||||
_createWorkspacesSection : function() {
|
||||
this._workspaceSection.removeAll();
|
||||
this.workspacesItems = [];
|
||||
|
||||
let i = 0;
|
||||
for(; i < global.screen.n_workspaces; i++) {
|
||||
this.workspacesItems[i] = new PopupMenu.PopupMenuItem(this._labelText(i));
|
||||
this._workspaceSection.addMenuItem(this.workspacesItems[i]);
|
||||
this.workspacesItems[i].workspaceId = i;
|
||||
this.workspacesItems[i].label_actor = this.statusLabel;
|
||||
let self = this;
|
||||
this.workspacesItems[i].connect('activate', Lang.bind(this, function(actor, event) {
|
||||
this._activate(actor.workspaceId);
|
||||
}));
|
||||
}
|
||||
|
||||
this._updateIndicator();
|
||||
},
|
||||
|
||||
_activate : function (index) {
|
||||
if(index >= 0 && index < global.screen.n_workspaces) {
|
||||
let metaWorkspace = global.screen.get_workspace_by_index(index);
|
||||
metaWorkspace.activate(true);
|
||||
}
|
||||
},
|
||||
|
||||
_onScrollEvent : function(actor, event) {
|
||||
let direction = event.get_scroll_direction();
|
||||
let diff = 0;
|
||||
if (direction == Clutter.ScrollDirection.DOWN) {
|
||||
diff = 1;
|
||||
} else if (direction == Clutter.ScrollDirection.UP) {
|
||||
diff = -1;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
let newIndex = global.screen.get_active_workspace().index() + diff;
|
||||
this._activate(newIndex);
|
||||
},
|
||||
}
|
||||
|
||||
function main() {
|
||||
Panel.STANDARD_TRAY_ICON_ORDER.unshift('workspace-indicator');
|
||||
Panel.STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION['workspace-indicator'] = WorkspaceIndicator;
|
||||
}
|
||||
9
extensions/workspace-indicator/metadata.json.in
Normal file
9
extensions/workspace-indicator/metadata.json.in
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"uuid": "@uuid@",
|
||||
"name": "Workspace Indicator",
|
||||
"description": "Put an indicator on the panel signaling in which workspace you are, and give you the possibility of switching to another one",
|
||||
"shell-version": [ "@shell_current@" ],
|
||||
"localedir": "@LOCALEDIR@",
|
||||
"original-authors": [ "erick.red@gmail.com" ],
|
||||
"url": "@url@"
|
||||
}
|
||||
4
extensions/workspace-indicator/stylesheet.css
Normal file
4
extensions/workspace-indicator/stylesheet.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.workspace-indicator-shorter {
|
||||
min-width: 25px;
|
||||
font-size: 10pt;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ gl
|
||||
he
|
||||
hu
|
||||
it
|
||||
ja
|
||||
lv
|
||||
nb
|
||||
pa
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
extensions/alternative-status-menu/extension.js
|
||||
extensions/alternate-tab/extension.js
|
||||
extensions/alternate-tab/org.gnome.shell.extensions.alternate-tab.gschema.xml.in
|
||||
extensions/auto-move-windows/extension.js
|
||||
extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in
|
||||
extensions/dock/extension.js
|
||||
|
||||
205
po/ja.po
Normal file
205
po/ja.po
Normal file
@@ -0,0 +1,205 @@
|
||||
# gnome-shell-extensions ja.po
|
||||
# Copyright (C) 2011 gnome-shell-extensions's COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the gnome-shell-extensions package.
|
||||
# Takeshi AIHANA <takeshi.aihana@gmail.com>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell-extensions master\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-07-05 00:34+0900\n"
|
||||
"PO-Revision-Date: 2011-07-05 00:34+0900\n"
|
||||
"Last-Translator: Takeshi AIHANA <takeshi.aihana@gmail.com>\n"
|
||||
"Language-Team: Japanese <takeshi.aihana@gmail.com>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:39
|
||||
msgid "Available"
|
||||
msgstr "在席中"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:44
|
||||
msgid "Busy"
|
||||
msgstr "離席中"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:52
|
||||
msgid "My Account"
|
||||
msgstr "自分のアカウント"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:56
|
||||
msgid "System Settings"
|
||||
msgstr "システムの設定"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:63
|
||||
msgid "Lock Screen"
|
||||
msgstr "画面のロック"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:67
|
||||
msgid "Switch User"
|
||||
msgstr "ユーザの切り替え"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:72
|
||||
msgid "Log Out..."
|
||||
msgstr "ログアウト..."
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:79
|
||||
msgid "Suspend"
|
||||
msgstr "サスペンド"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:85
|
||||
msgid "Hibernate"
|
||||
msgstr "ハイバーネート"
|
||||
|
||||
#: ../extensions/alternative-status-menu/extension.js:91
|
||||
msgid "Power Off..."
|
||||
msgstr "電源オフ..."
|
||||
|
||||
#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:1
|
||||
msgid ""
|
||||
"A list of strings, each containing an application id (desktop file name), "
|
||||
"followed by a colon and the workspace number"
|
||||
msgstr ""
|
||||
"アプリケーションの識別子 (.desktop ファイル名) とコロンの後にワークスペース番"
|
||||
"号を付与した文字列を要素とするリストです。"
|
||||
|
||||
#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:2
|
||||
msgid "Application and workspace list"
|
||||
msgstr "アプリケーションとワークスペースのリスト"
|
||||
|
||||
#: ../extensions/dock/extension.js:142
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "ここにドラッグしてお気に入りへ追加します"
|
||||
|
||||
#: ../extensions/dock/extension.js:462
|
||||
msgid "New Window"
|
||||
msgstr "新しいウィンドウで開く"
|
||||
|
||||
#: ../extensions/dock/extension.js:464
|
||||
msgid "Quit Application"
|
||||
msgstr "アプリケーションの終了"
|
||||
|
||||
#: ../extensions/dock/extension.js:469
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "お気に入りから削除する"
|
||||
|
||||
#: ../extensions/dock/extension.js:470
|
||||
msgid "Add to Favorites"
|
||||
msgstr "お気に入りへ追加する"
|
||||
|
||||
#: ../extensions/dock/org.gnome.shell.extensions.dock.gschema.xml.in.h:1
|
||||
msgid "Icon size"
|
||||
msgstr "アイコンのサイズ"
|
||||
|
||||
#: ../extensions/dock/org.gnome.shell.extensions.dock.gschema.xml.in.h:2
|
||||
msgid "Position of the dock"
|
||||
msgstr "ドックの位置"
|
||||
|
||||
#: ../extensions/dock/org.gnome.shell.extensions.dock.gschema.xml.in.h:3
|
||||
msgid "Sets icon size of the dock."
|
||||
msgstr "ドックに表示するアイコンの大きさを指定します。"
|
||||
|
||||
#: ../extensions/dock/org.gnome.shell.extensions.dock.gschema.xml.in.h:4
|
||||
msgid ""
|
||||
"Sets the position of the dock in the screen. Allowed values are 'right' or "
|
||||
"'left'"
|
||||
msgstr ""
|
||||
"ドックをデスクトップに表示する位置を指定します。指定可能な値: 'right'、'left'"
|
||||
|
||||
#: ../extensions/example/extension.js:11
|
||||
msgid "Hello, world!"
|
||||
msgstr "\"Hello, world!\""
|
||||
|
||||
#: ../extensions/gajim/extension.js:219
|
||||
#, c-format
|
||||
msgid "%s is away."
|
||||
msgstr "%sさんは離席中です"
|
||||
|
||||
#: ../extensions/gajim/extension.js:222
|
||||
#, c-format
|
||||
msgid "%s is offline."
|
||||
msgstr "%sさんはオフラインです"
|
||||
|
||||
#: ../extensions/gajim/extension.js:225
|
||||
#, c-format
|
||||
msgid "%s is online."
|
||||
msgstr "%sさんはオンラインです"
|
||||
|
||||
#: ../extensions/gajim/extension.js:228
|
||||
#, c-format
|
||||
msgid "%s is busy."
|
||||
msgstr "%sさんは取り込み中です"
|
||||
|
||||
#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:1
|
||||
msgid ""
|
||||
"If true, place window captions on top the respective thumbnail, overriding "
|
||||
"shell default of placing it at the bottom. Changing this setting requires "
|
||||
"restarting the shell to have any effect."
|
||||
msgstr ""
|
||||
"TRUE にすると、ウィンドウのサムネイルの上端にそのウィンドウのタイトルバーを表"
|
||||
"示します (これは、サムネイルの下端にタイトルバーを表示する GNOME シェルのデ"
|
||||
"フォルト値よりも優先されます)。この設定を適用する際は GNOME シェルを再起動し"
|
||||
"て下さい。"
|
||||
|
||||
#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:2
|
||||
msgid "Place window captions on top"
|
||||
msgstr "ウィンドウのタイトルバーを上端に表示するかどうか"
|
||||
|
||||
#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:3
|
||||
msgid ""
|
||||
"The algorithm used to layout thumbnails in the overview. 'grid' to use the "
|
||||
"default grid based algorithm, 'natural' to use another one that reflects "
|
||||
"more the position and size of the actual window"
|
||||
msgstr ""
|
||||
"オーバービュー・モードでウィンドウのサムネイルを配置する際のアルゴリズムで"
|
||||
"す。指定可能な値: 'grid' (原則的に格子状に配置していくアルゴリズ"
|
||||
"ム)、'natural' (ウィンドウの実際の位置や大きさを考慮して配置していくアルゴリ"
|
||||
"ズム)"
|
||||
|
||||
#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:4
|
||||
msgid ""
|
||||
"Try to use more screen for placing window thumbnails by adapting to screen "
|
||||
"aspect ratio, and consolidating them further to reduce the bounding box. "
|
||||
"This setting applies only with the natural placement strategy."
|
||||
msgstr ""
|
||||
"ウィンドウのサムネイルを複数配置する際に、画面のアスペクト比に合わせて、境界"
|
||||
"部分を減らすことにより、ウィンドウを統合しすることで、さらにたくさんの画面を"
|
||||
"使用できるようにするかどうかです。この設定は 'natural' の配置アルゴリズムを採"
|
||||
"用している場合にのみ適用されます。"
|
||||
|
||||
#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:5
|
||||
msgid "Use more screen for windows"
|
||||
msgstr "ウィンドウにたくさんの画面を使うかどうか"
|
||||
|
||||
#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:6
|
||||
msgid "Window placement strategy"
|
||||
msgstr "ウィンドウを配置するアルゴリズム"
|
||||
|
||||
#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:1
|
||||
msgid "The name of the theme, to be loaded from ~/.themes/name/gnome-shell"
|
||||
msgstr "テーマの名前です (~/.themes/name/gnome-shell 配下に格納します)。"
|
||||
|
||||
#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:2
|
||||
msgid "Theme name"
|
||||
msgstr "テーマの名前"
|
||||
|
||||
#: ../extensions/xrandr-indicator/extension.js:26
|
||||
msgid "Normal"
|
||||
msgstr "標準"
|
||||
|
||||
#: ../extensions/xrandr-indicator/extension.js:27
|
||||
msgid "Left"
|
||||
msgstr "左回り"
|
||||
|
||||
#: ../extensions/xrandr-indicator/extension.js:28
|
||||
msgid "Right"
|
||||
msgstr "右回り"
|
||||
|
||||
#: ../extensions/xrandr-indicator/extension.js:29
|
||||
msgid "Upside-down"
|
||||
msgstr "逆さま"
|
||||
|
||||
#: ../extensions/xrandr-indicator/extension.js:78
|
||||
msgid "Configure display settings..."
|
||||
msgstr "ディスプレイの設定..."
|
||||
Reference in New Issue
Block a user