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
This commit is contained in:
Jasper St. Pierre
2012-05-30 09:58:37 -04:00
parent 042c1fd54b
commit c21b1e5fe0
32 changed files with 94 additions and 300 deletions

View File

@ -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 = [];

View File

@ -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 } );

View File

@ -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;
},

View File

@ -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;

View File

@ -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() {

View File

@ -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;

View File

@ -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);
},

View File

@ -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) {

View File

@ -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();

View File

@ -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 });
},

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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);
}
},

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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));
}

View File

@ -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 });
}

View File

@ -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' });

View File

@ -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

View File

@ -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);
}
}]);