[MessageTray] notification size/wrapping fixes

Make the font match the panel.
Make the max width be em-based rather than screen-size-based.
Fix it to break lines mid-word if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=606755
This commit is contained in:
Dan Winship 2010-02-12 16:10:24 -05:00
parent 721e1ea863
commit 94f32030e6
2 changed files with 7 additions and 6 deletions

View File

@ -561,12 +561,14 @@ StTooltip {
}
#notification {
font-size: 16px;
border-radius: 5px;
background: rgba(0,0,0,0.9);
color: white;
padding: 2px 10px 10px 10px;
spacing-rows: 5px;
spacing-columns: 10px;
max-width: 40em;
}
#notification-actions {

View File

@ -189,6 +189,7 @@ Notification.prototype = {
addBody: function(text, props) {
let body = new St.Label();
body.clutter_text.line_wrap = true;
body.clutter_text.line_wrap_mode = Pango.WrapMode.WORD_CHAR;
body.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
text = text ? _cleanMarkup(text) : '';
@ -345,7 +346,8 @@ MessageTray.prototype = {
this.actor = new St.BoxLayout({ name: 'message-tray',
reactive: true });
this._notificationBin = new St.Bin({ reactive: true });
this._notificationBin = new St.Bin({ reactive: true,
x_align: St.Align.MIDDLE });
this.actor.add(this._notificationBin);
this._notificationBin.hide();
this._notificationQueue = [];
@ -390,11 +392,8 @@ MessageTray.prototype = {
this.actor.y = primary.y + primary.height - 1;
this.actor.width = primary.width;
let third = Math.floor(this.actor.width / 3);
this._notificationBin.x = third;
this._notificationBin.width = third;
this._summaryBin.x = this.actor.width - third;
this._summaryBin.width = third;
this._notificationBin.x = this._summaryBin.x = 0;
this._notificationBin.width = this._summaryBin.width = primary.width;
},
contains: function(source) {