From e8eec2d357a5b4c6db312687c8987b0595e91bec Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 4 Mar 2011 15:54:19 -0500 Subject: [PATCH] Use points for font sizes Do a basic job of converting font sizes from pixels to points, so they will scale will the global GNOME scale factor. Some other sizes that are clearly related to the font sizes are changed to ems, but no comprehensive attempt is made to get rid of px units. https://bugzilla.gnome.org/show_bug.cgi?id=636868 --- data/theme/gnome-shell.css | 70 +++++++++++++++++++------------------- js/ui/overview.js | 2 +- js/ui/panel.js | 4 +-- js/ui/workspace.js | 2 +- 4 files changed, 38 insertions(+), 40 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 1335e8405..fac0006e0 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -98,7 +98,7 @@ StTooltip StLabel { .popup-menu { color: #ffffff; - font-size: 14px; + font-size: 10.5pt; min-width: 200px; } @@ -183,6 +183,8 @@ StTooltip StLabel { color: #ffffff; background-color: black; border-image: url("panel-border.svg") 1; + font-size: 10.5pt; + height: 1.86em; } #panelLeft, #panelCenter, #panelRight { @@ -242,7 +244,6 @@ StTooltip StLabel { .panel-button { padding: 0px 12px; - font-size: 14px; font-weight: bold; color: #ccc; transition-duration: 100; @@ -345,7 +346,7 @@ StTooltip StLabel { background: rgba(0,0,0,0.8); border: 1px solid rgba(128,128,128,0.40); border-radius: 10px; - font-size: 12px; + font-size: 9pt; padding: 2px 8px; -shell-caption-spacing: 4px; } @@ -365,7 +366,7 @@ StTooltip StLabel { #dash { color: #5f5f5f; - font-size: 12px; + font-size: 9pt; padding: 4px 0px; background-color: rgba(0, 0, 0, 0.5); border: 1px solid rgba(128, 128, 128, 0.4); @@ -391,12 +392,12 @@ StTooltip StLabel { } #viewSelector { - spacing: 16px; - font-size: 16px; + spacing: 1em; + font-size: 12pt; } #viewSelectorTabBar { - padding: 16px; + padding: 1em; } #searchArea { @@ -444,8 +445,8 @@ StTooltip StLabel { .view-tab-title { color: #888a85; font-weight: bold; - padding: 0px 12px; - height: 24px; + padding: 0px 0.75em; + height: 1.5em; } .view-tab-title:hover { @@ -455,8 +456,7 @@ StTooltip StLabel { .view-tab-title:selected { color: #000000; background-color: #c2c7cd; - border-radius: 4px; - height: 24px; + border-radius: 0.25em; } #searchResults { @@ -519,7 +519,7 @@ StTooltip StLabel { .dash-search-button-label { color: #cccccc; - font-size: 16px; + font-size: 12pt; } /* Apps */ @@ -544,9 +544,9 @@ StTooltip StLabel { } .app-filter { - font-size: 14px; + font-size: 10.5pt; font-weight: bold; - height: 40px; + height: 2.85em; color: #aaa; width: 200px; } @@ -589,7 +589,7 @@ StTooltip StLabel { border-radius: 4px; padding: 3px; border: 1px rgba(0,0,0,0); - font-size: 10px; + font-size: 7.5pt; color: white; transition-duration: 100; text-align: center; @@ -619,7 +619,7 @@ StTooltip StLabel { } .app-well-menu { - font-size: 12px + font-size: 9pt; } /* LookingGlass */ @@ -775,7 +775,7 @@ StTooltip StLabel { .calendar-month-label { color: #666666; - font-size: 10px; + font-size: 7.5pt; padding: 2px; font-weight: bold; } @@ -818,16 +818,16 @@ StTooltip StLabel { .datemenu-date-label { padding: .4em 1.75em; - font-size: 14px; + font-size: 10.5pt; color: #cccccc; font-weight: bold; } .calendar-day-base { - font-size: 10px; + font-size: 7.5pt; text-align: center; - width: 24px; - height: 24px; + width: 2.4em; + height: 2.4em; } .calendar-day-base:hover { @@ -897,7 +897,7 @@ StTooltip StLabel { } .events-day-header { - font-size: 12px; + font-size: 9pt; font-weight: bold; color: rgba(153, 153, 153, 1.0); padding-left: 0.3em; @@ -909,7 +909,7 @@ StTooltip StLabel { } .events-day-dayname { - font-size: 12px; + font-size: 9pt; color: rgba(153, 153, 153, 1.0); text-align: left; } @@ -919,7 +919,7 @@ StTooltip StLabel { } .events-day-time { - font-size: 12px; + font-size: 9pt; color: #fff; text-align: right; } @@ -929,7 +929,7 @@ StTooltip StLabel { } .events-day-task { - font-size: 12px; + font-size: 9pt; color: rgba(153, 153, 153, 1.0); } @@ -964,7 +964,7 @@ StTooltip StLabel { } #notification { - font-size: 16px; + font-size: 12pt; border-radius: 5px 5px 0px 0px; background: rgba(0,0,0,0.9); padding: 8px 8px 4px 8px; @@ -993,7 +993,7 @@ StTooltip StLabel { } .summary-boxpointer #summary-right-click-menu { - font-size: 14px; + font-size: 10.5pt; padding-top: 12px; padding-bottom: 12px; } @@ -1095,7 +1095,7 @@ StTooltip StLabel { .chat-meta-message { padding-left: 4px; border-radius: 4px; - font-size: 14px; + font-size: 10.5pt; color: #bbbbbb; } @@ -1163,7 +1163,7 @@ StTooltip StLabel { } .source-title { - font-size: 12px; + font-size: 9pt; font-weight: bold; padding-left: 4px; } @@ -1185,7 +1185,7 @@ StTooltip StLabel { border-radius: 24px; padding: 20px; - font-size: 12px; + font-size: 9pt; color: white; } @@ -1317,7 +1317,7 @@ StTooltip StLabel { .modal-dialog-button { border: 1px solid #8b8b8b; border-radius: 18px; - font-size: 14px; + font-size: 10.5pt; margin-left: 10px; margin-right: 10px; @@ -1350,12 +1350,12 @@ StTooltip StLabel { /* Run Dialog */ .run-dialog-label { - font-size: 12px; + font-size: 9pt; color: white; } .run-dialog-error-label { - font-size: 12px; + font-size: 9pt; color: white; } @@ -1365,9 +1365,9 @@ StTooltip StLabel { } .run-dialog-entry { - font-size: 14px; + font-size: 10.5pt; font-weight: bold; - width: 320px; + width: 23em; color: white; } diff --git a/js/ui/overview.js b/js/ui/overview.js index 18f0c0f85..3bb478923 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -439,7 +439,7 @@ Overview.prototype = { let primary = global.get_primary_monitor(); let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL); - let contentY = Panel.PANEL_HEIGHT; + let contentY = Main.panel.actor.height; let contentHeight = primary.height - contentY - Main.messageTray.actor.height; this._group.set_position(primary.x, primary.y); diff --git a/js/ui/panel.js b/js/ui/panel.js index 79376199c..da27f6fbe 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -22,8 +22,6 @@ const DateMenu = imports.ui.dateMenu; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const PANEL_HEIGHT = 26; - const PANEL_ICON_SIZE = 24; const STARTUP_ANIMATION_TIME = 0.2; @@ -1044,7 +1042,7 @@ Panel.prototype = { let primary = global.get_primary_monitor(); this.actor.set_position(primary.x, primary.y); - this.actor.set_size(primary.width, PANEL_HEIGHT); + this.actor.set_size(primary.width, -1); this._leftCorner.relayout(); this._rightCorner.relayout(); diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 9a80f8c8e..82dbcb087 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -222,7 +222,7 @@ WindowClone.prototype = { let [width, height] = this.actor.get_transformed_size(); this.actor.x = _clamp(this.actor.x, 0, global.screen_width - width); - this.actor.y = _clamp(this.actor.y, Panel.PANEL_HEIGHT, global.screen_height - height); + this.actor.y = _clamp(this.actor.y, Main.panel.actor.height, global.screen_height - height); }, _zoomStart : function () {