From 68c482ec324fd908e6d9bece8399dcf9a71f4dae Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 19 Jan 2011 16:30:01 +0100 Subject: [PATCH 1/3] notification: be compatible with various names of the icon data hint The hint changed its name during various iterations of the notification daemon spec; be compatible with all of them. https://bugzilla.gnome.org/show_bug.cgi?id=639959 --- js/ui/notificationDaemon.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 0b377a834..63062794e 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -146,9 +146,9 @@ NotificationDaemon.prototype = { return new St.Icon({ icon_name: icon, icon_type: St.IconType.FULLCOLOR, icon_size: size }); - } else if (hints.icon_data) { + } else if (hints['image-data']) { let [width, height, rowStride, hasAlpha, - bitsPerSample, nChannels, data] = hints.icon_data; + bitsPerSample, nChannels, data] = hints['image-data']; return textureCache.load_from_raw(data, data.length, hasAlpha, width, height, rowStride, size); } else { @@ -238,6 +238,15 @@ NotificationDaemon.prototype = { hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true); + // Be compatible with the various hints for image data + // 'image-data' is the latest name of this hint, introduced in 1.2 + if (!hints['image-data']) { + if (hints['image_data']) + hints['image-data'] = hints['image_data']; // version 1.1 of the spec + else if (hints['icon_data']) + hints['image-data'] = hints['icon_data']; // previous versions of the spec + } + let ndata = { appName: appName, icon: icon, summary: summary, From 28adc03cceddce342ce496b60304a029a9f509c9 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 19 Jan 2011 11:34:10 -0500 Subject: [PATCH 2/3] StIcon: round icon size to an integer Instead of converting a CSS-specified length to an integer by truncation, round. This means that sizes specified by converting a pixel value into non-px terms will work reliably instead of potentially being off-by-one. --- src/st/st-icon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 6101107f1..78519c483 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -279,7 +279,7 @@ st_icon_style_changed (StWidget *widget) StThemeNode *theme_node = st_widget_get_theme_node (widget); StIconPrivate *priv = self->priv; - priv->theme_icon_size = st_theme_node_get_length (theme_node, "icon-size"); + priv->theme_icon_size = (int)(0.5 + st_theme_node_get_length (theme_node, "icon-size")); st_icon_update_icon_size (self); st_icon_update (self); } From 961fdd861fac46ef0ecc67bb8be14c0ce828e612 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 14 Dec 2010 02:50:19 +0100 Subject: [PATCH 3/3] Hard code Cantarell as the default UI font. - specify an overall font-family for all children of the stage and for places where we just want to use a size, use font-size. - also shrink the humongous 16px panel and menu size to a reasonable 14. - scale up the icons to be 16px by default again Based on a patch by Jakub Steiner https://bugzilla.gnome.org/show_bug.cgi?id=634226 --- data/theme/gnome-shell.css | 39 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index d7c0b6c13..6104ac95a 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -17,6 +17,10 @@ * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ +stage { + font-family: cantarell, sans-serif; +} + .shell-link { color: #0000ff; text-decoration: underline; @@ -101,7 +105,7 @@ StTooltip StLabel { .popup-menu { color: #ffffff; - font-size: 16px; + font-size: 14px; min-width: 200px; } @@ -151,7 +155,7 @@ StTooltip StLabel { } .popup-menu-icon { - icon-size: 1em; + icon-size: 1.14em; } /* Switches (to be used in menus) */ @@ -178,7 +182,6 @@ StTooltip StLabel { #panel { color: #ffffff; - font-size: 16px; background-color: black; } @@ -209,7 +212,7 @@ StTooltip StLabel { border-radius: 5px; border-radius-bottomleft: 0px; border-radius-bottomright: 0px; - font: 16px sans-serif; + font-size: 14px; font-weight: bold; transition-duration: 100; } @@ -242,7 +245,7 @@ StTooltip StLabel { } .system-status-icon { - icon-size: 1em; + icon-size: 1.14em; } /* Overview */ @@ -464,7 +467,7 @@ StTooltip StLabel { .dash-search-button-label { color: #cccccc; - font: 16px sans-serif; + font-size: 16px; } /* Apps */ @@ -883,7 +886,7 @@ StTooltip StLabel { } .source-title { - font: 12px sans-serif; + font-size: 12px; font-weight: bold; padding-left: 4px; } @@ -904,7 +907,7 @@ StTooltip StLabel { border-radius: 24px; padding: 20px; - font: 12px sans-serif; + font-size: 12px; color: white; } @@ -1021,7 +1024,7 @@ StTooltip StLabel { /* Modal Dialogs */ .modal-dialog { - font: 12pt sans-serif; + font-size: 12pt; border-radius: 24px; background-color: rgba(0.0, 0.0, 0.0, 0.9); border: 2px solid #868686; @@ -1036,7 +1039,7 @@ StTooltip StLabel { .modal-dialog-button { border: 1px solid #8b8b8b; border-radius: 18px; - font: 14px sans-serif; + font-size: 14px; margin-left: 10px; margin-right: 10px; @@ -1069,7 +1072,7 @@ StTooltip StLabel { /* Run Dialog */ .run-dialog-label { - font: 12px sans-serif; + font-size: 12px; color: white; } @@ -1080,12 +1083,12 @@ StTooltip StLabel { } .run-dialog-error-label { - font: 16px sans-serif; + font-size: 16px; color: white; } .run-dialog-entry { - font: 14px sans-serif; + font-size: 14px; font-weight: bold; width: 320px; color: white; @@ -1106,7 +1109,7 @@ StTooltip StLabel { /* End Session Dialog */ .end-session-dialog-subject { - font: 12pt sans-serif; + font-size: 12pt; font-weight: bold; color: #666666; padding-top: 10px; @@ -1115,7 +1118,7 @@ StTooltip StLabel { } .end-session-dialog-description { - font: 10pt sans-serif; + font-size: 10pt; color: white; padding-left: 17px; padding-right: 40px; @@ -1135,7 +1138,7 @@ StTooltip StLabel { } .end-session-dialog-app-list { - font: 10pt sans-serif; + font-size: 10pt; max-height: 200px; padding-top: 42px; padding-bottom: 42px; @@ -1152,11 +1155,11 @@ StTooltip StLabel { } .end-session-dialog-app-list-item-name { - font: 10pt sans-serif; + font-size: 10pt; } .end-session-dialog-app-list-item-description { - font: 8pt sans-serif; + font-size: 8pt; color: #444444; }