[gnome-shell] Calendar: hide all actions when on the login screen
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Calendar: hide all actions when on the login screen
- Date: Mon, 8 Oct 2012 17:49:25 +0000 (UTC)
commit 0f6effa26316c553e5c1074eb9ada1102c162d21
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 2 19:32:55 2012 +0200
Calendar: hide all actions when on the login screen
No events on the login screen, and no opening calendars or
settings either.
https://bugzilla.gnome.org/show_bug.cgi?id=685142
js/ui/dateMenu.js | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 2c45582..7f01a76 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -89,8 +89,10 @@ const DateMenuButton = new Lang.Class({
separator.setColumnWidths(1);
vbox.add(separator.actor, {y_align: St.Align.END, expand: true, y_fill: false});
+ item.actor.show_on_set_parent = false;
item.actor.can_focus = false;
item.actor.reparent(vbox);
+ this._dateAndTimeSeparator = separator;
}
this._separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
@@ -145,9 +147,18 @@ const DateMenuButton = new Lang.Class({
},
_setEventsVisibility: function(visible) {
+ this._openCalendarItem.actor.visible = visible;
this._separator.visible = visible;
- this._eventList.visible = visible;
- this._openCalendarItem.visible = visible;
+ if (visible) {
+ let alignment = 0.25;
+ if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
+ alignment = 1.0 - alignment;
+ this.menu._arrowAlignment = alignment;
+ this._eventList.actor.get_parent().show();
+ } else {
+ this.menu._arrowAlignment = 0.5;
+ this._eventList.actor.get_parent().hide();
+ }
},
_setEventSource: function(eventSource) {
@@ -165,6 +176,10 @@ const DateMenuButton = new Lang.Class({
}
this._setEventSource(eventSource);
this._setEventsVisibility(showEvents);
+
+ // This needs to be handled manually, as the code to
+ // autohide separators doesn't work across the vbox
+ this._dateAndTimeSeparator.actor.visible = Main.sessionMode.allowSettings;
},
_updateClockAndDate: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]