From 6e1a791273d8adae0369b193d7aa7059638f7d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 15 Nov 2009 02:11:20 +0100 Subject: [PATCH] Allow clicking on any part of section header to browse This is more intuitive, though we need to make the whole thing feel more like a button. https://bugzilla.gnome.org/show_bug.cgi?id=596985 --- js/ui/dash.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/js/ui/dash.js b/js/ui/dash.js index f70be4dfc..e50c8538c 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -596,15 +596,15 @@ MoreLink.prototype = { let expander = new St.Bin({ style_class: "more-link-expander" }); this.actor.add(expander, { expand: true, y_fill: false }); + }, - this.actor.connect('button-press-event', Lang.bind(this, function (b, e) { - if (this.pane == null) { - // Ensure the pane is created; the activated handler will call setPane - this.emit('activated'); - } - this._pane.toggle(); - return true; - })); + activate: function() { + if (this.pane == null) { + // Ensure the pane is created; the activated handler will call setPane + this.emit('activated'); + } + this._pane.toggle(); + return true; }, setPane: function (pane) { @@ -637,7 +637,8 @@ SectionHeader.prototype = { this.actor = new St.Bin({ style_class: "section-header", x_align: St.Align.START, x_fill: true, - y_fill: true }); + y_fill: true, + reactive: !suppressBrowse }); this._innerBox = new St.BoxLayout({ style_class: "section-header-inner" }); this.actor.set_child(this._innerBox); @@ -662,9 +663,14 @@ SectionHeader.prototype = { if (!suppressBrowse) { this.moreLink = new MoreLink(); this._innerBox.add(this.moreLink.actor, { x_align: St.Align.END }); + this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); } }, + _onButtonPress: function() { + this.moreLink.activate(); + }, + setTitle : function(title) { this.text.text = title; },