summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-11-04 14:40:18 +0100
committerKevin Chabowski <kevin@kch42.de>2013-11-04 14:40:18 +0100
commit568116b8644255e04759190d3ad764f858398646 (patch)
treec37a9ecb66feef04b26b66df617b8dc0dfc7a194
parentbb8ec813d87a15519749c44aa6f9e8b7b85a443d (diff)
downloadbiomed-568116b8644255e04759190d3ad764f858398646.tar.gz
biomed-568116b8644255e04759190d3ad764f858398646.tar.bz2
biomed-568116b8644255e04759190d3ad764f858398646.zip
Biome editor is now opened by a button in the sidebar
-rw-r--r--main.go37
1 files changed, 18 insertions, 19 deletions
diff --git a/main.go b/main.go
index e4c3767..b1ae1ad 100644
--- a/main.go
+++ b/main.go
@@ -79,6 +79,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
dlg.Destroy()
}
+func (g *GUI) biomeEditor() {
+ ed := NewBiomeInfoEditor(g.biomes)
+ rv := ed.Run()
+ ed.Destroy()
+ if rv == gtk.RESPONSE_OK {
+ g.biomes = ed.Biomes()
+ g.updateBiomeInfo()
+ }
+}
+
func (g *GUI) mkMenuBar() *gtk.MenuBar {
menubar := gtk.NewMenuBar()
@@ -107,24 +117,6 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar {
fileMenuItem.SetSubmenu(fileMenu)
menubar.Append(fileMenuItem)
- prefMenu := gtk.NewMenu()
-
- confbiomes := gtk.NewMenuItemWithLabel("Configure Biomes")
- confbiomes.Connect("activate", func() {
- ed := NewBiomeInfoEditor(g.biomes)
- rv := ed.Run()
- ed.Destroy()
- if rv == gtk.RESPONSE_OK {
- g.biomes = ed.Biomes()
- g.updateBiomeInfo()
- }
- })
- prefMenu.Append(confbiomes)
-
- prefMenuItem := gtk.NewMenuItemWithLabel("Preferences")
- prefMenuItem.SetSubmenu(prefMenu)
- menubar.Append(prefMenuItem)
-
helpMenu := gtk.NewMenu()
controls := gtk.NewMenuItemWithLabel("Controls")
@@ -216,7 +208,14 @@ func (g *GUI) mkSidebar() *gtk.ScrolledWindow {
sbVBox.PackStart(drawHBox, false, false, 3)
sbVBox.PackStart(gtk.NewHSeparator(), false, false, 3)
- sbVBox.PackStart(labelCustomFont("Biomes", "Sans Bold 14"), false, false, 3)
+ bioHeaderHBox := gtk.NewHBox(false, 0)
+ bioHeaderHBox.PackStart(labelCustomFont("Biomes", "Sans Bold 14"), true, false, 0)
+ editBiomesBtn := gtk.NewButton()
+ editBiomesBtn.Add(gtk.NewImageFromStock(gtk.STOCK_EDIT, gtk.ICON_SIZE_SMALL_TOOLBAR))
+ editBiomesBtn.Connect("clicked", g.biomeEditor)
+ editBiomesBtn.SetTooltipText("Configure Biomes")
+ bioHeaderHBox.PackStart(editBiomesBtn, false, false, 0)
+ sbVBox.PackStart(bioHeaderHBox, false, false, 3)
g.bioVBoxWrap = gtk.NewVBox(false, 0)
g.bioVBox = gtk.NewVBox(false, 0)