1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 04:48:00 +01:00

More fixes to the themeability of wicd

This commit is contained in:
David Paleino
2012-11-18 09:25:58 +01:00
parent 666a8de503
commit 9e5d6aab25
4 changed files with 16 additions and 19 deletions

View File

@@ -232,10 +232,7 @@ class appGui(object):
self.status_area.hide_all() self.status_area.hide_all()
if os.path.exists(os.path.join(wpath.images, "wicd.png")): self.window.set_icon_name('wicd-gtk')
self.window.set_icon_from_file(
os.path.join(wpath.images, "wicd.png")
)
self.statusID = None self.statusID = None
self.first_dialog_load = True self.first_dialog_load = True
self.is_visible = True self.is_visible = True

View File

@@ -802,7 +802,7 @@ class WiredNetworkEntry(NetworkEntry):
self.image.set_padding(0, 0) self.image.set_padding(0, 0)
self.image.set_alignment(.5, .5) self.image.set_alignment(.5, .5)
self.image.set_size_request(60, -1) self.image.set_size_request(60, -1)
self.image.set_from_icon_name("wired-gui", 4) self.image.set_from_icon_name("wired-gui", gtk.ICON_SIZE_DND)
self.image.show() self.image.show()
self.connect_button.show() self.connect_button.show()
@@ -1130,28 +1130,28 @@ class WirelessNetworkEntry(NetworkEntry):
# "converted" to strength bars, so suggestions from people # "converted" to strength bars, so suggestions from people
# for a better way would be welcome. # for a better way would be welcome.
if dbm_strength >= -60: if dbm_strength >= -60:
signal_img = 'signal-100.png' signal_img = 'signal-100'
elif dbm_strength >= -70: elif dbm_strength >= -70:
signal_img = 'signal-75.png' signal_img = 'signal-75'
elif dbm_strength >= -80: elif dbm_strength >= -80:
signal_img = 'signal-50.png' signal_img = 'signal-50'
else: else:
signal_img = 'signal-25.png' signal_img = 'signal-25'
ending = "dBm" ending = "dBm"
disp_strength = str(dbm_strength) disp_strength = str(dbm_strength)
else: else:
# Uses normal link quality, should be fine in most cases # Uses normal link quality, should be fine in most cases
if strength > 75: if strength > 75:
signal_img = 'signal-100.png' signal_img = 'signal-100'
elif strength > 50: elif strength > 50:
signal_img = 'signal-75.png' signal_img = 'signal-75'
elif strength > 25: elif strength > 25:
signal_img = 'signal-50.png' signal_img = 'signal-50'
else: else:
signal_img = 'signal-25.png' signal_img = 'signal-25'
ending = "%" ending = "%"
disp_strength = str(strength) disp_strength = str(strength)
self.image.set_from_file(wpath.images + signal_img) self.image.set_from_icon_name(signal_img, gtk.ICON_SIZE_DND)
self.lbl_strength.set_label(disp_strength + ending) self.lbl_strength.set_label(disp_strength + ending)
self.image.show() self.image.show()

View File

@@ -378,9 +378,7 @@ class PreferencesDialog(object):
self.dialog = self.wTree.get_object("pref_dialog") self.dialog = self.wTree.get_object("pref_dialog")
self.dialog.set_title(_('Preferences')) self.dialog.set_title(_('Preferences'))
if os.path.exists(os.path.join(wpath.images, "wicd.png")): self.dialog.set_icon_name('wicd-gtk')
self.dialog.set_icon_from_file(
os.path.join(wpath.images, "wicd.png"))
width = int(gtk.gdk.screen_width() / 2.4) width = int(gtk.gdk.screen_width() / 2.4)
if width > 450: if width > 450:
width = 450 width = 450

View File

@@ -701,9 +701,11 @@ TX:'''))
image = gtk.Image() image = gtk.Image()
if type_ == "__wired__": if type_ == "__wired__":
image.set_from_icon_name("network-wired", 2) image.set_from_icon_name("network-wired",
gtk.ICON_SIZE_SMALL_TOOLBAR)
else: else:
image.set_from_icon_name(self._get_img(n_id), 2) image.set_from_icon_name(self._get_img(n_id),
gtk.ICON_SIZE_SMALL_TOOLBAR)
item.set_image(image) item.set_image(image)
del image del image
item.connect("activate", network_selected, type_, n_id) item.connect("activate", network_selected, type_, n_id)