This commit is contained in:
davedatum 2019-10-26 21:50:28 +01:00
parent 302349855d
commit bdc807428d
426 changed files with 26974 additions and 52 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
Appfolders Management extension by Maestroschan
Dash to Dock by michele_g
Do Not Disturb by kylecorry31
No Topleft Hot Corner by azuri
Notifications Alert by hackedbellini
Pamac Updates Indicator
Tweaks in System Menu by philippetroin
Unite by hardpixel
User Themes by fmuellner
Volume Scroll by krizajb

View File

@ -1,36 +0,0 @@
[org.gnome.shell.extensions.dash-to-dock]
animate-show-apps=true
apply-custom-theme=false
background-color='#1b2224'
background-opacity=0.73999999999999999
click-action='minimize-or-previews'
custom-background-color=false
custom-theme-customize-running-dots=true
custom-theme-running-dots-border-color='#34a27b'
custom-theme-running-dots-border-width=1
custom-theme-running-dots-color='#34a27b'
custom-theme-shrink=false
dash-max-icon-size=37
dock-fixed=true
dock-position='LEFT'
extend-height=true
force-straight-corner=true
icon-size-fixed=true
isolate-monitors=true
isolate-workspaces=true
max-alpha=0.80000000000000004
middle-click-action='launch'
multi-monitor=false
running-indicator-dominant-color=false
running-indicator-style='SEGMENTED'
scroll-action='do-nothing'
shift-click-action='minimize'
shift-middle-click-action='launch'
show-apps-at-top=false
show-running=true
show-show-apps-button=true
show-windows-preview=true
show-trash=false
show-mounts=false
transparency-mode='DYNAMIC'
unity-backlit-items=false

View File

@ -1,3 +0,0 @@
[org.gnome.shell.extensions.notifications-alert]
blinkrate=0
color='#279079'

View File

@ -1,3 +1,58 @@
[org/gnome/shell/extensions/user-theme]
name='vimix-dark-beryl'
[org/gnome/shell/extensions/unite]
desktop-name-text='TROM Spin :)'
extend-left-box=false
greyscale-tray-icons=true
hide-activities-button='always'
hide-window-titlebars='maximized'
notifications-position='center'
show-desktop-name=false
show-window-title='never'
window-buttons-theme='vimix'
[org/gnome/shell/extensions/notifications-alert]
blinkrate=0
color='#279079'
[org/gnome/shell/extensions/dash-to-dock]
animate-show-apps=true
apply-custom-theme=false
background-color='#1b2224'
background-opacity=0.73999999999999999
click-action='minimize-or-previews'
custom-background-color=false
custom-theme-customize-running-dots=true
custom-theme-running-dots-border-color='#34a27b'
custom-theme-running-dots-border-width=1
custom-theme-running-dots-color='#34a27b'
custom-theme-shrink=false
dash-max-icon-size=37
dock-fixed=true
dock-position='LEFT'
extend-height=true
force-straight-corner=true
icon-size-fixed=true
isolate-monitors=true
isolate-workspaces=true
max-alpha=0.80000000000000004
middle-click-action='launch'
multi-monitor=false
running-indicator-dominant-color=false
running-indicator-style='SEGMENTED'
scroll-action='do-nothing'
shift-click-action='minimize'
shift-middle-click-action='launch'
show-apps-at-top=false
show-running=true
show-show-apps-button=true
show-windows-preview=true
show-trash=false
show-mounts=false
transparency-mode='DYNAMIC'
unity-backlit-items=false
[org/gnome/desktop/app-folders]
folder-children = ['accessories', 'chrome-apps', 'games', 'graphics', 'internet', 'office', 'programming', 'science', 'sound---video', 'system-tools', 'universal-access', 'wine']

View File

@ -4,5 +4,5 @@ logo='/usr/share/icons/manjaro/maia/tromjaro-logo.png'
[org/gnome/settings-daemon/plugins/color]
night-light-enabled=false
[org.gnome.desktop.screensaver]
[org/gnome/desktop/screensaver]
picture-uri='file:///usr/share/backgrounds/flat5.jpg'

View File

@ -1,10 +0,0 @@
[org.gnome.shell.extensions.unite]
desktop-name-text='TROM Spin :)'
extend-left-box=false
greyscale-tray-icons=true
hide-activities-button='always'
hide-window-titlebars='maximized'
notifications-position='center'
show-desktop-name=false
show-window-title='never'
window-buttons-theme='vimix'

View File

@ -1,2 +0,0 @@
[org.gnome.shell.extensions.user-theme]
name='vimix-dark-beryl'

View File

@ -0,0 +1,542 @@
// appfolderDialog.js
// GPLv3
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const St = imports.gi.St;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const PopupMenu = imports.ui.popupMenu;
const ShellEntry = imports.ui.shellEntry;
const Signals = imports.signals;
const Gtk = imports.gi.Gtk;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const Extension = Me.imports.extension;
const Gettext = imports.gettext.domain('appfolders-manager');
const _ = Gettext.gettext;
let FOLDER_SCHEMA;
let FOLDER_LIST;
//--------------------------------------------------------------
// This is a modal dialog for creating a new folder, or renaming or modifying
// categories of existing folders.
var AppfolderDialog = class AppfolderDialog {
// build a new dialog. If folder is null, the dialog will be for creating a new
// folder, else app is null, and the dialog will be for editing an existing folder
constructor (folder, app, id) {
this._folder = folder;
this._app = app;
this._id = id;
this.super_dialog = new ModalDialog.ModalDialog({ destroyOnClose: true });
FOLDER_SCHEMA = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
FOLDER_LIST = FOLDER_SCHEMA.get_strv('folder-children');
let nameSection = this._buildNameSection();
let categoriesSection = this._buildCategoriesSection();
this.super_dialog.contentLayout.style = 'spacing: 20px';
this.super_dialog.contentLayout.add(nameSection, {
x_fill: false,
x_align: St.Align.START,
y_align: St.Align.START
});
if ( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('categories') ) {
this.super_dialog.contentLayout.add(categoriesSection, {
x_fill: false,
x_align: St.Align.START,
y_align: St.Align.START
});
}
if (this._folder == null) {
this.super_dialog.setButtons([
{ action: this.destroy.bind(this),
label: _("Cancel"),
key: Clutter.Escape },
{ action: this._apply.bind(this),
label: _("Create"),
key: Clutter.Return }
]);
} else {
this.super_dialog.setButtons([
{ action: this.destroy.bind(this),
label: _("Cancel"),
key: Clutter.Escape },
{ action: this._deleteFolder.bind(this),
label: _("Delete"),
key: Clutter.Delete },
{ action: this._apply.bind(this),
label: _("Apply"),
key: Clutter.Return }
]);
}
this._nameEntryText.connect('key-press-event', (o, e) => {
let symbol = e.get_key_symbol();
if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
this.super_dialog.popModal();
this._apply();
}
});
}
// build the section of the UI handling the folder's name and returns it.
_buildNameSection () {
let nameSection = new St.BoxLayout({
style: 'spacing: 5px;',
vertical: true,
x_expand: true,
natural_width_set: true,
natural_width: 350,
});
let nameLabel = new St.Label({
text: _("Folder's name:"),
style: 'font-weight: bold;',
});
nameSection.add(nameLabel, { y_align: St.Align.START });
this._nameEntry = new St.Entry({
x_expand: true,
});
this._nameEntryText = null; ///???
this._nameEntryText = this._nameEntry.clutter_text;
nameSection.add(this._nameEntry, { y_align: St.Align.START });
ShellEntry.addContextMenu(this._nameEntry);
this.super_dialog.setInitialKeyFocus(this._nameEntryText);
if (this._folder != null) {
this._nameEntryText.set_text(this._folder.get_string('name'));
}
return nameSection;
}
// build the section of the UI handling the folder's categories and returns it.
_buildCategoriesSection () {
let categoriesSection = new St.BoxLayout({
style: 'spacing: 5px;',
vertical: true,
x_expand: true,
natural_width_set: true,
natural_width: 350,
});
let categoriesLabel = new St.Label({
text: _("Categories:"),
style: 'font-weight: bold;',
});
categoriesSection.add(categoriesLabel, {
x_fill: false,
x_align: St.Align.START,
y_align: St.Align.START,
});
let categoriesBox = new St.BoxLayout({
style: 'spacing: 5px;',
vertical: false,
x_expand: true,
});
// at the left, how to add categories
let addCategoryBox = new St.BoxLayout({
style: 'spacing: 5px;',
vertical: true,
x_expand: true,
});
this._categoryEntry = new St.Entry({
can_focus: true,
x_expand: true,
hint_text: _("Other category?"),
secondary_icon: new St.Icon({
icon_name: 'list-add-symbolic',
icon_size: 16,
style_class: 'system-status-icon',
y_align: Clutter.ActorAlign.CENTER,
}),
});
ShellEntry.addContextMenu(this._categoryEntry, null);
this._categoryEntry.connect('secondary-icon-clicked', this._addCategory.bind(this));
this._categoryEntryText = null; ///???
this._categoryEntryText = this._categoryEntry.clutter_text;
this._catSelectButton = new SelectCategoryButton(this);
addCategoryBox.add(this._catSelectButton.actor, { y_align: St.Align.CENTER });
addCategoryBox.add(this._categoryEntry, { y_align: St.Align.START });
categoriesBox.add(addCategoryBox, {
x_fill: true,
x_align: St.Align.START,
y_align: St.Align.START,
});
// at the right, a list of categories
this.listContainer = new St.BoxLayout({
vertical: true,
x_expand: true,
});
this.noCatLabel = new St.Label({ text: _("No category") });
this.listContainer.add_actor(this.noCatLabel);
categoriesBox.add(this.listContainer, {
x_fill: true,
x_align: St.Align.END,
y_align: St.Align.START,
});
categoriesSection.add(categoriesBox, {
x_fill: true,
x_align: St.Align.START,
y_align: St.Align.START,
});
// Load categories is necessary even if no this._folder,
// because it initializes the value of this._categories
this._loadCategories();
return categoriesSection;
}
open () {
this.super_dialog.open();
}
// returns if a folder id already exists
_alreadyExists (folderId) {
for(var i = 0; i < FOLDER_LIST.length; i++) {
if (FOLDER_LIST[i] == folderId) {
// this._showError( _("This appfolder already exists.") );
return true;
}
}
return false;
}
destroy () {
if ( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('debug') ) {
log('[AppfolderDialog v2] destroying dialog');
}
this._catSelectButton.destroy(); // TODO ?
this.super_dialog.destroy(); //XXX crée des erreurs reloues ???
}
// Generates a valid folder id, which as no space, no dot, no slash, and which
// doesn't already exist.
_folderId (newName) {
let tmp0 = newName.split(" ");
let folderId = "";
for(var i = 0; i < tmp0.length; i++) {
folderId += tmp0[i];
}
tmp0 = folderId.split(".");
folderId = "";
for(var i = 0; i < tmp0.length; i++) {
folderId += tmp0[i];
}
tmp0 = folderId.split("/");
folderId = "";
for(var i = 0; i < tmp0.length; i++) {
folderId += tmp0[i];
}
if(this._alreadyExists(folderId)) {
folderId = this._folderId(folderId+'_');
}
return folderId;
}
// creates a folder from the data filled by the user (with no properties)
_create () {
let folderId = this._folderId(this._nameEntryText.get_text());
FOLDER_LIST.push(folderId);
FOLDER_SCHEMA.set_strv('folder-children', FOLDER_LIST);
this._folder = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder',
path: '/org/gnome/desktop/app-folders/folders/' + folderId + '/'
});
// this._folder.set_string('name', this._nameEntryText.get_text()); //superflu
// est-il nécessaire d'initialiser la clé apps à [] ??
this._addToFolder();
}
// sets the name to the folder
_applyName () {
let newName = this._nameEntryText.get_text();
this._folder.set_string('name', newName); // génère un bug ?
return Clutter.EVENT_STOP;
}
// loads categories, as set in gsettings, to the UI
_loadCategories () {
if (this._folder == null) {
this._categories = [];
} else {
this._categories = this._folder.get_strv('categories');
if ((this._categories == null) || (this._categories.length == 0)) {
this._categories = [];
} else {
this.noCatLabel.visible = false;
}
}
this._categoriesButtons = [];
for (var i = 0; i < this._categories.length; i++) {
this._addCategoryBox(i);
}
}
_addCategoryBox (i) {
let aCategory = new AppCategoryBox(this, i);
this.listContainer.add_actor(aCategory.super_box);
}
// adds a category to the UI (will be added to gsettings when pressing "apply" only)
_addCategory (entry, new_cat_name) {
if (new_cat_name == null) {
new_cat_name = this._categoryEntryText.get_text();
}
if (this._categories.indexOf(new_cat_name) != -1) {
return;
}
if (new_cat_name == '') {
return;
}
this._categories.push(new_cat_name);
this._categoryEntryText.set_text('');
this.noCatLabel.visible = false;
this._addCategoryBox(this._categories.length-1);
}
// adds all categories to gsettings
_applyCategories () {
this._folder.set_strv('categories', this._categories);
return Clutter.EVENT_STOP;
}
// Apply everything by calling methods above, and reload the view
_apply () {
if (this._app != null) {
this._create();
// this._addToFolder();
}
this._applyCategories();
this._applyName();
this.destroy();
//-----------------------
Main.overview.viewSelector.appDisplay._views[1].view._redisplay();
if ( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('debug') ) {
log('[AppfolderDialog v2] reload the view');
}
}
// initializes the folder with its first app. This is not optional since empty
// folders are not displayed. TODO use the equivalent method from extension.js
_addToFolder () {
let content = this._folder.get_strv('apps');
content.push(this._app);
this._folder.set_strv('apps', content);
}
// Delete the folder, using the extension.js method
_deleteFolder () {
if (this._folder != null) {
Extension.deleteFolder(this._id);
}
this.destroy();
}
};
//------------------------------------------------
// Very complex way to have a menubutton for displaying a menu with standard
// categories. Button part.
class SelectCategoryButton {
constructor (dialog) {
this._dialog = dialog;
let catSelectBox = new St.BoxLayout({
vertical: false,
x_expand: true,
});
let catSelectLabel = new St.Label({
text: _("Select a category…"),
x_align: Clutter.ActorAlign.START,
y_align: Clutter.ActorAlign.CENTER,
x_expand: true,
});
let catSelectIcon = new St.Icon({
icon_name: 'pan-down-symbolic',
icon_size: 16,
style_class: 'system-status-icon',
x_expand: false,
x_align: Clutter.ActorAlign.END,
y_align: Clutter.ActorAlign.CENTER,
});
catSelectBox.add(catSelectLabel, { y_align: St.Align.MIDDLE });
catSelectBox.add(catSelectIcon, { y_align: St.Align.END });
this.actor = new St.Button ({
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
child: catSelectBox,
style_class: 'button',
style: 'padding: 5px 5px;',
x_expand: true,
y_expand: false,
x_fill: true,
y_fill: true,
});
this.actor.connect('button-press-event', this._onButtonPress.bind(this));
this._menu = null;
this._menuManager = new PopupMenu.PopupMenuManager(this);
}
popupMenu () {
this.actor.fake_release();
if (!this._menu) {
this._menu = new SelectCategoryMenu(this, this._dialog);
this._menu.super_menu.connect('open-state-changed', (menu, isPoppedUp) => {
if (!isPoppedUp) {
this.actor.sync_hover();
this.emit('menu-state-changed', false);
}
});
this._menuManager.addMenu(this._menu.super_menu);
}
this.emit('menu-state-changed', true);
this.actor.set_hover(true);
this._menu.popup();
this._menuManager.ignoreRelease();
return false;
}
_onButtonPress (actor, event) {
this.popupMenu();
return Clutter.EVENT_STOP;
}
destroy () {
if (this._menu) {
this._menu.destroy();
}
this.actor.destroy();
}
};
Signals.addSignalMethods(SelectCategoryButton.prototype);
//------------------------------------------------
// Very complex way to have a menubutton for displaying a menu with standard
// categories. Menu part.
class SelectCategoryMenu {
constructor (source, dialog) {
this.super_menu = new PopupMenu.PopupMenu(source.actor, 0.5, St.Side.RIGHT);
this._source = source;
this._dialog = dialog;
this.super_menu.actor.add_style_class_name('app-well-menu');
this._source.actor.connect('destroy', this.super_menu.destroy.bind(this));
// We want to keep the item hovered while the menu is up //XXX used ??
this.super_menu.blockSourceEvents = true;
Main.uiGroup.add_actor(this.super_menu.actor);
// This is a really terrible hack to overwrite _redisplay without
// actually inheriting from PopupMenu.PopupMenu
this.super_menu._redisplay = this._redisplay;
this.super_menu._dialog = this._dialog;
}
_redisplay () {
this.removeAll();
let mainCategories = ['AudioVideo', 'Audio', 'Video', 'Development',
'Education', 'Game', 'Graphics', 'Network', 'Office', 'Science',
'Settings', 'System', 'Utility'];
for (var i=0; i<mainCategories.length; i++) {
let labelItem = mainCategories[i] ;
let item = new PopupMenu.PopupMenuItem( labelItem );
item.connect('activate', () => {
this._dialog._addCategory(null, labelItem);
});
this.addMenuItem(item);
}
}
popup (activatingButton) {
this.super_menu._redisplay();
this.super_menu.open();
}
destroy () {
this.super_menu.close(); //FIXME error in the logs but i don't care
this.super_menu.destroy();
}
};
Signals.addSignalMethods(SelectCategoryMenu.prototype);
//----------------------------------------
// This custom widget is a deletable row, displaying a category name.
class AppCategoryBox {
constructor (dialog, i) {
this.super_box = new St.BoxLayout({
vertical: false,
style_class: 'appCategoryBox',
});
this._dialog = dialog;
this.catName = this._dialog._categories[i];
this.super_box.add_actor(new St.Label({
text: this.catName,
y_align: Clutter.ActorAlign.CENTER,
x_align: Clutter.ActorAlign.CENTER,
}));
this.super_box.add_actor( new St.BoxLayout({ x_expand: true }) );
this.deleteButton = new St.Button({
x_expand: false,
y_expand: true,
style_class: 'appCategoryDeleteBtn',
y_align: Clutter.ActorAlign.CENTER,
x_align: Clutter.ActorAlign.CENTER,
child: new St.Icon({
icon_name: 'edit-delete-symbolic',
icon_size: 16,
style_class: 'system-status-icon',
x_expand: false,
y_expand: true,
style: 'margin: 3px;',
y_align: Clutter.ActorAlign.CENTER,
x_align: Clutter.ActorAlign.CENTER,
}),
});
this.super_box.add_actor(this.deleteButton);
this.deleteButton.connect('clicked', this.removeFromList.bind(this));
}
removeFromList () {
this._dialog._categories.splice(this._dialog._categories.indexOf(this.catName), 1);
if (this._dialog._categories.length == 0) {
this._dialog.noCatLabel.visible = true;
}
this.destroy();
}
destroy () {
this.deleteButton.destroy();
this.super_box.destroy();
}
};

View File

@ -0,0 +1,92 @@
/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (c) 2011-2012, Giovanni Campagna <scampa.giovanni@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the GNOME nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
const Gettext = imports.gettext;
const Gio = imports.gi.Gio;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
/**
* initTranslations:
* @domain: (optional): the gettext domain to use
*
* Initialize Gettext to load translations from extensionsdir/locale.
* If @domain is not provided, it will be taken from metadata['gettext-domain']
*/
function initTranslations(domain) {
let extension = ExtensionUtils.getCurrentExtension();
domain = domain || extension.metadata['gettext-domain'];
// check if this extension was built with "make zip-file", and thus
// has the locale files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell
let localeDir = extension.dir.get_child('locale');
if (localeDir.query_exists(null))
Gettext.bindtextdomain(domain, localeDir.get_path());
else
Gettext.bindtextdomain(domain, Config.LOCALEDIR);
}
/**
* getSettings:
* @schema: (optional): the GSettings schema id
*
* Builds and return a GSettings schema for @schema, using schema files
* in extensionsdir/schemas. If @schema is not provided, it is taken from
* metadata['settings-schema'].
*/
function getSettings(schema) {
let extension = ExtensionUtils.getCurrentExtension();
schema = schema || extension.metadata['settings-schema'];
const GioSSS = Gio.SettingsSchemaSource;
// check if this extension was built with "make zip-file", and thus
// has the schema files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell (and therefore schemas are available
// in the standard folders)
let schemaDir = extension.dir.get_child('schemas');
let schemaSource;
if (schemaDir.query_exists(null)) {
schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),
GioSSS.get_default(),
false);
} else {
schemaSource = GioSSS.get_default();
}
let schemaObj = schemaSource.lookup(schema, true);
if (!schemaObj)
throw new Error('Schema ' + schema + ' could not be found for extension '
+ extension.metadata.uuid + '. Please check your installation.');
return new Gio.Settings({ settings_schema: schemaObj });
}

View File

