[gnome-shell-extensions] default-min-max: New extension
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] default-min-max: New extension
- Date: Fri, 30 Nov 2012 17:50:56 +0000 (UTC)
commit ad542d2f77eb88b4bebe5e790bb0f8b207fb1167
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Nov 29 14:22:48 2012 +0100
default-min-max: New extension
Adds minimize and maximize buttons to the titlebar by default. It
restores org.gnome.desktop.wm.preferences as the schema to be used for
the button-layout key.
It is included in classic-mode.
https://bugzilla.gnome.org/show_bug.cgi?id=689275
configure.ac | 5 +++--
extensions/default-min-max/Makefile.am | 3 +++
extensions/default-min-max/extension.js | 20 ++++++++++++++++++++
extensions/default-min-max/metadata.json.in | 11 +++++++++++
extensions/default-min-max/stylesheet.css | 1 +
5 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3eb65d1..d0e9930 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@ fi
AC_SUBST([SHELL_VERSION])
dnl keep this in alphabetic order
-CLASSIC_EXTENSIONS="apps-menu places-menu alternate-tab workspace-indicator"
+CLASSIC_EXTENSIONS="apps-menu places-menu alternate-tab default-min-max workspace-indicator"
DEFAULT_EXTENSIONS="$CLASSIC_EXTENSIONS alternative-status-menu drive-menu windowsNavigator"
ALL_EXTENSIONS="$DEFAULT_EXTENSIONS auto-move-windows example native-window-placement systemMonitor user-theme xrandr-indicator"
AC_SUBST(ALL_EXTENSIONS, [$ALL_EXTENSIONS])
@@ -59,7 +59,7 @@ for e in $enable_extensions; do
[AC_MSG_WARN([gnome-desktop-3.0 not found, disabling xrandr-indicator])])
;;
dnl keep this in alphabetic order
- alternate-tab|alternative-status-menu|apps-menu|auto-move-windows|drive-menu|example|native-window-placement|places-menu|user-theme|windowsNavigator|workspace-indicator)
+ alternate-tab|alternative-status-menu|apps-menu|auto-move-windows|default-min-max|drive-menu|example|native-window-placement|places-menu|user-theme|windowsNavigator|workspace-indicator)
ENABLED_EXTENSIONS="$ENABLED_EXTENSIONS $e"
;;
*)
@@ -75,6 +75,7 @@ AC_CONFIG_FILES([
extensions/alternative-status-menu/Makefile
extensions/apps-menu/Makefile
extensions/auto-move-windows/Makefile
+ extensions/default-min-max/Makefile
extensions/drive-menu/Makefile
extensions/example/Makefile
extensions/native-window-placement/Makefile
diff --git a/extensions/default-min-max/Makefile.am b/extensions/default-min-max/Makefile.am
new file mode 100644
index 0000000..7ade06c
--- /dev/null
+++ b/extensions/default-min-max/Makefile.am
@@ -0,0 +1,3 @@
+EXTENSION_ID = default-min-max
+
+include ../../extension.mk
diff --git a/extensions/default-min-max/extension.js b/extensions/default-min-max/extension.js
new file mode 100644
index 0000000..aa8ff2e
--- /dev/null
+++ b/extensions/default-min-max/extension.js
@@ -0,0 +1,20 @@
+// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
+
+const Meta = imports.gi.Meta;
+
+const BUTTON_LAYOUT_KEY = 'button-layout';
+const EXTENSION_SCHEMA = 'org.gnome.desktop.wm.preferences';
+const SHELL_OVERRIDES_SCHEMA = 'org.gnome.shell.overrides';
+
+function init(metadata) {
+}
+
+function enable() {
+ // Override gnome-shell's overrides
+ Meta.prefs_override_preference_schema(BUTTON_LAYOUT_KEY, EXTENSION_SCHEMA);
+}
+
+function disable() {
+ // Restore gnome-shell's overrides
+ Meta.prefs_override_preference_schema(BUTTON_LAYOUT_KEY, SHELL_OVERRIDES_SCHEMA);
+}
diff --git a/extensions/default-min-max/metadata.json.in b/extensions/default-min-max/metadata.json.in
new file mode 100644
index 0000000..92e5a9e
--- /dev/null
+++ b/extensions/default-min-max/metadata.json.in
@@ -0,0 +1,11 @@
+{
+"extension-id": "@extension_id@",
+"uuid": "@uuid@",
+"settings-schema": "@gschemaname@",
+"gettext-domain": "@gettext_domain@",
+"name": "Default Minimize and Maximize",
+"description": "Adds minimize and maximize buttons to the titlebar by default",
+"original-authors": [ "debarshir gnome org" ],
+"shell-version": [ "@shell_current@" ],
+"url": "@url@"
+}
diff --git a/extensions/default-min-max/stylesheet.css b/extensions/default-min-max/stylesheet.css
new file mode 100644
index 0000000..25134b6
--- /dev/null
+++ b/extensions/default-min-max/stylesheet.css
@@ -0,0 +1 @@
+/* This extensions requires no special styling */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]