1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-07 21:05:45 +01:00

Auto-hide the command-line by default; allow showing messages/mode/command-line in the status bar.

This commit is contained in:
Kris Maglione
2010-09-27 07:39:49 -04:00
parent c8faebba0a
commit bed08a3455
14 changed files with 377 additions and 191 deletions

View File

@@ -94,22 +94,27 @@ const Dactyl = Module("dactyl", {
postCommands: null
},
registerObserver: function (type, callback) {
registerObserver: function (type, callback, weak) {
if (!(type in this.observers))
this.observers[type] = [];
this.observers[type].push(callback);
this.observers[type].push(weak ? Cu.getWeakReference(callback) : { get: function () callback });
},
unregisterObserver: function (type, callback) {
if (type in this.observers)
this.observers[type] = this.observers[type].filter(function (c) c != callback);
this.observers[type] = this.observers[type].filter(function (c) c.get() != callback);
},
// TODO: "zoom": if the zoom value of the current buffer changed
triggerObserver: function (type) {
let args = Array.slice(arguments, 1);
for (let [, func] in Iterator(this.observers[type] || []))
func.apply(null, args);
if (type in this.observers)
this.observers[type] = this.observers[type].filter(function (callback) {
if (callback.get()) {
callback.get().apply(null, args);
return true;
}
});
},
/**
@@ -1199,6 +1204,15 @@ const Dactyl = Module("dactyl", {
"boolean", false);
const groups = {
commandline: {
opts: {
M: ["Always show messages outside of the status line"],
C: ["Always show the command-line outside of the status line"],
},
setter: function (opts) {
commandline.widgets.updateVisibility();
}
},
config: {
opts: config.guioptions,
setter: function (opts) {