@ -0,0 +1,550 @@
// dragAndDrop.js
// GPLv3
const DND = imports.ui.dnd;
const AppDisplay = imports.ui.appDisplay;
const Clutter = imports.gi.Clutter;
const St = imports.gi.St;
const Main = imports.ui.main;
const Mainloop = imports.mainloop;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const Extension = Me.imports.extension;
const CHANGE_PAGE_TIMEOUT = 400;
const Gettext = imports.gettext.domain('appfolders-manager');
const _ = Gettext.gettext;
//-------------------------------------------------
var OVERLAY_MANAGER;
/* This method is called by extension.js' enable function. It does code injections
* to AppDisplay.AppIcon, connecting it to DND-related signals.
*/
function initDND () {
OVERLAY_MANAGER = new OverlayManager();
}
//--------------------------------------------------------------
/* Amazing! A singleton! It allows easy (and safer?) access to general methods,
* managing other objects: it creates/updates/deletes all overlays (for folders,
* pages, creation, removing).
*/
class OverlayManager {
constructor () {
this.addActions = [];
this.removeAction = new FolderActionArea('remove');
this.createAction = new FolderActionArea('create');
this.upAction = new NavigationArea('up');
this.downAction = new NavigationArea('down');
this.next_drag_should_recompute = true;
this.current_width = 0;
}
on_drag_begin () {
this.ensurePopdowned();
this.ensureFolderOverlayActors();
this.updateFoldersVisibility();
this.updateState(true);
}
on_drag_end () {
// force to compute new positions if a drop occurs
this.next_drag_should_recompute = true;
this.updateState(false);
}
on_drag_cancelled () {
this.updateState(false);
}
updateArrowVisibility () {
let grid = Main.overview.viewSelector.appDisplay._views[1].view._grid;
if (grid.currentPage == 0) {
this.upAction.setActive(false);
} else {
this.upAction.setActive(true);
}
if (grid.currentPage == grid._nPages -1) {
this.downAction.setActive(false);
} else {
this.downAction.setActive(true);
}
this.upAction.show();
this.downAction.show();
}
updateState (isDragging) {
if (isDragging) {
this.removeAction.show();
if (this.openedFolder == null) {
this.removeAction.setActive(false);
} else {
this.removeAction.setActive(true);
}
this.createAction.show();
this.updateArrowVisibility();
} else {
this.hideAll();
}
}
hideAll () {
this.removeAction.hide();
this.createAction.hide();
this.upAction.hide();
this.downAction.hide();
this.hideAllFolders();
}
hideAllFolders () {
for (var i = 0; i < this.addActions.length; i++) {
this.addActions[i].hide();
}
}
updateActorsPositions () {
let monitor = Main.layoutManager.primaryMonitor;
this.topOfTheGrid = Main.overview.viewSelector.actor.get_parent().get_parent().get_allocation_box().y1;
let temp = Main.overview.viewSelector.appDisplay._views[1].view.actor.get_parent();
let bottomOfTheGrid = this.topOfTheGrid + temp.get_allocation_box().y2;
let _availHeight = bottomOfTheGrid - this.topOfTheGrid;
let _availWidth = Main.overview.viewSelector.appDisplay._views[1].view._grid.actor.width;
let sideMargin = (monitor.width - _availWidth) / 2;
let xMiddle = ( monitor.x + monitor.width ) / 2;
let yMiddle = ( monitor.y + monitor.height ) / 2;
// Positions of areas
this.removeAction.setPosition( xMiddle , bottomOfTheGrid );
this.createAction.setPosition( xMiddle, Main.overview._panelGhost.height );
this.upAction.setPosition( 0, Main.overview._panelGhost.height );
this.downAction.setPosition( 0, bottomOfTheGrid );
// Sizes of areas
this.removeAction.setSize(xMiddle, monitor.height - bottomOfTheGrid);
this.createAction.setSize(xMiddle, this.topOfTheGrid - Main.overview._panelGhost.height);
this.upAction.setSize(xMiddle, this.topOfTheGrid - Main.overview._panelGhost.height);
this.downAction.setSize(xMiddle, monitor.height - bottomOfTheGrid);
this.updateArrowVisibility();
}
ensureFolderOverlayActors () {
// A folder was opened, and just closed.
if (this.openedFolder != null) {
this.updateActorsPositions();
this.computeFolderOverlayActors();
this.next_drag_should_recompute = true;
return;
}
// The grid "moved" or the whole shit needs forced updating
let allAppsGrid = Main.overview.viewSelector.appDisplay._views[1].view._grid;
let new_width = allAppsGrid.actor.allocation.get_width();
if (new_width != this.current_width || this.next_drag_should_recompute) {
this.next_drag_should_recompute = false;
this.updateActorsPositions();
this.computeFolderOverlayActors();
}
}
computeFolderOverlayActors () {
let monitor = Main.layoutManager.primaryMonitor;
let xMiddle = ( monitor.x + monitor.width ) / 2;
let yMiddle = ( monitor.y + monitor.height ) / 2;
let allAppsGrid = Main.overview.viewSelector.appDisplay._views[1].view._grid;
let nItems = 0;
let indexes = [];
let folders = [];
let x, y;
Main.overview.viewSelector.appDisplay._views[1].view._allItems.forEach(function(icon) {
if (icon.actor.visible) {
if (icon instanceof AppDisplay.FolderIcon) {
indexes.push(nItems);
folders.push(icon);
}
nItems++;
}
});
this.current_width = allAppsGrid.actor.allocation.get_width();
let x_correction = (monitor.width - this.current_width)/2;
let availHeightPerPage = (allAppsGrid.actor.height)/(allAppsGrid._nPages);
for (var i = 0; i < this.addActions.length; i++) {
this.addActions[i].actor.destroy();
}
for (var i = 0; i < indexes.length; i++) {
let inPageIndex = indexes[i] % allAppsGrid._childrenPerPage;
let page = Math.floor(indexes[i] / allAppsGrid._childrenPerPage);
x = folders[i].actor.get_allocation_box().x1;
y = folders[i].actor.get_allocation_box().y1;
// Invalid coords (example: when dragging out of the folder) should
// not produce a visible overlay, a negative page number is an easy
// way to be sure it stays hidden.
if (x == 0) {
page = -1;
}
x = Math.floor(x + x_correction);
y = y + this.topOfTheGrid;
y = y - (page * availHeightPerPage);
this.addActions[i] = new FolderArea(folders[i].id, x, y, page);
}
}
updateFoldersVisibility () {
let appView = Main.overview.viewSelector.appDisplay._views[1].view;
for (var i = 0; i < this.addActions.length; i++) {
if ((this.addActions[i].page == appView._grid.currentPage) && (!appView._currentPopup)) {
this.addActions[i].show();
} else {
this.addActions[i].hide();
}
}
}
ensurePopdowned () {
let appView = Main.overview.viewSelector.appDisplay._views[1].view;
if (appView._currentPopup) {
this.openedFolder = appView._currentPopup._source.id;
appView._currentPopup.popdown();
} else {
this.openedFolder = null;
}
}
goToPage (nb) {
Main.overview.viewSelector.appDisplay._views[1].view.goToPage( nb );
this.updateArrowVisibility();
this.hideAllFolders();
this.updateFoldersVisibility(); //load folders of the new page
}
destroy () {
for (let i = 0; i > this.addActions.length; i++) {
this.addActions[i].destroy();
}
this.removeAction.destroy();
this.createAction.destroy();
this.upAction.destroy();
this.downAction.destroy();
//log('OverlayManager destroyed');
}
};
//-------------------------------------------------------
// Abstract overlay with very generic methods
class DroppableArea {
constructor (id) {
this.id = id;
this.styleClass = 'folderArea';
this.actor = new St.BoxLayout ({
width: 10,
height: 10,
visible: false,
});
this.actor._delegate = this;
this.lock = true;
this.use_frame = Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('debug');
}
setPosition (x, y) {
let monitor = Main.layoutManager.primaryMonitor;
this.actor.set_position(monitor.x + x, monitor.y + y);
}
setSize (w, h) {
this.actor.width = w;
this.actor.height = h;
}
hide () {
this.actor.visible = false;
this.lock = true;
}
show () {
this.actor.visible = true;
}
setActive (active) {
this._active = active;
if (this._active) {
this.actor.style_class = this.styleClass;
} else {
this.actor.style_class = 'insensitiveArea';
}
}
destroy () {
this.actor.destroy();
}
}
/* Overlay representing an "action". Actions can be creating a folder, or
* removing an app from a folder. These areas accept drop, and display a label.
*/
class FolderActionArea extends DroppableArea {
constructor (id) {
super(id);
let x, y, label;
switch (this.id) {
case 'create':
label = _("Create a new folder");
this.styleClass = 'shadowedAreaTop';
break;
case 'remove':
label = '';
this.styleClass = 'shadowedAreaBottom';
break;
default:
label = 'invalid id';
break;
}
if (this.use_frame) {
this.styleClass = 'framedArea';
}
this.actor.style_class = this.styleClass;
this.label = new St.Label({
text: label,
style_class: 'dropAreaLabel',
x_expand: true,
y_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
});
this.actor.add(this.label);
this.setPosition(10, 10);
Main.layoutManager.overviewGroup.add_actor(this.actor);
}
getRemoveLabel () {
let label;
if (OVERLAY_MANAGER.openedFolder == null) {
label = '…';
} else {
let folder_schema = Extension.folderSchema (OVERLAY_MANAGER.openedFolder);
label = folder_schema.get_string('name');
}
return (_("Remove from %s")).replace('%s', label);
}
setActive (active) {
super.setActive(active);
if (this.id == 'remove') {
this.label.text = this.getRemoveLabel();
}
}
handleDragOver (source, actor, x, y, time) {
if (source instanceof AppDisplay.AppIcon && this._active) {
return DND.DragMotionResult.MOVE_DROP;
}
Main.overview.endItemDrag(this);
return DND.DragMotionResult.NO_DROP;
}
acceptDrop (source, actor, x, y, time) {
if ((source instanceof AppDisplay.AppIcon) && (this.id == 'create')) {
Extension.createNewFolder(source);
Main.overview.endItemDrag(this);
return true;
}
if ((source instanceof AppDisplay.AppIcon) && (this.id == 'remove')) {
this.removeApp(source);
Main.overview.endItemDrag(this);
return true;
}
Main.overview.endItemDrag(this);
return false;
}
removeApp (source) {
let id = source.app.get_id();
Extension.removeFromFolder(id, OVERLAY_MANAGER.openedFolder);
OVERLAY_MANAGER.updateState(false);
Main.overview.viewSelector.appDisplay._views[1].view._redisplay();
}
destroy () {
this.label.destroy();
super.destroy();
}
};
/* Overlay reacting to hover, but isn't droppable. The goal is to go to an other
* page of the grid while dragging an app.
*/
class NavigationArea extends DroppableArea {
constructor (id) {
super(id);
let x, y, i;
switch (this.id) {
case 'up':
i = 'pan-up-symbolic';
this.styleClass = 'shadowedAreaTop';
break;
case 'down':
i = 'pan-down-symbolic';
this.styleClass = 'shadowedAreaBottom';
break;
default:
i = 'dialog-error-symbolic';
break;
}
if (this.use_frame) {
this.styleClass = 'framedArea';
}
this.actor.style_class = this.styleClass;
this.actor.add(new St.Icon({
icon_name: i,
icon_size: 24,
style_class: 'system-status-icon',
x_expand: true,
y_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
}));
this.setPosition(x, y);
Main.layoutManager.overviewGroup.add_actor(this.actor);
}
handleDragOver (source, actor, x, y, time) {
if (this.id == 'up' && this._active) {
this.pageUp();
return DND.DragMotionResult.CONTINUE;
}
if (this.id == 'down' && this._active) {
this.pageDown();
return DND.DragMotionResult.CONTINUE;
}
Main.overview.endItemDrag(this);
return DND.DragMotionResult.NO_DROP;
}
pageUp () {
if(this.lock && !this.timeoutSet) {
this._timeoutId = Mainloop.timeout_add(CHANGE_PAGE_TIMEOUT, this.unlock.bind(this));
this.timeoutSet = true;
}
if(!this.lock) {
let currentPage = Main.overview.viewSelector.appDisplay._views[1].view._grid.currentPage;
this.lock = true;
OVERLAY_MANAGER.goToPage(currentPage - 1);
}
}
pageDown () {
if(this.lock && !this.timeoutSet) {
this._timeoutId = Mainloop.timeout_add(CHANGE_PAGE_TIMEOUT, this.unlock.bind(this));
this.timeoutSet = true;
}
if(!this.lock) {
let currentPage = Main.overview.viewSelector.appDisplay._views[1].view._grid.currentPage;
this.lock = true;
OVERLAY_MANAGER.goToPage(currentPage + 1);
}
}
acceptDrop (source, actor, x, y, time) {
Main.overview.endItemDrag(this);
return false;
}
unlock () {
this.lock = false;
this.timeoutSet = false;
Mainloop.source_remove(this._timeoutId);
}
};
/* This overlay is the area upon a folder. Position and visibility of the actor
* is handled by exterior functions.
* "this.id" is the folder's id, a string, as written in the gsettings key.
* Dropping an app on this folder will add it to the folder
*/
class FolderArea extends DroppableArea {
constructor (id, asked_x, asked_y, page) {
super(id);
this.page = page;
let grid = Main.overview.viewSelector.appDisplay._views[1].view._grid;
this.actor.width = grid._getHItemSize();
this.actor.height = grid._getVItemSize();
if (this.use_frame) {
this.styleClass = 'framedArea';
this.actor.add(new St.Label({
text: this.id,
x_expand: true,
y_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
}));
} else {
this.styleClass = 'folderArea';
this.actor.add(new St.Icon({
icon_name: 'list-add-symbolic',
icon_size: 24,
style_class: 'system-status-icon',
x_expand: true,
y_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
}));
}
if (this.use_frame) {
this.styleClass = 'framedArea';
}
this.actor.style_class = this.styleClass;
this.setPosition(asked_x, asked_y);
Main.layoutManager.overviewGroup.add_actor(this.actor);
}
handleDragOver (source, actor, x, y, time) {
if (source instanceof AppDisplay.AppIcon) {
return DND.DragMotionResult.MOVE_DROP;
}
Main.overview.endItemDrag(this);
return DND.DragMotionResult.NO_DROP;
}
acceptDrop (source, actor, x, y, time) { //FIXME recharger la vue ou au minimum les miniatures des dossiers
if ((source instanceof AppDisplay.AppIcon) &&
!Extension.isInFolder(source.id, this.id)) {
Extension.addToFolder(source, this.id);
Main.overview.endItemDrag(this);
return true;
}
Main.overview.endItemDrag(this);
return false;
}
};

View File

@ -0,0 +1,445 @@
// extension.js
// GPLv3
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const St = imports.gi.St;
const Main = imports.ui.main;
const AppDisplay = imports.ui.appDisplay;
const PopupMenu = imports.ui.popupMenu;
const Meta = imports.gi.Meta;
const Mainloop = imports.mainloop;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const AppfolderDialog = Me.imports.appfolderDialog;
const DragAndDrop = Me.imports.dragAndDrop;
const Gettext = imports.gettext.domain('appfolders-manager');
const _ = Gettext.gettext;
let FOLDER_SCHEMA;
let FOLDER_LIST;
let INIT_TIME;
function init () {
Convenience.initTranslations();
INIT_TIME = getTimeStamp();
}
function getTimeStamp () {
let today = new Date();
let str = today.getDate() + '' + today.getHours() + '' + today.getMinutes()
+ '' + today.getSeconds();
return parseInt(str);
}
//------------------------------------------------------------------------------
/* do not edit this section */
function injectToFunction(parent, name, func) {
let origin = parent[name];
parent[name] = function() {
let ret;
ret = origin.apply(this, arguments);
if (ret === undefined)
ret = func.apply(this, arguments);
return ret;
}
return origin;
}
function removeInjection(object, injection, name) {
if (injection[name] === undefined)
delete object[name];
else
object[name] = injection[name];
}
var injections=[];
//------------------------------------------------------------------------------
/* this function injects items (1 or 2 submenus) in AppIconMenu's _redisplay method. */
function injectionInAppsMenus() {
injections['_redisplay'] = injectToFunction(AppDisplay.AppIconMenu.prototype, '_redisplay', function() {
if (Main.overview.viewSelector.getActivePage() == 2
|| Main.overview.viewSelector.getActivePage() == 3) {
//ok
} else {
return;
}
this._appendSeparator(); //TODO injecter ailleurs dans le menu?
let mainAppView = Main.overview.viewSelector.appDisplay._views[1].view;
FOLDER_LIST = FOLDER_SCHEMA.get_strv('folder-children');
//------------------------------------------------------------------
let addto = new PopupMenu.PopupSubMenuMenuItem(_("Add to"));
let newAppFolder = new PopupMenu.PopupMenuItem('+ ' + _("New AppFolder"));
newAppFolder.connect('activate', () => {
this._source._menuManager._grabHelper.ungrab({ actor: this.actor });
// XXX broken scrolling ??
// We can't popdown the folder immediately because the
// AppDisplay.AppFolderPopup.popdown() method tries to ungrab
// the global focus from the folder's popup actor, which isn't
// having the focus since the menu is still open. Menus' animation
// last ~0.25s so we will wait 0.30s before doing anything.
let a = Mainloop.timeout_add(300, () => {
if (mainAppView._currentPopup) {
mainAppView._currentPopup.popdown();
}
createNewFolder(this._source);
mainAppView._redisplay();
Mainloop.source_remove(a);
});
});
addto.menu.addMenuItem(newAppFolder);
for (var i = 0 ; i < FOLDER_LIST.length ; i++) {
let _folder = FOLDER_LIST[i];
let shouldShow = !isInFolder( this._source.app.get_id(), _folder );
let iFolderSchema = folderSchema(_folder);
let item = new PopupMenu.PopupMenuItem( AppDisplay._getFolderName(iFolderSchema) );
if ( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('debug') ) {
shouldShow = true; //TODO ??? et l'exclusion ?
}
if(shouldShow) {
item.connect('activate', () => {
this._source._menuManager._grabHelper.ungrab({ actor: this.actor });
// XXX broken scrolling ??
// We can't popdown the folder immediatly because the
// AppDisplay.AppFolderPopup.popdown() method tries to
// ungrab the global focus from the folder's popup actor,
// which isn't having the focus since the menu is still
// open. Menus' animation last ~0.25s so we will wait 0.30s
// before doing anything.
let a = Mainloop.timeout_add(300, () => {
if (mainAppView._currentPopup) {
mainAppView._currentPopup.popdown();
}
addToFolder(this._source, _folder);
mainAppView._redisplay();
Mainloop.source_remove(a);
});
});
addto.menu.addMenuItem(item);
}
}
this.addMenuItem(addto);
//----------------------------------------------------------------------
let removeFrom = new PopupMenu.PopupSubMenuMenuItem(_("Remove from"));
let shouldShow2 = false;
for (var i = 0 ; i < FOLDER_LIST.length ; i++) {
let _folder = FOLDER_LIST[i];
let appId = this._source.app.get_id();
let shouldShow = isInFolder(appId, _folder);
let iFolderSchema = folderSchema(_folder);
let item = new PopupMenu.PopupMenuItem( AppDisplay._getFolderName(iFolderSchema) );
if ( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('debug') ) {
shouldShow = true; //FIXME ??? et l'exclusion ?
}
if(shouldShow) {
item.connect('activate', () => {
this._source._menuManager._grabHelper.ungrab({ actor: this.actor });
// XXX broken scrolling ??
// We can't popdown the folder immediatly because the
// AppDisplay.AppFolderPopup.popdown() method tries to
// ungrab the global focus from the folder's popup actor,
// which isn't having the focus since the menu is still
// open. Menus' animation last ~0.25s so we will wait 0.30s
// before doing anything.
let a = Mainloop.timeout_add(300, () => {
if (mainAppView._currentPopup) {
mainAppView._currentPopup.popdown();
}
removeFromFolder(appId, _folder);
mainAppView._redisplay();
Mainloop.source_remove(a);
});
});
removeFrom.menu.addMenuItem(item);
shouldShow2 = true;
}
}
if (shouldShow2) {
this.addMenuItem(removeFrom);
}
});
}
//------------------------------------------------
function injectionInIcons() {
// Right-click on a FolderIcon launches a new AppfolderDialog
AppDisplay.FolderIcon = class extends AppDisplay.FolderIcon {
constructor (id, path, parentView) {
super(id, path, parentView);
if (!this.isCustom) {
this.actor.connect('button-press-event', this._onButtonPress.bind(this));
}
this.isCustom = true;
}
_onButtonPress (actor, event) {
let button = event.get_button();
if (button == 3) {
let tmp = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder',
path: '/org/gnome/desktop/app-folders/folders/' + this.id + '/'
});
let dialog = new AppfolderDialog.AppfolderDialog(tmp, null, this.id);
dialog.open();
}
return Clutter.EVENT_PROPAGATE;
}
};
// Dragging an AppIcon triggers the DND mode
AppDisplay.AppIcon = class extends AppDisplay.AppIcon {
constructor (app, params) {
super(app, params);
if (!this.isCustom) {
this._draggable.connect('drag-begin', this.onDragBeginExt.bind(this));
this._draggable.connect('drag-cancelled', this.onDragCancelledExt.bind(this));
this._draggable.connect('drag-end', this.onDragEndExt.bind(this));
}
this.isCustom = true;
}
onDragBeginExt () {
if (Main.overview.viewSelector.getActivePage() != 2) {
return;
}
this._removeMenuTimeout(); // why ?
Main.overview.beginItemDrag(this);
DragAndDrop.OVERLAY_MANAGER.on_drag_begin();
}
onDragEndExt () {
Main.overview.endItemDrag(this);
DragAndDrop.OVERLAY_MANAGER.on_drag_end();
}
onDragCancelledExt () {
Main.overview.cancelledItemDrag(this);
DragAndDrop.OVERLAY_MANAGER.on_drag_cancelled();
}
};
}
//------------------------------------------------------------------------------
//---------------------------------- Generic -----------------------------------
//--------------------------------- functions ----------------------------------
//------------------------------------------------------------------------------
/* These functions perform the requested actions but do not care about popdowning
* open menu/open folder, nor about hiding/showing/activating dropping areas, nor
* about redisplaying the view.
*/
function removeFromFolder (app_id, folder_id) {
let folder_schema = folderSchema(folder_id);
if ( isInFolder(app_id, folder_id) ) {
let pastContent = folder_schema.get_strv('apps');
let presentContent = [];
for(var i=0; i<pastContent.length; i++){
if(pastContent[i] != app_id) {
presentContent.push(pastContent[i]);
}
}
folder_schema.set_strv('apps', presentContent);
} else {
let content = folder_schema.get_strv('excluded-apps');
content.push(app_id);
folder_schema.set_strv('excluded-apps', content);
}
return true;
}
//------------------------------------------------------------------------------
function deleteFolder (folder_id) {
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
let tmp = [];
FOLDER_LIST = FOLDER_SCHEMA.get_strv('folder-children');
for(var j=0;j < FOLDER_LIST.length;j++){
if(FOLDER_LIST[j] != folder_id) {
tmp.push(FOLDER_LIST[j]);
}
}
FOLDER_LIST = tmp;
FOLDER_SCHEMA.set_strv('folder-children', FOLDER_LIST);
// ?? XXX (ne fonctionne pas mieux hors du meta.later_add)
if ( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('total-deletion') ) {
let folder_schema = folderSchema (folder_id);
folder_schema.reset('apps'); // génère un bug volumineux ?
folder_schema.reset('categories'); // génère un bug volumineux ?
folder_schema.reset('excluded-apps'); // génère un bug volumineux ?
folder_schema.reset('name'); // génère un bug volumineux ?
}
});
return true;
}
//------------------------------------------------------------------------------
function mergeFolders (folder_staying_id, folder_dying_id) { //unused XXX
let folder_dying_schema = folderSchema (folder_dying_id);
let folder_staying_schema = folderSchema (folder_staying_id);
let newerContent = folder_dying_schema.get_strv('categories');
let presentContent = folder_staying_schema.get_strv('categories');
for(var i=0;i<newerContent.length;i++){
if(presentContent.indexOf(newerContent[i]) == -1) {
presentContent.push(newerContent[i]);
}
}
folder_staying_schema.set_strv('categories', presentContent);
newerContent = folder_dying_schema.get_strv('excluded-apps');
presentContent = folder_staying_schema.get_strv('excluded-apps');
for(var i=0;i<newerContent.length;i++){
if(presentContent.indexOf(newerContent[i]) == -1) {
presentContent.push(newerContent[i]);
}
}
folder_staying_schema.set_strv('excluded-apps', presentContent);
newerContent = folder_dying_schema.get_strv('apps');
presentContent = folder_staying_schema.get_strv('apps');
for(var i=0;i<newerContent.length;i++){
if(presentContent.indexOf(newerContent[i]) == -1) {
// if(!isInFolder(newerContent[i], folder_staying_id)) {
presentContent.push(newerContent[i]);
//TODO utiliser addToFolder malgré ses paramètres chiants
}
}
folder_staying_schema.set_strv('apps', presentContent);
deleteFolder(folder_dying_id);
return true;
}
//------------------------------------------------------------------------------
function createNewFolder (app_source) {
let id = app_source.app.get_id();
let dialog = new AppfolderDialog.AppfolderDialog(null , id);
dialog.open();
return true;
}
//------------------------------------------------------------------------------
function addToFolder (app_source, folder_id) {
let id = app_source.app.get_id();
let folder_schema = folderSchema (folder_id);
//un-exclude the application if it was excluded TODO else don't do it at all
let pastExcluded = folder_schema.get_strv('excluded-apps');
let presentExcluded = [];
for(let i=0; i<pastExcluded.length; i++){
if(pastExcluded[i] != id) {
presentExcluded.push(pastExcluded[i]);
}
}
if (presentExcluded.length > 0) {
folder_schema.set_strv('excluded-apps', presentExcluded);
}
//actually add the app
let content = folder_schema.get_strv('apps');
content.push(id);
folder_schema.set_strv('apps', content); //XXX verbose errors
//update icons in the ugliest possible way
let icons = Main.overview.viewSelector.appDisplay._views[1].view.folderIcons;
for (let i=0; i<icons.length; i++) {
let size = icons[i].icon._iconBin.width;
icons[i].icon.icon = icons[i]._createIcon(size);
icons[i].icon._iconBin.child = icons[i].icon.icon;
}
return true;
}
//------------------------------------------------------------------------------
function isInFolder (app_id, folder_id) {
let folder_schema = folderSchema(folder_id);
let isIn = false;
let content_ = folder_schema.get_strv('apps');
for(var j=0; j<content_.length; j++) {
if(content_[j] == app_id) {
isIn = true;
}
}
return isIn;
}
//------------------------------------------------------------------------------
function folderSchema (folder_id) {
let a = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder',
path: '/org/gnome/desktop/app-folders/folders/' + folder_id + '/'
});
return a;
} // TODO et AppDisplay._getFolderName ??
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function enable() {
FOLDER_SCHEMA = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' });
FOLDER_LIST = FOLDER_SCHEMA.get_strv('folder-children');
injectionInIcons();
if( Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager').get_boolean('extend-menus') ) {
injectionInAppsMenus();
}
DragAndDrop.initDND();
// Reload the view if the user load the extension at least a minute after
// opening the session. XXX works like shit
let delta = getTimeStamp() - INIT_TIME;
if (delta < 0 || delta > 105) {
Main.overview.viewSelector.appDisplay._views[1].view._redisplay();
}
}
function disable() {
AppDisplay.FolderIcon.prototype._onButtonPress = null;
AppDisplay.FolderIcon.prototype.popupMenu = null;
removeInjection(AppDisplay.AppIconMenu.prototype, injections, '_redisplay');
// Overwrite my shit for FolderIcon
AppDisplay.FolderIcon = class extends AppDisplay.FolderIcon {
_onButtonPress (actor, event) {
return Clutter.EVENT_PROPAGATE;
}
};
// Overwrite my shit for AppIcon
AppDisplay.AppIcon = class extends AppDisplay.AppIcon {
onDragBeginExt () {}
onDragEndExt () {}
onDragCancelledExt () {}
};
DragAndDrop.OVERLAY_MANAGER.destroy();
}
//------------------------------------------------------------------------------

View File

@ -0,0 +1,114 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr ""
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr ""
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, javascript-format
msgid "Remove from %s"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""

View File

@ -0,0 +1,123 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2018-12-30 14:03+0300\n"
"Last-Translator: Максім Крапіўка <metalomaniax@gmail.com>\n"
"Language-Team: \n"
"Language: be\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Дадаць у"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Новая папка праграм"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Выдаліць з"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr "Стварыць новую папку"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, javascript-format
msgid "Remove from %s"
msgstr "Выдаліць з %s"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Скасаваць"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Выдаліць"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr "Дастасаваць"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr "Назва папкі"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr "Катэгорыі:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr "Іншая катэгорыя?"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr "Без катэгорыі"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr "Выбраць катэгорыю..."
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Змены ўступяць у сілу пасля перазагрузкі пашырэння."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr "Галоўныя налады"
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr "Катэгорыі"
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Выдаляць усе звязаныя налады пры выдаленні папкі праграм"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
"Выкарыстоўваць націсканне правай кнопкай мышы ў дадатак да перацягвання "
"значкоў"
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr "Выкарыстоўваць катэгорыі"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Больш інфармацыі пра «дадатковыя» катэгорыі"
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Паведаміць пра памылкі або ідэі"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Гэта пашырэнне можна адключыць, пасля таго як вы канчаткова наладзіце "
"арганізацыю сваіх праграм."
#~ msgid "Standard specification"
#~ msgstr "Стандартная спецыфікацыя"

View File

@ -0,0 +1,124 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2017-10-28 01:50+0200\n"
"Last-Translator: Jonatan Hatakeyama Zeidler <jonatan_zeidler@gmx.de>\n"
"Language-Team: https://github.com/hobbypunk90/appfolders-manager-gnome-"
"extension\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Hinzufügen zu"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Neuer Ordner"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Löschen aus"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Löschen aus"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Abbrechen"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Erstelle"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Löschen"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
#, fuzzy
msgid "Other category?"
msgstr "Lösche eine Kategorie"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
#, fuzzy
msgid "No category"
msgstr "Kategorie hinzufügen"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Lösche eine Kategorie"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Änderungen werden nach Neustart der Erweiterung übernommen."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Lösche alle Einstellungen, wenn ein Ordner gelöscht wird"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
#, fuzzy
msgid "Use categories"
msgstr "Hinzugefügte Kategorien"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
#~ msgid "This appfolder already exists."
#~ msgstr "Dieser Ordner existiert bereits."

View File

@ -0,0 +1,118 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2017-05-29 23:26+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: el\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Προσθήκη σε"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Νέος φάκελος"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Αφαίρεση από"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Αφαίρεση από"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Αναίρεση"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Διαγραφή"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr ""
"Οι τροποποιήσεις απαιτούν την επανεκκίνηση της επέκτασης για να "
"λειτουργήσουν."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Διαγραφή όλων των σχετικών ρυθμίσεων κατά την διαγραφή ενός φακέλου"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""

View File

@ -0,0 +1,116 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2017-02-05 16:47+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Ajouter à"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Nouvel AppFolder"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Retirer de"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr "Créer un nouveau dossier"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, javascript-format
msgid "Remove from %s"
msgstr "Retirer de %s"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Annuler"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Créer"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Supprimer"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr "Appliquer"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr "Nom du dossier :"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr "Catégories :"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr "Autre catégorie ?"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr "Aucune catégorie"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr "Choisir une catégorie…"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Les modifications prendront effet après avoir rechargé l'extension"
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr "Réglages principaux"
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr "Catégories"
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr ""
"Supprimer tous les réglages relatifs à un appfolder lors de sa suppression"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr "Utiliser le menu du clic-droit en complément du glisser-déposer"
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr "Utiliser des catégories"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Plus d'informations à propos des \"catégories supplémentaires\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Reporter un bug ou une idée"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Cette extension peut être désactivée une fois que vos applications sont "
"organisées comme souhaité."
#~ msgid "Standard specification"
#~ msgstr "Spécification standard"

View File

@ -0,0 +1,116 @@
# Hungarian translation for appfolders-manager.
# Copyright (C) 2017 Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
#
# Balázs Úr <urbalazs@gmail.com>, 2017.
msgid ""
msgstr ""
"Project-Id-Version: appfolders-manager master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2017-05-31 20:41+0100\n"
"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
"Language-Team: Hungarian <openscope@googlegroups.com>\n"
"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 2.0\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Hozzáadás ehhez"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Új alkalmazásmappa"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Eltávolítás innen"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Eltávolítás innen"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Mégse"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Törlés"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "A módosítások a kiterjesztés újratöltése után lépnek hatályba."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr ""
"Az összes kapcsolódó beállítás törlése, ha egy alkalmazásmappa törölve lesz"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""

View File

