From a2e0e0ad06aefb219682ea846033d1fbf320be7c Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 20 Aug 2012 16:44:28 -0400 Subject: [PATCH] messageTray: Adjust the position of the close button Make this closer to the mockups. https://bugzilla.gnome.org/show_bug.cgi?id=682253 --- data/theme/gnome-shell.css | 11 ++++++++++- js/ui/messageTray.js | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index cfdefd87d..3512d5ab4 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -615,7 +615,16 @@ StButton.popup-menu-item:insensitive { } .notification-close { - -shell-close-overlap: 14px; + /* we start out in the top right of the + * notification, inset. + * + * center is 32px/2 = 17px + * + * adjust left 2px + * adjust down 8px */ + + -shell-close-overlap-x: 15px; + -shell-close-overlap-y: 12px; } .window-close:rtl { diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 95044a19c..82dea0ac5 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -236,9 +236,10 @@ function makeCloseButton() { closeButton.connect('style-changed', function() { let themeNode = closeButton.get_theme_node(); - let overlap = themeNode.get_length('-shell-close-overlap'); - closeButton.translation_x = overlap; - closeButton.translation_y = -overlap; + closeButton.translation_x = themeNode.get_length('-shell-close-overlap-x'); + + // libcroco doesn't support negative units + closeButton.translation_y = -themeNode.get_length('-shell-close-overlap-y'); }); return closeButton;