summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-09-19 00:36:05 -0300
committerFlorian Müllner <fmuellner@gnome.org>2012-10-25 21:45:18 +0200
commit4f876995de42397e9dce2d3fe6f9e27322a869fd (patch)
tree3cad74cf7c216cdbb46703a809e0b8d2398be72f
parent9cf4a7619679a97b91bf085b028dc024dce8aab2 (diff)
downloadgnome-shell-4f876995de42397e9dce2d3fe6f9e27322a869fd.tar.gz
messageTray: make SummaryItem._closeButton public
Use this to show/hide the close button instead of closeButtonVisible. https://bugzilla.gnome.org/show_bug.cgi?id=682237
-rw-r--r--js/ui/messageTray.js26
-rw-r--r--js/ui/screenShield.js4
2 files changed, 12 insertions, 18 deletions
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index bd2ab2f4f..a425926f4 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1237,12 +1237,6 @@ const SummaryItem = new Lang.Class({
this.notificationStackWidget = new St.Widget({ layout_manager: new Clutter.BinLayout() });
- this._closeButton = makeCloseButton();
- this._closeButton.connect('clicked', Lang.bind(this, function() {
- source.destroy();
- source.emit('done-displaying-content');
- }));
-
this.notificationStackView = new St.ScrollView({ style_class: source.isChat ? '' : 'summary-notification-stack-scrollview',
vscrollbar_policy: source.isChat ? Gtk.PolicyType.NEVER : Gtk.PolicyType.AUTOMATIC,
hscrollbar_policy: Gtk.PolicyType.NEVER });
@@ -1251,7 +1245,13 @@ const SummaryItem = new Lang.Class({
vertical: true });
this.notificationStackView.add_actor(this.notificationStack);
this.notificationStackWidget.add_actor(this.notificationStackView);
- this.notificationStackWidget.add_actor(this._closeButton);
+
+ this.closeButton = makeCloseButton();
+ this.closeButton.connect('clicked', Lang.bind(this, function() {
+ source.destroy();
+ source.emit('done-displaying-content');
+ }));
+ this.notificationStackWidget.add_actor(this.closeButton);
this._stackedNotifications = [];
this._oldMaxScrollAdjustment = 0;
@@ -1268,14 +1268,6 @@ const SummaryItem = new Lang.Class({
global.focus_manager.add_group(this.rightClickMenu);
},
- get closeButtonVisible() {
- return this._closeButton.visible;
- },
-
- set closeButtonVisible(v) {
- this._closeButton.visible = v;
- },
-
_onKeyPress: function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Up) {
actor.emit('clicked', 1);
@@ -2419,7 +2411,9 @@ const MessageTray = new Lang.Class({
this._notificationQueue = newQueue;
this._summaryBoxPointer.bin.child = this._summaryBoxPointerItem.notificationStackWidget;
- this._summaryBoxPointerItem.closeButtonVisible = true;
+
+ let closeButton = this._summaryBoxPointerItem.closeButton;
+ closeButton.show();
this._summaryBoxPointerItem.prepareNotificationStackForShowing();
} else if (this._clickedSummaryItemMouseButton == 3) {
this._summaryBoxPointer.bin.child = this._clickedSummaryItem.rightClickMenu;
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 206956882..a02182d5a 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -186,7 +186,7 @@ const NotificationsBox = new Lang.Class({
if (obj.resident) {
this._residentNotificationBox.add(item.notificationStackWidget);
- item.closeButtonVisible = false;
+ item.closeButton.hide();
item.prepareNotificationStackForShowing();
} else {
[obj.sourceBox, obj.countLabel] = this._makeNotificationSource(item.source);
@@ -244,7 +244,7 @@ const NotificationsBox = new Lang.Class({
obj.resident = true;
this._residentNotificationBox.add(obj.item.notificationStackWidget);
- obj.item.closeButtonVisible = false;
+ obj.item.closeButton.hide();
obj.item.prepareNotificationStackForShowing();
} else {
// just update the counter