@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2018-03-08 17:21+0100\n"
"Last-Translator: Jimmy Scionti <jimmy.scionti@gmail.com>\n"
"Language-Team: \n"
"Language: it_IT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Aggiungi a"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Nuova AppFolder"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Rimuovi da"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Rimuovi da"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Annulla"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Crea"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Elimina"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
#, fuzzy
msgid "Other category?"
msgstr "Rimuovi una categoria"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
#, fuzzy
msgid "No category"
msgstr "Aggiungi una categoria"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Rimuovi una categoria"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Le modifiche avranno effetto dopo aver ricaricato l'estensione."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Elimina tutte le impostazioni dell'AppFolder quando viene rimossa"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
#, fuzzy
msgid "Use categories"
msgstr "Categorie aggiuntive"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Maggiori informazioni sulle \"categorie aggiuntive\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Invia segnalazioni di bug o idee"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Questa estensione può essere disattivata dopo aver organizzato le "
"applicazione come desiderato."
#~ msgid "Standard specification"
#~ msgstr "Specifiche standards"
#~ msgid "This appfolder already exists."
#~ msgstr "Questa AppFolder esiste già."

View File

@ -0,0 +1,126 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
msgid ""
msgstr ""
"Project-Id-Version: Appfolders Management (GNOME extension)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2018-12-19 21:13+0100\n"
"Last-Translator: Piotr Komur <pkomur@gmail.com>\n"
"Language-Team: Piotr Komur\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Dodaj do folderu"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Nowy folder programów"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Usuń z folderu"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr "Utwórz nowy folder"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Usuń z folderu"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Anuluj"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Utwórz"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Usuń"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr "Zastosuj"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr "Nazwa folderu:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr "Kategorie programów:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr "Nowa kategoria"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr "Brak wybranych kategorii"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Wybierz kategorię"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Zmiany będą aktywne po ponownym zrestartowaniu środowiska Gnome."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr "Ustawienia"
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr "Kategorie"
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Usuń powiązane zmiany wraz z usunięciem folderu programów."
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr "Użyj standardowych kategorii"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Więcej informacji o \"standardowych kategoriach\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Zgłoś błędy lub nowe funkcje"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Można dezaktywować to rozszerzenie po zakończeniu porządkowania programów w "
"folderach."
#~ msgid "Standard specification"
#~ msgstr "Specyfikacja standardu"
#~ msgid "This appfolder already exists."
#~ msgstr "Folder o tej nazwie już istnieje."

View File

@ -0,0 +1,124 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2019-02-10 11:19-0200\n"
"Last-Translator: Fábio Nogueira <fnogueira@gnome.org>\n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.1\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Adicionar para"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Nova AppFolder"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Remover de"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr "Criar uma nova pasta"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, javascript-format
msgid "Remove from %s"
msgstr "Remover de %s"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Cancelar"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Criar"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Excluir"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr "Aplicar"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr "Nome da pasta:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr "Categorias:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr "Outra categoria?"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr "Nenhuma categoria"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr "Selecione uma categoria…"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "As modificações entrarão em vigor depois de recarregar a extensão."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr "Configurações principais"
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr "Categorias"
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr ""
"Excluir todas as configurações relacionadas quando um appfolder for excluído"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr "Use os menus do botão direito, além do arrastar e soltar"
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr "Usar categorias"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Mais informações sobre \"categorias adicionais\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Comunicar erros ou ideias"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Esta extensão pode ser desativada assim que seus aplicativos forem "
"organizados conforme desejado."
#~ msgid "Standard specification"
#~ msgstr "Especificação padrão"
#~ msgid "This appfolder already exists."
#~ msgstr "Esta appfolder já existe."

View File

@ -0,0 +1,125 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Max Krapiŭka <metalomaniax@gmail.com>\n"
"Language-Team: RUSSIAN <metalomaniax@gmail.com>\n"
"Language: be\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Добавить в"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Новая папка"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Удалить из"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Удалить из"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Отмена"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Стварыць"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Удалить"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
#, fuzzy
msgid "Other category?"
msgstr "Удалить категорию"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
#, fuzzy
msgid "No category"
msgstr "Добавить категорию"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Удалить категорию"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Изменения вступят в силу после перезагрузки расширения."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Удалять все связанные настройки при удалении папки приложений."
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
#, fuzzy
msgid "Use categories"
msgstr "Дополнительные категории"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Больше информации про \"дополнительные категории\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Сообщить об ошибках, предложить идеи"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Это расширение может быть деактивировано, после того как вы окончательно "
"настроите организацию своих приложений."
#~ msgid "Standard specification"
#~ msgstr "Стандартная спецификация"
#~ msgid "This appfolder already exists."
#~ msgstr "Эта папка приложений уже существует"

View File

@ -0,0 +1,124 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2017-09-15 16:40+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: sr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Додај у"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Нова фаскила програма"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Уклони ставку"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Уклони ставку"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Откажи"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Направи"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Обриши"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
#, fuzzy
msgid "Other category?"
msgstr "Уклони категорију"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
#, fuzzy
msgid "No category"
msgstr "Додај категорију"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Уклони категорију"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Измене ће ступити на снагу по поновном учитавању проширења."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Обриши све припадајуће поставке при брисању проширења"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
#, fuzzy
msgid "Use categories"
msgstr "Додатне категорије"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
#~ msgid "This appfolder already exists."
#~ msgstr "Ова фасцикла програма већ постоји."

View File

@ -0,0 +1,124 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2017-09-15 16:40+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: sr@latin\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Dodaj u"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Nova faskila programa"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Ukloni stavku"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr ""
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Ukloni stavku"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Otkaži"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Napravi"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Obriši"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
#, fuzzy
msgid "Other category?"
msgstr "Ukloni kategoriju"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
#, fuzzy
msgid "No category"
msgstr "Dodaj kategoriju"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Ukloni kategoriju"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Izmene će stupiti na snagu po ponovnom učitavanju proširenja."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Obriši sve pripadajuće postavke pri brisanju proširenja"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:56
#, fuzzy
msgid "Use categories"
msgstr "Dodatne kategorije"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr ""
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
#~ msgid "This appfolder already exists."
#~ msgstr "Ova fascikla programa već postoji."

View File

@ -0,0 +1,118 @@
# Uygulama klasörleme Türkçe çeviri.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Serdar Sağlam <teknomobil@yandex.com>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: v13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2019-01-19 12:10+0300\n"
"Last-Translator: Serdar Sağlam <teknomobil@yandex.com>\n"
"Language-Team: Türkçe <teknomobil@yandex.com>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Klasör Grubuna Taşı"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Yeni Klasör Grubu"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Buradan Kaldır"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr "Yeni klasör oluştur"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, javascript-format
msgid "Remove from %s"
msgstr "Buradan Kaldır %s"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "İptal"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr "Oluştur"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Sil"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr "Onayla"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr "Klasör İsmi:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr "Kategoriler:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr "Diğer Kategori?"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr "Kategori Yok"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
msgid "Select a category…"
msgstr "Kategori Seç…"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Değişiklikler,eklenti yeniden başladıktan sonra etkili olacaktır."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr "Ayarlar"
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr "Kategoriler"
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Bir klasör grubu silindiğinde tüm ilgili ayarları silin"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr "Sürükle ve bırak işlevine ek olarak sağ tıklama menülerini kullanın"
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr "Kategorileri Kullan"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Hakkında daha fazla bilgi \"ek kategoriler\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Yeni bir fikir veya hata bildirin"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr ""
"Menüleri istediğiniz şekilde düzenlendiğinde bu uzantı devre dışı "
"bırakılabilir."
#~ msgid "Standard specification"
#~ msgstr "Standart şartname"

View File

@ -0,0 +1,123 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-27 21:15+0200\n"
"PO-Revision-Date: 2018-12-19 05:43+0200\n"
"Last-Translator: Igor Gordiichuk <igor_ck@outlook.com>\n"
"Language-Team: \n"
"Language: uk_UA\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: appfolders-manager@maestroschan.fr/extension.js:83
msgid "Add to"
msgstr "Додати до"
#: appfolders-manager@maestroschan.fr/extension.js:85
msgid "New AppFolder"
msgstr "Нова тека програм"
#: appfolders-manager@maestroschan.fr/extension.js:139
msgid "Remove from"
msgstr "Вилучити з"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:312
msgid "Create a new folder"
msgstr "Створити нову теку"
#: appfolders-manager@maestroschan.fr/dragAndDrop.js:350
#, fuzzy, javascript-format
msgid "Remove from %s"
msgstr "Вилучити з "
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:62
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:72
msgid "Cancel"
msgstr "Скасувати"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:66
msgid "Create"
msgstr ""
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:76
msgid "Delete"
msgstr "Вилучити"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:80
msgid "Apply"
msgstr "Застосовувати"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:106
msgid "Folder's name:"
msgstr "Назва теки:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:139
msgid "Categories:"
msgstr "Категорії:"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:164
msgid "Other category?"
msgstr "Інша категорія?"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:192
msgid "No category"
msgstr "Без категорії"
#: appfolders-manager@maestroschan.fr/appfolderDialog.js:375
#, fuzzy
msgid "Select a category…"
msgstr "Обрати категорію"
#: appfolders-manager@maestroschan.fr/prefs.js:31
msgid "Modifications will be effective after reloading the extension."
msgstr "Зміни буде застосовано після перезавантаження розширення."
#: appfolders-manager@maestroschan.fr/prefs.js:38
msgid "Main settings"
msgstr "Основні налаштування"
#: appfolders-manager@maestroschan.fr/prefs.js:39
msgid "Categories"
msgstr "Категорії"
#: appfolders-manager@maestroschan.fr/prefs.js:46
msgid "Delete all related settings when an appfolder is deleted"
msgstr "Вилучити всі пов'язані налаштування, коли видаляється тека"
#: appfolders-manager@maestroschan.fr/prefs.js:48
msgid "Use the right-click menus in addition to the drag-and-drop"
msgstr "Використовувати контекстне меню додатково до перетягування мишкою"
#: appfolders-manager@maestroschan.fr/prefs.js:56
msgid "Use categories"
msgstr "Використати категорії"
#: appfolders-manager@maestroschan.fr/prefs.js:59
msgid "More informations about \"additional categories\""
msgstr "Більше інформації про \"додаткові категорії\""
#: appfolders-manager@maestroschan.fr/prefs.js:74
msgid "Report bugs or ideas"
msgstr "Повідомити про ваду або запропонувати ідею"
#: appfolders-manager@maestroschan.fr/prefs.js:85
msgid ""
"This extension can be deactivated once your applications are organized as "
"wished."
msgstr "Це розширення можна деактивувати, якщо програми було впорядковано."
#~ msgid "Standard specification"
#~ msgstr "Стандартні категорії"
#~ msgid "This appfolder already exists."
#~ msgstr "Ця тека програм вже існує."

View File

@ -0,0 +1,15 @@
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "An easy way to arrange your applications in folders, directly from the applications grid. Create folders and add/remove apps using drag-and-drop, rename/delete them with a right-click.",
"gettext-domain": "appfolders-manager",
"name": "Appfolders Management extension",
"shell-version": [
"3.26",
"3.28",
"3.30",
"3.32"
],
"url": "https://github.com/maoschanz/appfolders-manager-gnome-extension",
"uuid": "appfolders-manager@maestroschan.fr",
"version": 16
}

View File

