Compare commits

..

19 Commits

Author SHA1 Message Date
9ab35786f6 theme: Search in versioned directories
We support third party themes, via the "stylesheetName" property of a
mode's json files. However, our external CSS API is not completely
stable. If a third party theme wants to work on multiple gnome-shell
versions - for example because it is shipped as a Flatpak or a Snap - it
is not possible to ensure that a theme corresponding to the running
gnome-shell version is loaded.

GTK+ loads themes from versioned directories, search backwards from the
current version. Let's do the same in gnome-shell too. Then a downstream
theme can be shipped in $datadir/gnome-shell/3.28/theme/.

We keep searching all of the current paths. Additionally, the default
case where we look for the 'gnome' theme as a resource in the binary
continues to be the default so there are no additional lookups for users
of this theme.
2018-06-28 11:14:54 +01:00
5fe349d5ba thunderbolt: Do not auto start boltd
The service is expected to be activated by systemd when a thunderbolt
device is plugged in, so no need to have it auto-started with the
session.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/54
2018-06-25 14:17:07 +00:00
1f03599d1c st-texture-cache: Save cairo surfaces to a different map
The default keyed_surface is meant to handle CoglTextures thus we can't
add cairo surfaces to it, as the DestroyNotify function won't handle them.

Then the quicker way is to just add another Hash table for handling
such types of textures, with proper destroy function.
2018-06-21 00:56:36 +02:00
a24999b7a3 st-texture-cache: Don't add NULL textures to cache
This might cause a crash when cleaning up the cache as the hash table has
cogl_object_unref as DestroyNotify function but that assumes that
the passed object is a valid CoglObject.

Fixes: #210
2018-06-21 00:48:54 +02:00
8237a1f6e0 Change "const" to "var"
These variables are in fact used from other modules, so gjs complains about them
being const.
2018-06-18 11:19:13 -04:00
f9dec475a1 Update Chinese (Taiwan) translation 2018-06-13 08:38:03 +00:00
68b01a8f56 theme: Use tabular figures where appropriate
In places where numbers appear in columns (like the calendar widget) or
where changing numbers would result in labels jiggling around due to
small width changes (like the clock), use the newly added
font-feature-settings support to request tabular figures.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/34
2018-06-08 13:27:57 -04:00
f56ba0877a st: Add support for font-feature-settings
Cantarell now supports tabular figures, which are useful in places
where digits should either align or not use different widths. In
order to allow elements to request the feature, add support for
the corresponding CSS property[0].

[0] https://www.w3.org/TR/css-fonts-3/#font-rend-desc

https://gitlab.gnome.org/GNOME/gnome-shell/issues/34
2018-06-08 18:45:07 +02:00
5ac6201d91 test-theme: Fix a comment 2018-06-08 17:39:13 +02:00
a21a22fdb5 appDisplay: Make middle-click like Ctrl+click
When middle-clicking an app icon on the Dash, it will always try to open
a new window of that app, even if the app doesn't support multiple
windows. Meanwhile, Ctrl+click on an app will only open a new window if
the app allows it.

This change prevents middle-clicks on app icons from opening new windows
for apps without multi-window support.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/316
2018-06-07 17:49:36 +00:00
a0fa50ac31 Update Scottish Gaelic translation
(cherry picked from commit 0ac0f7e85b)
2018-06-01 10:36:57 +00:00
b1dd746443 network: Keep key focus in dialog when removing networks
When the actor that has the key focus is destroyed, Clutter moves
the focus to the stage. In case the destroyed actor was inside a
ModalDialog, this breaks any keyboard interaction: keynav is broken
because the stage isn't in any focus chain, and access keys like
Escape because they are handled on the dialog's parent.

The only dialog that may destroy a child without recreating the dialog
buttons (and thus moving the key focus there) is the WirelessDialog,
fix it by keeping the key focus within the dialog when removing networks
from the list.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/76
2018-05-31 11:42:14 +00:00
c15e163eb1 network: Handle networks with no access points
This avoids a couple of warnings when encountering such a network.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/76
2018-05-31 11:42:14 +00:00
7a3927c168 screenshot: Store creation time in metadata
It's useful information, even when we are not using JPEG/Exif - at
least nautilus will show it in its image properties.

https://bugzilla.gnome.org/show_bug.cgi?id=790481
2018-05-31 11:36:27 +00:00
6eed4e31d7 workspace: Fall back to app name in window caption
Just like we did for the window list in app icons' context menu,
provide a fallback for window captions in the window picker rather
than showing blank items to the user.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/26
2018-05-31 11:27:44 +00:00
f0557ea05c appDisplay: Fall back to app name in icon menu
The app icon's context menu contains a list of open windows,
identified by their title. As we currently don't handle the
case where the app didn't set a title, we end up with empty
menu items which looks clearly broken. Fall back to the app's
name in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/26
2018-05-31 11:27:43 +00:00
44894262f4 st-label: Unset clutter text instance on disposal
The instance is owned by the actor (being its child), and thus when the
disposal happens for the parent the text is disposed too, thus it's just
safer to nullify its reference so that we won't try to access to invalid
objects later, and this might be the case since the JS objects could be kept
around until they aren't finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=788931
2018-05-29 02:28:26 +03:00
b03bcc85aa closeDialog: Periodically check for window to become responsive again
The close dialog for non-responding windows is closed automatically
when we detect that the window is responding again. However as we
currently only ping the window in response to certain user actions
(like focusing the window or opening the window menu), this can
easily go undetected.

