[gnome-shell] st: Remove StIconType
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st: Remove StIconType
- Date: Wed, 29 Aug 2012 19:41:25 +0000 (UTC)
commit c21b1e5fe00a99936f67d358a931f3083304ebc8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed May 30 09:58:37 2012 -0400
st: Remove StIconType
GTK+ works by explicitly specifying a -symbolic suffix for all icons.
Do the same here.
https://bugzilla.gnome.org/show_bug.cgi?id=682540
js/ui/autorunManager.js | 2 +-
js/ui/ctrlAltTab.js | 1 -
js/ui/dash.js | 5 +--
js/ui/endSessionDialog.js | 5 +--
js/ui/keyboard.js | 2 +-
js/ui/lookingGlass.js | 1 -
js/ui/messageTray.js | 6 +--
js/ui/notificationDaemon.js | 1 -
js/ui/overview.js | 2 +-
js/ui/panel.js | 2 +-
js/ui/panelMenu.js | 1 -
js/ui/remoteSearch.js | 6 +--
js/ui/shellMountOperation.js | 2 +-
js/ui/status/accessibility.js | 2 +-
js/ui/status/bluetooth.js | 8 ++--
js/ui/status/network.js | 45 +++++++++++------------
js/ui/status/power.js | 3 +-
js/ui/status/volume.js | 10 +++---
js/ui/telepathyClient.js | 11 ++----
js/ui/userMenu.js | 25 ++++++-------
js/ui/viewSelector.js | 12 +++----
js/ui/wanda.js | 5 +--
src/gnome-shell-extension-tool.in | 3 +-
src/st/st-entry.c | 3 +-
src/st/st-icon.c | 73 +------------------------------------
src/st/st-icon.h | 3 --
src/st/st-private.c | 52 --------------------------
src/st/st-private.h | 2 -
src/st/st-texture-cache.c | 60 ++++++-------------------------
src/st/st-texture-cache.h | 1 -
src/st/st-types.h | 5 ---
tests/interactive/icons.js | 35 +++++++-----------
32 files changed, 94 insertions(+), 300 deletions(-)
---
diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js
index e93fbfc..2776fbb 100644
--- a/js/ui/autorunManager.js
+++ b/js/ui/autorunManager.js
@@ -261,7 +261,7 @@ const AutorunResidentSource = new Lang.Class({
Extends: MessageTray.Source,
_init: function() {
- this.parent(_("Removable Devices"), 'media-removable', St.IconType.FULLCOLOR);
+ this.parent(_("Removable Devices"), 'media-removable');
this.showInLockScreen = false;
this._mounts = [];
diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js
index 3462eac..bd9bb14 100644
--- a/js/ui/ctrlAltTab.js
+++ b/js/ui/ctrlAltTab.js
@@ -318,7 +318,6 @@ const CtrlAltTabSwitcher = new Lang.Class({
let icon = item.iconActor;
if (!icon) {
icon = new St.Icon({ icon_name: item.iconName,
- icon_type: St.IconType.SYMBOLIC,
icon_size: POPUP_APPICON_SIZE });
}
box.add(icon, { x_fill: false, y_fill: false } );
diff --git a/js/ui/dash.js b/js/ui/dash.js
index b4de3ea..6299765 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -256,10 +256,9 @@ const ShowAppsIcon = new Lang.Class({
_createIcon: function(size) {
this._iconActor = new St.Icon({ icon_name: 'view-grid-symbolic',
+ icon_size: size,
style_class: 'show-apps-icon',
- track_hover: true,
- icon_type: St.IconType.SYMBOLIC,
- icon_size: size });
+ track_hover: true });
return this._iconActor;
},
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index d9f9893..a487196 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -89,7 +89,7 @@ const shutdownDialogContent = {
label: C_("button", "Restart") },
{ signal: 'ConfirmedShutdown',
label: C_("button", "Power Off") }],
- iconName: 'system-shutdown',
+ iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
@@ -104,7 +104,7 @@ const restartDialogContent = {
endDescription: _("Restarting the system."),
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart") }],
- iconName: 'system-shutdown',
+ iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
@@ -327,7 +327,6 @@ const EndSessionDialog = new Lang.Class({
let textureCache = St.TextureCache.get_default();
let icon = textureCache.load_icon_name(this._iconBin.get_theme_node(),
iconName,
- St.IconType.SYMBOLIC,
_DIALOG_ICON_SIZE);
this._iconBin.child = icon;
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index fcacc50..57e4db4 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -542,7 +542,7 @@ const KeyboardSource = new Lang.Class({
_init: function(keyboard) {
this._keyboard = keyboard;
- this.parent(_("Keyboard"), 'input-keyboard', St.IconType.SYMBOLIC);
+ this.parent(_("Keyboard"), 'input-keyboard-symbolic');
},
handleSummaryClick: function() {
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index ac89d43..33f5c86 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -869,7 +869,6 @@ const LookingGlass = new Lang.Class({
let toolbar = new St.BoxLayout({ name: 'Toolbar' });
this.actor.add_actor(toolbar);
let inspectIcon = new St.Icon({ icon_name: 'gtk-color-picker',
- icon_type: St.IconType.FULLCOLOR,
icon_size: 24 });
toolbar.add_actor(inspectIcon);
inspectIcon.reactive = true;
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 2a33a1c..9d15597 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1034,10 +1034,9 @@ const Source = new Lang.Class({
SOURCE_ICON_SIZE: 48,
- _init: function(title, iconName, iconType) {
+ _init: function(title, iconName) {
this.title = title;
this.iconName = iconName;
- this.iconType = iconType;
this.isTransient = false;
this.isChat = false;
@@ -1084,7 +1083,6 @@ const Source = new Lang.Class({
// something more fancy.
createIcon: function(size) {
return new St.Icon({ icon_name: this.iconName,
- icon_type: this.iconType,
icon_size: size });
},
@@ -2461,7 +2459,7 @@ const SystemNotificationSource = new Lang.Class({
Extends: Source,
_init: function() {
- this.parent(_("System Information"), 'dialog-information', St.IconType.SYMBOLIC);
+ this.parent(_("System Information"), 'dialog-information-symbolic');
this.setTransient(true);
},
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index 80803cf..fb580fe 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -357,7 +357,6 @@ const NotificationDaemon = new Lang.Class({
let gicon = this._iconForNotificationData(icon, hints);
let iconActor = new St.Icon({ gicon: gicon,
- icon_type: St.IconType.FULLCOLOR,
icon_size: MessageTray.NOTIFICATION_ICON_SIZE });
if (notification == null) {
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 2c706a2..a319a3b 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -210,7 +210,7 @@ const Overview = new Lang.Class({
// Translators: this is the name of the dock/favorites area on
// the left of the overview
- Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks');
+ Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks-symbolic');
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
this._relayout();
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 631a0a1..28a5ca3 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -968,7 +968,7 @@ const Panel = new Lang.Class({
this._menus.addMenu(this._dateMenu.menu);
Main.layoutManager.panelBox.add(this.actor);
- Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here',
+ Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.TOP });
},
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 3e48f62..0983a92 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -242,7 +242,6 @@ const SystemStatusButton = new Lang.Class({
addIcon: function(gicon) {
let icon = new St.Icon({ gicon: gicon,
- icon_type: St.IconType.SYMBOLIC,
style_class: 'system-status-icon' });
this._box.add_actor(icon);
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 2004dc3..35176f4 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -117,8 +117,7 @@ const RemoteSearchProvider = new Lang.Class({
createIcon: function(size, meta) {
if (meta['gicon']) {
return new St.Icon({ gicon: Gio.icon_new_for_string(meta['gicon']),
- icon_size: size,
- icon_type: St.IconType.FULLCOLOR });
+ icon_size: size });
} else if (meta['icon-data']) {
let [width, height, rowStride, hasAlpha,
bitsPerSample, nChannels, data] = meta['icon-data'];
@@ -129,8 +128,7 @@ const RemoteSearchProvider = new Lang.Class({
// Ugh, but we want to fall back to something ...
return new St.Icon({ icon_name: 'text-x-generic',
- icon_size: size,
- icon_type: St.IconType.FULLCOLOR });
+ icon_size: size });
},
_getResultsFinished: function(results, error) {
diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js
index 907df11..06eb814 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -240,7 +240,7 @@ const ShellUnmountNotifier = new Lang.Class({
Extends: MessageTray.Source,
_init: function() {
- this.parent('', 'media-removable', St.IconType.FULLCOLOR);
+ this.parent('', 'media-removable');
this._notification = null;
Main.messageTray.add(this);
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index a2409f6..d06dd25 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -36,7 +36,7 @@ const ATIndicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('preferences-desktop-accessibility', _("Accessibility"));
+ this.parent('preferences-desktop-accessibility-symbolic', _("Accessibility"));
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index c9ba1fc..5086d77 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -24,7 +24,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('bluetooth-disabled', _("Bluetooth"));
+ this.parent('bluetooth-disabled-symbolic', _("Bluetooth"));
this._applet = new GnomeBluetoothApplet.Applet();
@@ -111,10 +111,10 @@ const Indicator = new Lang.Class({
if (on) {
this._discoverable.actor.show();
- this.setIcon('bluetooth-active');
+ this.setIcon('bluetooth-active-symbolic');
} else {
this._discoverable.actor.hide();
- this.setIcon('bluetooth-disabled');
+ this.setIcon('bluetooth-disabled-symbolic');
}
},
@@ -306,7 +306,7 @@ const Indicator = new Lang.Class({
_ensureSource: function() {
if (!this._source) {
- this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active', St.IconType.SYMBOLIC);
+ this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active-symbolic');
Main.messageTray.add(this._source);
}
},
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 72cea77..980563e 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -122,7 +122,7 @@ const NMNetworkMenuItem = new Lang.Class({
this._secureIcon = new St.Icon({ style_class: 'popup-menu-icon' });
if (this.bestAP._secType != NMAccessPointSecurity.UNKNOWN &&
this.bestAP._secType != NMAccessPointSecurity.NONE)
- this._secureIcon.icon_name = 'network-wireless-encrypted';
+ this._secureIcon.icon_name = 'network-wireless-encrypted-symbolic';
this._icons.add_actor(this._secureIcon);
},
@@ -133,9 +133,9 @@ const NMNetworkMenuItem = new Lang.Class({
_getIcon: function() {
if (this.bestAP.mode == NM80211Mode.ADHOC)
- return 'network-workgroup';
+ return 'network-workgroup-symbolic';
else
- return 'network-wireless-signal-' + signalToIcon(this.bestAP.strength);
+ return 'network-wireless-signal-' + signalToIcon(this.bestAP.strength) + '-symbolic';
}
});
@@ -761,7 +761,7 @@ const NMDeviceModem = new Lang.Class({
},
_getSignalIcon: function() {
- return 'network-cellular-signal-' + signalToIcon(this.mobileDevice.signal_quality);
+ return 'network-cellular-signal-' + signalToIcon(this.mobileDevice.signal_quality) + '-symbolic';
},
_createSection: function() {
@@ -1469,7 +1469,7 @@ const NMDeviceWireless = new Lang.Class({
{ reactive: false });
else
this._activeConnectionItem = new PopupMenu.PopupImageMenuItem(title,
- 'network-wireless-connected',
+ 'network-wireless-connected-symbolic',
{ reactive: false });
this._activeConnectionItem.setShowDot(true);
},
@@ -1570,7 +1570,7 @@ const NMApplet = new Lang.Class({
_init: function() {
this.parent('network-offline', _('Network'));
- this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn' }));
+ this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn-symbolic' }));
this.secondaryIcon.hide();
this._isLocked = false;
@@ -1689,8 +1689,7 @@ const NMApplet = new Lang.Class({
_ensureSource: function() {
if (!this._source) {
this._source = new MessageTray.Source(_("Network Manager"),
- 'network-transmit-receive',
- St.IconType.SYMBOLIC);
+ 'network-transmit-receive-symbolic');
this._source.connect('destroy', Lang.bind(this, function() {
this._source = null;
@@ -1761,7 +1760,6 @@ const NMApplet = new Lang.Class({
this._ensureSource();
let icon = new St.Icon({ icon_name: iconName,
- icon_type: St.IconType.SYMBOLIC,
icon_size: MessageTray.NOTIFICATION_ICON_SIZE });
device._notification = new MessageTray.Notification(this._source, title, text,
{ icon: icon });
@@ -1804,7 +1802,6 @@ const NMApplet = new Lang.Class({
let wrapperClass = this._dtypes[device.get_device_type()];
if (wrapperClass) {
let wrapper = this._makeWrapperDevice(wrapperClass, device);
-
let section = this._devices[wrapper.category].section;
let devices = this._devices[wrapper.category].devices;
@@ -2075,7 +2072,7 @@ const NMApplet = new Lang.Class({
this.actor.visible = this.mainIcon.visible && !this._isLocked;
if (!this._client.networking_enabled) {
- this.setIcon('network-offline');
+ this.setIcon('network-offline-symbolic');
this._hideDevices();
this._statusItem.label.text = _("Networking is disabled");
this._statusSection.actor.show();
@@ -2093,22 +2090,22 @@ const NMApplet = new Lang.Class({
let hasMobileIcon = false;
if (!mc) {
- this.setIcon('network-offline');
+ this.setIcon('network-offline-symbolic');
} else if (mc.state == NetworkManager.ActiveConnectionState.ACTIVATING) {
switch (mc._section) {
case NMConnectionCategory.WWAN:
- this.setIcon('network-cellular-acquiring');
+ this.setIcon('network-cellular-acquiring-symbolic');
break;
case NMConnectionCategory.WIRELESS:
- this.setIcon('network-wireless-acquiring');
+ this.setIcon('network-wireless-acquiring-symbolic');
break;
case NMConnectionCategory.WIRED:
- this.setIcon('network-wired-acquiring');
+ this.setIcon('network-wired-acquiring-symbolic');
break;
default:
// fallback to a generic connected icon
// (it could be a private connection of some other user)
- this.setIcon('network-wired-acquiring');
+ this.setIcon('network-wired-acquiring-symbolic');
}
} else {
let dev;
@@ -2123,17 +2120,17 @@ const NMApplet = new Lang.Class({
log('An active wireless connection, in infrastructure mode, involves no access point?');
break;
}
- this.setIcon('network-wireless-connected');
+ this.setIcon('network-wireless-connected-symbolic');
} else {
if (this._activeAccessPoint != ap) {
if (this._accessPointUpdateId)
this._activeAccessPoint.disconnect(this._accessPointUpdateId);
this._activeAccessPoint = ap;
this._activeAccessPointUpdateId = ap.connect('notify::strength', Lang.bind(this, function() {
- this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength));
+ this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength) + '-symbolic');
}));
}
- this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength));
+ this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength) + '-symbolic');
hasApIcon = true;
}
break;
@@ -2142,7 +2139,7 @@ const NMApplet = new Lang.Class({
break;
}
case NMConnectionCategory.WIRED:
- this.setIcon('network-wired');
+ this.setIcon('network-wired-symbolic');
break;
case NMConnectionCategory.WWAN:
dev = mc._primaryDevice;
@@ -2152,7 +2149,7 @@ const NMApplet = new Lang.Class({
}
if (!dev.mobileDevice) {
// this can happen for bluetooth in PAN mode
- this.setIcon('network-cellular-connected');
+ this.setIcon('network-cellular-connected-symbolic');
break;
}
@@ -2161,16 +2158,16 @@ const NMApplet = new Lang.Class({
this._mobileUpdateDevice.disconnect(this._mobileUpdateId);
this._mobileUpdateDevice = dev.mobileDevice;
this._mobileUpdateId = dev.mobileDevice.connect('notify::signal-quality', Lang.bind(this, function() {
- this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality));
+ this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality) + '-symbolic');
}));
}
- this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality));
+ this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality) + '-symbolic');
hasMobileIcon = true;
break;
default:
// fallback to a generic connected icon
// (it could be a private connection of some other user)
- this.setIcon('network-wired');
+ this.setIcon('network-wired-symbolic');
break;
}
}
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 195422f..ea76549 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -52,7 +52,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('battery-missing', _("Battery"));
+ this.parent('battery-missing-symbolic', _("Battery"));
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
@@ -182,7 +182,6 @@ const DeviceItem = new Lang.Class({
this._label = new St.Label({ text: this._deviceTypeToString(device_type) });
this._icon = new St.Icon({ gicon: Gio.icon_new_for_string(icon),
- icon_type: St.IconType.SYMBOLIC,
style_class: 'popup-menu-icon' });
this._box.add_actor(this._icon);
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index ab383dc..70343d6 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -156,14 +156,14 @@ const VolumeMenu = new Lang.Class({
_volumeToIcon: function(volume) {
if (volume <= 0) {
- return 'audio-volume-muted';
+ return 'audio-volume-muted-symbolic';
} else {
let n = Math.floor(3 * volume / this._volumeMax) + 1;
if (n < 2)
- return 'audio-volume-low';
+ return 'audio-volume-low-symbolic';
if (n >= 3)
- return 'audio-volume-high';
- return 'audio-volume-medium';
+ return 'audio-volume-high-symbolic';
+ return 'audio-volume-medium-symbolic';
}
},
@@ -197,7 +197,7 @@ const VolumeMenu = new Lang.Class({
slider.setValue(muted ? 0 : (this[property].volume / this._volumeMax));
if (property == '_output') {
if (muted)
- this.emit('icon-changed', 'audio-volume-muted');
+ this.emit('icon-changed', 'audio-volume-muted-symbolic');
else
this.emit('icon-changed', this._volumeToIcon(this._output.volume));
}
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index ffa84dd..08218d7 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -383,8 +383,7 @@ const Client = new Lang.Class({
_ensureSubscriptionSource: function() {
if (this._subscriptionSource == null) {
this._subscriptionSource = new MessageTray.Source(_("Subscription request"),
- 'gtk-dialog-question',
- St.IconType.FULLCOLOR);
+ 'gtk-dialog-question');
Main.messageTray.add(this._subscriptionSource);
this._subscriptionSource.connect('destroy', Lang.bind(this, function () {
this._subscriptionSource = null;
@@ -420,8 +419,7 @@ const Client = new Lang.Class({
_ensureAccountSource: function() {
if (this._accountSource == null) {
this._accountSource = new MessageTray.Source(_("Connection error"),
- 'gtk-dialog-error',
- St.IconType.FULLCOLOR);
+ 'gtk-dialog-error');
Main.messageTray.add(this._accountSource);
this._accountSource.connect('destroy', Lang.bind(this, function () {
this._accountSource = null;
@@ -497,7 +495,6 @@ const ChatSource = new Lang.Class({
this._iconBox.child = textureCache.load_uri_async(uri, this._iconBox._size, this._iconBox._size);
} else {
this._iconBox.child = new St.Icon({ icon_name: 'avatar-default',
- icon_type: St.IconType.FULLCOLOR,
icon_size: this._iconBox._size });
}
@@ -506,8 +503,7 @@ const ChatSource = new Lang.Class({
createSecondaryIcon: function() {
let iconBox = new St.Bin();
- iconBox.child = new St.Icon({ style_class: 'secondary-icon',
- icon_type: St.IconType.FULLCOLOR });
+ iconBox.child = new St.Icon({ style_class: 'secondary-icon' });
let presenceType = this._contact.get_presence_type();
switch (presenceType) {
@@ -1197,7 +1193,6 @@ const SubscriptionRequestNotification = new Lang.Class({
}
else {
iconBox.child = new St.Icon({ icon_name: 'avatar-default',
- icon_type: St.IconType.FULLCOLOR,
icon_size: iconBox._size });
}
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index 7b05145..3d8c7f2 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -67,7 +67,6 @@ const UserAvatarWidget = new Lang.Class({
} else {
this.actor.style = null;
this.actor.child = new St.Icon({ icon_name: 'avatar-default',
- icon_type: St.IconType.SYMBOLIC,
icon_size: DIALOG_ICON_SIZE });
}
}
@@ -164,22 +163,22 @@ const IMStatusChooserItem = new Lang.Class({
let item;
- item = new IMStatusItem(_("Available"), 'user-available');
+ item = new IMStatusItem(_("Available"), 'user-available-symbolic');
this._combo.addMenuItem(item, IMStatus.AVAILABLE);
- item = new IMStatusItem(_("Busy"), 'user-busy');
+ item = new IMStatusItem(_("Busy"), 'user-busy-symbolic');
this._combo.addMenuItem(item, IMStatus.BUSY);
- item = new IMStatusItem(_("Invisible"), 'user-invisible');
+ item = new IMStatusItem(_("Invisible"), 'user-invisible-symbolic');
this._combo.addMenuItem(item, IMStatus.HIDDEN);
- item = new IMStatusItem(_("Away"), 'user-away');
+ item = new IMStatusItem(_("Away"), 'user-away-symbolic');
this._combo.addMenuItem(item, IMStatus.AWAY);
- item = new IMStatusItem(_("Idle"), 'user-idle');
+ item = new IMStatusItem(_("Idle"), 'user-idle-symbolic');
this._combo.addMenuItem(item, IMStatus.IDLE);
- item = new IMStatusItem(_("Unavailable"), 'user-offline');
+ item = new IMStatusItem(_("Unavailable"), 'user-offline-symbolic');
this._combo.addMenuItem(item, IMStatus.OFFLINE);
this._combo.connect('active-item-changed',
@@ -480,17 +479,17 @@ const UserMenuButton = new Lang.Class({
box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false });
let textureCache = St.TextureCache.get_default();
- this._offlineIcon = new St.Icon({ icon_name: 'user-offline',
+ this._offlineIcon = new St.Icon({ icon_name: 'user-offline-symbolic',
style_class: 'popup-menu-icon' });
- this._availableIcon = new St.Icon({ icon_name: 'user-available',
+ this._availableIcon = new St.Icon({ icon_name: 'user-available-symbolic',
style_class: 'popup-menu-icon' });
- this._busyIcon = new St.Icon({ icon_name: 'user-busy',
+ this._busyIcon = new St.Icon({ icon_name: 'user-busy-symbolic',
style_class: 'popup-menu-icon' });
- this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible',
+ this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible-symbolic',
style_class: 'popup-menu-icon' });
- this._awayIcon = new St.Icon({ icon_name: 'user-away',
+ this._awayIcon = new St.Icon({ icon_name: 'user-away-symbolic',
style_class: 'popup-menu-icon' });
- this._idleIcon = new St.Icon({ icon_name: 'user-idle',
+ this._idleIcon = new St.Icon({ icon_name: 'user-idle-symbolic',
style_class: 'popup-menu-icon' });
this._pendingIcon = new St.Icon({ icon_name: 'user-status-pending',
style_class: 'popup-menu-icon' });
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 36626b2..1d4a953 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -73,11 +73,9 @@ const ViewSelector = new Lang.Class({
global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));
this._inactiveIcon = new St.Icon({ style_class: 'search-entry-icon',
- icon_name: 'edit-find',
- icon_type: St.IconType.SYMBOLIC });
+ icon_name: 'edit-find-symbolic' });
this._activeIcon = new St.Icon({ style_class: 'search-entry-icon',
- icon_name: 'edit-clear',
- icon_type: St.IconType.SYMBOLIC });
+ icon_name: 'edit-clear-symbolic' });
this._entry.set_secondary_icon(this._inactiveIcon);
this._iconClickedId = 0;
@@ -85,15 +83,15 @@ const ViewSelector = new Lang.Class({
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
this._workspacesPage = this._addPage(this._workspacesDisplay.actor, null,
- _("Windows"), 'text-x-generic');
+ _("Windows"), 'text-x-generic-symbolic');
this._appDisplay = new AppDisplay.AllAppDisplay();
this._appsPage = this._addPage(this._appDisplay.actor, null,
- _("Applications"), 'system-run');
+ _("Applications"), 'system-run-symbolic');
this._searchResults = new SearchDisplay.SearchResults(this._searchSystem);
this._searchPage = this._addPage(this._searchResults.actor, this._entry,
- _("Search"), 'edit-find');
+ _("Search"), 'edit-find-symbolic');
// Default search providers
// Wanda comes obviously first
diff --git a/js/ui/wanda.js b/js/ui/wanda.js
index e02e7f4..c37ff29 100644
--- a/js/ui/wanda.js
+++ b/js/ui/wanda.js
@@ -55,9 +55,7 @@ const WandaIcon = new Lang.Class({
if (!this._imageFile) {
return new St.Icon({ icon_name: 'face-smile',
- icon_type: St.IconType.FULLCOLOR,
- icon_size: iconSize
- });
+ icon_size: iconSize });
}
this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight);
@@ -183,7 +181,6 @@ const WandaSearchProvider = new Lang.Class({
// triggers an assertion failure)
return St.TextureCache.get_default().load_icon_name(null,
'face-smile',
- St.IconType.FULLCOLOR,
iconSize);
}
}]);
diff --git a/src/gnome-shell-extension-tool.in b/src/gnome-shell-extension-tool.in
index 222bcb3..988271f 100644
--- a/src/gnome-shell-extension-tool.in
+++ b/src/gnome-shell-extension-tool.in
@@ -59,8 +59,7 @@ function init() {
x_fill: true,
y_fill: false,
track_hover: true });
- let icon = new St.Icon({ icon_name: 'system-run',
- icon_type: St.IconType.SYMBOLIC,
+ let icon = new St.Icon({ icon_name: 'system-run-symbolic',
style_class: 'system-status-icon' });
button.set_child(icon);
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index a035cd2..e4c35a2 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -172,8 +172,7 @@ show_capslock_feedback (StEntry *entry)
{
ClutterActor *icon = g_object_new (ST_TYPE_ICON,
"style-class", "capslock-warning",
- "icon-type", ST_ICON_SYMBOLIC,
- "icon-name", "dialog-warning",
+ "icon-name", "dialog-warning-symbolic",
NULL);
st_entry_set_secondary_icon (entry, icon);
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index ba04a5b..d608672 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -37,7 +37,6 @@ enum
PROP_GICON,
PROP_ICON_NAME,
- PROP_ICON_TYPE,
PROP_ICON_SIZE
};
@@ -53,7 +52,6 @@ struct _StIconPrivate
guint opacity_handler_id;
GIcon *gicon;
- StIconType icon_type;
gint prop_icon_size; /* icon size set as property */
gint theme_icon_size; /* icon size from theme node */
gint icon_size; /* icon size we are using */
@@ -68,7 +66,6 @@ static void st_icon_update (StIcon *icon);
static gboolean st_icon_update_icon_size (StIcon *icon);
#define DEFAULT_ICON_SIZE 48
-#define DEFAULT_ICON_TYPE ST_ICON_SYMBOLIC
static void
st_icon_set_property (GObject *gobject,
@@ -88,10 +85,6 @@ st_icon_set_property (GObject *gobject,
st_icon_set_icon_name (icon, g_value_get_string (value));
break;
- case PROP_ICON_TYPE:
- st_icon_set_icon_type (icon, g_value_get_enum (value));
- break;
-
case PROP_ICON_SIZE:
st_icon_set_icon_size (icon, g_value_get_int (value));
break;
@@ -120,10 +113,6 @@ st_icon_get_property (GObject *gobject,
g_value_set_string (value, st_icon_get_icon_name (icon));
break;
- case PROP_ICON_TYPE:
- g_value_set_enum (value, st_icon_get_icon_type (icon));
- break;
-
case PROP_ICON_SIZE:
g_value_set_int (value, st_icon_get_icon_size (icon));
break;
@@ -343,14 +332,6 @@ st_icon_class_init (StIconClass *klass)
NULL, ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
g_object_class_install_property (object_class, PROP_ICON_NAME, pspec);
- pspec = g_param_spec_enum ("icon-type",
- "Icon type",
- "The type of icon that should be used",
- ST_TYPE_ICON_TYPE,
- DEFAULT_ICON_TYPE,
- ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
- g_object_class_install_property (object_class, PROP_ICON_TYPE, pspec);
-
pspec = g_param_spec_int ("icon-size",
"Icon size",
"The size if the icon, if positive. Otherwise the size will be derived from the current style",
@@ -366,7 +347,6 @@ st_icon_init (StIcon *self)
self->priv->icon_size = DEFAULT_ICON_SIZE;
self->priv->prop_icon_size = -1;
- self->priv->icon_type = DEFAULT_ICON_TYPE;
self->priv->shadow_material = COGL_INVALID_HANDLE;
self->priv->shadow_width = -1;
@@ -564,12 +544,7 @@ st_icon_set_icon_name (StIcon *icon,
g_object_unref (priv->gicon);
if (icon_name)
- {
- if (priv->icon_type == ST_ICON_SYMBOLIC)
- priv->gicon = _st_make_symbolic_themed_icon (icon_name);
- else
- priv->gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
- }
+ priv->gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
else
priv->gicon = NULL;
@@ -580,52 +555,6 @@ st_icon_set_icon_name (StIcon *icon,
}
/**
- * st_icon_get_icon_type:
- * @icon: a #StIcon
- *
- * Gets the type of icon we'll look up to display in the actor.
- * See st_icon_set_icon_type().
- *
- * Return value: the icon type.
- */
-StIconType
-st_icon_get_icon_type (StIcon *icon)
-{
- g_return_val_if_fail (ST_IS_ICON (icon), DEFAULT_ICON_TYPE);
-
- return icon->priv->icon_type;
-}
-
-/**
- * st_icon_set_icon_type:
- * @icon: a #StIcon
- * @icon_type: the type of icon to use
- *
- * Sets the type of icon we'll look up to display in the actor.
- * The icon type determines whether we use a symbolic icon or
- * a full color icon and also is used for specific handling for
- * application and document icons.
- */
-void
-st_icon_set_icon_type (StIcon *icon,
- StIconType icon_type)
-{
- StIconPrivate *priv;
-
- g_return_if_fail (ST_IS_ICON (icon));
-
- priv = icon->priv;
-
- if (icon_type == priv->icon_type)
- return;
-
- priv->icon_type = icon_type;
- st_icon_update (icon);
-
- g_object_notify (G_OBJECT (icon), "icon-type");
-}
-
-/**
* st_icon_get_gicon:
* @icon: an icon
*
diff --git a/src/st/st-icon.h b/src/st/st-icon.h
index eac4a16..cb7b568 100644
--- a/src/st/st-icon.h
+++ b/src/st/st-icon.h
@@ -88,9 +88,6 @@ ClutterActor* st_icon_new (void);
const gchar *st_icon_get_icon_name (StIcon *icon);
void st_icon_set_icon_name (StIcon *icon, const gchar *icon_name);
-void st_icon_set_icon_type (StIcon *icon, StIconType icon_type);
-StIconType st_icon_get_icon_type (StIcon *icon);
-
gint st_icon_get_icon_size (StIcon *icon);
void st_icon_set_icon_size (StIcon *icon, gint size);
diff --git a/src/st/st-private.c b/src/st/st-private.c
index b34b3e4..bab1d3c 100644
--- a/src/st/st-private.c
+++ b/src/st/st-private.c
@@ -691,55 +691,3 @@ _st_paint_shadow_with_opacity (StShadow *shadow_spec,
shadow_box.x2, shadow_box.y2,
0, 0, 1, 1);
}
-
-/* generates names like g_themed_icon_new_with_default_fallbacks(),
- * but *only* symbolic names
- */
-static char **
-symbolic_names_for_icon (const char *name)
-{
- char **parts, **names;
- int i, numnames;
-
- parts = g_strsplit (name, "-", -1);
- numnames = g_strv_length (parts);
- names = g_new (char *, numnames + 1);
- for (i = 0; parts[i]; i++)
- {
- if (i == 0)
- {
- names[i] = g_strdup_printf ("%s-symbolic", parts[i]);
- }
- else
- {
- names[i] = g_strdup_printf ("%.*s-%s-symbolic",
- (int) (strlen (names[i - 1]) - strlen ("-symbolic")),
- names[i - 1], parts[i]);
- }
- }
- names[i] = NULL;
-
- g_strfreev (parts);
-
- /* need to reverse here, because longest (most specific)
- name has to come first */
- for (i = 0; i < (numnames / 2); i++) {
- char *tmp = names[i];
- names[i] = names[numnames - i - 1];
- names[numnames - i - 1] = tmp;
- }
- return names;
-}
-
-GIcon *
-_st_make_symbolic_themed_icon (const char *icon_name)
-{
- char **names;
- GIcon *themed;
-
- names = symbolic_names_for_icon (icon_name);
- themed = g_themed_icon_new_from_names (names, -1);
- g_strfreev (names);
-
- return themed;
-}
diff --git a/src/st/st-private.h b/src/st/st-private.h
index 87edff9..c8ee495 100644
--- a/src/st/st-private.h
+++ b/src/st/st-private.h
@@ -79,6 +79,4 @@ void _st_paint_shadow_with_opacity (StShadow *shadow_spec,
ClutterActorBox *box,
guint8 paint_opacity);
-GIcon *_st_make_symbolic_themed_icon (const char *icon_name);
-
#endif /* __ST_PRIVATE_H__ */
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 67c7c52..c271c04 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1122,28 +1122,14 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
}
/**
- * StIconType:
- * @ST_ICON_SYMBOLIC: a symbolic (ie, mostly monochrome) icon
- * @ST_ICON_FULLCOLOR: a full-color icon
- *
- * Describes what style of icon is desired in a call to
- * st_texture_cache_load_icon_name() or st_texture_cache_load_gicon().
- * Use %ST_ICON_SYMBOLIC for symbolic icons (eg, for the panel and
- * much of the rest of the shell chrome) or %ST_ICON_FULLCOLOR for a
- * full-color icon.
- */
-
-/**
* st_texture_cache_load_icon_name:
* @cache: The texture cache instance
* @theme_node: (allow-none): a #StThemeNode
* @name: Name of a themed icon
- * @icon_type: the type of icon to load
* @size: Size of themed icon
*
- * Load a themed icon into a texture. See the #StIconType documentation
- * for an explanation of how @icon_type affects the returned icon. The
- * colors used for symbolic icons are derived from @theme_node.
+ * Load a themed icon into a texture. The colors used for symbolic
+ * icons are derived from @theme_node.
*
* Return Value: (transfer none): A new #ClutterTexture for the icon
*/
@@ -1151,47 +1137,23 @@ ClutterActor *
st_texture_cache_load_icon_name (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
- StIconType icon_type,
gint size)
{
ClutterActor *texture;
GIcon *themed;
- g_return_val_if_fail (!(icon_type == ST_ICON_SYMBOLIC && theme_node == NULL), NULL);
+ themed = g_themed_icon_new_with_default_fallbacks (name);
+ texture = load_gicon_with_colors (cache, themed, size,
+ theme_node ? st_theme_node_get_icon_colors (theme_node) : NULL);
+ g_object_unref (themed);
- switch (icon_type)
+ if (texture == NULL)
{
- case ST_ICON_SYMBOLIC:
- themed = _st_make_symbolic_themed_icon (name);
- texture = load_gicon_with_colors (cache, themed, size,
- st_theme_node_get_icon_colors (theme_node));
- g_object_unref (themed);
- if (texture == NULL)
- {
- /* We don't have an equivalent of image-missing
- * for the symbolic icon theme, so just create a blank
- * actor. */
- texture = (ClutterActor *) create_default_texture ();
- clutter_actor_set_size (texture, size, size);
- }
-
- return texture;
- break;
- case ST_ICON_FULLCOLOR:
- themed = g_themed_icon_new_with_default_fallbacks (name);
- texture = load_gicon_with_colors (cache, themed, size, NULL);
- g_object_unref (themed);
- if (texture == NULL)
- {
- themed = g_themed_icon_new ("image-missing");
- texture = load_gicon_with_colors (cache, themed, size, NULL);
- g_object_unref (themed);
- }
- return texture;
- break;
- default:
- g_assert_not_reached ();
+ texture = (ClutterActor *) create_default_texture ();
+ clutter_actor_set_size (texture, size, size);
}
+
+ return texture;
}
/**
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
index ce9f1d6..fc7dac2 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -81,7 +81,6 @@ ClutterActor *st_texture_cache_bind_pixbuf_property (StTextureCache *cache,
ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
- StIconType icon_type,
gint size);
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
diff --git a/src/st/st-types.h b/src/st/st-types.h
index 13bf3f8..d204041 100644
--- a/src/st/st-types.h
+++ b/src/st/st-types.h
@@ -41,11 +41,6 @@ typedef enum {
} StAlign;
typedef enum {
- ST_ICON_SYMBOLIC,
- ST_ICON_FULLCOLOR
-} StIconType;
-
-typedef enum {
ST_BACKGROUND_SIZE_AUTO,
ST_BACKGROUND_SIZE_CONTAIN,
ST_BACKGROUND_SIZE_COVER,
diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js
index 0d074e1..64cf898 100644
--- a/tests/interactive/icons.js
+++ b/tests/interactive/icons.js
@@ -28,27 +28,21 @@ function test() {
}
addTest("Symbolic",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
icon_size: 48 });
addTest("Full color",
{ icon_name: 'battery-full',
- icon_type: St.IconType.FULLCOLOR,
icon_size: 48 });
addTest("Default size",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC });
+ { icon_name: 'battery-full-symbolic' });
addTest("Size set by property",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
icon_size: 32 });
addTest("Size set by style",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
style: 'icon-size: 1em;' });
addTest("16px icon in 48px icon widget",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
style: 'icon-size: 16px; width: 48px; height: 48px; border: 1px solid black;' });
function iconRow(icons, box_style) {
@@ -56,7 +50,6 @@ function test() {
for each (let iconName in icons) {
hb.add(new St.Icon({ icon_name: iconName,
- icon_type: St.IconType.SYMBOLIC,
icon_size: 48 }));
}
@@ -66,16 +59,16 @@ function test() {
let normalCss = 'background: white; color: black; padding: 10px 10px;';
let reversedCss = 'background: black; color: white; warning-color: #ffcc00; error-color: #ff0000; padding: 10px 10px;';
- let batteryIcons = ['battery-full-charging',
- 'battery-full',
- 'battery-good',
- 'battery-low',
- 'battery-caution' ];
+ let batteryIcons = ['battery-full-charging-symbolic',
+ 'battery-full-symbolic',
+ 'battery-good-symbolic',
+ 'battery-low-symbolic',
+ 'battery-caution-symbolic' ];
- let volumeIcons = ['audio-volume-high',
- 'audio-volume-medium',
- 'audio-volume-low',
- 'audio-volume-muted' ];
+ let volumeIcons = ['audio-volume-high-symbolic',
+ 'audio-volume-medium-symbolic',
+ 'audio-volume-low-symbolic',
+ 'audio-volume-muted-symbolic' ];
iconRow(batteryIcons, normalCss);
iconRow(batteryIcons, reversedCss);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]