From 2529448e8ac2cafc588c1005c11c7202680326eb Mon Sep 17 00:00:00 2001 From: jderose9 Date: Thu, 22 Dec 2016 18:12:04 -0500 Subject: [PATCH] Allow panel size and position adjustment --- .gitignore | 7 + Makefile | 84 ++ README.md | 5 +- Settings.ui | 757 ++++++++++++++++++ convenience.js | 67 +- extension.js | 80 +- metadata.json | 13 +- prefs.js | 224 ++++++ ....gnome.shell.extensions.onebar.gschema.xml | 76 ++ stylesheet.css | 4 + 10 files changed, 1302 insertions(+), 15 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 Settings.ui mode change 100755 => 100644 metadata.json create mode 100644 prefs.js create mode 100644 schemas/org.gnome.shell.extensions.onebar.gschema.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9e4726 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.~ +*~ +gschemas.compiled +onebar@jderose9.github.com.zip +*.mo +po/onebar.pot +Settings.ui.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ea63f76 --- /dev/null +++ b/Makefile @@ -0,0 +1,84 @@ +# Basic Makefile + +UUID = onebar@jderose9.github.com +BASE_MODULES = extension.js stylesheet.css metadata.json COPYING README.md +EXTRA_MODULES = convenience.js taskbar.js secondaryMenu.js windowPreview.js prefs.js Settings.ui +#EXTRA_MEDIA = logo.svg +TOLOCALIZE = prefs.js +MSGSRC = $(wildcard po/*.po) +ifeq ($(strip $(DESTDIR)),) + INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions +else + INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions +endif +INSTALLNAME = onebar@jderose9.github.com + +# The command line passed variable VERSION is used to set the version string +# in the metadata and in the generated zip-file. If no VERSION is passed, the +# current commit SHA1 is used as version number in the metadata while the +# generated zip file has no string attached. +ifdef VERSION + VSTRING = _v$(VERSION) +else + VERSION = $(shell git rev-parse HEAD) + VSTRING = +endif + +all: extension + +clean: + rm -f ./schemas/gschemas.compiled + +extension: ./schemas/gschemas.compiled $(MSGSRC:.po=.mo) + +./schemas/gschemas.compiled: ./schemas/org.gnome.shell.extensions.onebar.gschema.xml + glib-compile-schemas ./schemas/ + +potfile: ./po/onebar.pot + +mergepo: potfile + for l in $(MSGSRC); do \ + msgmerge -U $$l ./po/onebar.pot; \ + done; + +./po/onebar.pot: $(TOLOCALIZE) Settings.ui + mkdir -p po + xgettext -k_ -kN_ -o po/onebar.pot --package-name "OneBar" $(TOLOCALIZE) + intltool-extract --type=gettext/glade Settings.ui + xgettext -k_ -kN_ --join-existing -o po/onebar.pot Settings.ui.h + +./po/%.mo: ./po/%.po + msgfmt -c $< -o $@ + +install: install-local + +install-local: _build + rm -rf $(INSTALLBASE)/$(INSTALLNAME) + mkdir -p $(INSTALLBASE)/$(INSTALLNAME) + cp -r ./_build/* $(INSTALLBASE)/$(INSTALLNAME)/ + -rm -fR _build + echo done + +zip-file: _build + cd _build ; \ + zip -qr "$(UUID)$(VSTRING).zip" . + mv _build/$(UUID)$(VSTRING).zip ./ + -rm -fR _build + +_build: all + -rm -fR ./_build + mkdir -p _build + cp $(BASE_MODULES) $(EXTRA_MODULES) _build + #mkdir -p _build/media + #cd media ; cp $(EXTRA_MEDIA) ../_build/media/ + mkdir -p _build/schemas + cp schemas/*.xml _build/schemas/ + cp schemas/gschemas.compiled _build/schemas/ + mkdir -p _build/locale + for l in $(MSGSRC:.po=.mo) ; do \ + lf=_build/locale/`basename $$l .mo`; \ + mkdir -p $$lf; \ + mkdir -p $$lf/LC_MESSAGES; \ + cp $$l $$lf/LC_MESSAGES/onebar.mo; \ + done; + sed -i 's/"version": -1/"version": "$(VERSION)"/' _build/metadata.json; diff --git a/README.md b/README.md index 5958c6c..a43780e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1 @@ -# Zorin Taskbar -The official taskbar for Zorin OS. - -Based on the [Dash to Dock](https://github.com/micheleg/dash-to-dock) Gnome Shell extension by micheleg. +# gnome-onebar \ No newline at end of file diff --git a/Settings.ui b/Settings.ui new file mode 100644 index 0000000..562890d --- /dev/null +++ b/Settings.ui @@ -0,0 +1,757 @@ + + + + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + When set to minimize, double clicking minimizes all the windows of the application. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Shift+Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Quit + + + + 1 + 0 + 2 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behavior for Middle-Click. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Middle-Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Quit + + + + 1 + 0 + 2 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behavior for Shift+Middle-Click. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Shift+Middle-Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Quit + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 0 + + + + + 10 + 1 + 5 + + + 0.33000000000000002 + 1 + 0.01 + 0.10000000000000001 + + + True + True + 6 + 6 + 6 + 6 + False + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + 100 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Position on screen + 0 + + + False + True + 0 + + + + + True + False + 32 + + + Bottom + True + True + False + center + center + 0 + True + + + + False + True + 1 + + + + + Top + True + True + False + center + center + 0 + bottom + True + position_bottom_button + + + + False + True + 2 + + + + + False + True + 1 + + + + + + + + + + + + + + False + True + 0 + + + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Panel Size + 0 + + + 0 + 0 + + + + + True + True + baseline + True + panel_size_adjustment + 0 + 0 + right + + + + + 1 + 0 + + + + + + + + + + + + + + False + True + 1 + + + + + + + + + + True + False + Position and size + + + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + If disabled, these settings are acccessible from gnome-tweak-tool or the extension website. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Show <i>Applications</i> icon + True + 0 + + + 0 + 0 + + + + + Move the applications button at the beginning of the panel. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + True + True + False + 3 + 0 + 0.43000000715255737 + True + + + True + False + Animate <i>Show Applications</i>. + True + + + + + 0 + 3 + 2 + + + + + + + + + + + + + + False + True + 0 + + + + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behaviour when clicking on the icon of a running application. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Click action + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + center + + Raise window + Minimize + Launch new instance + Cycle through windows + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 2 + + + + + + + + 1 + + + + + True + False + Behavior + + + 1 + False + + + + + + + + + + + + + + + + diff --git a/convenience.js b/convenience.js index 0918d5c..4340f13 100644 --- a/convenience.js +++ b/convenience.js @@ -21,10 +21,75 @@ * Some code was also adapted from the upstream Gnome Shell source code. */ - +const ExtensionUtils = imports.misc.extensionUtils; +const Gettext = imports.gettext; +const Gio = imports.gi.Gio; const Lang = imports.lang; +/** + * 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 + }); +} + + // simplify global signals and function injections handling // abstract class const BasicHandler = new Lang.Class({ diff --git a/extension.js b/extension.js index 80ea801..6d6e0fe 100644 --- a/extension.js +++ b/extension.js @@ -28,6 +28,8 @@ const Convenience = Me.imports.convenience; const Taskbar = Me.imports.taskbar; const Lang = imports.lang; const Main = imports.ui.main; +const PanelBox = Main.layoutManager.panelBox; +const St = imports.gi.St; let appMenu; let container; @@ -35,11 +37,19 @@ let panel; let panelConnectId; let signalsHandler; let taskbar; +let settings; + +let MonitorsChangedListener = null; +let HeightNotifyListener = null; + +let oldPanelHeight; +let myPanelGhost; function init() { } function enable() { + settings = Convenience.getSettings('org.gnome.shell.extensions.onebar'); panel = Main.panel; container = panel._leftBox; appMenu = panel.statusArea['appMenu']; @@ -50,6 +60,24 @@ function enable() { Main.overview.dashIconSize = taskbar.iconSize; container.insert_child_at_index( taskbar.actor, 2 ); + + oldPanelHeight = panel.actor.get_height(); + + // The overview uses the panel height as a margin by way of a "ghost" transparent Clone + // This pushes everything down, which isn't desired when the panel is moved to the bottom + // I'm adding a 2nd ghost panel and will resize the top or bottom ghost depending on the panel position + myPanelGhost = new St.Bin({ + child: new Clutter.Clone({ source: Main.overview._panelGhost.get_child(0) }), + reactive: false, + opacity: 0 + }); + Main.overview._overview.add_actor(myPanelGhost); + + // panel styling + MonitorsChangedListener = global.screen.connect("monitors-changed", setPanelStyle); + HeightNotifyListener = PanelBox.connect("notify::height", setPanelStyle); + setPanelStyle(); + Main.panel.actor.add_style_class_name("popup-menu"); // Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to //animate a null target since some variables are not initialized when the viewSelector is created @@ -69,7 +97,7 @@ function enable() { Main.overview.dashIconSize = taskbar.iconSize; }) ], - // This duplicate the similar signal which is in owerview.js. + // This duplicate the similar signal which is in overview.js. // Being connected and thus executed later this effectively // overwrite any attempt to use the size of the default dash // which given the customization is usually much smaller. @@ -82,7 +110,9 @@ function enable() { }) ] ); - } + + bindSettingsChanges(); +} function disable() { signalsHandler.destroy(); @@ -90,16 +120,58 @@ function disable() { container.add_child(appMenu.container); taskbar.destroy(); panel.actor.disconnect(panelConnectId); + settings.run_dispose(); // reset stored icon size to the default dash Main.overview.dashIconSize = Main.overview._controls.dash.iconSize; + // remove panel styling + if(HeightNotifyListener !== null) { + PanelBox.disconnect(HeightNotifyListener); + } + if(MonitorsChangedListener !== null) { + global.screen.disconnect(MonitorsChangedListener); + } + panel.actor.set_height(oldPanelHeight); + PanelBox.set_anchor_point(0, 0); + Main.overview._overview.remove_child(myPanelGhost); + Main.overview._panelGhost.set_height(oldPanelHeight); + Main.panel.actor.remove_style_class_name("popup-menu"); + + // dereference + settings = null; appMenu = null; container = null; panel = null; panelConnectId = null; signalsHandler = null; taskbar = null; + MonitorsChangedListener = null; + HeightNotifyListener = null; + oldPanelHeight = null; +} + +function setPanelStyle() { + size = settings.get_int('panel-size'); + position = settings.get_enum('panel-position'); + + panel.actor.set_height(size); + + Main.overview._panelGhost.set_height(position ? size : 0); + myPanelGhost.set_height(position ? 0 : size); + + position ? PanelBox.set_anchor_point(0, 0) : + PanelBox.set_anchor_point(0,(-1)*(Main.layoutManager.primaryMonitor.height-PanelBox.height)); +} + +function bindSettingsChanges() { + settings.connect('changed::panel-position', function() { + setPanelStyle(); + }); + + settings.connect('changed::panel-size', function() { + setPanelStyle(); + }); } function allocate(actor, box, flags) { @@ -155,8 +227,8 @@ function allocate(actor, box, flags) { childBox.y2 = allocHeight + cornerHeight; panel._leftCorner.actor.allocate(childBox, flags); - let [cornerMinWidth, cornerWidth] = panel._rightCorner.actor.get_preferred_width(-1); - let [cornerMinHeight, cornerHeight] = panel._rightCorner.actor.get_preferred_width(-1); + [cornerMinWidth, cornerWidth] = panel._rightCorner.actor.get_preferred_width(-1); + [cornerMinHeight, cornerHeight] = panel._rightCorner.actor.get_preferred_width(-1); childBox.x1 = allocWidth - cornerWidth; childBox.x2 = allocWidth; childBox.y1 = allocHeight; diff --git a/metadata.json b/metadata.json old mode 100755 new mode 100644 index ecbb294..9fa579c --- a/metadata.json +++ b/metadata.json @@ -1,8 +1,9 @@ { -"extension-id": "zorin-taskbar", -"uuid": "zorin-taskbar@zorinos.com", -"name": "Zorin Taskbar", -"description": "The official taskbar for Zorin OS.", -"shell-version": [ "3.18" ], -"url": "https://github.com/ZorinOS/zorin-taskbar" +"extension-id": "onebar", +"uuid": "onebar@jderose9.github.com", +"name": "OneBar", +"description": "Win7 style taskbar", +"shell-version": [ "3.20", "3.22" ], +"url": "https://github.com/jderose9/onebar", +"gettext-domain": "onebar" } diff --git a/prefs.js b/prefs.js new file mode 100644 index 0000000..690ad2d --- /dev/null +++ b/prefs.js @@ -0,0 +1,224 @@ +// -*- 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 Lang = imports.lang; +const Mainloop = imports.mainloop; + +const Gettext = imports.gettext.domain('onebar'); +const _ = Gettext.gettext; +const N_ = function(e) { return e }; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Convenience = Me.imports.convenience; + +const SCALE_UPDATE_TIMEOUT = 500; +const DEFAULT_PANEL_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ]; + +const Settings = new Lang.Class({ + Name: 'TaskBar.Settings', + + _init: function() { + this._settings = Convenience.getSettings('org.gnome.shell.extensions.onebar'); + + 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 = this._builder.get_object('settings_notebook'); + + // Timeout to delay the update of the settings + this._panel_size_timeout = 0; + + this._bindSettings(); + + this._builder.connect_signals_full(Lang.bind(this, this._connector)); + }, + + /** + * Connect signals + */ + _connector: function(builder, object, signal, handler) { + object.connect(signal, Lang.bind(this, this._SignalHandler[handler])); + }, + + _bindSettings: function() { + // Position and size panel + + // Position option + let position = this._settings.get_enum('panel-position'); + + switch (position) { + case 0: + this._builder.get_object('position_bottom_button').set_active(true); + break; + case 1: + this._builder.get_object('position_top_button').set_active(true); + break; + + } + + // size options + let panel_size_scale = this._builder.get_object('panel_size_scale'); + panel_size_scale.set_range(DEFAULT_PANEL_SIZES[DEFAULT_PANEL_SIZES.length-1], DEFAULT_PANEL_SIZES[0]); + panel_size_scale.set_value(this._settings.get_int('panel-size')); + DEFAULT_PANEL_SIZES.slice(1, -1).forEach(function(val) { + panel_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 + panel_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 + panel_size_scale.set_flippable(false); + panel_size_scale.set_inverted(true); + } + + // Behavior panel + + 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); + + this._builder.get_object('click_action_combo').set_active(this._settings.get_enum('click-action')); + this._builder.get_object('click_action_combo').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_enum('click-action', widget.get_active()); + })); + + this._builder.get_object('shift_click_action_combo').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_enum('shift-click-action', widget.get_active()); + })); + + this._builder.get_object('middle_click_action_combo').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_enum('middle-click-action', widget.get_active()); + })); + this._builder.get_object('shift_middle_click_action_combo').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_enum('shift-middle-click-action', widget.get_active()); + })); + + // Create dialog for middle-click options + this._builder.get_object('middle_click_options_button').connect('clicked', Lang.bind(this, function() { + + 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', Lang.bind(this, function(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(); + + })); + + }, + + /** + * Object containing all signals defined in the glade file + */ + _SignalHandler: { + + position_bottom_button_toggled_cb: function(button) { + if (button.get_active()) + this._settings.set_enum('panel-position', 0); + }, + + position_top_button_toggled_cb: function(button) { + if (button.get_active()) + this._settings.set_enum('panel-position', 1); + }, + + panel_size_scale_format_value_cb: function(scale, value) { + return value+ ' px'; + }, + + panel_size_scale_value_changed_cb: function(scale) { + // Avoid settings the size consinuosly + if (this._panel_size_timeout > 0) + Mainloop.source_remove(this._panel_size_timeout); + + this._panel_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, Lang.bind(this, function() { + this._settings.set_int('panel-size', scale.get_value()); + this._panel_size_timeout = 0; + return GLib.SOURCE_REMOVE; + })); + } + } +}); + +function init() { + Convenience.initTranslations(); +} + +function buildPrefsWidget() { + let settings = new Settings(); + let widget = settings.widget; + widget.show_all(); + return widget; +} diff --git a/schemas/org.gnome.shell.extensions.onebar.gschema.xml b/schemas/org.gnome.shell.extensions.onebar.gschema.xml new file mode 100644 index 0000000..b3781fb --- /dev/null +++ b/schemas/org.gnome.shell.extensions.onebar.gschema.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + 'BOTTOM' + Panel position + Panel is shown on the Bottom or Top of the screen. + + + 48 + Panel size + Set the size of the panel. + + + true + Show applications button + Show appplications button in the dash + + + false + Show application button at top + Show appplication button at top of the dash + + + true + Animate Show Applications from the desktop + Animate Show Applications from the desktop + + + true + Customize click behaviour + Customize action on various mouse events + + + true + Minimize on shift+click + + + true + Activate only one window + + + 'cycle-windows' + Action when clicking on a running app + Set the action that is executed when clicking on the icon of a running application + + + 'minimize' + Action when shit+clicking on a running app + Set the action that is executed when shift+clicking on the icon of a running application + + + 'launch' + Action when clicking on a running app + Set the action that is executed when middle-clicking on the icon of a running application + + + 'launch' + Action when clicking on a running app + Set the action that is executed when shift+middle-clicking on the icon of a running application + + + diff --git a/stylesheet.css b/stylesheet.css index f6cbcb9..a689610 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -59,3 +59,7 @@ #thumbnailPreviewList .preview-window-title { padding-top: 1em; } + +.popup-menu.panel-menu { + margin-bottom: 0; +} \ No newline at end of file