@ -0,0 +1,153 @@
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Gettext = imports.gettext.domain('appfolders-manager');
const _ = Gettext.gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
//-----------------------------------------------
const appfoldersManagerSettingsWidget = new GObject.Class({
Name: 'appfoldersManager.Prefs.Widget',
GTypeName: 'appfoldersManagerPrefsWidget',
Extends: Gtk.Box,
_init: function (params) {
this.parent(params);
this.margin = 30;
this.spacing = 18;
this.set_orientation(Gtk.Orientation.VERTICAL);
this._settings = Convenience.getSettings('org.gnome.shell.extensions.appfolders-manager');
this._settings.set_boolean('debug', this._settings.get_boolean('debug'));
//----------------------------
let labelMain = new Gtk.Label({
label: _("Modifications will be effective after reloading the extension."),
use_markup: true,
wrap: true,
halign: Gtk.Align.START
});
this.add(labelMain);
let generalSection = this.add_section(_("Main settings"));
let categoriesSection = this.add_section(_("Categories"));
//----------------------------
// let autoDeleteBox = this.build_switch('auto-deletion',
// _("Delete automatically empty folders"));
let deleteAllBox = this.build_switch('total-deletion',
_("Delete all related settings when an appfolder is deleted"));
let menusBox = this.build_switch('extend-menus',
_("Use the right-click menus in addition to the drag-and-drop"));
// this.add_row(autoDeleteBox, generalSection);
this.add_row(deleteAllBox, generalSection);
this.add_row(menusBox, generalSection);
//-------------------------
let categoriesBox = this.build_switch('categories', _("Use categories"));
let categoriesLinkButton = new Gtk.LinkButton({
label: _("More informations about \"additional categories\""),
uri: "https://standards.freedesktop.org/menu-spec/latest/apas02.html"
});
this.add_row(categoriesBox, categoriesSection);
this.add_row(categoriesLinkButton, categoriesSection);
//-------------------------
let aboutBox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL, spacing: 10 });
let about_label = new Gtk.Label({
label: '(v' + Me.metadata.version.toString() + ')',
halign: Gtk.Align.START
});
let url_button = new Gtk.LinkButton({
label: _("Report bugs or ideas"),
uri: Me.metadata.url.toString()
});
aboutBox.pack_start(url_button, false, false, 0);
aboutBox.pack_end(about_label, false, false, 0);
this.pack_end(aboutBox, false, false, 0);
//-------------------------
let desacLabel = new Gtk.Label({
label: _("This extension can be deactivated once your applications are organized as wished."),
wrap: true,
halign: Gtk.Align.CENTER
});
this.pack_end(desacLabel, false, false, 0);
},
add_section: function (titre) {
let section = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
margin: 6,
spacing: 6,
});
let frame = new Gtk.Frame({
label: titre,
label_xalign: 0.1,
});
frame.add(section);
this.add(frame);
return section;
},
add_row: function (filledbox, section) {
section.add(filledbox);
},
build_switch: function (key, label) {
let rowLabel = new Gtk.Label({
label: label,
halign: Gtk.Align.START,
wrap: true,
visible: true,
});
let rowSwitch = new Gtk.Switch({ valign: Gtk.Align.CENTER });
rowSwitch.set_state(this._settings.get_boolean(key));
rowSwitch.connect('notify::active', (widget) => {
this._settings.set_boolean(key, widget.active);
});
let rowBox = new Gtk.Box({
orientation: Gtk.Orientation.HORIZONTAL,
spacing: 15,
margin: 6,
visible: true,
});
rowBox.pack_start(rowLabel, false, false, 0);
rowBox.pack_end(rowSwitch, false, false, 0);
return rowBox;
},
});
//-----------------------------------------------
function init() {
Convenience.initTranslations();
}
//I guess this is like the "enable" in extension.js : something called each
//time he user try to access the settings' window
function buildPrefsWidget () {
let widget = new appfoldersManagerSettingsWidget();
widget.show_all();
return widget;
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="appfolders-manager">
<schema id="org.gnome.shell.extensions.appfolders-manager" path="/org/gnome/shell/extensions/appfolders-manager/">
<key type="b" name="total-deletion">
<default>true</default>
<summary>Complete deletion of an appfolder</summary>
<description>if a deleted appfolder should be 100% deleted (false = restauration is possible)</description>
</key>
<key type="b" name="categories">
<default>true</default>
<summary>Use categories</summary>
<description>If the interface for managing categories should be shown.</description>
</key>
<key type="b" name="debug">
<default>false</default>
<summary>Debug key</summary>
<description>this is not supposed to be activated by the user</description>
</key>
<key type="b" name="extend-menus">
<default>true</default>
<summary>Show items in right-click menus</summary>
<description>The legacy interface, with submenus in the right-click menu on application icons, can be shown in addition to the default drag-and-drop behavior.</description>
</key>
</schema>
</schemalist>

View File

@ -0,0 +1,56 @@
.dropAreaLabel {
font-size: 24px;
font-weight: bold;
}
.framedArea {
background-color: rgba(255,255,255,0.0);
border-color: rgba(255,255,255,1.0);
border-width: 1px;
color: rgba(255, 255, 255, 1.0);
}
.shadowedAreaTop {
background-gradient-start: rgba(0, 0, 0, 0.7);
background-gradient-end: rgba(0, 0, 0, 0.1);
background-gradient-direction: vertical;
color: rgba(255, 255, 255, 1.0);
}
.shadowedAreaBottom {
background-gradient-start: rgba(0, 0, 0, 0.1);
background-gradient-end: rgba(0, 0, 0, 0.7);
background-gradient-direction: vertical;
color: rgba(255, 255, 255, 1.0);
}
.folderArea {
background-gradient-start: rgba(0, 0, 0, 0.4);
background-gradient-end: rgba(0, 0, 0, 0.0);
background-gradient-direction: vertical;
border-color: rgba(255,255,255,1.0);
border-radius: 4px;
border-width: 2px;
color: rgba(255, 255, 255, 1.0);
}
.insensitiveArea {
background-color: rgba(0, 0, 0, 0.1);
color: rgba(100, 100, 100, 0.6);
}
.appCategoryBox {
background-color: rgba(100, 100, 100, 0.3);
border-radius: 3px;
margin: 3px;
padding: 2px;
padding-left: 6px;
}
.appCategoryDeleteBtn {
background-color: rgba(100, 100, 100, 0.3);
border-radius: 3px;
}

View File

@ -0,0 +1,341 @@
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
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -0,0 +1,28 @@
# Dash to Dock
![screenshot](https://github.com/micheleg/dash-to-dock/raw/master/media/screenshot.jpg)
## A dock for the GNOME Shell
This extension enhances the dash moving it out of the overview and transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops without having to leave the desktop view.
[<img src="https://micheleg.github.io/dash-to-dock/media/get-it-on-ego.png" height="100">](https://extensions.gnome.org/extension/307/dash-to-dock)
For additional installation instructions and more information visit [https://micheleg.github.io/dash-to-dock/](https://micheleg.github.io/dash-to-dock/).
## Installation from source
The extension can be installed directly from source, either for the convenience of using git or to test the latest development version. Clone the desired branch with git
<pre>git clone https://github.com/micheleg/dash-to-dock.git</pre>
or download the branch from github. A simple Makefile is included. Then run
<pre>make
make install
</pre>
to install the extension in your home directory. A Shell reload is required <code>Alt+F2 r Enter</code> and the extension has to be enabled with *gnome-tweak-tool* or with *dconf*.
## Bug Reporting
Bugs should be reported to the Github bug tracker [https://github.com/micheleg/dash-to-dock/issues](https://github.com/micheleg/dash-to-dock/issues).
## License
Dash to Dock Gnome Shell extension is distributed under the terms of the GNU General Public License,
version 2 or later. See the COPYING file for details.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Docking = Me.imports.docking;
// We declare this with var so it can be accessed by other extensions in
// GNOME Shell 3.26+ (mozjs52+).
var dockManager;
function init() {
ExtensionUtils.initTranslations('dashtodock');
}
function enable() {
new Docking.DockManager();
}
function disable() {
dockManager.destroy();
}

View File

@ -0,0 +1,217 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const Signals = imports.signals;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Utils = Me.imports.utils;
const FileManager1Iface = '<node><interface name="org.freedesktop.FileManager1">\
<property name="XUbuntuOpenLocationsXids" type="a{uas}" access="read"/>\
<property name="OpenWindowsWithLocations" type="a{sas}" access="read"/>\
</interface></node>';
const FileManager1Proxy = Gio.DBusProxy.makeProxyWrapper(FileManager1Iface);
/**
* This class implements a client for the org.freedesktop.FileManager1 dbus
* interface, and specifically for the OpenWindowsWithLocations property
* which is published by Nautilus, but is not an official part of the interface.
*
* The property is a map from window identifiers to a list of locations open in
* the window.
*
* While OpeWindowsWithLocations is part of upstream Nautilus, for many years
* prior, Ubuntu patched Nautilus to publish XUbuntuOpenLocationsXids, which is
* similar but uses Xids as the window identifiers instead of gtk window paths.
*
* When an old or unpatched Nautilus is running, we will observe the properties
* to always be empty arrays, but there will not be any correctness issues.
*/
var FileManager1Client = class DashToDock_FileManager1Client {
constructor() {
this._signalsHandler = new Utils.GlobalSignalsHandler();
this._locationMap = new Map();
this._proxy = new FileManager1Proxy(Gio.DBus.session,
"org.freedesktop.FileManager1",
"/org/freedesktop/FileManager1",
(initable, error) => {
// Use async construction to avoid blocking on errors.
if (error) {
global.log(error);
} else {
this._updateLocationMap();
}
});
this._signalsHandler.add([
this._proxy,
'g-properties-changed',
this._onPropertyChanged.bind(this)
], [
// We must additionally listen for Screen events to know when to
// rebuild our location map when the set of available windows changes.
global.workspace_manager,
'workspace-switched',
this._updateLocationMap.bind(this)
], [
global.display,
'window-entered-monitor',
this._updateLocationMap.bind(this)
], [
global.display,
'window-left-monitor',
this._updateLocationMap.bind(this)
]);
}
destroy() {
this._signalsHandler.destroy();
this._proxy.run_dispose();
}
/**
* Return an array of windows that are showing a location or
* sub-directories of that location.
*/
getWindows(location) {
let ret = new Set();
for (let [k,v] of this._locationMap) {
if (k.startsWith(location)) {
for (let l of v) {
ret.add(l);
}
}
}
return Array.from(ret);
}
_onPropertyChanged(proxy, changed, invalidated) {
let property = changed.unpack();
if (property &&
('XUbuntuOpenLocationsXids' in property ||
'OpenWindowsWithLocations' in property)) {
this._updateLocationMap();
}
}
_updateLocationMap() {
let properties = this._proxy.get_cached_property_names();
if (properties == null) {
// Nothing to check yet.
return;
}
if (properties.includes('OpenWindowsWithLocations')) {
this._updateFromPaths();
} else if (properties.includes('XUbuntuOpenLocationsXids')) {
this._updateFromXids();
}
}
_updateFromPaths() {
let pathToLocations = this._proxy.OpenWindowsWithLocations;
let pathToWindow = getPathToWindow();
let locationToWindow = new Map();
for (let path in pathToLocations) {
let locations = pathToLocations[path];
for (let i = 0; i < locations.length; i++) {
let l = locations[i];
// Use a set to deduplicate when a window has a
// location open in multiple tabs.
if (!locationToWindow.has(l)) {
locationToWindow.set(l, new Set());
}
let window = pathToWindow.get(path);
if (window != null) {
locationToWindow.get(l).add(window);
}
}
}
this._locationMap = locationToWindow;
this.emit('windows-changed');
}
_updateFromXids() {
let xidToLocations = this._proxy.XUbuntuOpenLocationsXids;
let xidToWindow = getXidToWindow();
let locationToWindow = new Map();
for (let xid in xidToLocations) {
let locations = xidToLocations[xid];
for (let i = 0; i < locations.length; i++) {
let l = locations[i];
// Use a set to deduplicate when a window has a
// location open in multiple tabs.
if (!locationToWindow.has(l)) {
locationToWindow.set(l, new Set());
}
let window = xidToWindow.get(parseInt(xid));
if (window != null) {
locationToWindow.get(l).add(window);
}
}
}
this._locationMap = locationToWindow;
this.emit('windows-changed');
}
}
Signals.addSignalMethods(FileManager1Client.prototype);
/**
* Construct a map of gtk application window object paths to MetaWindows.
*/
function getPathToWindow() {
let pathToWindow = new Map();
for (let i = 0; i < global.workspace_manager.n_workspaces; i++) {
let ws = global.workspace_manager.get_workspace_by_index(i);
ws.list_windows().map(function(w) {
let path = w.get_gtk_window_object_path();
if (path != null) {
pathToWindow.set(path, w);
}
});
}
return pathToWindow;
}
/**
* Construct a map of XIDs to MetaWindows.
*
* This is somewhat annoying as you cannot lookup a window by
* XID in any way, and must iterate through all of them looking
* for a match.
*/
function getXidToWindow() {
let xidToWindow = new Map();
for (let i = 0; i < global.workspace_manager.n_workspaces; i++) {
let ws = global.workspace_manager.get_workspace_by_index(i);
ws.list_windows().map(function(w) {
let xid = guessWindowXID(w);
if (xid != null) {
xidToWindow.set(parseInt(xid), w);
}
});
}
return xidToWindow;
}
/**
* Guesses the X ID of a window.
*
* This is the basic implementation that is sufficient for Nautilus
* windows. The pixel-saver extension has a much more complex
* implementation if we ever need it.
*/
function guessWindowXID(win) {
try {
return win.get_description().match(/0x[0-9a-f]+/)[0];
} catch (err) {
return null;
}
}

View File

@ -0,0 +1,321 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const Main = imports.ui.main;
const Signals = imports.signals;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Docking = Me.imports.docking;
const Utils = Me.imports.utils;
// A good compromise between reactivity and efficiency; to be tuned.
const INTELLIHIDE_CHECK_INTERVAL = 100;
const OverlapStatus = {
UNDEFINED: -1,
FALSE: 0,
TRUE: 1
};
const IntellihideMode = {
ALL_WINDOWS: 0,
FOCUS_APPLICATION_WINDOWS: 1,
MAXIMIZED_WINDOWS : 2
};
// List of windows type taken into account. Order is important (keep the original
// enum order).
const handledWindowTypes = [
Meta.WindowType.NORMAL,
Meta.WindowType.DOCK,
Meta.WindowType.DIALOG,
Meta.WindowType.MODAL_DIALOG,
Meta.WindowType.TOOLBAR,
Meta.WindowType.MENU,
Meta.WindowType.UTILITY,
Meta.WindowType.SPLASHSCREEN
];
/**
* A rough and ugly implementation of the intellihide behaviour.
* Intallihide object: emit 'status-changed' signal when the overlap of windows
* with the provided targetBoxClutter.ActorBox changes;
*/
var Intellihide = class DashToDock_Intellihide {
constructor(monitorIndex) {
// Load settings
this._monitorIndex = monitorIndex;
this._signalsHandler = new Utils.GlobalSignalsHandler();
this._tracker = Shell.WindowTracker.get_default();
this._focusApp = null; // The application whose window is focused.
this._topApp = null; // The application whose window is on top on the monitor with the dock.
this._isEnabled = false;
this.status = OverlapStatus.UNDEFINED;
this._targetBox = null;
this._checkOverlapTimeoutContinue = false;
this._checkOverlapTimeoutId = 0;
this._trackedWindows = new Map();
// Connect global signals
this._signalsHandler.add([
// Add signals on windows created from now on
global.display,
'window-created',
this._windowCreated.bind(this)
], [
// triggered for instance when the window list order changes,
// included when the workspace is switched
global.display,
'restacked',
this._checkOverlap.bind(this)
], [
// when windows are alwasy on top, the focus window can change
// without the windows being restacked. Thus monitor window focus change.
this._tracker,
'notify::focus-app',
this._checkOverlap.bind(this)
], [
// update wne monitor changes, for instance in multimonitor when monitor are attached
Meta.MonitorManager.get(),
'monitors-changed',
this._checkOverlap.bind(this)
]);
}
destroy() {
// Disconnect global signals
this._signalsHandler.destroy();
// Remove residual windows signals
this.disable();
}
enable() {
this._isEnabled = true;
this._status = OverlapStatus.UNDEFINED;
global.get_window_actors().forEach(function(wa) {
this._addWindowSignals(wa);
}, this);
this._doCheckOverlap();
}
disable() {
this._isEnabled = false;
for (let wa of this._trackedWindows.keys()) {
this._removeWindowSignals(wa);
}
this._trackedWindows.clear();
if (this._checkOverlapTimeoutId > 0) {
Mainloop.source_remove(this._checkOverlapTimeoutId);
this._checkOverlapTimeoutId = 0;
}
}
_windowCreated(display, metaWindow) {
this._addWindowSignals(metaWindow.get_compositor_private());
}
_addWindowSignals(wa) {
if (!this._handledWindow(wa))
return;
let signalId = wa.connect('allocation-changed', this._checkOverlap.bind(this));
this._trackedWindows.set(wa, signalId);
wa.connect('destroy', this._removeWindowSignals.bind(this));
}
_removeWindowSignals(wa) {
if (this._trackedWindows.get(wa)) {
wa.disconnect(this._trackedWindows.get(wa));
this._trackedWindows.delete(wa);
}
}
updateTargetBox(box) {
this._targetBox = box;
this._checkOverlap();
}
forceUpdate() {
this._status = OverlapStatus.UNDEFINED;
this._doCheckOverlap();
}
getOverlapStatus() {
return (this._status == OverlapStatus.TRUE);
}
_checkOverlap() {
if (!this._isEnabled || (this._targetBox == null))
return;
/* Limit the number of calls to the doCheckOverlap function */
if (this._checkOverlapTimeoutId) {
this._checkOverlapTimeoutContinue = true;
return
}
this._doCheckOverlap();
this._checkOverlapTimeoutId = Mainloop.timeout_add(INTELLIHIDE_CHECK_INTERVAL, () => {
this._doCheckOverlap();
if (this._checkOverlapTimeoutContinue) {
this._checkOverlapTimeoutContinue = false;
return GLib.SOURCE_CONTINUE;
} else {
this._checkOverlapTimeoutId = 0;
return GLib.SOURCE_REMOVE;
}
});
}
_doCheckOverlap() {
if (!this._isEnabled || (this._targetBox == null))
return;
let overlaps = OverlapStatus.FALSE;
let windows = global.get_window_actors();
if (windows.length > 0) {
/*
* Get the top window on the monitor where the dock is placed.
* The idea is that we dont want to overlap with the windows of the topmost application,
* event is it's not the focused app -- for instance because in multimonitor the user
* select a window in the secondary monitor.
*/
let topWindow = null;
for (let i = windows.length - 1; i >= 0; i--) {
let meta_win = windows[i].get_meta_window();
if (this._handledWindow(windows[i]) && (meta_win.get_monitor() == this._monitorIndex)) {
topWindow = meta_win;
break;
}
}
if (topWindow !== null) {
this._topApp = this._tracker.get_window_app(topWindow);
// If there isn't a focused app, use that of the window on top
this._focusApp = this._tracker.focus_app || this._topApp
windows = windows.filter(this._intellihideFilterInteresting, this);
for (let i = 0; i < windows.length; i++) {
let win = windows[i].get_meta_window();
if (win) {
let rect = win.get_frame_rect();
let test = (rect.x < this._targetBox.x2) &&
(rect.x + rect.width > this._targetBox.x1) &&
(rect.y < this._targetBox.y2) &&
(rect.y + rect.height > this._targetBox.y1);
if (test) {
overlaps = OverlapStatus.TRUE;
break;
}
}
}
}
}
if (this._status !== overlaps) {
this._status = overlaps;
this.emit('status-changed', this._status);
}
}
// Filter interesting windows to be considered for intellihide.
// Consider all windows visible on the current workspace.
// Optionally skip windows of other applications
_intellihideFilterInteresting(wa) {
let meta_win = wa.get_meta_window();
if (!this._handledWindow(wa))
return false;
let currentWorkspace = global.workspace_manager.get_active_workspace_index();
let wksp = meta_win.get_workspace();
let wksp_index = wksp.index();
// Depending on the intellihide mode, exclude non-relevent windows
switch (Docking.DockManager.settings.get_enum('intellihide-mode')) {
case IntellihideMode.ALL_WINDOWS:
// Do nothing
break;
case IntellihideMode.FOCUS_APPLICATION_WINDOWS:
// Skip windows of other apps
if (this._focusApp) {
// The DropDownTerminal extension is not an application per se
// so we match its window by wm class instead
if (meta_win.get_wm_class() == 'DropDownTerminalWindow')
return true;
let currentApp = this._tracker.get_window_app(meta_win);
let focusWindow = global.display.get_focus_window()
// Consider half maximized windows side by side
// and windows which are alwayson top
if((currentApp != this._focusApp) && (currentApp != this._topApp)
&& !((focusWindow && focusWindow.maximized_vertically && !focusWindow.maximized_horizontally)
&& (meta_win.maximized_vertically && !meta_win.maximized_horizontally)
&& meta_win.get_monitor() == focusWindow.get_monitor())
&& !meta_win.is_above())
return false;
}
break;
case IntellihideMode.MAXIMIZED_WINDOWS:
// Skip unmaximized windows
if (!meta_win.maximized_vertically && !meta_win.maximized_horizontally)
return false;
break;
}
if ( wksp_index == currentWorkspace && meta_win.showing_on_its_workspace() )
return true;
else
return false;
}
// Filter windows by type
// inspired by Opacify@gnome-shell.localdomain.pl
_handledWindow(wa) {
let metaWindow = wa.get_meta_window();
if (!metaWindow)
return false;
// The DropDownTerminal extension uses the POPUP_MENU window type hint
// so we match its window by wm class instead
if (metaWindow.get_wm_class() == 'DropDownTerminalWindow')
return true;
let wtype = metaWindow.get_window_type();
for (let i = 0; i < handledWindowTypes.length; i++) {
var hwtype = handledWindowTypes[i];
if (hwtype == wtype)
return true;
else if (hwtype > wtype)
return false;
}
return false;
}
};
Signals.addSignalMethods(Intellihide.prototype);

View File

@ -0,0 +1,239 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const Signals = imports.signals;
var LauncherEntryRemoteModel = class DashToDock_LauncherEntryRemoteModel {
constructor() {
this._entriesByDBusName = {};
this._launcher_entry_dbus_signal_id =
Gio.DBus.session.signal_subscribe(null, // sender
'com.canonical.Unity.LauncherEntry', // iface
null, // member
null, // path
null, // arg0
Gio.DBusSignalFlags.NONE,
this._onEntrySignalReceived.bind(this));
this._dbus_name_owner_changed_signal_id =
Gio.DBus.session.signal_subscribe('org.freedesktop.DBus', // sender
'org.freedesktop.DBus', // interface
'NameOwnerChanged', // member
'/org/freedesktop/DBus', // path
null, // arg0
Gio.DBusSignalFlags.NONE,
this._onDBusNameOwnerChanged.bind(this));
this._acquireUnityDBus();
}
destroy() {
if (this._launcher_entry_dbus_signal_id) {
Gio.DBus.session.signal_unsubscribe(this._launcher_entry_dbus_signal_id);
}
if (this._dbus_name_owner_changed_signal_id) {
Gio.DBus.session.signal_unsubscribe(this._dbus_name_owner_changed_signal_id);
}
this._releaseUnityDBus();
}
size() {
return Object.keys(this._entriesByDBusName).length;
}
lookupByDBusName(dbusName) {
return this._entriesByDBusName.hasOwnProperty(dbusName) ? this._entriesByDBusName[dbusName] : null;
}
lookupById(appId) {
let ret = [];
for (let dbusName in this._entriesByDBusName) {
let entry = this._entriesByDBusName[dbusName];
if (entry && entry.appId() == appId) {
ret.push(entry);
}
}
return ret;
}
addEntry(entry) {
let existingEntry = this.lookupByDBusName(entry.dbusName());
if (existingEntry) {
existingEntry.update(entry);
} else {
this._entriesByDBusName[entry.dbusName()] = entry;
this.emit('entry-added', entry);
}
}
removeEntry(entry) {
delete this._entriesByDBusName[entry.dbusName()]
this.emit('entry-removed', entry);
}
_acquireUnityDBus() {
if (!this._unity_bus_id) {
Gio.DBus.session.own_name('com.canonical.Unity',
Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null);
}
}
_releaseUnityDBus() {
if (this._unity_bus_id) {
Gio.DBus.session.unown_name(this._unity_bus_id);
this._unity_bus_id = 0;
}
}
_onEntrySignalReceived(connection, sender_name, object_path,
interface_name, signal_name, parameters, user_data) {
if (!parameters || !signal_name)
return;
if (signal_name == 'Update') {
if (!sender_name) {
return;
}
this._handleUpdateRequest(sender_name, parameters);
}
}
_onDBusNameOwnerChanged(connection, sender_name, object_path,
interface_name, signal_name, parameters, user_data) {
if (!parameters || !this.size())
return;
let [name, before, after] = parameters.deep_unpack();
if (!after) {
if (this._entriesByDBusName.hasOwnProperty(before)) {
this.removeEntry(this._entriesByDBusName[before]);
}
}
}
_handleUpdateRequest(senderName, parameters) {
if (!senderName || !parameters) {
return;
}
let [appUri, properties] = parameters.deep_unpack();
let appId = appUri.replace(/(^\w+:|^)\/\//, '');
let entry = this.lookupByDBusName(senderName);
if (entry) {
entry.setDBusName(senderName);
entry.update(properties);
} else {
let entry = new LauncherEntryRemote(senderName, appId, properties);
this.addEntry(entry);
}
}
};
Signals.addSignalMethods(LauncherEntryRemoteModel.prototype);
var LauncherEntryRemote = class DashToDock_LauncherEntryRemote {
constructor(dbusName, appId, properties) {
this._dbusName = dbusName;
this._appId = appId;
this._count = 0;
this._countVisible = false;
this._progress = 0.0;
this._progressVisible = false;
this.update(properties);
}
appId() {
return this._appId;
}
dbusName() {
return this._dbusName;
}
count() {
return this._count;
}
setCount(count) {
if (this._count != count) {
this._count = count;
this.emit('count-changed', this._count);
}
}
countVisible() {
return this._countVisible;
}
setCountVisible(countVisible) {
if (this._countVisible != countVisible) {
this._countVisible = countVisible;
this.emit('count-visible-changed', this._countVisible);
}
}
progress() {
return this._progress;
}
setProgress(progress) {
if (this._progress != progress) {
this._progress = progress;
this.emit('progress-changed', this._progress);
}
}
progressVisible() {
return this._progressVisible;
}
setProgressVisible(progressVisible) {
if (this._progressVisible != progressVisible) {
this._progressVisible = progressVisible;
this.emit('progress-visible-changed', this._progressVisible);
}
}
setDBusName(dbusName) {
if (this._dbusName != dbusName) {
let oldName = this._dbusName;
this._dbusName = dbusName;
this.emit('dbus-name-changed', oldName);
}
}
update(other) {
if (other instanceof LauncherEntryRemote) {
this.setDBusName(other.dbusName())
this.setCount(other.count());
this.setCountVisible(other.countVisible());
this.setProgress(other.progress());
this.setProgressVisible(other.progressVisible())
} else {
for (let property in other) {
if (other.hasOwnProperty(property)) {
if (property == 'count') {
this.setCount(other[property].get_int64());
} else if (property == 'count-visible') {
this.setCountVisible(other[property].get_boolean());
} if (property == 'progress') {
this.setProgress(other[property].get_double());
} else if (property == 'progress-visible') {
this.setProgressVisible(other[property].get_boolean());
} else {
// Not implemented yet
}
}
}
}
}
};
Signals.addSignalMethods(LauncherEntryRemote.prototype);

View File

@ -0,0 +1,268 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Shell = imports.gi.Shell;
const Signals = imports.signals;
// Use __ () and N__() for the extension gettext domain, and reuse
// the shell domain with the default _() and N_()
const Gettext = imports.gettext.domain('dashtodock');
const __ = Gettext.gettext;
const N__ = function(e) { return e };
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Utils = Me.imports.utils;
/**
* This class maintains a Shell.App representing the Trash and keeps it
* up-to-date as the trash fills and is emptied over time.
*/
var Trash = class DashToDock_Trash {
constructor() {
this._file = Gio.file_new_for_uri('trash://');
try {
this._monitor = this._file.monitor_directory(0, null);
this._signalId = this._monitor.connect(
'changed',
this._onTrashChange.bind(this)
);
} catch (e) {
log(`Impossible to monitor trash: ${e}`)
}
this._lastEmpty = true;
this._empty = true;
this._onTrashChange();
}
destroy() {
if (this._monitor) {
this._monitor.disconnect(this._signalId);
this._monitor.run_dispose();
}
this._file.run_dispose();
}
_onTrashChange() {
try {
let children = this._file.enumerate_children('*', 0, null);
this._empty = children.next_file(null) == null;
children.close(null);
} catch (e) {
log(`Impossible to enumerate trash children: ${e}`)
return;
}
this._ensureApp();
}
_ensureApp() {
if (this._trashApp == null ||
this._lastEmpty != this._empty) {
let trashKeys = new GLib.KeyFile();
trashKeys.set_string('Desktop Entry', 'Name', __('Trash'));
trashKeys.set_string('Desktop Entry', 'Icon',
this._empty ? 'user-trash' : 'user-trash-full');
trashKeys.set_string('Desktop Entry', 'Type', 'Application');
trashKeys.set_string('Desktop Entry', 'Exec', 'gio open trash:///');
trashKeys.set_string('Desktop Entry', 'StartupNotify', 'false');
trashKeys.set_string('Desktop Entry', 'XdtdUri', 'trash:///');
if (!this._empty) {
trashKeys.set_string('Desktop Entry', 'Actions', 'empty-trash;');
trashKeys.set_string('Desktop Action empty-trash', 'Name', __('Empty Trash'));
trashKeys.set_string('Desktop Action empty-trash', 'Exec',
'dbus-send --print-reply --dest=org.gnome.Nautilus /org/gnome/Nautilus org.gnome.Nautilus.FileOperations.EmptyTrash');
}
let trashAppInfo = Gio.DesktopAppInfo.new_from_keyfile(trashKeys);
this._trashApp = new Shell.App({appInfo: trashAppInfo});
this._lastEmpty = this._empty;
this.emit('changed');
}
}
getApp() {
this._ensureApp();
return this._trashApp;
}
}
Signals.addSignalMethods(Trash.prototype);
/**
* This class maintains Shell.App representations for removable devices
* plugged into the system, and keeps the list of Apps up-to-date as
* devices come and go and are mounted and unmounted.
*/
var Removables = class DashToDock_Removables {
constructor() {
this._signalsHandler = new Utils.GlobalSignalsHandler();
this._monitor = Gio.VolumeMonitor.get();
this._volumeApps = []
this._mountApps = []
this._monitor.get_volumes().forEach(
(volume) => {
this._onVolumeAdded(this._monitor, volume);
}
);
this._monitor.get_mounts().forEach(
(mount) => {
this._onMountAdded(this._monitor, mount);
}
);
this._signalsHandler.add([
this._monitor,
'mount-added',
this._onMountAdded.bind(this)
], [
this._monitor,
'mount-removed',
this._onMountRemoved.bind(this)
], [
this._monitor,
'volume-added',
this._onVolumeAdded.bind(this)
], [
this._monitor,
'volume-removed',
this._onVolumeRemoved.bind(this)
]);
}
destroy() {
this._signalsHandler.destroy();
this._monitor.run_dispose();
}
_getWorkingIconName(icon) {
if (icon instanceof Gio.ThemedIcon) {
let iconTheme = Gtk.IconTheme.get_default();
let names = icon.get_names();
for (let i = 0; i < names.length; i++) {
let iconName = names[i];
if (iconTheme.has_icon(iconName)) {
return iconName;
}
}
return '';
} else {
return icon.to_string();
}
}
_onVolumeAdded(monitor, volume) {
if (!volume.can_mount()) {
return;
}
let activationRoot = volume.get_activation_root();
if (!activationRoot) {
// Can't offer to mount a device if we don't know
// where to mount it.
// These devices are usually ejectable so you
// don't normally unmount them anyway.
return;
}
let uri = GLib.uri_unescape_string(activationRoot.get_uri(), null);
let volumeKeys = new GLib.KeyFile();
volumeKeys.set_string('Desktop Entry', 'Name', volume.get_name());
volumeKeys.set_string('Desktop Entry', 'Icon', this._getWorkingIconName(volume.get_icon()));
volumeKeys.set_string('Desktop Entry', 'Type', 'Application');
volumeKeys.set_string('Desktop Entry', 'Exec', 'nautilus "' + uri + '"');
volumeKeys.set_string('Desktop Entry', 'StartupNotify', 'false');
volumeKeys.set_string('Desktop Entry', 'Actions', 'mount;');
volumeKeys.set_string('Desktop Action mount', 'Name', __('Mount'));
volumeKeys.set_string('Desktop Action mount', 'Exec', 'gio mount "' + uri + '"');
let volumeAppInfo = Gio.DesktopAppInfo.new_from_keyfile(volumeKeys);
let volumeApp = new Shell.App({appInfo: volumeAppInfo});
this._volumeApps.push(volumeApp);
this.emit('changed');
}
_onVolumeRemoved(monitor, volume) {
for (let i = 0; i < this._volumeApps.length; i++) {
let app = this._volumeApps[i];
if (app.get_name() == volume.get_name()) {
this._volumeApps.splice(i, 1);
}
}
this.emit('changed');
}
_onMountAdded(monitor, mount) {
// Filter out uninteresting mounts
if (!mount.can_eject() && !mount.can_unmount())
return;
if (mount.is_shadowed())
return;
let volume = mount.get_volume();
if (!volume || volume.get_identifier('class') == 'network') {
return;
}
let escapedUri = mount.get_root().get_uri()
let uri = GLib.uri_unescape_string(escapedUri, null);
let mountKeys = new GLib.KeyFile();
mountKeys.set_string('Desktop Entry', 'Name', mount.get_name());
mountKeys.set_string('Desktop Entry', 'Icon',
this._getWorkingIconName(volume.get_icon()));
mountKeys.set_string('Desktop Entry', 'Type', 'Application');
mountKeys.set_string('Desktop Entry', 'Exec', 'gio open "' + uri + '"');
mountKeys.set_string('Desktop Entry', 'StartupNotify', 'false');
mountKeys.set_string('Desktop Entry', 'XdtdUri', escapedUri);
mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;');
if (mount.can_eject()) {
mountKeys.set_string('Desktop Action unmount', 'Name', __('Eject'));
mountKeys.set_string('Desktop Action unmount', 'Exec',
'gio mount -e "' + uri + '"');
} else {
mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;');
mountKeys.set_string('Desktop Action unmount', 'Name', __('Unmount'));
mountKeys.set_string('Desktop Action unmount', 'Exec',
'gio mount -u "' + uri + '"');
}
let mountAppInfo = Gio.DesktopAppInfo.new_from_keyfile(mountKeys);
let mountApp = new Shell.App({appInfo: mountAppInfo});
this._mountApps.push(mountApp);
this.emit('changed');
}
_onMountRemoved(monitor, mount) {
for (let i = 0; i < this._mountApps.length; i++) {
let app = this._mountApps[i];
if (app.get_name() == mount.get_name()) {
this._mountApps.splice(i, 1);
}
}
this.emit('changed');
}
getApps() {
// When we have both a volume app and a mount app, we prefer
// the mount app.
let apps = new Map();
this._volumeApps.map(function(app) {
apps.set(app.get_name(), app);
});
this._mountApps.map(function(app) {
apps.set(app.get_name(), app);
});
let ret = [];
for (let app of apps.values()) {
ret.push(app);
}
return ret;
}
}
Signals.addSignalMethods(Removables.prototype);

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="18.343554mm"
height="18.343554mm"
viewBox="0 0 14.674843 14.674842"
version="1.1"
id="svg4941"
sodipodi:docname="glossy.svg"
inkscape:version="0.92.1 r15371">
<defs
id="defs4935">
<linearGradient
id="linearGradient6812"
inkscape:collect="always">
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="0"
id="stop6810" />
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop6808" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient18962"
id="linearGradient35463"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.29132751,0,0,0.15428114,-54.210829,160.22776)"
x1="214.71877"
y1="404.36081"
x2="214.71877"
y2="443.54596" />
<linearGradient
inkscape:collect="always"
id="linearGradient18962">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop18964" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop18966" />
</linearGradient>
<linearGradient
id="linearGradient18806">
<stop
style="stop-color:#ff0101;stop-opacity:1;"
offset="0"
id="stop18808" />
<stop
style="stop-color:#800000;stop-opacity:1;"
offset="1"
id="stop18810" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6812"
id="radialGradient6798"
cx="7.3538475"
cy="230.28426"
fx="7.3538475"
fy="230.28426"
r="7.2099228"
gradientTransform="matrix(5.9484829,-0.0346444,0.01679088,3.0681664,-40.338609,-476.01412)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="10.68"
inkscape:cx="65.485107"
inkscape:cy="29.432163"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="2560"
inkscape:window-height="1406"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
scale-x="0.8"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata4938">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-222.92515)">
<rect
inkscape:export-ydpi="180"
inkscape:export-xdpi="180"
inkscape:export-filename="C:\Arbeit\Blog\Tutorials\glossybutton\Glossy_Button_Tutorial.png"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.35100002;fill:url(#linearGradient35463);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.39747861;marker:none;enable-background:accumulate"
id="rect19155"
width="14.634871"
height="3.7392156"
x="0.039808333"
y="222.98268"
rx="1.5496143"
ry="0.82064426" />
<rect
style="opacity:0.427;fill:url(#radialGradient6798);fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect6706"
width="14.363673"
height="14.404656"
x="0.090466507"
y="223.07919" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="-0.7 0 48 48"
version="1.1"
id="svg10"
sodipodi:docname="highlight_stacked_bg.svg"
width="48"
height="48"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs14" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="951"
id="namedview12"
showgrid="false"
viewbox-x="-0.7"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="3.8125"
inkscape:cx="-63.872219"
inkscape:cy="15.195756"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg10" />
<g
id="g8"
transform="matrix(1,0,0,48,-0.7,0)"
style="opacity:0.25;fill:#eeeeee;stroke-width:0.14433756">
<rect
width="45"
height="1"
id="rect2"
x="0"
y="0"
style="stroke-width:0.14433756" />
<rect
x="45"
width="1"
height="1"
id="rect4"
y="0"
style="opacity:0.2;stroke-width:0.02083333" />
<rect
x="46"
width="2"
height="1"
id="rect6"
y="0"
style="opacity:0.6;stroke-width:0.02083333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="-0.7 0 48 48"
version="1.1"
id="svg10"
sodipodi:docname="highlight_stacked_bg_h.svg"
width="48"
height="48"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs14" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1853"
inkscape:window-height="1016"
id="namedview12"
showgrid="false"
viewbox-x="-0.7"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="3.8125"
inkscape:cx="-63.872219"
inkscape:cy="15.195756"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg10" />
<g
id="g8"
transform="matrix(0,-1,-48,0,47.3,48)"
style="opacity:0.25;fill:#eeeeee;stroke-width:0.14433756">
<rect
width="45"
height="1"
id="rect2"
x="0"
y="0"
style="stroke-width:0.14433756" />
<rect
x="45"
width="1"
height="1"
id="rect4"
y="0"
style="opacity:0.2;stroke-width:0.02083333" />
<rect
x="46"
width="2"
height="1"
id="rect6"
y="0"
style="opacity:0.6;stroke-width:0.02083333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,528 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="33.866665mm"
height="33.866684mm"
viewBox="0 0 33.866665 33.866683"
id="svg5179"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="logo.svg">
<defs
id="defs5181">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4379-92-4-9-6-8-0">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.83189655;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4381-17-7-5-2-0-6"
width="19.934219"
height="33.52573"
x="356.02826"
y="457.71631" />
</clipPath>
<filter
style="color-interpolation-filters:sRGB"
inkscape:collect="always"
id="filter4435-8-5-3-2-13-8"
x="-0.22881356"
width="1.4576271"
y="-0.22881356"
height="1.4576271">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.0352993"
id="feGaussianBlur4437-6-7-9-8-8-1" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:collect="always"
id="filter4365-71-5-7-0-6-2"
x="-0.21864407"
width="1.437288"
y="-0.21864407"
height="1.437288">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.98928601"
id="feGaussianBlur4367-74-5-92-0-6-5" />
</filter>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4379-6-7-5-8-6-01-2">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.83189655;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4381-1-8-5-2-0-2-7"
width="19.934219"
height="33.52573"
x="356.02826"
y="457.71631" />
</clipPath>
<filter
style="color-interpolation-filters:sRGB"
inkscape:collect="always"
id="filter4435-6-1-2-8-2-2-7"
x="-0.22881356"
width="1.4576271"
y="-0.22881356"
height="1.4576271">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.0352993"
id="feGaussianBlur4437-1-1-3-60-1-4-4" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:collect="always"
id="filter4365-4-5-2-24-7-3-3"
x="-0.21864407"
width="1.437288"
y="-0.21864407"
height="1.437288">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.98928601"
id="feGaussianBlur4367-7-0-7-7-9-0-3" />
</filter>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4379-5-6-0-9-8-7-9">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.83189655;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4381-6-8-5-9-9-2-4"
width="19.934219"
height="33.52573"
x="356.02826"
y="457.71631" />
</clipPath>
<filter
style="color-interpolation-filters:sRGB"
inkscape:collect="always"
id="filter4435-63-9-2-4-1-2-6"
x="-0.22881356"
width="1.4576271"
y="-0.22881356"
height="1.4576271">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.0352993"
id="feGaussianBlur4437-0-5-6-8-8-9-9" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:collect="always"
id="filter4365-2-4-3-6-3-1-7"
x="-0.21864407"
width="1.437288"
y="-0.21864407"
height="1.437288">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.98928601"
id="feGaussianBlur4367-1-2-5-3-5-8-3" />
</filter>
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter4255"
x="-0.20374454"
width="1.4074891"
y="-0.13779147"
height="1.2755829">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.25863247"
id="feGaussianBlur4257" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="60.090739"
inkscape:cy="60.108985"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1861"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5184">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(136.97858,-11.552354)">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#0055d4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4006-4-6-9-2-0-6"
width="33.83363"
height="33.859909"
x="-136.9473"
y="11.552354"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.25;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.15440008;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
d="m -130.12265,11.559157 c -4.30029,5.691881 -6.67207,12.608761 -6.82289,19.674442 -0.0115,0.54232 -0.0147,1.0766 0,1.62024 0.11433,4.23572 1.04846,8.50668 2.82497,12.565201 l 31.00865,0 0,-33.859883 -27.01073,0 z"
id="path6097-2-6-0-89-4"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
d="m -136.9473,18.430158 0,0.7896 0,20.641361 0,0.7896 1.23782,0 2.26288,0 1.60528,0 c 0.68577,0 1.23783,-0.3548 1.23783,-0.7896 l 0,-20.641361 c 0,-0.4398 -0.55206,-0.7896 -1.23783,-0.7896 l -1.60528,0 -2.26288,0 z"
id="rect4008-7-9-2-0-3-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccssssccc"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.15;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.15440008;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
d="m -119.36792,11.559157 c -10.47023,5.721881 -17.57762,16.847401 -17.57762,29.627402 0,1.43804 0.0897,2.841801 0.26432,4.232481 l 33.5693,0 0,-33.859883 -16.256,0 z"
id="path6097-4-5-23-9"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4247-4-4-5-3-8-1"
width="33.83363"
height="2.1162443"
x="-136.9473"
y="11.552354"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
d="m -103.11365,13.668597 0,1.05812 c 0,-0.58196 -0.47338,-1.05812 -1.05731,-1.05812 l 1.05731,0 z"
id="rect4272-0-7-8-1-1-3-3-1"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4031-9-9-2-4-2-5"
width="4.2292037"
height="4.2324886"
x="-135.89"
y="19.488146"
rx="1.0583334"
ry="1.0583334"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
d="m -136.94728,13.668597 0,1.05812 c 0,-0.58196 0.47337,-1.05812 1.0573,-1.05812 l -1.0573,0 z"
id="rect4272-0-2-1-74-41-1-6"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<g
id="g4353-9-2-1-5-5-4"
transform="matrix(0.10331261,0,0,0.10339285,-173.76079,-27.453246)"
clip-path="url(#clipPath4379-92-4-9-6-8-0)"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099">
<circle
r="5.4295697"
cy="477.71164"
cx="274.13016"
transform="matrix(0.94749688,0,0,0.94749688,96.290796,21.848877)"
id="path3153-1-7-3-5-60-3-6"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.42241378;fill:#d7eef4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;filter:url(#filter4435-8-5-3-2-13-8);enable-background:accumulate" />
<circle
r="5.4295697"
cy="477.71164"
cx="274.13016"
transform="matrix(0.24231546,0,0,0.24231546,289.60229,358.72226)"
id="path3153-2-4-1-6-6-9-4-1"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#d7eef4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;filter:url(#filter4365-71-5-7-0-6-2);enable-background:accumulate" />
</g>
<g
id="g4589-4-1-1-3-6-2"
transform="matrix(0.49926208,0,0,0.49964988,-318.21072,-206.05794)"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099">
<g
clip-path="url(#clipPath4379-6-7-5-8-6-01-2)"
transform="matrix(0.20693061,0,0,0.20693061,289.32686,368.5622)"
id="g4353-66-1-4-2-6-94-5">
<circle
r="5.4295697"
cy="477.71164"
cx="274.13016"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.42241378;fill:#d7eef4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;filter:url(#filter4435-6-1-2-8-2-2-7);enable-background:accumulate"
id="path3153-1-6-4-5-63-7-1-0"
transform="matrix(0.94749688,0,0,0.94749688,96.290796,21.848877)" />
<circle
r="5.4295697"
cy="477.71164"
cx="274.13016"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#d7eef4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;filter:url(#filter4365-4-5-2-24-7-3-3);enable-background:accumulate"
id="path3153-2-4-7-6-5-8-5-9-5"
transform="matrix(0.24231546,0,0,0.24231546,289.60229,358.72226)" />
</g>
<g
clip-path="url(#clipPath4379-5-6-0-9-8-7-9)"
transform="matrix(0.20693061,0,0,0.20693061,289.32686,367.53449)"
id="g4353-7-2-2-6-4-5-1">
<circle
r="5.4295697"
cy="477.71164"
cx="274.13016"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.42241378;fill:#d7eef4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;filter:url(#filter4435-63-9-2-4-1-2-6);enable-background:accumulate"
id="path3153-1-19-3-1-5-5-7-8"
transform="matrix(0.94749688,0,0,0.94749688,96.290796,21.848877)" />
<circle
r="5.4295697"
cy="477.71164"
cx="274.13016"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#d7eef4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;filter:url(#filter4365-2-4-3-6-3-1-7);enable-background:accumulate"
id="path3153-2-4-5-7-9-9-9-7-6"
transform="matrix(0.24231546,0,0,0.24231546,289.60229,358.72226)" />
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:1.28805089px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none"
x="-124.44726"
y="13.10139"
id="text4824-5-2-0-4-8"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099"
transform="scale(0.99961185,1.0003883)"><tspan
sodipodi:role="line"
id="tspan4826-16-3-8-8-1"
x="-124.44726"
y="13.10139">Dash to Dock</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:1.28805089px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none"
x="-136.50272"
y="13.10139"
id="text4824-8-8-6-8-7-4"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099"
transform="scale(0.99961185,1.0003883)"><tspan
sodipodi:role="line"
id="tspan4826-1-7-7-5-07-5"
x="-136.50272"
y="13.10139">Michele</tspan></text>
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4031-9-0-8-5-4-0-7-6"
width="4.2292037"
height="4.2324886"
x="-135.89"
y="24.778917"
rx="1.0583334"
ry="1.0583334"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4031-9-0-7-3-3-6-0-1"
width="4.2292037"
height="4.2324886"
x="-135.89"
y="30.069445"
rx="1.0583334"
ry="1.0583334"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.04922473;marker:none;enable-background:accumulate"
id="rect4031-9-0-6-5-1-3-9-0"
width="4.2292037"
height="4.2324886"
x="-135.89"
y="35.359974"
rx="1.0583334"
ry="1.0583334"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.5;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
d="m -136.9473,17.901078 0,0.52908 2.42849,0 2.21372,0 c 0.94338,0 1.7016,0.3372 1.7016,0.77704 l 0,20.649921 c 0,0.43476 -0.75822,0.7936 -1.7016,0.7936 l -2.21372,0 -2.42849,0 0,0.52904 0.90862,0 2.64325,0 1.88332,0 c 0.80005,0 1.43727,-0.3712 1.43727,-0.82664 l 0,-21.625361 c 0,-0.46072 -0.63722,-0.82668 -1.43727,-0.82668 l -1.88332,0 -2.64325,0 z"
id="rect4008-7-0-0-3-3-3-7-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccsssscccccssssccc"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.25;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
d="m -136.9473,17.901078 0,0.52908 2.42849,0 2.21372,0 c 0.94338,0 1.7016,0.3372 1.7016,0.77704 l 0,20.649921 c 0,0.43476 -0.75822,0.7936 -1.7016,0.7936 l -2.21372,0 -2.42849,0 0,0.52904 0.90862,0 2.64325,0 1.88332,0 c 0.80005,0 1.43727,-0.3712 1.43727,-0.82664 l 0,-21.625361 c 0,-0.46072 -0.63722,-0.82668 -1.43727,-0.82668 l -1.88332,0 -2.64325,0 z"
id="rect4008-7-0-0-3-1-5-0-5-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccsssscccccssssccc"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="44.99099"
inkscape:export-ydpi="44.99099" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#f2f2f2;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
id="rect6777-7-9-6-9-8"
width="20.108335"
height="18.256252"
x="-125.24149"
y="19.139757"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.25;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.13229166;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4923-8-7-8-2"
width="3.7041669"
height="3.7041669"
x="-116.71888"
y="30.163927"
rx="1.0583334"
ry="1.0583334" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.15;fill:#b3b3b3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
d="m -111.94623,19.146638 c -5.49508,1.3884 -10.21465,5.00036 -13.29531,9.92188 l 0,8.334361 20.10833,0 0,-18.256241 -6.81302,0 z"
id="path6862-84-2-2-6-7"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#cccccc;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
d="m -125.02657,18.882038 c -0.11728,0 -0.21496,0.0812 -0.21496,0.1984 l 0,0.44648 0,1.2568 0,0.2148 0.21496,0 19.67838,0 0.215,0 0,-0.2148 0,-1.2568 0,-0.44648 c 0,-0.1172 -0.0977,-0.1984 -0.215,-0.1984 l -19.67838,0 z"
id="rect6779-5-8-6-4-6"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
id="rect6779-2-3-9-9-0-8"
width="20.108335"
height="0.5291667"
x="-125.24149"
y="20.991808"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#b3b3b3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
id="rect6779-2-4-8-0-7-1-1"
width="15.875001"
height="0.5291667"
x="21.521105"
y="105.13315"
transform="rotate(90)"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45" />
<g
id="g6839-1-5-1-33-0"
transform="matrix(0.02002288,0.02002284,-0.02002288,0.02002284,-106.62848,-6.0229242)"
style="fill:#1a1a1a"
inkscape:export-filename="/home/michele/Dropbox/lavori/gnome-shell-extension/icon/g5218.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45">
<rect
y="616.07727"
x="653.01312"
height="41.542522"
width="11.313708"
id="rect6819-8-9-2-56-9"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate" />
<rect
transform="rotate(90)"
y="-679.44122"
x="631.19165"
height="41.542522"
width="11.313708"
id="rect6819-3-9-4-3-1-5"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;filter:url(#filter4365-3);enable-background:accumulate" />
</g>
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.25;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.13229166;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4923-6-8-9-1"
width="3.7041669"
height="3.7041669"
x="-123.59805"
y="30.163927"
rx="1.0583334"
ry="1.0583334" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.26458335;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate;opacity:0.866;filter:url(#filter4255)"
d="m -121.46776,32.043964 -5e-4,1.742839 -4.9e-4,1.742839 0.71518,-0.708051 0.99716,1.727136 1.33421,-0.770304 -0.99542,-1.724104 0.96903,-0.268366 -1.50959,-0.870995 z"
id="path6155-6-0-01-4-5-6-0-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;marker:none;filter:url(#filter4365-3);enable-background:accumulate"
d="m -121.86464,32.043964 -5e-4,1.742839 -4.9e-4,1.742839 0.71518,-0.708051 1.05563,1.8284 1.3342,-0.770304 -1.05388,-1.825368 0.96903,-0.268366 -1.50959,-0.870995 z"
id="path6155-6-0-8-0-7-97-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.25;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.13229166;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4923-4-8-4"
width="3.7041669"
height="3.7041669"
x="-123.59805"
y="23.020128"
rx="1.0583334"
ry="1.0583334" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.25;fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.13229166;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4923-2-6-7-8"
width="3.7041669"
height="3.7041669"
x="-116.71888"
y="23.020128"
rx="1.0583334"
ry="1.0583334" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,13 @@
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "A dock for the Gnome Shell. This extension moves the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops. Side and bottom placement options are available.",
"gettext-domain": "dashtodock",
"name": "Dash to Dock",
"original-author": "micxgx@gmail.com",
"shell-version": [
"3.34"
],
"url": "https://micheleg.github.io/dash-to-dock/",
"uuid": "dash-to-dock@micxgx.gmail.com",
"version": 67
}

View File

@ -0,0 +1,869 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const Mainloop = imports.mainloop;
// Use __ () and N__() for the extension gettext domain, and reuse
// the shell domain with the default _() and N_()
const Gettext = imports.gettext.domain('dashtodock');
const __ = Gettext.gettext;
const N__ = function(e) { return e };
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const SCALE_UPDATE_TIMEOUT = 500;
const DEFAULT_ICONS_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ];
const TransparencyMode = {
DEFAULT: 0,
FIXED: 1,
DYNAMIC: 3
};
const RunningIndicatorStyle = {
DEFAULT: 0,
DOTS: 1,
SQUARES: 2,
DASHES: 3,
SEGMENTED: 4,
SOLID: 5,
CILIORA: 6,
METRO: 7
};
/**
* This function was copied from the activities-config extension
* https://github.com/nls1729/acme-code/tree/master/activities-config
* by Norman L. Smith.
*/
function cssHexString(css) {
let rrggbb = '#';
let start;
for (let loop = 0; loop < 3; loop++) {
let end = 0;
let xx = '';
for (let loop = 0; loop < 2; loop++) {
while (true) {
let x = css.slice(end, end + 1);
if ((x == '(') || (x == ',') || (x == ')'))
break;
end++;
}
if (loop == 0) {
end++;
start = end;
}
}
xx = parseInt(css.slice(start, end)).toString(16);
if (xx.length == 1)
xx = '0' + xx;
rrggbb += xx;
css = css.slice(end);
}
return rrggbb;
}
function setShortcut(settings) {
let shortcut_text = settings.get_string('shortcut-text');
let [key, mods] = Gtk.accelerator_parse(shortcut_text);
if (Gtk.accelerator_valid(key, mods)) {
let shortcut = Gtk.accelerator_name(key, mods);
settings.set_strv('shortcut', [shortcut]);
}
else {
settings.set_strv('shortcut', []);
}
}
var Settings = class DashToDock_Settings {
constructor() {
this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock');
this._rtl = (Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL);
this._builder = new Gtk.Builder();
this._builder.set_translation_domain(Me.metadata['gettext-domain']);
this._builder.add_from_file(Me.path + '/Settings.ui');
this.widget = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER });
this._notebook = this._builder.get_object('settings_notebook');
this.widget.add(this._notebook);
// Set a reasonable initial window height
this.widget.connect('realize', () => {
let window = this.widget.get_toplevel();
let [default_width, default_height] = window.get_default_size();
window.resize(default_width, 650);
});
// Timeout to delay the update of the settings
this._dock_size_timeout = 0;
this._icon_size_timeout = 0;
this._opacity_timeout = 0;
this._bindSettings();
this._builder.connect_signals_full(this._connector.bind(this));
}
/**
* Connect signals
*/
_connector(builder, object, signal, handler) {
/**init
* Object containing all signals defined in the glade file
*/
const SignalHandler = {
dock_display_combo_changed_cb(combo) {
this._settings.set_int('preferred-monitor', this._monitors[combo.get_active()]);
},
position_top_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('dock-position', 0);
},
position_right_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('dock-position', 1);
},
position_bottom_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('dock-position', 2);
},
position_left_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('dock-position', 3);
},
icon_size_combo_changed_cb(combo) {
this._settings.set_int('dash-max-icon-size', this._allIconSizes[combo.get_active()]);
},
dock_size_scale_format_value_cb(scale, value) {
return Math.round(value * 100) + ' %';
},
dock_size_scale_value_changed_cb(scale) {
// Avoid settings the size consinuosly
if (this._dock_size_timeout > 0)
Mainloop.source_remove(this._dock_size_timeout);
this._dock_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
this._settings.set_double('height-fraction', scale.get_value());
this._dock_size_timeout = 0;
return GLib.SOURCE_REMOVE;
});
},
icon_size_scale_format_value_cb(scale, value) {
return value + ' px';
},
icon_size_scale_value_changed_cb(scale) {
// Avoid settings the size consinuosly
if (this._icon_size_timeout > 0)
Mainloop.source_remove(this._icon_size_timeout);
this._icon_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
this._settings.set_int('dash-max-icon-size', scale.get_value());
this._icon_size_timeout = 0;
return GLib.SOURCE_REMOVE;
});
},
custom_opacity_scale_value_changed_cb(scale) {
// Avoid settings the opacity consinuosly as it's change is animated
if (this._opacity_timeout > 0)
Mainloop.source_remove(this._opacity_timeout);
this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
this._settings.set_double('background-opacity', scale.get_value());
this._opacity_timeout = 0;
return GLib.SOURCE_REMOVE;
});
},
min_opacity_scale_value_changed_cb(scale) {
// Avoid settings the opacity consinuosly as it's change is animated
if (this._opacity_timeout > 0)
Mainloop.source_remove(this._opacity_timeout);
this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
this._settings.set_double('min-alpha', scale.get_value());
this._opacity_timeout = 0;
return GLib.SOURCE_REMOVE;
});
},
max_opacity_scale_value_changed_cb(scale) {
// Avoid settings the opacity consinuosly as it's change is animated
if (this._opacity_timeout > 0)
Mainloop.source_remove(this._opacity_timeout);
this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
this._settings.set_double('max-alpha', scale.get_value());
this._opacity_timeout = 0;
return GLib.SOURCE_REMOVE;
});
},
custom_opacity_scale_format_value_cb(scale, value) {
return Math.round(value * 100) + ' %';
},
min_opacity_scale_format_value_cb(scale, value) {
return Math.round(value * 100) + ' %';
},
max_opacity_scale_format_value_cb(scale, value) {
return Math.round(value * 100) + ' %';
},
all_windows_radio_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('intellihide-mode', 0);
},
focus_application_windows_radio_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('intellihide-mode', 1);
},
maximized_windows_radio_button_toggled_cb(button) {
if (button.get_active())
this._settings.set_enum('intellihide-mode', 2);
}
}
object.connect(signal, SignalHandler[handler].bind(this));
}
_bindSettings() {
// Position and size panel
// Monitor options
this._monitors = [];
// Build options based on the number of monitors and the current settings.
let n_monitors = Gdk.Screen.get_default().get_n_monitors();
let primary_monitor = Gdk.Screen.get_default().get_primary_monitor();
let monitor = this._settings.get_int('preferred-monitor');
// Add primary monitor with index 0, because in GNOME Shell the primary monitor is always 0
this._builder.get_object('dock_monitor_combo').append_text(__('Primary monitor'));
this._monitors.push(0);
// Add connected monitors
let ctr = 0;
for (let i = 0; i < n_monitors; i++) {
if (i !== primary_monitor) {
ctr++;
this._monitors.push(ctr);
this._builder.get_object('dock_monitor_combo').append_text(__('Secondary monitor ') + ctr);
}
}
// If one of the external monitor is set as preferred, show it even if not attached
if ((monitor >= n_monitors) && (monitor !== primary_monitor)) {
this._monitors.push(monitor)
this._builder.get_object('dock_monitor_combo').append_text(__('Secondary monitor ') + ++ctr);
}
this._builder.get_object('dock_monitor_combo').set_active(this._monitors.indexOf(monitor));
// Position option
let position = this._settings.get_enum('dock-position');
switch (position) {
case 0:
this._builder.get_object('position_top_button').set_active(true);
break;
case 1:
this._builder.get_object('position_right_button').set_active(true);
break;
case 2:
this._builder.get_object('position_bottom_button').set_active(true);
break;
case 3:
this._builder.get_object('position_left_button').set_active(true);
break;
}
if (this._rtl) {
/* Left is Right in rtl as a setting */
this._builder.get_object('position_left_button').set_label(__('Right'));
this._builder.get_object('position_right_button').set_label(__('Left'));
}
// Intelligent autohide options
this._settings.bind('dock-fixed',
this._builder.get_object('intelligent_autohide_switch'),
'active',
Gio.SettingsBindFlags.INVERT_BOOLEAN);
this._settings.bind('dock-fixed',
this._builder.get_object('intelligent_autohide_button'),
'sensitive',
Gio.SettingsBindFlags.INVERT_BOOLEAN);
this._settings.bind('autohide',
this._builder.get_object('autohide_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('autohide-in-fullscreen',
this._builder.get_object('autohide_enable_in_fullscreen_checkbutton'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('require-pressure-to-show',
this._builder.get_object('require_pressure_checkbutton'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('intellihide',
this._builder.get_object('intellihide_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('animation-time',
this._builder.get_object('animation_duration_spinbutton'),
'value',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('hide-delay',
this._builder.get_object('hide_timeout_spinbutton'),
'value',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-delay',
this._builder.get_object('show_timeout_spinbutton'),
'value',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('pressure-threshold',
this._builder.get_object('pressure_threshold_spinbutton'),
'value',
Gio.SettingsBindFlags.DEFAULT);
//this._builder.get_object('animation_duration_spinbutton').set_value(this._settings.get_double('animation-time'));
// Create dialog for intelligent autohide advanced settings
this._builder.get_object('intelligent_autohide_button').connect('clicked', () => {
let dialog = new Gtk.Dialog({ title: __('Intelligent autohide customization'),
transient_for: this.widget.get_toplevel(),
use_header_bar: true,
modal: true });
// GTK+ leaves positive values for application-defined response ids.
// Use +1 for the reset action
dialog.add_button(__('Reset to defaults'), 1);
let box = this._builder.get_object('intelligent_autohide_advanced_settings_box');
dialog.get_content_area().add(box);
this._settings.bind('intellihide',
this._builder.get_object('intellihide_mode_box'),
'sensitive',
Gio.SettingsBindFlags.GET);
// intellihide mode
let intellihideModeRadioButtons = [
this._builder.get_object('all_windows_radio_button'),
this._builder.get_object('focus_application_windows_radio_button'),
this._builder.get_object('maximized_windows_radio_button')
];
intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true);
this._settings.bind('autohide',
this._builder.get_object('require_pressure_checkbutton'),
'sensitive',
Gio.SettingsBindFlags.GET);
this._settings.bind('autohide',
this._builder.get_object('autohide_enable_in_fullscreen_checkbutton'),
'sensitive',
Gio.SettingsBindFlags.GET);
this._settings.bind('require-pressure-to-show',
this._builder.get_object('show_timeout_spinbutton'),
'sensitive',
Gio.SettingsBindFlags.INVERT_BOOLEAN);
this._settings.bind('require-pressure-to-show',
this._builder.get_object('show_timeout_label'),
'sensitive',
Gio.SettingsBindFlags.INVERT_BOOLEAN);
this._settings.bind('require-pressure-to-show',
this._builder.get_object('pressure_threshold_spinbutton'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('require-pressure-to-show',
this._builder.get_object('pressure_threshold_label'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
dialog.connect('response', (dialog, id) => {
if (id == 1) {
// restore default settings for the relevant keys
let keys = ['intellihide', 'autohide', 'intellihide-mode', 'autohide-in-fullscreen', 'require-pressure-to-show',
'animation-time', 'show-delay', 'hide-delay', 'pressure-threshold'];
keys.forEach(function(val) {
this._settings.set_value(val, this._settings.get_default_value(val));
}, this);
intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true);
} else {
// remove the settings box so it doesn't get destroyed;
dialog.get_content_area().remove(box);
dialog.destroy();
}
return;
});
dialog.show_all();
});
// size options
this._builder.get_object('dock_size_scale').set_value(this._settings.get_double('height-fraction'));
this._builder.get_object('dock_size_scale').add_mark(0.9, Gtk.PositionType.TOP, null);
let icon_size_scale = this._builder.get_object('icon_size_scale');
icon_size_scale.set_range(8, DEFAULT_ICONS_SIZES[0]);
icon_size_scale.set_value(this._settings.get_int('dash-max-icon-size'));
DEFAULT_ICONS_SIZES.forEach(function(val) {
icon_size_scale.add_mark(val, Gtk.PositionType.TOP, val.toString());
});
// Corrent for rtl languages
if (this._rtl) {
// Flip value position: this is not done automatically
this._builder.get_object('dock_size_scale').set_value_pos(Gtk.PositionType.LEFT);
icon_size_scale.set_value_pos(Gtk.PositionType.LEFT);
// I suppose due to a bug, having a more than one mark and one above a value of 100
// makes the rendering of the marks wrong in rtl. This doesn't happen setting the scale as not flippable
// and then manually inverting it
icon_size_scale.set_flippable(false);
icon_size_scale.set_inverted(true);
}
this._settings.bind('icon-size-fixed', this._builder.get_object('icon_size_fixed_checkbutton'), 'active', Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('extend-height', this._builder.get_object('dock_size_extend_checkbutton'), 'active', Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('extend-height', this._builder.get_object('dock_size_scale'), 'sensitive', Gio.SettingsBindFlags.INVERT_BOOLEAN);
// Apps panel
this._settings.bind('show-running',
this._builder.get_object('show_running_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('isolate-workspaces',
this._builder.get_object('application_button_isolation_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('isolate-monitors',
this._builder.get_object('application_button_monitor_isolation_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-windows-preview',
this._builder.get_object('windows_preview_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('multi-monitor',
this._builder.get_object('multi_monitor_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-favorites',
this._builder.get_object('show_favorite_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-trash',
this._builder.get_object('show_trash_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-mounts',
this._builder.get_object('show_mounts_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-show-apps-button',
this._builder.get_object('show_applications_button_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-apps-at-top',
this._builder.get_object('application_button_first_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-show-apps-button',
this._builder.get_object('application_button_first_button'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('animate-show-apps',
this._builder.get_object('application_button_animation_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-show-apps-button',
this._builder.get_object('application_button_animation_button'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
// Behavior panel
this._settings.bind('hot-keys',
this._builder.get_object('hot_keys_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('hot-keys',
this._builder.get_object('overlay_button'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
this._builder.get_object('click_action_combo').set_active(this._settings.get_enum('click-action'));
this._builder.get_object('click_action_combo').connect('changed', (widget) => {
this._settings.set_enum('click-action', widget.get_active());
});
this._builder.get_object('scroll_action_combo').set_active(this._settings.get_enum('scroll-action'));
this._builder.get_object('scroll_action_combo').connect('changed', (widget) => {
this._settings.set_enum('scroll-action', widget.get_active());
});
this._builder.get_object('shift_click_action_combo').connect('changed', (widget) => {
this._settings.set_enum('shift-click-action', widget.get_active());
});
this._builder.get_object('middle_click_action_combo').connect('changed', (widget) => {
this._settings.set_enum('middle-click-action', widget.get_active());
});
this._builder.get_object('shift_middle_click_action_combo').connect('changed', (widget) => {
this._settings.set_enum('shift-middle-click-action', widget.get_active());
});
// Create dialog for number overlay options
this._builder.get_object('overlay_button').connect('clicked', () => {
let dialog = new Gtk.Dialog({ title: __('Show dock and application numbers'),
transient_for: this.widget.get_toplevel(),
use_header_bar: true,
modal: true });
// GTK+ leaves positive values for application-defined response ids.
// Use +1 for the reset action
dialog.add_button(__('Reset to defaults'), 1);
let box = this._builder.get_object('box_overlay_shortcut');
dialog.get_content_area().add(box);
this._builder.get_object('overlay_switch').set_active(this._settings.get_boolean('hotkeys-overlay'));
this._builder.get_object('show_dock_switch').set_active(this._settings.get_boolean('hotkeys-show-dock'));
// We need to update the shortcut 'strv' when the text is modified
this._settings.connect('changed::shortcut-text', () => {setShortcut(this._settings);});
this._settings.bind('shortcut-text',
this._builder.get_object('shortcut_entry'),
'text',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('hotkeys-overlay',
this._builder.get_object('overlay_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('hotkeys-show-dock',
this._builder.get_object('show_dock_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('shortcut-timeout',
this._builder.get_object('timeout_spinbutton'),
'value',
Gio.SettingsBindFlags.DEFAULT);
dialog.connect('response', (dialog, id) => {
if (id == 1) {
// restore default settings for the relevant keys
let keys = ['shortcut-text', 'hotkeys-overlay', 'hotkeys-show-dock', 'shortcut-timeout'];
keys.forEach(function(val) {
this._settings.set_value(val, this._settings.get_default_value(val));
}, this);
} else {
// remove the settings box so it doesn't get destroyed;
dialog.get_content_area().remove(box);
dialog.destroy();
}
return;
});
dialog.show_all();
});
// Create dialog for middle-click options
this._builder.get_object('middle_click_options_button').connect('clicked', () => {
let dialog = new Gtk.Dialog({ title: __('Customize middle-click behavior'),
transient_for: this.widget.get_toplevel(),
use_header_bar: true,
modal: true });
// GTK+ leaves positive values for application-defined response ids.
// Use +1 for the reset action
dialog.add_button(__('Reset to defaults'), 1);
let box = this._builder.get_object('box_middle_click_options');
dialog.get_content_area().add(box);
this._builder.get_object('shift_click_action_combo').set_active(this._settings.get_enum('shift-click-action'));
this._builder.get_object('middle_click_action_combo').set_active(this._settings.get_enum('middle-click-action'));
this._builder.get_object('shift_middle_click_action_combo').set_active(this._settings.get_enum('shift-middle-click-action'));
this._settings.bind('shift-click-action',
this._builder.get_object('shift_click_action_combo'),
'active-id',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('middle-click-action',
this._builder.get_object('middle_click_action_combo'),
'active-id',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('shift-middle-click-action',
this._builder.get_object('shift_middle_click_action_combo'),
'active-id',
Gio.SettingsBindFlags.DEFAULT);
dialog.connect('response', (dialog, id) => {
if (id == 1) {
// restore default settings for the relevant keys
let keys = ['shift-click-action', 'middle-click-action', 'shift-middle-click-action'];
keys.forEach(function(val) {
this._settings.set_value(val, this._settings.get_default_value(val));
}, this);
this._builder.get_object('shift_click_action_combo').set_active(this._settings.get_enum('shift-click-action'));
this._builder.get_object('middle_click_action_combo').set_active(this._settings.get_enum('middle-click-action'));
this._builder.get_object('shift_middle_click_action_combo').set_active(this._settings.get_enum('shift-middle-click-action'));
} else {
// remove the settings box so it doesn't get destroyed;
dialog.get_content_area().remove(box);
dialog.destroy();
}
return;
});
dialog.show_all();
});
// Appearance Panel
this._settings.bind('apply-custom-theme', this._builder.get_object('customize_theme'), 'sensitive', Gio.SettingsBindFlags.INVERT_BOOLEAN | Gio.SettingsBindFlags.GET);
this._settings.bind('apply-custom-theme', this._builder.get_object('builtin_theme_switch'), 'active', Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('custom-theme-shrink', this._builder.get_object('shrink_dash_switch'), 'active', Gio.SettingsBindFlags.DEFAULT);
// Running indicators
this._builder.get_object('running_indicators_combo').set_active(
this._settings.get_enum('running-indicator-style')
);
this._builder.get_object('running_indicators_combo').connect(
'changed',
(widget) => {
this._settings.set_enum('running-indicator-style', widget.get_active());
}
);
if (this._settings.get_enum('running-indicator-style') == RunningIndicatorStyle.DEFAULT)
this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(false);
this._settings.connect('changed::running-indicator-style', () => {
if (this._settings.get_enum('running-indicator-style') == RunningIndicatorStyle.DEFAULT)
this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(false);
else
this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(true);
});
// Create dialog for running indicators advanced settings
this._builder.get_object('running_indicators_advance_settings_button').connect('clicked', () => {
let dialog = new Gtk.Dialog({ title: __('Customize running indicators'),
transient_for: this.widget.get_toplevel(),
use_header_bar: true,
modal: true });
let box = this._builder.get_object('running_dots_advance_settings_box');
dialog.get_content_area().add(box);
this._settings.bind('running-indicator-dominant-color',
this._builder.get_object('dominant_color_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('custom-theme-customize-running-dots',
this._builder.get_object('dot_style_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('custom-theme-customize-running-dots',
this._builder.get_object('dot_style_settings_box'),
'sensitive', Gio.SettingsBindFlags.DEFAULT);
let rgba = new Gdk.RGBA();
rgba.parse(this._settings.get_string('custom-theme-running-dots-color'));
this._builder.get_object('dot_color_colorbutton').set_rgba(rgba);
this._builder.get_object('dot_color_colorbutton').connect('notify::color', (button) => {
let rgba = button.get_rgba();
let css = rgba.to_string();
let hexString = cssHexString(css);
this._settings.set_string('custom-theme-running-dots-color', hexString);
});
rgba.parse(this._settings.get_string('custom-theme-running-dots-border-color'));
this._builder.get_object('dot_border_color_colorbutton').set_rgba(rgba);
this._builder.get_object('dot_border_color_colorbutton').connect('notify::color', (button) => {
let rgba = button.get_rgba();
let css = rgba.to_string();
let hexString = cssHexString(css);
this._settings.set_string('custom-theme-running-dots-border-color', hexString);
});
this._settings.bind('custom-theme-running-dots-border-width',
this._builder.get_object('dot_border_width_spin_button'),
'value',
Gio.SettingsBindFlags.DEFAULT);
dialog.connect('response', (dialog, id) => {
// remove the settings box so it doesn't get destroyed;
dialog.get_content_area().remove(box);
dialog.destroy();
return;
});
dialog.show_all();
});
this._settings.bind('custom-background-color', this._builder.get_object('custom_background_color_switch'), 'active', Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('custom-background-color', this._builder.get_object('custom_background_color'), 'sensitive', Gio.SettingsBindFlags.DEFAULT);
let rgba = new Gdk.RGBA();
rgba.parse(this._settings.get_string('background-color'));
this._builder.get_object('custom_background_color').set_rgba(rgba);
this._builder.get_object('custom_background_color').connect('notify::color', (button) => {
let rgba = button.get_rgba();
let css = rgba.to_string();
let hexString = cssHexString(css);
this._settings.set_string('background-color', hexString);
});
// Opacity
this._builder.get_object('customize_opacity_combo').set_active_id(
this._settings.get_enum('transparency-mode').toString()
);
this._builder.get_object('customize_opacity_combo').connect(
'changed',
(widget) => {
this._settings.set_enum('transparency-mode', parseInt(widget.get_active_id()));
}
);
this._builder.get_object('custom_opacity_scale').set_value(this._settings.get_double('background-opacity'));
if (this._settings.get_enum('transparency-mode') !== TransparencyMode.FIXED)
this._builder.get_object('custom_opacity_scale').set_sensitive(false);
this._settings.connect('changed::transparency-mode', () => {
if (this._settings.get_enum('transparency-mode') !== TransparencyMode.FIXED)
this._builder.get_object('custom_opacity_scale').set_sensitive(false);
else
this._builder.get_object('custom_opacity_scale').set_sensitive(true);
});
if (this._settings.get_enum('transparency-mode') !== TransparencyMode.DYNAMIC) {
this._builder.get_object('dynamic_opacity_button').set_sensitive(false);
}
this._settings.connect('changed::transparency-mode', () => {
if (this._settings.get_enum('transparency-mode') !== TransparencyMode.DYNAMIC) {
this._builder.get_object('dynamic_opacity_button').set_sensitive(false);
}
else {
this._builder.get_object('dynamic_opacity_button').set_sensitive(true);
}
});
// Create dialog for transparency advanced settings
this._builder.get_object('dynamic_opacity_button').connect('clicked', () => {
let dialog = new Gtk.Dialog({ title: __('Cutomize opacity'),
transient_for: this.widget.get_toplevel(),
use_header_bar: true,
modal: true });
let box = this._builder.get_object('advanced_transparency_dialog');
dialog.get_content_area().add(box);
this._settings.bind(
'customize-alphas',
this._builder.get_object('customize_alphas_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT
);
this._settings.bind(
'customize-alphas',
this._builder.get_object('min_alpha_scale'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT
);
this._settings.bind(
'customize-alphas',
this._builder.get_object('max_alpha_scale'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT
);
this._builder.get_object('min_alpha_scale').set_value(
this._settings.get_double('min-alpha')
);
this._builder.get_object('max_alpha_scale').set_value(
this._settings.get_double('max-alpha')
);
dialog.connect('response', (dialog, id) => {
// remove the settings box so it doesn't get destroyed;
dialog.get_content_area().remove(box);
dialog.destroy();
return;
});
dialog.show_all();
});
this._settings.bind('unity-backlit-items',
this._builder.get_object('unity_backlit_items_switch'),
'active', Gio.SettingsBindFlags.DEFAULT
);
this._settings.bind('force-straight-corner',
this._builder.get_object('force_straight_corner_switch'),
'active', Gio.SettingsBindFlags.DEFAULT);
// About Panel
this._builder.get_object('extension_version').set_label(Me.metadata.version.toString());
}
};
function init() {
ExtensionUtils.initTranslations();
}
function buildPrefsWidget() {
let settings = new Settings();
let widget = settings.widget;
widget.show_all();
return widget;
}

View File

@ -0,0 +1,550 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="gnome-shell-extensions">
<enum id='org.gnome.shell.extensions.dash-to-dock.clickAction'>
<value value='0' nick='skip'/>
<value value='1' nick='minimize'/>
<value value='2' nick='launch'/>
<value value='3' nick='cycle-windows'/>
<value value='4' nick='minimize-or-overview'/>
<value value='5' nick='previews'/>
<value value='6' nick='minimize-or-previews'/>
<value value='7' nick='focus-or-previews'/>
<value value='8' nick='quit'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-dock.scrollAction'>
<value value='0' nick='do-nothing'/>
<value value='1' nick='cycle-windows'/>
<value value='2' nick='switch-workspace'/>
</enum>
<!-- this is mean to Match StSide. LEFT and RIGHT actual position in reversed in
rtl languages -->
<enum id='org.gnome.shell.extensions.dash-to-dock.position'>
<value value='0' nick='TOP'/>
<value value='1' nick='RIGHT'/>
<value value='2' nick='BOTTOM'/>
<value value='3' nick='LEFT'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-dock.intellihide-mode'>
<value value='0' nick='ALL_WINDOWS'/>
<value value='1' nick='FOCUS_APPLICATION_WINDOWS'/>
<value value='2' nick='MAXIMIZED_WINDOWS'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-dock.transparency-mode'>
<value value='0' nick='DEFAULT'/>
<value value='1' nick='FIXED'/>
<value value='3' nick='DYNAMIC'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-dock.running-indicator-style'>
<value value='0' nick='DEFAULT'/>
<value value='1' nick='DOTS'/>
<value value='2' nick='SQUARES'/>
<value value='3' nick='DASHES'/>
<value value='4' nick='SEGMENTED'/>
<value value='5' nick='SOLID'/>
<value value='6' nick='CILIORA'/>
<value value='7' nick='METRO'/>
</enum>
<schema path="/org/gnome/shell/extensions/dash-to-dock/" id="org.gnome.shell.extensions.dash-to-dock">
<key name="dock-position" enum="org.gnome.shell.extensions.dash-to-dock.position">
<default>'LEFT'</default>
<summary>Dock position</summary>
<description>Dock is shown on the Left, Right, Top or Bottom side of the screen.</description>
</key>
<key type="d" name="animation-time">
<default>0.2</default>
<summary>Animation time</summary>
<description>Sets the time duration of the autohide effect.</description>
</key>
<key type="d" name="show-delay">
<default>0.25</default>
<summary>Show delay</summary>
<description>Sets the delay after the mouse reaches the screen border before showing the dock.</description>
</key>
<key type="d" name="hide-delay">
<default>0.20</default>
<summary>Show delay</summary>
<description>Sets the delay after the mouse left the dock before hiding it.</description>
</key>
<key type="b" name="custom-background-color">
<default>false</default>
<summary>Set a custom dash background background color</summary>
<description>Sets the color for the dash background.</description>
</key>
<key type="s" name="background-color">
<default>"#ffffff"</default>
<summary>Dash background color.</summary>
<description>Customize the background color of the dash.</description>
</key>
<key name="transparency-mode" enum="org.gnome.shell.extensions.dash-to-dock.transparency-mode">
<default>'DEFAULT'</default>
<summary>Transparency mode for the dock</summary>
<description>FIXED: constant transparency. DYNAMIC: dock takes the opaque style only when windows are close to it.</description>
</key>
<key name="running-indicator-style" enum="org.gnome.shell.extensions.dash-to-dock.running-indicator-style">
<default>'DEFAULT'</default>
<summary>...</summary>
<description>DEFAULT: .... DOTS: ....</description>
</key>
<key type="b" name="running-indicator-dominant-color">
<default>false</default>
<summary>Use application icon dominant color for the indicator color</summary>
<description></description>
</key>
<key type="b" name="customize-alphas">
<default>false</default>
<summary>Manually set the min and max opacity</summary>
<description>For the dynamic mode, the min/max opacity values will be given by 'min-alpha' and 'max-alpha'.</description>
</key>
<key type="d" name="min-alpha">
<default>0.2</default>
<summary>Opacity of the dash background when free-floating</summary>
<description>Sets the opacity of the dash background when no windows are close.</description>
</key>
<key type="d" name="max-alpha">
<default>0.8</default>
<summary>Opacity of the dash background when windows are close.</summary>
<description>Sets the opacity of the dash background when windows are close.</description>
</key>
<key type="d" name="background-opacity">
<default>0.8</default>
<summary>Opacity of the dash background</summary>
<description>Sets the opacity of the dash background when in autohide mode.</description>
</key>
<key type="b" name="intellihide">
<default>true</default>
<summary>Dock dodges windows</summary>
<description>Enable or disable intellihide mode</description>
</key>
<key name="intellihide-mode" enum="org.gnome.shell.extensions.dash-to-dock.intellihide-mode">
<default>'FOCUS_APPLICATION_WINDOWS'</default>
<summary>Define which windows are considered for intellihide.</summary>
<description></description>
</key>
<key type="b" name="autohide">
<default>true</default>
<summary>Dock shown on mouse over</summary>
<description>Enable or disable autohide mode</description>
</key>
<key type="b" name="require-pressure-to-show">
<default>true</default>
<summary>Require pressure to show dash</summary>
<description>Enable or disable requiring pressure to show the dash</description>
</key>
<key type="d" name="pressure-threshold">
<default>100</default>
<summary>Pressure threshold</summary>
<description>Sets how much pressure is needed to show the dash.</description>
</key>
<key type="b" name="autohide-in-fullscreen">
<default>false</default>
<summary>Enable autohide in fullscreen mode.</summary>
<description>Enable autohide in fullscreen mode.</description>
</key>
<key type="b" name="dock-fixed">
<default>false</default>
<summary>Dock always visible</summary>
<description>Dock is always visible</description>
</key>
<key type="b" name="scroll-switch-workspace">
<default>true</default>
<summary>Switch workspace by scrolling over the dock</summary>
<description>Add the possibility to switch workspace by mouse scrolling over the dock.</description>
</key>
<key type="i" name="dash-max-icon-size">
<default>48</default>
<summary>Maximum dash icon size</summary>
<description>Set the allowed maximum dash icon size. Allowed range: 16..64.</description>
</key>
<key type="b" name="icon-size-fixed">
<default>false</default>
<summary>Fixed icon size</summary>
<description>Keep the icon size fived by scrolling the dock.</description>
</key>
<key type="b" name="apply-custom-theme">
<default>false</default>
<summary>Apply custom theme</summary>
<description>Apply customization to the dash appearance</description>
</key>
<key type="b" name="custom-theme-shrink">
<default>false</default>
<summary>TODO</summary>
<description>TODO</description>
</key>
<key type="b" name="custom-theme-customize-running-dots">
<default>false</default>
<summary>Customize the style of the running application indicators.</summary>
<description>Customize the style of the running application indicators.</description>
</key>
<key type="s" name="custom-theme-running-dots-color">
<default>"#ffffff"</default>
<summary>Running application indicators color</summary>
<description>Customize the color of the running application indicators.</description>
</key>
<key type="s" name="custom-theme-running-dots-border-color">
<default>"#ffffff"</default>
<summary>Running application indicators border color.</summary>
<description>Customize the border color of the running application indicators.</description>
</key>
<key type="i" name="custom-theme-running-dots-border-width">
<default>0</default>
<summary>Running application indicators border width.</summary>
<description>Customize the border width of the running application indicators.</description>
</key>
<key type="b" name="show-running">
<default>true</default>
<summary>Show running apps</summary>
<description>Show or hide running appplications icons in the dash</description>
</key>
<key type="b" name="isolate-workspaces">
<default>false</default>
<summary>Provide workspace isolation</summary>
<description>Dash shows only windows from the currentworkspace</description>
</key>
<key type="b" name="isolate-monitors">
<default>false</default>
<summary>Provide monitor isolation</summary>
<description>Dash shows only windows from the monitor</description>
</key>
<key type="b" name="show-windows-preview">
<default>true</default>
<summary>Show preview of the open windows</summary>
<description>Replace open windows list with windows previews</description>
</key>
<key type="b" name="show-favorites">
<default>true</default>
<summary>Show favorites apps</summary>
<description>Show or hide favorite appplications icons in the dash</description>
</key>
<key type="b" name="show-trash">
<default>true</default>
<summary>Show trash can</summary>
<description>Show or hide the trash can icon in the dash</description>
</key>
<key type="b" name="show-mounts">
<default>true</default>
<summary>Show mounted volumes and devices</summary>
<description>Show or hide mounted volume and device icons in the dash</description>
</key>
<key type="b" name="show-show-apps-button">
<default>true</default>
<summary>Show applications button</summary>
<description>Show appplications button in the dash</description>
</key>
<key type="b" name="show-apps-at-top">
<default>false</default>
<summary>Show application button at top</summary>
<description>Show appplication button at top of the dash</description>
</key>
<key type="b" name="animate-show-apps">
<default>true</default>
<summary>Animate Show Applications from the desktop</summary>
<description>Animate Show Applications from the desktop</description>
</key>
<key type="b" name="bolt-support">
<default>true</default>
<summary>Basic compatibility with bolt extensions</summary>
<description>Make the extension work properly when bolt extensions is enabled</description>
</key>
<key type="d" name="height-fraction">
<default>0.90</default>
<summary>Dock max height (fraction of available space)</summary>
</key>
<key type="b" name="extend-height">
<default>false</default>
<summary>Extend the dock container to all the available height</summary>
</key>
<key type="i" name="preferred-monitor">
<default>-1</default>
<summary>Monitor on which putting the dock</summary>
<description>Set on which monitor to put the dock, use -1 for the primary one</description>
</key>
<key type="b" name="multi-monitor">
<default>false</default>
<summary>Enable multi-monitor docks</summary>
<description>Show a dock on every monitor</description>
</key>
<key type="b" name="minimize-shift">
<default>true</default>
<summary>Minimize on shift+click</summary>
</key>
<key type="b" name="activate-single-window">
<default>true</default>
<summary>Activate only one window</summary>
</key>
<key name="click-action" enum="org.gnome.shell.extensions.dash-to-dock.clickAction">
<default>'cycle-windows'</default>
<summary>Action when clicking on a running app</summary>
<description>Set the action that is executed when clicking on the icon of a running application</description>
</key>
<key name="scroll-action" enum="org.gnome.shell.extensions.dash-to-dock.scrollAction">
<default>'do-nothing'</default>
<summary>Action when scrolling app</summary>
<description>Set the action that is executed when scrolling on the application icon</description>
</key>
<key name="shift-click-action" enum="org.gnome.shell.extensions.dash-to-dock.clickAction">
<default>'minimize'</default>
<summary>Action when shift+clicking on a running app</summary>
<description>Set the action that is executed when shift+clicking on the icon of a running application</description>
</key>
<key name="middle-click-action" enum="org.gnome.shell.extensions.dash-to-dock.clickAction">
<default>'launch'</default>
<summary>Action when clicking on a running app</summary>
<description>Set the action that is executed when middle-clicking on the icon of a running application</description>
</key>
<key name="shift-middle-click-action" enum="org.gnome.shell.extensions.dash-to-dock.clickAction">
<default>'launch'</default>
<summary>Action when clicking on a running app</summary>
<description>Set the action that is executed when shift+middle-clicking on the icon of a running application</description>
</key>
<key type="b" name="hot-keys">
<default>true</default>
<summary>Super Hot-Keys</summary>
<description>Launch and switch between dash items using Super+(0-9)</description>
</key>
<key type="b" name="hotkeys-show-dock">
<default>true</default>
<summary>Show the dock when using the hotkeys</summary>
<description>The dock will be quickly shown so that the number-overlay is visible and app activation is easier</description>
</key>
<key type="s" name="shortcut-text">
<default>"&lt;Super&gt;q"</default>
<summary>Keybinding to show the dock and the number overlay.</summary>
<description>Behavior depends on hotkeys-show-dock and hotkeys-overlay.</description>
</key>
<key type="as" name="shortcut">
<default><![CDATA[['<Super>q']]]></default>
<summary>Keybinding to show the dock and the number overlay.</summary>
<description>Behavior depends on hotkeys-show-dock and hotkeys-overlay.</description>
</key>
<key type="d" name="shortcut-timeout">
<default>2</default>
<summary>Timeout to hide the dock</summary>
<description>Sets the time duration before the dock is hidden again.</description>
</key>
<key type="b" name="hotkeys-overlay">
<default>true</default>
<summary>Show the dock when using the hotkeys</summary>
<description>The dock will be quickly shown so that the number-overlay is visible and app activation is easier</description>
</key>
<key name="app-ctrl-hotkey-1" type="as">
<default><![CDATA[['<Ctrl><Super>1']]]></default>
<summary>Keybinding to launch 1st dash app</summary>
<description>
Keybinding to launch 1st app.
</description>
</key>
<key name="app-ctrl-hotkey-2" type="as">
<default><![CDATA[['<Ctrl><Super>2']]]></default>
<summary>Keybinding to launch 2nd dash app</summary>
<description>
Keybinding to launch 2nd app.
</description>
</key>
<key name="app-ctrl-hotkey-3" type="as">
<default><![CDATA[['<Ctrl><Super>3']]]></default>
<summary>Keybinding to launch 3rd dash app</summary>
<description>
Keybinding to launch 3rd app.
</description>
</key>
<key name="app-ctrl-hotkey-4" type="as">
<default><![CDATA[['<Ctrl><Super>4']]]></default>
<summary>Keybinding to launch 4th dash app</summary>
<description>
Keybinding to launch 4th app.
</description>
</key>
<key name="app-ctrl-hotkey-5" type="as">
<default><![CDATA[['<Ctrl><Super>5']]]></default>
<summary>Keybinding to launch 5th dash app</summary>
<description>
Keybinding to launch 5th app.
</description>
</key>
<key name="app-ctrl-hotkey-6" type="as">
<default><![CDATA[['<Ctrl><Super>6']]]></default>
<summary>Keybinding to launch 6th dash app</summary>
<description>
Keybinding to launch 6th app.
</description>
</key>
<key name="app-ctrl-hotkey-7" type="as">
<default><![CDATA[['<Ctrl><Super>7']]]></default>
<summary>Keybinding to launch 7th dash app</summary>
<description>
Keybinding to launch 7th app.
</description>
</key>
<key name="app-ctrl-hotkey-8" type="as">
<default><![CDATA[['<Ctrl><Super>8']]]></default>
<summary>Keybinding to launch 8th dash app</summary>
<description>
Keybinding to launch 8th app.
</description>
</key>
<key name="app-ctrl-hotkey-9" type="as">
<default><![CDATA[['<Ctrl><Super>9']]]></default>
<summary>Keybinding to launch 9th dash app</summary>
<description>
Keybinding to launch 9th app.
</description>
</key>
<key name="app-ctrl-hotkey-10" type="as">
<default><![CDATA[['<Ctrl><Super>0']]]></default>
<summary>Keybinding to launch 10th dash app</summary>
<description>
Keybinding to launch 10th app.
</description>
</key>
<key name="app-shift-hotkey-1" type="as">
<default><![CDATA[['<Shift><Super>1']]]></default>
<summary>Keybinding to trigger 1st dash app with shift behavior</summary>
<description>
Keybinding to trigger 1st app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-2" type="as">
<default><![CDATA[['<Shift><Super>2']]]></default>
<summary>Keybinding to trigger 2nd dash app with shift behavior</summary>
<description>
Keybinding to trigger 2nd app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-3" type="as">
<default><![CDATA[['<Shift><Super>3']]]></default>
<summary>Keybinding to trigger 3rd dash app with shift behavior</summary>
<description>
Keybinding to trigger 3rd app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-4" type="as">
<default><![CDATA[['<Shift><Super>4']]]></default>
<summary>Keybinding to trigger 4th dash app with shift behavior</summary>
<description>
Keybinding to trigger 4th app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-5" type="as">
<default><![CDATA[['<Shift><Super>5']]]></default>
<summary>Keybinding to trigger 5th dash app with shift behavior</summary>
<description>
Keybinding to trigger 5th app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-6" type="as">
<default><![CDATA[['<Shift><Super>6']]]></default>
<summary>Keybinding to trigger 6th dash app with shift behavior</summary>
<description>
Keybinding to trigger 6th app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-7" type="as">
<default><![CDATA[['<Shift><Super>7']]]></default>
<summary>Keybinding to trigger 7th dash app with shift behavior</summary>
<description>
Keybinding to trigger 7th app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-8" type="as">
<default><![CDATA[['<Shift><Super>8']]]></default>
<summary>Keybinding to trigger 8th dash app with shift behavior</summary>
<description>
Keybinding to trigger 8th app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-9" type="as">
<default><![CDATA[['<Shift><Super>9']]]></default>
<summary>Keybinding to trigger 9th dash app with shift behavior</summary>
<description>
Keybinding to trigger 9th app with shift behavior.
</description>
</key>
<key name="app-shift-hotkey-10" type="as">
<default><![CDATA[['<Shift><Super>0']]]></default>
<summary>Keybinding to trigger 10th dash app with shift behavior</summary>
<description>
Keybinding to trigger 10th app with shift behavior.
</description>
</key>
<key name="app-hotkey-1" type="as">
<default><![CDATA[['<Super>1']]]></default>
<summary>Keybinding to trigger 1st dash app</summary>
<description>
Keybinding to either show or launch the 1st application in the dash.
</description>
</key>
<key name="app-hotkey-2" type="as">
<default><![CDATA[['<Super>2']]]></default>
<summary>Keybinding to trigger 2nd dash app</summary>
<description>
Keybinding to either show or launch the 2nd application in the dash.
</description>
</key>
<key name="app-hotkey-3" type="as">
<default><![CDATA[['<Super>3']]]></default>
<summary>Keybinding to trigger 3rd dash app</summary>
<description>
Keybinding to either show or launch the 3rd application in the dash.
</description>
</key>
<key name="app-hotkey-4" type="as">
<default><![CDATA[['<Super>4']]]></default>
<summary>Keybinding to trigger 4th dash app</summary>
<description>
Keybinding to either show or launch the 4th application in the dash.
</description>
</key>
<key name="app-hotkey-5" type="as">
<default><![CDATA[['<Super>5']]]></default>
<summary>Keybinding to trigger 5th dash app</summary>
<description>
Keybinding to either show or launch the 5th application in the dash.
</description>
</key>
<key name="app-hotkey-6" type="as">
<default><![CDATA[['<Super>6']]]></default>
<summary>Keybinding to trigger 6th dash app</summary>
<description>
Keybinding to either show or launch the 6th application in the dash.
</description>
</key>
<key name="app-hotkey-7" type="as">
<default><![CDATA[['<Super>7']]]></default>
<summary>Keybinding to trigger 7th dash app</summary>
<description>
Keybinding to either show or launch the 7th application in the dash.
</description>
</key>
<key name="app-hotkey-8" type="as">
<default><![CDATA[['<Super>8']]]></default>
<summary>Keybinding to trigger 8th dash app</summary>
<description>
Keybinding to either show or launch the 8th application in the dash.
</description>
</key>
<key name="app-hotkey-9" type="as">
<default><![CDATA[['<Super>9']]]></default>
<summary>Keybinding to trigger 9th dash app</summary>
<description>
Keybinding to either show or launch the 9th application in the dash.
</description>
</key>
<key name="app-hotkey-10" type="as">
<default><![CDATA[['<Super>0']]]></default>
<summary>Keybinding to trigger 10th dash app</summary>
<description>
Keybinding to either show or launch the 10th application in the dash.
</description>
</key>
<key name="force-straight-corner" type="b">
<default>false</default>
<summary>Force straight corners in dash</summary>
<description>Make the borders in the dash non rounded</description>
</key>
<key name="unity-backlit-items" type="b">
<default>false</default>
<summary>Enable unity7 like glossy backlit items</summary>
<description>Emulate the unity7 backlit glossy items behaviour</description>
</key>
</schema>
</schemalist>

View File

@ -0,0 +1,178 @@
/* Shrink the dash by reducing padding and border radius */
#dashtodockContainer.shrink #dash,
#dashtodockContainer.dashtodock #dash {
border:1px;
padding:0px;
}
#dashtodockContainer.shrink.left #dash,
#dashtodockContainer.dashtodock.left #dash {
border-left: 0px;
}
#dashtodockContainer.shrink.right #dash,
#dashtodockContainer.dashtodock.right #dash {
border-right: 0px;
}
#dashtodockContainer.shrink.top #dash,
#dashtodockContainer.dashtodock.top #dash {
border-top: 0px;
}
#dashtodockContainer.shrink.bottom #dash,
#dashtodockContainer.dashtodock.bottom #dash {
border-bottom: 0px;
}
#dashtodockContainer.straight-corner #dash,
#dashtodockContainer.shrink.straight-corner #dash {
border-radius: 0px;
}
/* Scrollview style */
.bottom #dashtodockDashScrollview,
.top #dashtodockDashScrollview {
-st-hfade-offset: 24px;
}
.left #dashtodockDashScrollview,
.right #dashtodockDashScrollview {
-st-vfade-offset: 24px;
}
#dashtodockContainer.running-dots .dash-item-container > StButton,
#dashtodockContainer.dashtodock .dash-item-container > StButton {
transition-duration: 250;
background-size: contain;
}
#dashtodockContainer.shrink .dash-item-container > StButton,
#dashtodockContainer.dashtodock .dash-item-container > StButton {
padding: 1px 2px;
}
/* Dash height extended to the whole available vertical space */
#dashtodockContainer.extended.top #dash,
#dashtodockContainer.extended.right #dash,
#dashtodockContainer.extended.bottom #dash,
#dashtodockContainer.extended.left #dash {
border-radius: 0;
}
#dashtodockContainer.extended.top #dash,
#dashtodockContainer.extended.bottom #dash {
border-left:0px;
border-right:0px;
}
#dashtodockContainer.extended.right #dash,
#dashtodockContainer.extended.left #dash {
border-top:0px;
border-bottom:0px;
}
/* Running and focused application style */
#dashtodockContainer.running-dots .app-well-app.running > .overview-icon,
#dashtodockContainer.dashtodock .app-well-app.running > .overview-icon {
background-image:none;
}
#dashtodockContainer.running-dots .app-well-app.focused .overview-icon,
#dashtodockContainer.dashtodock .app-well-app.focused .overview-icon {
background-color: rgba(238, 238, 236, 0.2);
}
#dashtodockContainer.dashtodock #dash {
background: #2e3436;
}
#dashtodockContainer.dashtodock .progress-bar {
/* Customization of the progress bar style, e.g.:
-progress-bar-background: rgba(0.8, 0.8, 0.8, 1);
-progress-bar-border: rgba(0.9, 0.9, 0.9, 1);
*/
}
/*
* This is applied to a dummy actor. Only the alpha value for the background and border color
* and the transition-duration are used
*/
#dashtodockContainer.dummy-opaque {
background-color: rgba(0, 0, 0, 0.8);
border-color: rgba(0, 0, 0, 0.4);
transition-duration: 300ms;
}
/*
* This is applied to a dummy actor. Only the alpha value for the background and border color
* and the transition-duration are used
*/
#dashtodockContainer.dummy-transparent {
background-color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.1);
transition-duration: 500ms;
}
#dashtodockContainer.opaque {
}
#dashtodockContainer.transparent {
}
#dashtodockContainer .number-overlay {
color: rgba(255,255,255,1);
background-color: rgba(0,0,0,0.8);
text-align: center;
}
#dashtodockContainer .notification-badge {
color: rgba(255,255,255,1);
background-color: rgba(255,0,0,1.0);
padding: 0.2em 0.5em;
border-radius: 1em;
font-weight: bold;
text-align: center;
margin: 2px;
}
#dashtodockPreviewSeparator.popup-separator-menu-item-horizontal {
width: 1px;
height: auto;
border-right-width: 1px;
margin: 32px 0px;
}
.dashtodock-app-well-preview-menu-item {
padding: 1em 1em 0.5em 1em;
}
#dashtodockContainer .metro .overview-icon{
border-radius: 0px;
}
#dashtodockContainer.bottom .metro.running2.focused,
#dashtodockContainer.bottom .metro.running3.focused,
#dashtodockContainer.bottom .metro.running4.focused,
#dashtodockContainer.top .metro.running2.focused,
#dashtodockContainer.top .metro.running3.focused,
#dashtodockContainer.top .metro.running4.focused {
background-image: url('./media/highlight_stacked_bg.svg');
background-position: 0px 0px;
background-size: contain;
}
#dashtodockContainer.left .metro.running2.focused,
#dashtodockContainer.left .metro.running3.focused,
#dashtodockContainer.left .metro.running4.focused,
#dashtodockContainer.right .metro.running2.focused,
#dashtodockContainer.right .metro.running3.focused,
#dashtodockContainer.right .metro.running4.focused {
background-image: url('./media/highlight_stacked_bg_h.svg');
background-position: 0px 0px;
background-size: contain;
}

View File

@ -0,0 +1,572 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Signals = imports.signals;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Mainloop = imports.mainloop;
const AppDisplay = imports.ui.appDisplay;
const AppFavorites = imports.ui.appFavorites;
const Dash = imports.ui.dash;
const DND = imports.ui.dnd;
const IconGrid = imports.ui.iconGrid;
const Main = imports.ui.main;
const PopupMenu = imports.ui.popupMenu;
const Util = imports.misc.util;
const Workspace = imports.ui.workspace;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Docking = Me.imports.docking;
const Utils = Me.imports.utils;
/*
* DEFAULT: transparency given by theme
* FIXED: constant transparency chosen by user
* DYNAMIC: apply 'transparent' style when no windows are close to the dock
* */
const TransparencyMode = {
DEFAULT: 0,
FIXED: 1,
DYNAMIC: 3
};
/**
* Manage theme customization and custom theme support
*/
var ThemeManager = class DashToDock_ThemeManager {
constructor(dock) {
this._signalsHandler = new Utils.GlobalSignalsHandler();
this._bindSettingsChanges();
this._actor = dock;
this._dash = dock.dash;
// initialize colors with generic values
this._customizedBackground = {red: 0, green: 0, blue: 0, alpha: 0};
this._customizedBorder = {red: 0, green: 0, blue: 0, alpha: 0};
this._transparency = new Transparency(dock);
this._signalsHandler.add([
// When theme changes re-obtain default background color
St.ThemeContext.get_for_stage (global.stage),
'changed',
this.updateCustomTheme.bind(this)
], [
// update :overview pseudoclass
Main.overview,
'showing',
this._onOverviewShowing.bind(this)
], [
Main.overview,
'hiding',
this._onOverviewHiding.bind(this)
]);
this._updateCustomStyleClasses();
// destroy themeManager when the managed actor is destroyed (e.g. extension unload)
// in order to disconnect signals
this._actor.connect('destroy', this.destroy.bind(this));
}
destroy() {
this._signalsHandler.destroy();
this._transparency.destroy();
}
_onOverviewShowing() {
this._actor.add_style_pseudo_class('overview');
}
_onOverviewHiding() {
this._actor.remove_style_pseudo_class('overview');
}
_updateDashOpacity() {
let newAlpha = Docking.DockManager.settings.get_double('background-opacity');
let [backgroundColor, borderColor] = this._getDefaultColors();
if (backgroundColor==null)
return;
// Get the background and border alphas. We check the background alpha
// for a minimum of .001 to prevent division by 0 errors
let backgroundAlpha = Math.max(Math.round(backgroundColor.alpha/2.55)/100, .001);
let borderAlpha = Math.round(borderColor.alpha/2.55)/100;
// The border and background alphas should remain in sync
// We also limit the borderAlpha to a maximum of 1 (full opacity)
borderAlpha = Math.min((borderAlpha/backgroundAlpha)*newAlpha, 1);
this._customizedBackground = 'rgba(' +
backgroundColor.red + ',' +
backgroundColor.green + ',' +
backgroundColor.blue + ',' +
newAlpha + ')';
this._customizedBorder = 'rgba(' +
borderColor.red + ',' +
borderColor.green + ',' +
borderColor.blue + ',' +
borderAlpha + ')';
}
_getDefaultColors() {
// Prevent shell crash if the actor is not on the stage.
// It happens enabling/disabling repeatedly the extension
if (!this._dash._container.get_stage())
return [null, null];
// Remove custom style
let oldStyle = this._dash._container.get_style();
this._dash._container.set_style(null);
let themeNode = this._dash._container.get_theme_node();
this._dash._container.set_style(oldStyle);
let backgroundColor = themeNode.get_background_color();
// Just in case the theme has different border colors ..
// We want to find the inside border-color of the dock because it is
// the side most visible to the user. We do this by finding the side
// opposite the position
let position = Utils.getPosition();
let side = position + 2;
if (side > 3)
side = Math.abs(side - 4);
let borderColor = themeNode.get_border_color(side);
return [backgroundColor, borderColor];
}
_updateDashColor() {
// Retrieve the color. If needed we will adjust it before passing it to
// this._transparency.
let [backgroundColor, borderColor] = this._getDefaultColors();
if (backgroundColor==null)
return;
let settings = Docking.DockManager.settings;
if (settings.get_boolean('custom-background-color')) {
// When applying a custom color, we need to check the alpha value,
// if not the opacity will always be overridden by the color below.
// Note that if using 'dynamic' transparency modes,
// the opacity will be set by the opaque/transparent styles anyway.
let newAlpha = Math.round(backgroundColor.alpha/2.55)/100;
if (settings.get_enum('transparency-mode') == TransparencyMode.FIXED)
newAlpha = settings.get_double('background-opacity');
backgroundColor = Clutter.color_from_string(settings.get_string('background-color'))[1];
this._customizedBackground = 'rgba(' +
backgroundColor.red + ',' +
backgroundColor.green + ',' +
backgroundColor.blue + ',' +
newAlpha + ')';
this._customizedBorder = this._customizedBackground;
}
this._transparency.setColor(backgroundColor);
}
_updateCustomStyleClasses() {
let settings = Docking.DockManager.settings;
if (settings.get_boolean('apply-custom-theme'))
this._actor.add_style_class_name('dashtodock');
else
this._actor.remove_style_class_name('dashtodock');
if (settings.get_boolean('custom-theme-shrink'))
this._actor.add_style_class_name('shrink');
else
this._actor.remove_style_class_name('shrink');
if (settings.get_enum('running-indicator-style') !== 0)
this._actor.add_style_class_name('running-dots');
else
this._actor.remove_style_class_name('running-dots');
// If not the built-in theme option is not selected
if (!settings.get_boolean('apply-custom-theme')) {
if (settings.get_boolean('force-straight-corner'))
this._actor.add_style_class_name('straight-corner');
else
this._actor.remove_style_class_name('straight-corner');
} else {
this._actor.remove_style_class_name('straight-corner');
}
}
updateCustomTheme() {
this._updateCustomStyleClasses();
this._updateDashOpacity();
this._updateDashColor();
this._adjustTheme();
this._dash._redisplay();
}
/**
* Reimported back and adapted from atomdock
*/
_adjustTheme() {
// Prevent shell crash if the actor is not on the stage.
// It happens enabling/disabling repeatedly the extension
if (!this._dash._container.get_stage())
return;
let settings = Docking.DockManager.settings;
// Remove prior style edits
this._dash._container.set_style(null);
this._transparency.disable();
// If built-in theme is enabled do nothing else
if (settings.get_boolean('apply-custom-theme'))
return;
let newStyle = '';
let position = Utils.getPosition(settings);
// obtain theme border settings
let themeNode = this._dash._container.get_theme_node();
let borderColor = themeNode.get_border_color(St.Side.TOP);
let borderWidth = themeNode.get_border_width(St.Side.TOP);
let borderRadius = themeNode.get_border_radius(St.Corner.TOPRIGHT);
// We're copying border and corner styles to left border and top-left
// corner, also removing bottom border and bottom-right corner styles
let borderInner = '';
let borderRadiusValue = '';
let borderMissingStyle = '';
if (this._rtl && (position != St.Side.RIGHT))
borderMissingStyle = 'border-right: ' + borderWidth + 'px solid ' +
borderColor.to_string() + ';';
else if (!this._rtl && (position != St.Side.LEFT))
borderMissingStyle = 'border-left: ' + borderWidth + 'px solid ' +
borderColor.to_string() + ';';
switch (position) {
case St.Side.LEFT:
borderInner = 'border-left';
borderRadiusValue = '0 ' + borderRadius + 'px ' + borderRadius + 'px 0;';
break;
case St.Side.RIGHT:
borderInner = 'border-right';
borderRadiusValue = borderRadius + 'px 0 0 ' + borderRadius + 'px;';
break;
case St.Side.TOP:
borderInner = 'border-top';
borderRadiusValue = '0 0 ' + borderRadius + 'px ' + borderRadius + 'px;';
break;
case St.Side.BOTTOM:
borderInner = 'border-bottom';
borderRadiusValue = borderRadius + 'px ' + borderRadius + 'px 0 0;';
break;
}
newStyle = borderInner + ': none;' +
'border-radius: ' + borderRadiusValue +
borderMissingStyle;
// I do call set_style possibly twice so that only the background gets the transition.
// The transition-property css rules seems to be unsupported
this._dash._container.set_style(newStyle);
// Customize background
let fixedTransparency = settings.get_enum('transparency-mode') == TransparencyMode.FIXED;
let defaultTransparency = settings.get_enum('transparency-mode') == TransparencyMode.DEFAULT;
if (!defaultTransparency && !fixedTransparency) {
this._transparency.enable();
}
else if (!defaultTransparency || settings.get_boolean('custom-background-color')) {
newStyle = newStyle + 'background-color:'+ this._customizedBackground + '; ' +
'border-color:'+ this._customizedBorder + '; ' +
'transition-delay: 0s; transition-duration: 0.250s;';
this._dash._container.set_style(newStyle);
}
}
_bindSettingsChanges() {
let keys = ['transparency-mode',
'customize-alphas',
'min-alpha',
'max-alpha',
'background-opacity',
'custom-background-color',
'background-color',
'apply-custom-theme',
'custom-theme-shrink',
'custom-theme-running-dots',
'extend-height',
'force-straight-corner'];
keys.forEach(function(key) {
this._signalsHandler.add([
Docking.DockManager.settings,
'changed::' + key,
this.updateCustomTheme.bind(this)
]);
}, this);
}
};
/**
* The following class is based on the following upstream commit:
* https://git.gnome.org/browse/gnome-shell/commit/?id=447bf55e45b00426ed908b1b1035f472c2466956
* Transparency when free-floating
*/
var Transparency = class DashToDock_Transparency {
constructor(dock) {
this._dash = dock.dash;
this._actor = this._dash._container;
this._dockActor = dock;
this._dock = dock;
this._panel = Main.panel;
this._position = Utils.getPosition();
// All these properties are replaced with the ones in the .dummy-opaque and .dummy-transparent css classes
this._backgroundColor = '0,0,0';
this._transparentAlpha = '0.2';
this._opaqueAlpha = '1';
this._transparentAlphaBorder = '0.1';
this._opaqueAlphaBorder = '0.5';
this._transparentTransition = '0ms';
this._opaqueTransition = '0ms';
this._base_actor_style = "";
this._signalsHandler = new Utils.GlobalSignalsHandler();
this._injectionsHandler = new Utils.InjectionsHandler();
this._trackedWindows = new Map();
}
enable() {
// ensure I never double-register/inject
// although it should never happen
this.disable();
this._base_actor_style = this._actor.get_style();
if (this._base_actor_style == null) {
this._base_actor_style = "";
}
this._signalsHandler.addWithLabel('transparency', [
global.window_group,
'actor-added',
this._onWindowActorAdded.bind(this)
], [
global.window_group,
'actor-removed',
this._onWindowActorRemoved.bind(this)
], [
global.window_manager,
'switch-workspace',
this._updateSolidStyle.bind(this)
], [
Main.overview,
'hiding',
this._updateSolidStyle.bind(this)
], [
Main.overview,
'showing',
this._updateSolidStyle.bind(this)
]);
// Window signals
global.window_group.get_children().filter(function(child) {
// An irrelevant window actor ('Gnome-shell') produces an error when the signals are
// disconnected, therefore do not add signals to it.
return child instanceof Meta.WindowActor &&
child.get_meta_window().get_wm_class() !== 'Gnome-shell';
}).forEach(function(win) {
this._onWindowActorAdded(null, win);
}, this);
if (this._actor.get_stage())
this._updateSolidStyle();
this._updateStyles();
this._updateSolidStyle();
this.emit('transparency-enabled');
}
disable() {
// ensure I never double-register/inject
// although it should never happen
this._signalsHandler.removeWithLabel('transparency');
for (let key of this._trackedWindows.keys())
this._trackedWindows.get(key).forEach(id => {
key.disconnect(id);
});
this._trackedWindows.clear();
this.emit('transparency-disabled');
}
destroy() {
this.disable();
this._signalsHandler.destroy();
this._injectionsHandler.destroy();
}
_onWindowActorAdded(container, metaWindowActor) {
let signalIds = [];
['allocation-changed', 'notify::visible'].forEach(s => {
signalIds.push(metaWindowActor.connect(s, this._updateSolidStyle.bind(this)));
});
this._trackedWindows.set(metaWindowActor, signalIds);
}
_onWindowActorRemoved(container, metaWindowActor) {
if (!this._trackedWindows.get(metaWindowActor))
return;
this._trackedWindows.get(metaWindowActor).forEach(id => {
metaWindowActor.disconnect(id);
});
this._trackedWindows.delete(metaWindowActor);
this._updateSolidStyle();
}
_updateSolidStyle() {
let isNear = this._dockIsNear();
if (isNear) {
this._actor.set_style(this._opaque_style);
this._dockActor.remove_style_class_name('transparent');
this._dockActor.add_style_class_name('opaque');
}
else {
this._actor.set_style(this._transparent_style);
this._dockActor.remove_style_class_name('opaque');
this._dockActor.add_style_class_name('transparent');
}
this.emit('solid-style-updated', isNear);
}
_dockIsNear() {
if (this._dockActor.has_style_pseudo_class('overview'))
return false;
/* Get all the windows in the active workspace that are in the primary monitor and visible */
let activeWorkspace = global.workspace_manager.get_active_workspace();
let dash = this._dash;
let windows = activeWorkspace.list_windows().filter(function(metaWindow) {
return metaWindow.get_monitor() === dash._monitorIndex &&
metaWindow.showing_on_its_workspace() &&
metaWindow.get_window_type() != Meta.WindowType.DESKTOP;
});
/* Check if at least one window is near enough to the panel.
* If the dock is hidden, we need to account for the space it would take
* up when it slides out. This is avoid an ugly transition.
* */
let factor = 0;
if (!Docking.DockManager.settings.get_boolean('dock-fixed') &&
this._dock.getDockState() == Docking.State.HIDDEN)
factor = 1;
let [leftCoord, topCoord] = this._actor.get_transformed_position();
let threshold;
if (this._position === St.Side.LEFT)
threshold = leftCoord + this._actor.get_width() * (factor + 1);
else if (this._position === St.Side.RIGHT)
threshold = leftCoord - this._actor.get_width() * factor;
else if (this._position === St.Side.TOP)
threshold = topCoord + this._actor.get_height() * (factor + 1);
else
threshold = topCoord - this._actor.get_height() * factor;
let scale = St.ThemeContext.get_for_stage(global.stage).scale_factor;
let isNearEnough = windows.some((metaWindow) => {
let coord;
if (this._position === St.Side.LEFT) {
coord = metaWindow.get_frame_rect().x;
return coord < threshold + 5 * scale;
}
else if (this._position === St.Side.RIGHT) {
coord = metaWindow.get_frame_rect().x + metaWindow.get_frame_rect().width;
return coord > threshold - 5 * scale;
}
else if (this._position === St.Side.TOP) {
coord = metaWindow.get_frame_rect().y;
return coord < threshold + 5 * scale;
}
else {
coord = metaWindow.get_frame_rect().y + metaWindow.get_frame_rect().height;
return coord > threshold - 5 * scale;
}
});
return isNearEnough;
}
_updateStyles() {
this._getAlphas();
this._transparent_style = this._base_actor_style +
'background-color: rgba(' +
this._backgroundColor + ', ' + this._transparentAlpha + ');' +
'border-color: rgba(' +
this._backgroundColor + ', ' + this._transparentAlphaBorder + ');' +
'transition-duration: ' + this._transparentTransition + 'ms;';
this._opaque_style = this._base_actor_style +
'background-color: rgba(' +
this._backgroundColor + ', ' + this._opaqueAlpha + ');' +
'border-color: rgba(' +
this._backgroundColor + ',' + this._opaqueAlphaBorder + ');' +
'transition-duration: ' + this._opaqueTransition + 'ms;';
this.emit('styles-updated');
}
setColor(color) {
this._backgroundColor = color.red + ',' + color.green + ',' + color.blue;
this._updateStyles();
}
_getAlphas() {
// Create dummy object and add to the uiGroup to get it to the stage
let dummyObject = new St.Bin({
name: 'dashtodockContainer',
});
Main.uiGroup.add_child(dummyObject);
dummyObject.add_style_class_name('dummy-opaque');
let themeNode = dummyObject.get_theme_node();
this._opaqueAlpha = themeNode.get_background_color().alpha / 255;
this._opaqueAlphaBorder = themeNode.get_border_color(0).alpha / 255;
this._opaqueTransition = themeNode.get_transition_duration();
dummyObject.add_style_class_name('dummy-transparent');
themeNode = dummyObject.get_theme_node();
this._transparentAlpha = themeNode.get_background_color().alpha / 255;
this._transparentAlphaBorder = themeNode.get_border_color(0).alpha / 255;
this._transparentTransition = themeNode.get_transition_duration();
Main.uiGroup.remove_child(dummyObject);
let settings = Docking.DockManager.settings;
if (settings.get_boolean('customize-alphas')) {
this._opaqueAlpha = settings.get_double('max-alpha');
this._opaqueAlphaBorder = this._opaqueAlpha / 2;
this._transparentAlpha = settings.get_double('min-alpha');
this._transparentAlphaBorder = this._transparentAlpha / 2;
}
}
};
Signals.addSignalMethods(Transparency.prototype);

View File

@ -0,0 +1,284 @@
const Clutter = imports.gi.Clutter;
const Meta = imports.gi.Meta;
const St = imports.gi.St;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Docking = Me.imports.docking;
var SignalsHandlerFlags = {
NONE: 0,
CONNECT_AFTER: 1
};
/**
* Simplify global signals and function injections handling
* abstract class
*/
const BasicHandler = class DashToDock_BasicHandler {
constructor() {
this._storage = new Object();
}
add(/* unlimited 3-long array arguments */) {
// Convert arguments object to array, concatenate with generic
let args = Array.concat('generic', Array.slice(arguments));
// Call addWithLabel with ags as if they were passed arguments
this.addWithLabel.apply(this, args);
}
destroy() {
for( let label in this._storage )
this.removeWithLabel(label);
}
addWithLabel(label /* plus unlimited 3-long array arguments*/) {
if (this._storage[label] == undefined)
this._storage[label] = new Array();
// Skip first element of the arguments
for (let i = 1; i < arguments.length; i++) {
let item = this._storage[label];
try {
item.push(this._create(arguments[i]));
} catch (e) {
logError(e);
}
}
}
removeWithLabel(label) {
if (this._storage[label]) {
for (let i = 0; i < this._storage[label].length; i++)
this._remove(this._storage[label][i]);
delete this._storage[label];
}
}
// Virtual methods to be implemented by subclass
/**
* Create single element to be stored in the storage structure
*/
_create(item) {
throw new GObject.NotImplementedError(`_create in ${this.constructor.name}`);
}
/**
* Correctly delete single element
*/
_remove(item) {
throw new GObject.NotImplementedError(`_remove in ${this.constructor.name}`);
}
};
/**
* Manage global signals
*/
var GlobalSignalsHandler = class DashToDock_GlobalSignalHandler extends BasicHandler {
_create(item) {
let object = item[0];
let event = item[1];
let callback = item[2]
let flags = item.length > 3 ? item[3] : SignalsHandlerFlags.NONE;
if (!object)
throw new Error('Impossible to connect to an invalid object');
let after = flags == SignalsHandlerFlags.CONNECT_AFTER;
let connector = after ? object.connect_after : object.connect;
if (!connector) {
throw new Error(`Requested to connect to signal '${event}', ` +
`but no implementation for 'connect${after ? '_after' : ''}' `+
`found in ${object.constructor.name}`);
}
let id = connector.call(object, event, callback);
return [object, id];
}
_remove(item) {
item[0].disconnect(item[1]);
}
};
/**
* Color manipulation utilities
*/
var ColorUtils = class DashToDock_ColorUtils {
// Darken or brigthen color by a fraction dlum
// Each rgb value is modified by the same fraction.
// Return "#rrggbb" string
static ColorLuminance(r, g, b, dlum) {
let rgbString = '#';
rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(r*(1+dlum), 0), 255)), 2);
rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(g*(1+dlum), 0), 255)), 2);
rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(b*(1+dlum), 0), 255)), 2);
return rgbString;
}
// Convert decimal to an hexadecimal string adding the desired padding
static _decimalToHex(d, padding) {
let hex = d.toString(16);
while (hex.length < padding)
hex = '0'+ hex;
return hex;
}
// Convert hsv ([0-1, 0-1, 0-1]) to rgb ([0-255, 0-255, 0-255]).
// Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV
// here with h = [0,1] instead of [0, 360]
// Accept either (h,s,v) independently or {h:h, s:s, v:v} object.
// Return {r:r, g:g, b:b} object.
static HSVtoRGB(h, s, v) {
if (arguments.length === 1) {
s = h.s;
v = h.v;
h = h.h;
}
let r,g,b;
let c = v*s;
let h1 = h*6;
let x = c*(1 - Math.abs(h1 % 2 - 1));
let m = v - c;
if (h1 <=1)
r = c + m, g = x + m, b = m;
else if (h1 <=2)
r = x + m, g = c + m, b = m;
else if (h1 <=3)
r = m, g = c + m, b = x + m;
else if (h1 <=4)
r = m, g = x + m, b = c + m;
else if (h1 <=5)
r = x + m, g = m, b = c + m;
else
r = c + m, g = m, b = x + m;
return {
r: Math.round(r * 255),
g: Math.round(g * 255),
b: Math.round(b * 255)
};
}
// Convert rgb ([0-255, 0-255, 0-255]) to hsv ([0-1, 0-1, 0-1]).
// Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV
// here with h = [0,1] instead of [0, 360]
// Accept either (r,g,b) independently or {r:r, g:g, b:b} object.
// Return {h:h, s:s, v:v} object.
static RGBtoHSV(r, g, b) {
if (arguments.length === 1) {
r = r.r;
g = r.g;
b = r.b;
}
let h,s,v;
let M = Math.max(r, g, b);
let m = Math.min(r, g, b);
let c = M - m;
if (c == 0)
h = 0;
else if (M == r)
h = ((g-b)/c) % 6;
else if (M == g)
h = (b-r)/c + 2;
else
h = (r-g)/c + 4;
h = h/6;
v = M/255;
if (M !== 0)
s = c/M;
else
s = 0;
return {
h: h,
s: s,
v: v
};
}
};
/**
* Manage function injection: both instances and prototype can be overridden
* and restored
*/
var InjectionsHandler = class DashToDock_InjectionsHandler extends BasicHandler {
_create(item) {
let object = item[0];
let name = item[1];
let injectedFunction = item[2];
let original = object[name];
object[name] = injectedFunction;
return [object, name, injectedFunction, original];
}
_remove(item) {
let object = item[0];
let name = item[1];
let original = item[3];
object[name] = original;
}
};
/**
* Return the actual position reverseing left and right in rtl
*/
function getPosition() {
let position = Docking.DockManager.settings.get_enum('dock-position');
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
if (position == St.Side.LEFT)
position = St.Side.RIGHT;
else if (position == St.Side.RIGHT)
position = St.Side.LEFT;
}
return position;
}
function drawRoundedLine(cr, x, y, width, height, isRoundLeft, isRoundRight, stroke, fill) {
if (height > width) {
y += Math.floor((height - width) / 2.0);
height = width;
}
height = 2.0 * Math.floor(height / 2.0);
var leftRadius = isRoundLeft ? height / 2.0 : 0.0;
var rightRadius = isRoundRight ? height / 2.0 : 0.0;
cr.moveTo(x + width - rightRadius, y);
cr.lineTo(x + leftRadius, y);
if (isRoundLeft)
cr.arcNegative(x + leftRadius, y + leftRadius, leftRadius, -Math.PI/2, Math.PI/2);
else
cr.lineTo(x, y + height);
cr.lineTo(x + width - rightRadius, y + height);
if (isRoundRight)
cr.arcNegative(x + width - rightRadius, y + rightRadius, rightRadius, Math.PI/2, -Math.PI/2);
else
cr.lineTo(x + width, y);
cr.closePath();
if (fill != null) {
cr.setSource(fill);
cr.fillPreserve();
}
if (stroke != null)
cr.setSource(stroke);
cr.stroke();
}

View File

@ -0,0 +1,586 @@
/*
* Credits:
* This file is based on code from the Dash to Panel extension by Jason DeRose
* and code from the Taskbar extension by Zorin OS
* Some code was also adapted from the upstream Gnome Shell source code.
*/
const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const St = imports.gi.St;
const Mainloop = imports.mainloop;
const Main = imports.ui.main;
const Gtk = imports.gi.Gtk;
const Params = imports.misc.params;
const PopupMenu = imports.ui.popupMenu;
const Workspace = imports.ui.workspace;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Utils = Me.imports.utils;
const PREVIEW_MAX_WIDTH = 250;
const PREVIEW_MAX_HEIGHT = 150;
const PREVIEW_ANIMATION_DURATION = 250;
var WindowPreviewMenu = class DashToDock_WindowPreviewMenu extends PopupMenu.PopupMenu {
constructor(source) {
let side = Utils.getPosition();
super(source.actor, 0.5, side);
// We want to keep the item hovered while the menu is up
this.blockSourceEvents = true;
this._source = source;
this._app = this._source.app;
let monitorIndex = this._source.monitorIndex;
this.actor.add_style_class_name('app-well-menu');
this.actor.set_style('max-width: ' + (Main.layoutManager.monitors[monitorIndex].width - 22) + 'px; ' +
'max-height: ' + (Main.layoutManager.monitors[monitorIndex].height - 22) + 'px;');
this.actor.hide();
// Chain our visibility and lifecycle to that of the source
this._mappedId = this._source.actor.connect('notify::mapped', () => {
if (!this._source.actor.mapped)
this.close();
});
this._destroyId = this._source.actor.connect('destroy', this.destroy.bind(this));
Main.uiGroup.add_actor(this.actor);
// Change the initialized side where required.
this._arrowSide = side;
this._boxPointer._arrowSide = side;
this._boxPointer._userArrowSide = side;
this.connect('destroy', this._onDestroy.bind(this));
}
_redisplay() {
if (this._previewBox)
this._previewBox.destroy();
this._previewBox = new WindowPreviewList(this._source);
this.addMenuItem(this._previewBox);
this._previewBox._redisplay();
}
popup() {
let windows = this._source.getInterestingWindows();
if (windows.length > 0) {
this._redisplay();
this.open();
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
this._source.emit('sync-tooltip');
}
}
_onDestroy() {
if (this._mappedId)
this._source.actor.disconnect(this._mappedId);
if (this._destroyId)
this._source.actor.disconnect(this._destroyId);
}
};
var WindowPreviewList = class DashToDock_WindowPreviewList extends PopupMenu.PopupMenuSection {
constructor(source) {
super();
this.actor = new St.ScrollView({ name: 'dashtodockWindowScrollview',
hscrollbar_policy: Gtk.PolicyType.NEVER,
vscrollbar_policy: Gtk.PolicyType.NEVER,
enable_mouse_scrolling: true });
this.actor.connect('scroll-event', this._onScrollEvent.bind(this));
let position = Utils.getPosition();
this.isHorizontal = position == St.Side.BOTTOM || position == St.Side.TOP;
this.box.set_vertical(!this.isHorizontal);
this.box.set_name('dashtodockWindowList');
this.actor.add_actor(this.box);
this.actor._delegate = this;
this._shownInitially = false;
this._source = source;
this.app = source.app;
this._redisplayId = Main.initializeDeferredWork(this.actor, this._redisplay.bind(this));
this.actor.connect('destroy', this._onDestroy.bind(this));
this._stateChangedId = this.app.connect('windows-changed',
this._queueRedisplay.bind(this));
}
_queueRedisplay () {
Main.queueDeferredWork(this._redisplayId);
}
_onScrollEvent(actor, event) {
// Event coordinates are relative to the stage but can be transformed
// as the actor will only receive events within his bounds.
let stage_x, stage_y, ok, event_x, event_y, actor_w, actor_h;
[stage_x, stage_y] = event.get_coords();
[ok, event_x, event_y] = actor.transform_stage_point(stage_x, stage_y);
[actor_w, actor_h] = actor.get_size();
// If the scroll event is within a 1px margin from
// the relevant edge of the actor, let the event propagate.
if (event_y >= actor_h - 2)
return Clutter.EVENT_PROPAGATE;
// Skip to avoid double events mouse
if (event.is_pointer_emulated())
return Clutter.EVENT_STOP;
let adjustment, delta;
if (this.isHorizontal)
adjustment = this.actor.get_hscroll_bar().get_adjustment();
else
adjustment = this.actor.get_vscroll_bar().get_adjustment();
let increment = adjustment.step_increment;
switch ( event.get_scroll_direction() ) {
case Clutter.ScrollDirection.UP:
delta = -increment;
break;
case Clutter.ScrollDirection.DOWN:
delta = +increment;
break;
case Clutter.ScrollDirection.SMOOTH:
let [dx, dy] = event.get_scroll_delta();
delta = dy*increment;
delta += dx*increment;
break;
}
adjustment.set_value(adjustment.get_value() + delta);
return Clutter.EVENT_STOP;
}
_onDestroy() {
this.app.disconnect(this._stateChangedId);
this._stateChangedId = 0;
}
_createPreviewItem(window) {
let preview = new WindowPreviewMenuItem(window);
return preview;
}
_redisplay () {
let children = this._getMenuItems().filter(function(actor) {
return actor._window;
});
// Windows currently on the menu
let oldWin = children.map(function(actor) {
return actor._window;
});
// All app windows with a static order
let newWin = this._source.getInterestingWindows().sort(function(a, b) {
return a.get_stable_sequence() > b.get_stable_sequence();
});
let addedItems = [];
let removedActors = [];
let newIndex = 0;
let oldIndex = 0;
while (newIndex < newWin.length || oldIndex < oldWin.length) {
// No change at oldIndex/newIndex
if (oldWin[oldIndex] &&
oldWin[oldIndex] == newWin[newIndex]) {
oldIndex++;
newIndex++;
continue;
}
// Window removed at oldIndex
if (oldWin[oldIndex] &&
newWin.indexOf(oldWin[oldIndex]) == -1) {
removedActors.push(children[oldIndex]);
oldIndex++;
continue;
}
// Window added at newIndex
if (newWin[newIndex] &&
oldWin.indexOf(newWin[newIndex]) == -1) {
addedItems.push({ item: this._createPreviewItem(newWin[newIndex]),
pos: newIndex });
newIndex++;
continue;
}
// Window moved
let insertHere = newWin[newIndex + 1] &&
newWin[newIndex + 1] == oldWin[oldIndex];
let alreadyRemoved = removedActors.reduce(function(result, actor) {
let removedWin = actor._window;
return result || removedWin == newWin[newIndex];
}, false);
if (insertHere || alreadyRemoved) {
addedItems.push({ item: this._createPreviewItem(newWin[newIndex]),
pos: newIndex + removedActors.length });
newIndex++;
} else {
removedActors.push(children[oldIndex]);
oldIndex++;
}
}
for (let i = 0; i < addedItems.length; i++)
this.addMenuItem(addedItems[i].item,
addedItems[i].pos);
for (let i = 0; i < removedActors.length; i++) {
let item = removedActors[i];
if (this._shownInitially)
item._animateOutAndDestroy();
else
item.actor.destroy();
}
// Skip animations on first run when adding the initial set
// of items, to avoid all items zooming in at once
let animate = this._shownInitially;
if (!this._shownInitially)
this._shownInitially = true;
for (let i = 0; i < addedItems.length; i++)
addedItems[i].item.show(animate);
// Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744
// Without it, StBoxLayout may use a stale size cache
this.box.queue_relayout();
if (newWin.length < 1)
this._getTopMenu().close(~0);
// As for upstream:
// St.ScrollView always requests space horizontally for a possible vertical
// scrollbar if in AUTOMATIC mode. Doing better would require implementation
// of width-for-height in St.BoxLayout and St.ScrollView. This looks bad
// when we *don't* need it, so turn off the scrollbar when that's true.
// Dynamic changes in whether we need it aren't handled properly.
let needsScrollbar = this._needsScrollbar();
let scrollbar_policy = needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER;
if (this.isHorizontal)
this.actor.hscrollbar_policy = scrollbar_policy;
else
this.actor.vscrollbar_policy = scrollbar_policy;
if (needsScrollbar)
this.actor.add_style_pseudo_class('scrolled');
else
this.actor.remove_style_pseudo_class('scrolled');
}
_needsScrollbar() {
let topMenu = this._getTopMenu();
let topThemeNode = topMenu.actor.get_theme_node();
if (this.isHorizontal) {
let [topMinWidth, topNaturalWidth] = topMenu.actor.get_preferred_width(-1);
let topMaxWidth = topThemeNode.get_max_width();
return topMaxWidth >= 0 && topNaturalWidth >= topMaxWidth;
} else {
let [topMinHeight, topNaturalHeight] = topMenu.actor.get_preferred_height(-1);
let topMaxHeight = topThemeNode.get_max_height();
return topMaxHeight >= 0 && topNaturalHeight >= topMaxHeight;
}
}
isAnimatingOut() {
return this.actor.get_children().reduce(function(result, actor) {
return result || actor.animatingOut;
}, false);
}
};
var WindowPreviewMenuItem = GObject.registerClass(
class DashToDock_WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem {
_init(window, params) {
super._init(params);
this._window = window;
this._destroyId = 0;
this._windowAddedId = 0;
// We don't want this: it adds spacing on the left of the item.
this.remove_child(this._ornamentLabel);
this.add_style_class_name('dashtodock-app-well-preview-menu-item');
this._cloneBin = new St.Bin();
this._cloneBin.set_size(PREVIEW_MAX_WIDTH, PREVIEW_MAX_HEIGHT);
// TODO: improve the way the closebutton is layout. Just use some padding
// for the moment.
this._cloneBin.set_style('padding-bottom: 0.5em');
this.closeButton = new St.Button({ style_class: 'window-close',
x_expand: true,
y_expand: true});
this.closeButton.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' }));
this.closeButton.set_x_align(Clutter.ActorAlign.END);
this.closeButton.set_y_align(Clutter.ActorAlign.START);
this.closeButton.opacity = 0;
this.closeButton.connect('clicked', this._closeWindow.bind(this));
let overlayGroup = new Clutter.Actor({layout_manager: new Clutter.BinLayout() });
overlayGroup.add_actor(this._cloneBin);
overlayGroup.add_actor(this.closeButton);
let label = new St.Label({ text: window.get_title()});
label.set_style('max-width: '+PREVIEW_MAX_WIDTH +'px');
let labelBin = new St.Bin({ child: label,
x_align: St.Align.MIDDLE});
this._windowTitleId = this._window.connect('notify::title', () => {
label.set_text(this._window.get_title());
});
let box = new St.BoxLayout({ vertical: true,
reactive:true,
x_expand:true });
box.add(overlayGroup);
box.add(labelBin);
this.add_actor(box);
this.connect('enter-event', this._onEnter.bind(this));
this.connect('leave-event', this._onLeave.bind(this));
this.connect('key-focus-in', this._onEnter.bind(this));
this.connect('key-focus-out', this._onLeave.bind(this));
this._cloneTexture(window);
}
_cloneTexture(metaWin){
let mutterWindow = metaWin.get_compositor_private();
// Newly-created windows are added to a workspace before
// the compositor finds out about them...
// Moreover sometimes they return an empty texture, thus as a workarounf also check for it size
if (!mutterWindow || !mutterWindow.get_texture() || !mutterWindow.get_size()[0]) {
this._cloneTextureId = Mainloop.idle_add(() => {
// Check if there's still a point in getting the texture,
// otherwise this could go on indefinitely
if (metaWin.get_workspace())
this._cloneTexture(metaWin);
this._cloneTextureId = 0;
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._cloneTextureId, '[dash-to-dock] this._cloneTexture');
return;
}
let [width, height] = mutterWindow.get_size();
let scale = Math.min(1.0, PREVIEW_MAX_WIDTH/width, PREVIEW_MAX_HEIGHT/height);
let clone = new Clutter.Clone ({ source: mutterWindow,
reactive: true,
width: width * scale,
height: height * scale });
// when the source actor is destroyed, i.e. the window closed, first destroy the clone
// and then destroy the menu item (do this animating out)
this._destroyId = mutterWindow.connect('destroy', () => {
clone.destroy();
this._destroyId = 0; // avoid to try to disconnect this signal from mutterWindow in _onDestroy(),
// as the object was just destroyed
this._animateOutAndDestroy();
});
this._clone = clone;
this._mutterWindow = mutterWindow;
this._cloneBin.set_child(this._clone);
this._clone.connect('destroy', () => {
if (this._destroyId) {
mutterWindow.disconnect(this._destroyId);
this._destroyId = 0;
}
this._clone = null;
})
}
_windowCanClose() {
return this._window.can_close() &&
!this._hasAttachedDialogs();
}
_closeWindow(actor) {
this._workspace = this._window.get_workspace();
// This mechanism is copied from the workspace.js upstream code
// It forces window activation if the windows don't get closed,
// for instance because asking user confirmation, by monitoring the opening of
// such additional confirmation window
this._windowAddedId = this._workspace.connect('window-added',
this._onWindowAdded.bind(this));
this.deleteAllWindows();
}
deleteAllWindows() {
// Delete all windows, starting from the bottom-most (most-modal) one
//let windows = this._window.get_compositor_private().get_children();
let windows = this._clone.get_children();
for (let i = windows.length - 1; i >= 1; i--) {
let realWindow = windows[i].source;
let metaWindow = realWindow.meta_window;
metaWindow.delete(global.get_current_time());
}
this._window.delete(global.get_current_time());
}
_onWindowAdded(workspace, win) {
let metaWindow = this._window;
if (win.get_transient_for() == metaWindow) {
workspace.disconnect(this._windowAddedId);
this._windowAddedId = 0;
// use an idle handler to avoid mapping problems -
// see comment in Workspace._windowAdded
let activationEvent = Clutter.get_current_event();
let id = Mainloop.idle_add(() => {
this.emit('activate', activationEvent);
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[dash-to-dock] this.emit');
}
}
_hasAttachedDialogs() {
// count trasient windows
let n=0;
this._window.foreach_transient(function(){n++;});
return n>0;
}
_onEnter() {
this._showCloseButton();
return Clutter.EVENT_PROPAGATE;
}
_onLeave() {
if (!this._cloneBin.has_pointer &&
!this.closeButton.has_pointer)
this._hideCloseButton();
return Clutter.EVENT_PROPAGATE;
}
_idleToggleCloseButton() {
this._idleToggleCloseId = 0;
if (!this._cloneBin.has_pointer &&
!this.closeButton.has_pointer)
this._hideCloseButton();
return GLib.SOURCE_REMOVE;
}
_showCloseButton() {
if (this._windowCanClose()) {
this.closeButton.show();
this.closeButton.remove_all_transitions();
this.closeButton.ease({
opacity: 255,
duration: Workspace.WINDOW_OVERLAY_FADE_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
});
}
}
_hideCloseButton() {
this.closeButton.remove_all_transitions();
this.closeButton.ease({
opacity: 0,
duration: Workspace.WINDOW_OVERLAY_FADE_TIME,
mode: Clutter.AnimationMode.EASE_IN_QUAD
});
}
show(animate) {
let fullWidth = this.get_width();
this.opacity = 0;
this.set_width(0);
let time = animate ? PREVIEW_ANIMATION_DURATION : 0;
this.remove_all_transitions();
this.ease({
opacity: 255,
width: fullWidth,
duration: time,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
});
}
_animateOutAndDestroy() {
this.remove_all_transitions();
this.ease({
opacity: 0,
duration: PREVIEW_ANIMATION_DURATION,
});
this.ease({
width: 0,
height: 0,
duration: PREVIEW_ANIMATION_DURATION,
delay: PREVIEW_ANIMATION_DURATION,
onComplete: () => this.destroy()
});
}
activate() {
this._getTopMenu().close();
Main.activateWindow(this._window);
}
_onDestroy() {
super._onDestroy();
if (this._cloneTextureId) {
GLib.source_remove(this._cloneTextureId);
this._cloneTextureId = 0;
}
if (this._windowAddedId > 0) {
this._workspace.disconnect(this._windowAddedId);
this._windowAddedId = 0;
}
if (this._destroyId > 0) {
this._mutterWindow.disconnect(this._destroyId);
this._destroyId = 0;
}
if (this._windowTitleId > 0) {
this._window.disconnect(this._windowTitleId);
this._windowTitleId = 0;
}
}
});

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" version="1.1">
<path style="fill:#bebebe" d="M 8 1 C 7.45 1 7 1.45 7 2 C 7 2.03 6.9998 2.0696 7.0098 2.0996 C 6.513 2.1994 6.0506 2.385 5.6191 2.6191 L 13 10 L 13 9 L 13 7 C 13 4.57 11.28 2.5596 8.9902 2.0996 C 9.0002 2.0696 9 2.03 9 2 C 9 1.45 8.55 1 8 1 z M 4.0078 4.0078 C 3.3813 4.8419 3 5.8717 3 7 L 3 11.5 L 1 13.5 L 1 14 L 3 14 L 13 14 L 14 14 L 4.0078 4.0078 z M 6.2695 15 C 6.6295 15.62 7.29 16 8 16 C 8.71 16 9.3705 15.62 9.7305 15 L 6.2695 15 z"/>
<path style="fill:#bebebe" d="M 2.5,1.5 15,14 13.5,15.5 1,3 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 596 B

View File

@ -0,0 +1,84 @@
class Extension {
constructor(dnd, toggle, indicator, remote, audio){
this.dnd = dnd;
this.toggle = toggle;
this.indicator = indicator;
this.remote = remote;
this.audio = audio;
this.enabled = false;
this.toggle.setToggleState(this.dnd.isEnabled());
this.toggle.show();
this.toggle.onToggleStateChanged(() => {
if (this.toggle.getToggleState()){
this.enable();
} else {
this.disable();
}
});
// this.dndID = this.dnd.addStatusListener((dndEnabled) => this._setDND(dndEnabled));
this.remoteID = this.remote.addRemoteListener((dndEnabled) => this._setDND(dndEnabled));
this._setDND(this.remote.getRemote());
}
_setDND(enabled){
if (enabled){
this.enable();
} else {
this.disable();
}
}
/**
* Enable do not disturb mode
*/
enable(){
if (this.enabled){
return;
}
this.enabled = true;
this.dnd.enable();
this.toggle.setToggleState(true);
this.indicator.show();
this.remote.setRemote(true);
this.audio.mute();
}
/**
* Disable do not disturb mode
*/
disable(){
if (!this.enabled){
return;
}
this.enabled = false;
this.dnd.disable();
this.toggle.setToggleState(false);
this.indicator.hide();
this.remote.setRemote(false);
this.audio.unmute();
}
/**
* @return {Boolean} true if it is enabled, otherwise false
*/
isEnabled(){
return this.enabled;
}
/**
* Destroy the extension and its components
*/
destroy(){
this.enabled = false;
// this.dnd.removeStatusListener(this.dndID);
this.remote.removeRemoteListener(this.remoteID);
this.toggle.destroy();
this.indicator.destroy();
this.dnd.disable();
}
}

View File

@ -0,0 +1,76 @@
const BUSY = 2;
const AVAILABLE = 0;
/**
* A class which can enable do not disturb mode
*/
class DoNotDisturb {
/**
* Constructor
* @param {Presence} presence the interface to the Gnome Presence API
*/
constructor(presence){
this.presence = presence;
this.listeners = [];
this.presenceListernerID = -1;
}
/**
* Enable do not disturb mode
*/
enable(){
this.presence.status = BUSY;
}
/**
* Disable do not disturb mode
*/
disable(){
this.presence.status = AVAILABLE;
}
/**
* @return {Boolean} true if do not disturb mode is on, otherwise false
*/
isEnabled(){
return this.presence.status == BUSY;
}
/**
* Add a status listener for when the do not disturb mode is toggled
* @param {[Boolean => ()]} listener the listener to add
* @return {Integer} the ID of the listener
*/
addStatusListener(listener){
if (listener == null){
return -1;
}
if (this.listeners.length == 0){
this.presenceListernerID = this.presence.addStatusListener((status) => {
this.listeners.forEach((fn) => {
fn(status == BUSY);
});
});
}
listener(this.isEnabled());
return this.listeners.push(listener) - 1;
}
/**
* Remove the status listener with the ID
* @param {Integer} id the ID of the status listener
*/
removeStatusListener(id){
if (id < 0 || id >= this.listeners.length){
return;
}
this.listeners.splice(id, 1);
if (this.listeners.length == 0) {
this.presence.removeStatusListener(this.presenceListernerID);
}
}
}

View File

@ -0,0 +1,30 @@
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Settings = Me.imports.settings;
const System = Me.imports.system;
const Widget = Me.imports.widgets;
const DND = Me.imports.doNotDisturb;
const Extension = Me.imports.dndExtension.Extension;
/**
* Called when the extension is loaded.
*/
function init() {}
/**
* Enable the do not disturb extension. Adds all UI elements and monitors the settings object.
*/
function enable() {
var dnd = new DND.DoNotDisturb(new System.GnomePresence());
var toggle = new Widget.DoNotDisturbToggle();
var indicator = new Widget.DoNotDisturbIcon(new Settings.SettingsManager(), new System.NotificationManager());
var remote = new Settings.RemoteAPI();
var audio = new System.AudioManager(new Settings.SettingsManager());
this.extension = new Extension(dnd, toggle, indicator, remote, audio);
}
/**
* Disables the extension. Tears down all UI components.
*/
function disable() {
this.extension.destroy();
}

View File

@ -0,0 +1,33 @@
/* From https://github.com/pop-os/gnome-shell-extension-pop-suspend-button */
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/**
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
const GLib = imports.gi.GLib;
const Gettext = imports.gettext;
const Config = imports.misc.config;
function initTranslations(extension) {
let localeDir = extension.dir.get_child('locale').get_path();
// Extension installed in .local
if (GLib.file_test(localeDir, GLib.FileTest.EXISTS)) {
Gettext.bindtextdomain('gnome-shell-extension-do-not-disturb', localeDir);
}
// Extension installed system-wide
else {
Gettext.bindtextdomain('gnome-shell-extension-do-not-disturb',
Config.LOCALEDIR);
}
}

View File

@ -0,0 +1,46 @@
msgid ""
msgstr ""
"Project-Id-Version: Gnome-Shell-Extension Do Not Disturb\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-09 18:13+0200\n"
"PO-Revision-Date: 2018-10-14 07:30-0400\n"
"Last-Translator: \n"
"Language-Team: German <mike@barkmin.eu>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.2\n"
#: prefs.js:31
msgid "Enabled Icon"
msgstr "Icon anzeigen"
#: prefs.js:31
msgid "Show an indicator icon when do not disturb is enabled."
msgstr "Zeige ein Icon, wenn nicht stören aktiviert ist."
#: prefs.js:38
msgid "Count"
msgstr "Anzahl"
#: prefs.js:39
msgid "Dot"
msgstr "Punkt"
#: prefs.js:40
msgid "Nothing"
msgstr "Nichts"
#: prefs.js:50
msgid "Mute Sounds"
msgstr "Audio stumm schalten"
#: prefs.js:50
msgid "Mutes all sound when do not disturb is enabled."
msgstr "Audio stumm schalten, wenn nicht stören aktiviert ist."
#: widgets.js:40
msgid "Do not disturb"
msgstr "Nicht stören"

Some files were not shown because too many files have changed in this diff Show More