Button improvements
Changed the size of the random icon, and made the top row icons slightly larger.
This commit is contained in:
parent
9eae107dee
commit
5803f74701
BIN
images/d20.xcf
BIN
images/d20.xcf
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -1,16 +1,17 @@
|
||||||
# Bryan Schumaker (8/26/2010)
|
# Bryan Schumaker (8/26/2010)
|
||||||
|
|
||||||
import ocarina
|
import ocarina
|
||||||
|
import image
|
||||||
LS = ocarina.libsaria
|
LS = ocarina.libsaria
|
||||||
gtk = ocarina.gtk
|
gtk = ocarina.gtk
|
||||||
prefs = LS.prefs
|
prefs = LS.prefs
|
||||||
|
|
||||||
|
|
||||||
class Button(gtk.Button):
|
class Button(gtk.Button):
|
||||||
def __init__(self, stock, func=None, show=True):
|
def __init__(self, stock, size=gtk.ICON_SIZE_MENU, func=None, show=True):
|
||||||
gtk.Button.__init__(self)
|
gtk.Button.__init__(self)
|
||||||
self.func = func
|
self.func = func
|
||||||
img = gtk.image_new_from_stock(stock, gtk.ICON_SIZE_MENU)
|
img = gtk.image_new_from_stock(stock, size)
|
||||||
img.show()
|
img.show()
|
||||||
self.add(img)
|
self.add(img)
|
||||||
self.set_relief(gtk.RELIEF_NONE)
|
self.set_relief(gtk.RELIEF_NONE)
|
||||||
|
@ -78,15 +79,19 @@ class RewindButton(Button):
|
||||||
|
|
||||||
class OpenButton(Button):
|
class OpenButton(Button):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Button.__init__(self, gtk.STOCK_OPEN)
|
Button.__init__(self, gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
from ocarina import fsselect
|
from ocarina import fsselect
|
||||||
fsselect.run_chooser2(LS.data.universal_open)
|
fsselect.run_chooser2(LS.data.universal_open)
|
||||||
|
|
||||||
class RandomButton(gtk.CheckButton):
|
class RandomButton(gtk.ToggleButton):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gtk.CheckButton.__init__(self, "Random")
|
gtk.ToggleButton.__init__(self)
|
||||||
|
img = gtk.image_new_from_file("images/random.png")
|
||||||
|
img.show()
|
||||||
|
self.add(img)
|
||||||
self.set_active(prefs["random"])
|
self.set_active(prefs["random"])
|
||||||
|
self.set_relief(gtk.RELIEF_NONE)
|
||||||
self.connect("toggled", self.toggle)
|
self.connect("toggled", self.toggle)
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
@ -128,7 +133,7 @@ class VolumeButton(gtk.VolumeButton):
|
||||||
def resize(self):
|
def resize(self):
|
||||||
image = self.get_children()[0]
|
image = self.get_children()[0]
|
||||||
icon = image.get_icon_name()[0]
|
icon = image.get_icon_name()[0]
|
||||||
image.set_from_icon_name(icon, gtk.ICON_SIZE_MENU)
|
image.set_from_icon_name(icon, gtk.ICON_SIZE_BUTTON)
|
||||||
|
|
||||||
def changed(self, widget, value):
|
def changed(self, widget, value):
|
||||||
LS.music.set_volume(value)
|
LS.music.set_volume(value)
|
||||||
|
|
Loading…
Reference in New Issue