Address this by periodically pinging the window while the close
dialog is shown.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/298
2018-05-25 18:23:55 +02:00
70057c6a55 closeDialog: Disable unredirection while showing
The dialog won't be visible when unredirection is in place (for example
while a fullscreen window is focused), so disable unredirection while
the dialog is up.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/298
2018-05-25 14:05:29 +00:00
19 changed files with 697 additions and 469 deletions

View File

@ -733,6 +733,7 @@ StScrollBar {
transition-duration: 500ms;
font-weight: bold;
height: 1.86em;
font-feature-settings: "tnum";
&.unlock-screen,
&.login-screen,
@ -958,6 +959,7 @@ StScrollBar {
padding: 0.1em;
margin: 2px;
border-radius: 1.4em;
font-feature-settings: "tnum";
&:hover,&:focus { background-color: lighten($bg_color,5%); }
&:active,&:selected {
color: lighten($selected_fg_color,5%);
@ -1867,6 +1869,7 @@ StScrollBar {
.screen-shield-clock-time {
font-size: 72pt;
text-shadow: 0px 2px 2px rgba(0,0,0,0.4);
font-feature-settings: "tnum";
}
.screen-shield-clock-date {

View File

@ -1778,10 +1778,11 @@ var AppIcon = new Lang.Class({
activate(button) {
let event = Clutter.get_current_event();
let modifiers = event ? event.get_state() : 0;
let openNewWindow = this.app.can_open_new_window () &&
modifiers & Clutter.ModifierType.CONTROL_MASK &&
this.app.state == Shell.AppState.RUNNING ||
button && button == 2;
let isMiddleButton = button && button == Clutter.BUTTON_MIDDLE;
let isCtrlPressed = (modifiers & Clutter.ModifierType.CONTROL_MASK) != 0;
let openNewWindow = this.app.can_open_new_window() &&
this.app.state == Shell.AppState.RUNNING &&
(isCtrlPressed || isMiddleButton);
if (this.app.state == Shell.AppState.STOPPED || openNewWindow)
this.animateLaunch();
@ -1870,7 +1871,9 @@ var AppIconMenu = new Lang.Class({
this._appendSeparator();
separatorShown = true;
}
let item = this._appendMenuItem(window.title);
let title = window.title ? window.title
: this._source.app.get_name();
let item = this._appendMenuItem(title);
item.connect('activate', () => {
this.emit('activate-window', window);
});

View File

@ -2,6 +2,7 @@
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
@ -13,6 +14,7 @@ const Tweener = imports.ui.tweener;
var FROZEN_WINDOW_BRIGHTNESS = -0.3
var DIALOG_TRANSITION_TIME = 0.15
var ALIVE_TIMEOUT = 5000;
var CloseDialog = new Lang.Class({
Name: 'CloseDialog',
@ -26,6 +28,7 @@ var CloseDialog = new Lang.Class({
this.parent();
this._window = window;
this._dialog = null;
this._timeoutId = 0;
},
get window() {
@ -97,6 +100,14 @@ var CloseDialog = new Lang.Class({
if (this._dialog != null)
return;
Meta.disable_unredirect_for_screen(global.screen);
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, ALIVE_TIMEOUT,
() => {
this._window.check_alive(global.display.get_current_time_roundtrip());
return GLib.SOURCE_CONTINUE;
});
this._addWindowEffect();
this._initDialog();
@ -117,6 +128,11 @@ var CloseDialog = new Lang.Class({
if (this._dialog == null)
return;
Meta.enable_unredirect_for_screen(global.screen);
GLib.source_remove(this._timeoutId);
this._timeoutId = 0;
let dialog = this._dialog;
this._dialog = null;
this._removeWindowEffect();

View File

@ -14,6 +14,7 @@ const St = imports.gi.St;
const AccessDialog = imports.ui.accessDialog;
const AudioDeviceSelection = imports.ui.audioDeviceSelection;
const Components = imports.ui.components;
const Config = imports.misc.config;
const CtrlAltTab = imports.ui.ctrlAltTab;
const EndSessionDialog = imports.ui.endSessionDialog;
const Environment = imports.ui.environment;
@ -249,26 +250,61 @@ function _initializeUI() {
});
}
function _findThemeDirByVersion(dir, major, minor, name) {
let path;
let stylesheet;
let subpath;
/* Don't search back to before we introduced this support */
let max_minor = (major == 3) ? 28 : 0;
for (let i = minor; i >= max_minor; i = i - 2) {
subpath = major + '.' + i;
path = GLib.build_filenamev([dir, 'gnome-shell', subpath, 'theme', name]);
stylesheet = Gio.file_new_for_path(path);
log('Checking for ' + path);
if (stylesheet.query_exists(null)) {
log('Using ' + path);
return stylesheet;
}
}
path = GLib.build_filenamev([dir, 'gnome-shell', 'theme', name]);
stylesheet = Gio.file_new_for_path(path);
if (stylesheet.query_exists(null)) {
log('Using unversioned' + path);
return stylesheet;
}
return null;
}
function _getStylesheet(name) {
let stylesheet;
let [major, minor] = Config.PACKAGE_VERSION.split('.');
// Directories are versioned according to the stable version
if ((minor % 2) == 1)
minor++;
stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + name);
if (stylesheet.query_exists(null))
if (stylesheet.query_exists(null)) {
log('Using built-in default theme ' + name)
return stylesheet;
}
let dataDirs = GLib.get_system_data_dirs();
for (let i = 0; i < dataDirs.length; i++) {
let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
let stylesheet = Gio.file_new_for_path(path);
if (stylesheet.query_exists(null))
stylesheet = _findThemeDirByVersion(dataDirs[i], major, minor, name)
if (stylesheet != null)
return stylesheet;
}
stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + name);
if (stylesheet.query_exists(null))
return stylesheet;
return null;
return _findThemeDirByVersion(global.datadir, major, minor, name);
}
function _getDefaultStylesheet() {

View File

@ -995,8 +995,16 @@ var NMWirelessDialog = new Lang.Class({
else if (!oneHasConnection && twoHasConnection)
return 1;
let oneStrength = one.accessPoints[0].strength;
let twoStrength = two.accessPoints[0].strength;
let oneAp = one.accessPoints[0] || null;
let twoAp = two.accessPoints[0] || null;
if (oneAp != null && twoAp == null)
return -1;
else if (oneAp == null && twoAp != null)
return 1;
let oneStrength = oneAp.strength;
let twoStrength = twoAp.strength;
// place stronger connections first
if (oneStrength != twoStrength)
@ -1156,6 +1164,11 @@ var NMWirelessDialog = new Lang.Class({
Util.ensureActorVisibleInScrollView(this._scrollView, network.item.actor);
this._selectNetwork(network);
});
network.item.actor.connect('destroy', () => {
let keyFocus = global.stage.key_focus;
if (keyFocus && keyFocus.contains(network.item.actor))
this._itemBox.grab_key_focus();
});
},
});

View File

@ -49,7 +49,6 @@ const BoltDeviceInterface = '<node> \
</interface> \
</node>';
const BoltClientProxy = Gio.DBusProxy.makeProxyWrapper(BoltClientInterface);
const BoltDeviceProxy = Gio.DBusProxy.makeProxyWrapper(BoltDeviceInterface);
/* */
@ -78,6 +77,7 @@ var AuthMode = {
ENABLED: 'enabled'
};
const BOLT_DBUS_CLIENT_IFACE = 'org.freedesktop.bolt1.Manager';
const BOLT_DBUS_NAME = 'org.freedesktop.bolt';
const BOLT_DBUS_PATH = '/org/freedesktop/bolt';
@ -87,22 +87,26 @@ var Client = new Lang.Class({
_init() {
this._proxy = null;
new BoltClientProxy(
Gio.DBus.system,
BOLT_DBUS_NAME,
BOLT_DBUS_PATH,
this._onProxyReady.bind(this)
);
let nodeInfo = Gio.DBusNodeInfo.new_for_xml(BoltClientInterface);
Gio.DBusProxy.new(Gio.DBus.system,
Gio.DBusProxyFlags.DO_NOT_AUTO_START,
nodeInfo.lookup_interface(BOLT_DBUS_CLIENT_IFACE),
BOLT_DBUS_NAME,
BOLT_DBUS_PATH,
BOLT_DBUS_CLIENT_IFACE,
null,
this._onProxyReady.bind(this));
this.probing = false;
},
_onProxyReady(proxy, error) {
if (error !== null) {
log('error creating bolt proxy: %s'.format(error.message));
return;
}
this._proxy = proxy;
_onProxyReady(o, res) {
try {
this._proxy = Gio.DBusProxy.new_finish(res);
} catch(e) {
log('error creating bolt proxy: %s'.format(e.message));
return;
}
this._propsChangedId = this._proxy.connect('g-properties-changed', this._onPropertiesChanged.bind(this));
this._deviceAddedId = this._proxy.connectSignal('DeviceAdded', this._onDeviceAdded.bind(this));

View File

@ -24,7 +24,7 @@ const EdgeDragAction = imports.ui.edgeDragAction;
const CloseDialog = imports.ui.closeDialog;
const SwitchMonitor = imports.ui.switchMonitor;
const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
var SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
var MINIMIZE_WINDOW_ANIMATION_TIME = 0.2;
var SHOW_WINDOW_ANIMATION_TIME = 0.15;
var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 0.1;

View File

@ -447,12 +447,13 @@ var WindowOverlay = new Lang.Class({
this.border = new St.Bin({ style_class: 'window-clone-border' });
let title = new St.Label({ style_class: 'window-caption',
text: metaWindow.title });
text: this._getCaption() });
title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
windowClone.actor.label_actor = title;
this._updateCaptionId = metaWindow.connect('notify::title', w => {
this.title.text = w.title;
this.title.text = this._getCaption();
this.relayout(false);
});
@ -565,6 +566,16 @@ var WindowOverlay = new Lang.Class({
}
},
_getCaption() {
let metaWindow = this._windowClone.metaWindow;
if (metaWindow.title)
return metaWindow.title;
let tracker = Shell.WindowTracker.get_default();
let app = tracker.get_window_app(metaWindow);
return app.get_name();
},
_animateOverlayActor(actor, x, y, width, height) {
let params = { x: x,
y: y,

View File

@ -31,7 +31,7 @@ var WORKSPACE_CUT_SIZE = 10;
var WORKSPACE_KEEP_ALIVE_TIME = 100;
const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides';
var OVERRIDE_SCHEMA = 'org.gnome.shell.overrides';
/* A layout manager that requests size only for primary_actor, but then allocates
all using a fixed layout */
@ -241,7 +241,7 @@ var WindowClone = new Lang.Class({
Signals.addSignalMethods(WindowClone.prototype);
const ThumbnailState = {
var ThumbnailState = {
NEW : 0,
ANIMATING_IN : 1,
NORMAL: 2,

757
po/gd.po

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell 3.3.90\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
"POT-Creation-Date: 2018-03-05 21:11+0000\n"
"PO-Revision-Date: 2018-03-10 20:30+0800\n"
"POT-Creation-Date: 2018-06-08 17:30+0000\n"
"PO-Revision-Date: 2018-06-09 11:17+0800\n"
"Last-Translator: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw>\n"
"Language-Team: Chinese (Taiwan) <zh-l10n@lists.linux.org.tw>\n"
"Language: zh_TW\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 2.0.6\n"
"X-Generator: Poedit 2.0.8\n"
#: data/50-gnome-shell-system.xml:6
msgid "System"
@ -308,7 +308,7 @@ msgid "There was an error loading the preferences dialog for %s:"
msgstr "載入 %s 的偏好設定對話盒時發生錯誤:"
#: js/gdm/authPrompt.js:147 js/ui/audioDeviceSelection.js:71
#: js/ui/components/networkAgent.js:117 js/ui/components/polkitAgent.js:148
#: js/ui/components/networkAgent.js:117 js/ui/components/polkitAgent.js:153
#: js/ui/endSessionDialog.js:482 js/ui/extensionDownloader.js:197
#: js/ui/shellMountOperation.js:343 js/ui/status/network.js:919
msgid "Cancel"
@ -328,20 +328,20 @@ msgctxt "button"
msgid "Sign In"
msgstr "登入"
#: js/gdm/loginDialog.js:315
#: js/gdm/loginDialog.js:319
msgid "Choose Session"
msgstr "選擇工作階段"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: js/gdm/loginDialog.js:458
#: js/gdm/loginDialog.js:462
msgid "Not listed?"
msgstr "沒有列出來?"
#. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: js/gdm/loginDialog.js:887
#: js/gdm/loginDialog.js:891
#, javascript-format
msgid "(e.g., user or %s)"
msgstr "(例如: user 或 %s)"
@ -349,12 +349,12 @@ msgstr "(例如: user 或 %s)"
#. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: js/gdm/loginDialog.js:892 js/ui/components/networkAgent.js:243
#: js/gdm/loginDialog.js:896 js/ui/components/networkAgent.js:243
#: js/ui/components/networkAgent.js:261
msgid "Username: "
msgstr "使用者名稱:"
#: js/gdm/loginDialog.js:1228
#: js/gdm/loginDialog.js:1234
msgid "Login Window"
msgstr "登入視窗"
@ -601,32 +601,32 @@ msgstr "常用"
msgid "All"
msgstr "全部"
#: js/ui/appDisplay.js:1886
#: js/ui/appDisplay.js:1889
msgid "New Window"
msgstr "新視窗"
#: js/ui/appDisplay.js:1900
#: js/ui/appDisplay.js:1903
msgid "Launch using Dedicated Graphics Card"
msgstr "使用獨立顯卡啟動"
#: js/ui/appDisplay.js:1927 js/ui/dash.js:285
#: js/ui/appDisplay.js:1930 js/ui/dash.js:285
msgid "Remove from Favorites"
msgstr "自喜好中移除"
#: js/ui/appDisplay.js:1933
#: js/ui/appDisplay.js:1936
msgid "Add to Favorites"
msgstr "加入喜好"
#: js/ui/appDisplay.js:1943
#: js/ui/appDisplay.js:1946
msgid "Show Details"
msgstr "顯示詳細資訊"
#: js/ui/appFavorites.js:138
#: js/ui/appFavorites.js:140
#, javascript-format
msgid "%s has been added to your favorites."
msgstr "%s 已加入您的喜好中。"
#: js/ui/appFavorites.js:172
#: js/ui/appFavorites.js:174
#, javascript-format
msgid "%s has been removed from your favorites."
msgstr "%s 已經從您的喜好中移除。"
@ -787,22 +787,22 @@ msgid "Clear All"
msgstr "全部清除"
#. Translators: %s is an application name
#: js/ui/closeDialog.js:44
#: js/ui/closeDialog.js:47
#, javascript-format
msgid "“%s” is not responding."
msgstr "「%s」沒有回應。"
#: js/ui/closeDialog.js:45
#: js/ui/closeDialog.js:48
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr "您可以選擇再等一下讓它繼續,或是強制讓應用程式立刻退出。"
#: js/ui/closeDialog.js:61
#: js/ui/closeDialog.js:64
msgid "Force Quit"
msgstr "強制退出"
#: js/ui/closeDialog.js:64
#: js/ui/closeDialog.js:67
msgid "Wait"
msgstr "等待"
@ -819,7 +819,7 @@ msgstr "外部裝置已拔除"
msgid "Open with %s"
msgstr "用 %s 開啟"
#: js/ui/components/keyring.js:107 js/ui/components/polkitAgent.js:284
#: js/ui/components/keyring.js:107 js/ui/components/polkitAgent.js:297
msgid "Password:"
msgstr "密碼: "
@ -856,18 +856,18 @@ msgstr "私密金鑰密碼:"
msgid "Service: "
msgstr "服務:"
#: js/ui/components/networkAgent.js:292 js/ui/components/networkAgent.js:659
#: js/ui/components/networkAgent.js:292 js/ui/components/networkAgent.js:664
msgid "Authentication required by wireless network"
msgstr "無線網路所需要的核對"
#: js/ui/components/networkAgent.js:293 js/ui/components/networkAgent.js:660
#: js/ui/components/networkAgent.js:293 js/ui/components/networkAgent.js:665
#, javascript-format
msgid ""
"Passwords or encryption keys are required to access the wireless network "
"“%s”."
msgstr "需要密碼或是加密金鑰來存取無線網路「%s」。"
#: js/ui/components/networkAgent.js:297 js/ui/components/networkAgent.js:663
#: js/ui/components/networkAgent.js:297 js/ui/components/networkAgent.js:668
msgid "Wired 802.1X authentication"
msgstr "有線網路 802.1X 核對"
@ -875,15 +875,15 @@ msgstr "有線網路 802.1X 核對"
msgid "Network name: "
msgstr "網路名稱:"
#: js/ui/components/networkAgent.js:304 js/ui/components/networkAgent.js:667
#: js/ui/components/networkAgent.js:304 js/ui/components/networkAgent.js:672
msgid "DSL authentication"
msgstr "DSL 核對"
#: js/ui/components/networkAgent.js:311 js/ui/components/networkAgent.js:673
#: js/ui/components/networkAgent.js:311 js/ui/components/networkAgent.js:678
msgid "PIN code required"
msgstr "需要 PIN 碼"
#: js/ui/components/networkAgent.js:312 js/ui/components/networkAgent.js:674
#: js/ui/components/networkAgent.js:312 js/ui/components/networkAgent.js:679
msgid "PIN code is needed for the mobile broadband device"
msgstr "這個行動寬頻裝置需要 PIN 碼"
@ -891,29 +891,29 @@ msgstr "這個行動寬頻裝置需要 PIN 碼"
msgid "PIN: "
msgstr "PIN "
#: js/ui/components/networkAgent.js:320 js/ui/components/networkAgent.js:680
#: js/ui/components/networkAgent.js:320 js/ui/components/networkAgent.js:685
msgid "Mobile broadband network password"
msgstr "行動寬頻網路密碼"
#: js/ui/components/networkAgent.js:321 js/ui/components/networkAgent.js:664
#: js/ui/components/networkAgent.js:668 js/ui/components/networkAgent.js:681
#: js/ui/components/networkAgent.js:321 js/ui/components/networkAgent.js:669
#: js/ui/components/networkAgent.js:673 js/ui/components/networkAgent.js:686
#, javascript-format
msgid "A password is required to connect to “%s”."
msgstr "連線至「%s」需要密碼。"
#: js/ui/components/networkAgent.js:648 js/ui/status/network.js:1691
#: js/ui/components/networkAgent.js:653 js/ui/status/network.js:1704
msgid "Network Manager"
msgstr "網路管理員"
#: js/ui/components/polkitAgent.js:43
#: js/ui/components/polkitAgent.js:48
msgid "Authentication Required"
msgstr "要求核對"
#: js/ui/components/polkitAgent.js:71
#: js/ui/components/polkitAgent.js:76
msgid "Administrator"
msgstr "管理員"
#: js/ui/components/polkitAgent.js:151
#: js/ui/components/polkitAgent.js:156
msgid "Authenticate"
msgstr "核對"
@ -921,7 +921,7 @@ msgstr "核對"
#. * requested authentication was not gained; this can happen
#. * because of an authentication error (like invalid password),
#. * for instance.
#: js/ui/components/polkitAgent.js:270 js/ui/shellMountOperation.js:327
#: js/ui/components/polkitAgent.js:283 js/ui/shellMountOperation.js:327
msgid "Sorry, that didnt work. Please try again."
msgstr "抱歉,那沒有作用。請再試一次。"
@ -969,7 +969,7 @@ msgstr "加入世界時鐘…"
msgid "World Clocks"
msgstr "世界時鐘"
#: js/ui/dateMenu.js:225
#: js/ui/dateMenu.js:227
msgid "Weather"
msgstr "天氣"
@ -977,7 +977,7 @@ msgstr "天氣"
#. libgweather for the possible condition strings. If at all
#. possible, the sentence should match the grammatical case etc. of
#. the inserted conditions.
#: js/ui/dateMenu.js:289
#: js/ui/dateMenu.js:291
#, javascript-format
msgid "%s all day."
msgstr "全天%s。"
@ -986,7 +986,7 @@ msgstr "全天%s。"
#. libgweather for the possible condition strings. If at all
#. possible, the sentence should match the grammatical case etc. of
#. the inserted conditions.
#: js/ui/dateMenu.js:295
#: js/ui/dateMenu.js:297
#, javascript-format
msgid "%s, then %s later."
msgstr "%s較晚%s。"
@ -995,30 +995,30 @@ msgstr "%s較晚%s。"
#. libgweather for the possible condition strings. If at all
#. possible, the sentence should match the grammatical case etc. of
#. the inserted conditions.
#: js/ui/dateMenu.js:301
#: js/ui/dateMenu.js:303
#, javascript-format
msgid "%s, then %s, followed by %s later."
msgstr "%s然後%s接著較晚%s。"
#: js/ui/dateMenu.js:312
#: js/ui/dateMenu.js:314
msgid "Select a location…"
msgstr "選擇位置…"
#: js/ui/dateMenu.js:315
#: js/ui/dateMenu.js:317
msgid "Loading…"
msgstr "載入中…"
#. Translators: %s is a temperature with unit, e.g. "23℃"
#: js/ui/dateMenu.js:321
#: js/ui/dateMenu.js:323
#, javascript-format
msgid "Feels like %s."
msgstr "體感溫度 %s。"
#: js/ui/dateMenu.js:324
#: js/ui/dateMenu.js:326
msgid "Go online for weather information"
msgstr "上線以取得天氣資訊"
#: js/ui/dateMenu.js:326
#: js/ui/dateMenu.js:328
msgid "Weather information is currently unavailable"
msgstr "天氣資訊目前不可使用"
@ -1239,13 +1239,13 @@ msgid "Leave On"
msgstr "離開"
#: js/ui/kbdA11yDialog.js:59 js/ui/status/bluetooth.js:143
#: js/ui/status/network.js:1281
#: js/ui/status/network.js:1294
msgid "Turn On"
msgstr "開啟"
#: js/ui/kbdA11yDialog.js:67 js/ui/status/bluetooth.js:143
#: js/ui/status/network.js:154 js/ui/status/network.js:337
#: js/ui/status/network.js:1281 js/ui/status/network.js:1396
#: js/ui/status/network.js:1294 js/ui/status/network.js:1409
#: js/ui/status/nightLight.js:47 js/ui/status/rfkill.js:90
#: js/ui/status/rfkill.js:117
msgid "Turn Off"
@ -1307,7 +1307,7 @@ msgstr "檢示來源"
msgid "Web Page"
msgstr "網頁"
#: js/ui/messageTray.js:1493
#: js/ui/messageTray.js:1495
msgid "System Information"
msgstr "系統資訊"
@ -1622,7 +1622,7 @@ msgid "<unknown>"
msgstr "<不明>"
#. Translators: %s is a network identifier
#: js/ui/status/network.js:441 js/ui/status/network.js:1310
#: js/ui/status/network.js:441 js/ui/status/network.js:1323
#, javascript-format
msgid "%s Off"
msgstr "%s 關閉"
@ -1648,7 +1648,7 @@ msgid "%s Disconnecting"
msgstr "%s 正在斷線"
#. Translators: %s is a network identifier
#: js/ui/status/network.js:459 js/ui/status/network.js:1302
#: js/ui/status/network.js:459 js/ui/status/network.js:1315
#, javascript-format
msgid "%s Connecting"
msgstr "正連線到 %s"
@ -1688,7 +1688,7 @@ msgid "Mobile Broadband Settings"
msgstr "行動寬頻設定值"
#. Translators: %s is a network identifier
#: js/ui/status/network.js:578 js/ui/status/network.js:1307
#: js/ui/status/network.js:578 js/ui/status/network.js:1320
#, javascript-format
msgid "%s Hardware Disabled"
msgstr "%s 硬體已停用"
@ -1744,78 +1744,78 @@ msgstr "沒有網路"
msgid "Use hardware switch to turn off"
msgstr "使用硬體開關來關閉"
#: js/ui/status/network.js:1173
#: js/ui/status/network.js:1186
msgid "Select Network"
msgstr "選擇網路"
#: js/ui/status/network.js:1179
#: js/ui/status/network.js:1192
msgid "Wi-Fi Settings"
msgstr "Wi-Fi 設定值"
#. Translators: %s is a network identifier
#: js/ui/status/network.js:1298
#: js/ui/status/network.js:1311
#, javascript-format
msgid "%s Hotspot Active"
msgstr "%s 熱點有效"
#. Translators: %s is a network identifier
#: js/ui/status/network.js:1313
#: js/ui/status/network.js:1326
#, javascript-format
msgid "%s Not Connected"
msgstr "%s 未連線"
#: js/ui/status/network.js:1413
#: js/ui/status/network.js:1426
msgid "connecting…"
msgstr "連線中…"
#. Translators: this is for network connections that require some kind of key or password
#: js/ui/status/network.js:1416
#: js/ui/status/network.js:1429
msgid "authentication required"
msgstr "要求核對"
#: js/ui/status/network.js:1418
#: js/ui/status/network.js:1431
msgid "connection failed"
msgstr "連線失敗"
#: js/ui/status/network.js:1472
#: js/ui/status/network.js:1485
msgid "VPN Settings"
msgstr "VPN 設定值"
#: js/ui/status/network.js:1485
#: js/ui/status/network.js:1498
msgid "VPN"
msgstr "VPN"
#: js/ui/status/network.js:1495
#: js/ui/status/network.js:1508
msgid "VPN Off"
msgstr "VPN 關閉"
#: js/ui/status/network.js:1559 js/ui/status/rfkill.js:93
#: js/ui/status/network.js:1572 js/ui/status/rfkill.js:93
msgid "Network Settings"
msgstr "網路設定值"
#: js/ui/status/network.js:1588
#: js/ui/status/network.js:1601
#, javascript-format
msgid "%s Wired Connection"
msgid_plural "%s Wired Connections"
msgstr[0] "%s 個有線網路連線"
#: js/ui/status/network.js:1592
#: js/ui/status/network.js:1605
#, javascript-format
msgid "%s Wi-Fi Connection"
msgid_plural "%s Wi-Fi Connections"
msgstr[0] "%s 個 Wi-Fi 連線"
#: js/ui/status/network.js:1596
#: js/ui/status/network.js:1609
#, javascript-format
msgid "%s Modem Connection"
msgid_plural "%s Modem Connections"
msgstr[0] "%s 個數據機連線"
#: js/ui/status/network.js:1728
#: js/ui/status/network.js:1741
msgid "Connection failed"
msgstr "連線失敗"
#: js/ui/status/network.js:1729
#: js/ui/status/network.js:1742
msgid "Activation of network connection failed"
msgstr "啟動網路連線失敗"
@ -1918,7 +1918,7 @@ msgstr "Thunderbolt 授權錯誤"
#: js/ui/status/thunderbolt.js:357
#, javascript-format
msgid "Could not authorize the thunderbolt device: %s"
msgid "Could not authorize the Thunderbolt device: %s"
msgstr "無法授權該 Thunderbolt 裝置:%s"
#: js/ui/status/volume.js:128

View File

@ -31,6 +31,8 @@ struct _ShellScreenshotPrivate
char *filename;
char *filename_used;
GDateTime *datetime;
cairo_surface_t *image;
cairo_rectangle_int_t screenshot_area;
@ -72,6 +74,7 @@ on_screenshot_written (GObject *source,
g_clear_pointer (&priv->image, cairo_surface_destroy);
g_clear_pointer (&priv->filename, g_free);
g_clear_pointer (&priv->filename_used, g_free);
g_clear_pointer (&priv->datetime, g_date_time_unref);
meta_enable_unredirect_for_screen (shell_global_get_screen (priv->global));
}
@ -175,6 +178,7 @@ write_screenshot_thread (GTask *result,
GOutputStream *stream;
ShellScreenshot *screenshot = SHELL_SCREENSHOT (object);
ShellScreenshotPrivate *priv;
char *creation_time;
g_assert (screenshot != NULL);
@ -193,14 +197,18 @@ write_screenshot_thread (GTask *result,
0, 0,
cairo_image_surface_get_width (priv->image),
cairo_image_surface_get_height (priv->image));
creation_time = g_date_time_format (priv->datetime, "%c");
if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
"tEXt::Software", "gnome-screenshot", NULL))
"tEXt::Software", "gnome-screenshot",
"tEXt::Creation Time", creation_time,
NULL))
status = CAIRO_STATUS_SUCCESS;
else
status = CAIRO_STATUS_WRITE_ERROR;
g_object_unref (pixbuf);
g_free (creation_time);
}
@ -241,6 +249,7 @@ do_grab_screenshot (ShellScreenshot *screenshot,
n_captures,
x, y,
width, height);
priv->datetime = g_date_time_new_now_local ();
for (i = 0; i < n_captures; i++)
cairo_surface_destroy (captures[i].image);
@ -432,6 +441,7 @@ grab_window_screenshot (ClutterActor *stage,
stex = META_SHAPED_TEXTURE (meta_window_actor_get_texture (META_WINDOW_ACTOR (window_actor)));
priv->image = meta_shaped_texture_get_image (stex, &clip);
priv->datetime = g_date_time_new_now_local ();
settings = g_settings_new (A11Y_APPS_SCHEMA);
if (priv->include_cursor && !g_settings_get_boolean (settings, MAGNIFIER_ACTIVE_KEY))

View File

@ -180,6 +180,7 @@ st_label_dispose (GObject *object)
{
StLabelPrivate *priv = ST_LABEL (object)->priv;
priv->label = NULL;
g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
G_OBJECT_CLASS (st_label_parent_class)->dispose (object);

View File

@ -117,6 +117,7 @@ _st_set_text_from_style (ClutterText *text,
const PangoFontDescription *font;
StTextAlign align;
gdouble spacing;
gchar *font_features;
st_theme_node_get_foreground_color (theme_node, &color);
clutter_text_set_color (text, &color);
@ -151,6 +152,13 @@ _st_set_text_from_style (ClutterText *text,
pango_attr_list_insert (attribs, letter_spacing);
}
font_features = st_theme_node_get_font_features (theme_node);
if (font_features)
{
pango_attr_list_insert (attribs, pango_attr_font_features_new (font_features));
g_free (font_features);
}
clutter_text_set_attributes (text, attribs);
if (attribs)

View File

@ -37,6 +37,7 @@ struct _StTextureCachePrivate
/* Things that were loaded with a cache policy != NONE */
GHashTable *keyed_cache; /* char * -> CoglTexture* */
GHashTable *keyed_surface_cache; /* char * -> cairo_surface_t* */
/* Presently this is used to de-duplicate requests for GIcons and async URIs. */
GHashTable *outstanding_requests; /* char * -> AsyncTextureLoadData * */
@ -145,6 +146,10 @@ st_texture_cache_init (StTextureCache *self)
self->priv->keyed_cache = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, cogl_object_unref);
self->priv->keyed_surface_cache = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
(GDestroyNotify) cairo_surface_destroy);
self->priv->outstanding_requests = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
self->priv->file_monitors = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal,
@ -166,6 +171,7 @@ st_texture_cache_dispose (GObject *object)
}
g_clear_pointer (&self->priv->keyed_cache, g_hash_table_destroy);
g_clear_pointer (&self->priv->keyed_surface_cache, g_hash_table_destroy);
g_clear_pointer (&self->priv->outstanding_requests, g_hash_table_destroy);
g_clear_pointer (&self->priv->file_monitors, g_hash_table_destroy);
@ -520,6 +526,8 @@ finish_texture_load (AsyncTextureLoadData *data,
goto out;
texdata = pixbuf_to_cogl_texture (pixbuf);
if (!texdata)
goto out;
if (data->policy != ST_TEXTURE_CACHE_POLICY_NONE)
{
@ -986,7 +994,7 @@ file_changed_cb (GFileMonitor *monitor,
g_free (key);
key = g_strdup_printf (CACHE_PREFIX_FILE_FOR_CAIRO "%u", file_hash);
g_hash_table_remove (cache->priv->keyed_cache, key);
g_hash_table_remove (cache->priv->keyed_surface_cache, key);
g_free (key);
g_signal_emit (cache, signals[TEXTURE_FILE_CHANGED], 0, file);
@ -1273,6 +1281,9 @@ st_texture_cache_load_file_sync_to_cogl_texture (StTextureCache *cache,
texdata = pixbuf_to_cogl_texture (pixbuf);
g_object_unref (pixbuf);
if (!texdata)
goto out;
if (policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
{
cogl_object_ref (texdata);
@ -1304,7 +1315,7 @@ st_texture_cache_load_file_sync_to_cairo_surface (StTextureCache *cache,
key = g_strdup_printf (CACHE_PREFIX_FILE_FOR_CAIRO "%u", g_file_hash (file));
surface = g_hash_table_lookup (cache->priv->keyed_cache, key);
surface = g_hash_table_lookup (cache->priv->keyed_surface_cache, key);
if (surface == NULL)
{
@ -1318,7 +1329,8 @@ st_texture_cache_load_file_sync_to_cairo_surface (StTextureCache *cache,
if (policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
{
cairo_surface_reference (surface);
g_hash_table_insert (cache->priv->keyed_cache, g_strdup (key), surface);
g_hash_table_insert (cache->priv->keyed_surface_cache,
g_strdup (key), surface);
}
}
else

View File

@ -3019,6 +3019,39 @@ st_theme_node_get_font (StThemeNode *node)
return node->font_desc;
}
gchar *
st_theme_node_get_font_features (StThemeNode *node)
{
int i;
ensure_properties (node);
for (i = node->n_properties - 1; i >= 0; i--)
{
CRDeclaration *decl = node->properties[i];
if (strcmp (decl->property->stryng->str, "font-feature-settings") == 0)
{
CRTerm *term = decl->value;
if (!term->next && term->type == TERM_IDENT)
{
gchar *ident = term->content.str->stryng->str;
if (strcmp (ident, "inherit") == 0)
break;
if (strcmp (ident, "normal") == 0)
return NULL;
}
return (gchar *)cr_term_to_string (term);
}
}
return node->parent_node ? st_theme_node_get_font_features (node->parent_node) : NULL;
}
/**
* st_theme_node_get_border_image:
* @node: a #StThemeNode

View File

@ -232,6 +232,8 @@ double st_theme_node_get_letter_spacing (StThemeNode *node);
*/
const PangoFontDescription *st_theme_node_get_font (StThemeNode *node);
gchar *st_theme_node_get_font_features (StThemeNode *node);
StBorderImage *st_theme_node_get_border_image (StThemeNode *node);
StShadow *st_theme_node_get_box_shadow (StThemeNode *node);
StShadow *st_theme_node_get_text_shadow (StThemeNode *node);

View File

@ -59,6 +59,24 @@ assert_font (StThemeNode *node,
g_free (value);
}
static void
assert_font_features (StThemeNode *node,
const char *node_description,
const char *expected)
{
char *value = st_theme_node_get_font_features (node);
if (g_strcmp0 (expected, value) != 0)
{
g_print ("%s: %s.font-feature-settings: expected: %s, got: %s\n",
test, node_description, expected, value);
fail = TRUE;
}
if (value)
g_free (value);
}
static char *
text_decoration_to_string (StTextDecoration decoration)
{
@ -396,7 +414,7 @@ test_background (void)
/* text1 inherits the background image but not the color */
assert_background_color (text1, "text1", 0x00000000);
assert_background_image (text1, "text1", "st/some-background.png");
/* text1 inherits inherits both, but then background: none overrides both */
/* text2 inherits both, but then background: none overrides both */
assert_background_color (text2, "text2", 0x00000000);
assert_background_image (text2, "text2", NULL);
/* background-image property */
@ -413,6 +431,22 @@ test_font (void)
assert_font (text3, "text3", "serif Bold Oblique Small-Caps 24px");
}
static void
test_font_features (void)
{
test = "font_features";
/* group1 has font-feature-settings: "tnum" */
assert_font_features (group1, "group1", "\"tnum\"");
/* text2 should inherit from group1 */
assert_font_features (text2, "text2", "\"tnum\"");
/* group2 has font-feature-settings: "tnum", "zero" */
assert_font_features (group2, "group2", "\"tnum\", \"zero\"");
/* text3 should inherit from group2 using the inherit keyword */
assert_font_features (text3, "text3", "\"tnum\", \"zero\"");
/* text4 has font-feature-settings: normal */
assert_font_features (text4, "text4", NULL);
}
static void
test_pseudo_class (void)
{
@ -554,6 +588,7 @@ main (int argc, char **argv)
test_border ();
test_background ();
test_font ();
test_font_features ();
test_pseudo_class ();
test_inline_style ();

View File

@ -13,6 +13,8 @@ stage {
margin-left: 1in;
background: #ff0000 url('some-background.png');
font-feature-settings: "tnum";
}
#text1 {
@ -35,6 +37,7 @@ ClutterTexture.special-text {
#group2 {
font: italic 12px serif;
font-feature-settings: "tnum", "zero";
}
#text3 {
@ -42,6 +45,11 @@ ClutterTexture.special-text {
font-weight: bold;
font-style: oblique;
font-size: 200%;
font-feature-settings: "pnum";
}
#text4 {
font-feature-settings: normal;
}
ClutterTexture {
@ -60,6 +68,10 @@ stage > #text2 {
color: #ff0000;
}
#group2 > #text3 {
font-feature-settings: inherit;
}
#group2 {
background-image: url('other-background.png');
padding: 1px 2px 3px 4px;