summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rhlibrary/main.go2
-rw-r--r--src/rhlibrary/player_widget.go63
-rw-r--r--src/rhlibrary/vumeter_widget.go13
3 files changed, 56 insertions, 22 deletions
diff --git a/src/rhlibrary/main.go b/src/rhlibrary/main.go
index 4f339b9..8bfbeab 100644
--- a/src/rhlibrary/main.go
+++ b/src/rhlibrary/main.go
@@ -92,7 +92,7 @@ func main() {
return
}
- mw, err := NewAppWindow(p.GetInterface(), 640, 360)
+ mw, err := NewAppWindow(p.GetInterface(), 800, 600)
if err != nil {
rhl.Println("Error initializing Main Window:", err)
return
diff --git a/src/rhlibrary/player_widget.go b/src/rhlibrary/player_widget.go
index 032d1b2..5dd3b97 100644
--- a/src/rhlibrary/player_widget.go
+++ b/src/rhlibrary/player_widget.go
@@ -32,7 +32,7 @@ import (
"github.com/gotk3/gotk3/gtk"
)
-func addPlayButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
+func addPlayButton(box *gtk.Box, p *player.PlayerChan) (err error) {
var btn *gtk.Button
if btn, err = gtk.ButtonNewFromIconName("media-playback-start", gtk.ICON_SIZE_DIALOG); err != nil {
return
@@ -42,11 +42,11 @@ func addPlayButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
rhdl.Println(err) // TODO: feedback at GUI?
}
})
- grid.Attach(btn, 1, 1, 1, 2)
+ box.PackStart(btn, false, false, 0)
return
}
-func addPauseButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
+func addPauseButton(box *gtk.Box, p *player.PlayerChan) (err error) {
var btn *gtk.Button
if btn, err = gtk.ButtonNewFromIconName("media-playback-pause", gtk.ICON_SIZE_DIALOG); err != nil {
return
@@ -56,11 +56,11 @@ func addPauseButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
rhdl.Println(err) // TODO: feedback at GUI?
}
})
- grid.Attach(btn, 2, 1, 1, 2)
+ box.PackStart(btn, false, false, 0)
return
}
-func addStopButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
+func addStopButton(box *gtk.Box, p *player.PlayerChan) (err error) {
var btn *gtk.Button
if btn, err = gtk.ButtonNewFromIconName("media-playback-stop", gtk.ICON_SIZE_DIALOG); err != nil {
return
@@ -70,7 +70,27 @@ func addStopButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
rhdl.Println(err) // TODO: feedback at GUI?
}
})
- grid.Attach(btn, 3, 1, 1, 2)
+ box.PackStart(btn, false, false, 0)
+ return
+}
+
+func addButtons(grid *gtk.Grid, p *player.PlayerChan) (err error) {
+ var box *gtk.Box
+ if box, err = gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 3); err != nil {
+ return
+ }
+
+ if err = addPlayButton(box, p); err != nil {
+ return
+ }
+ if err = addPauseButton(box, p); err != nil {
+ return
+ }
+ if err = addStopButton(box, p); err != nil {
+ return
+ }
+
+ grid.Attach(box, 1, 1, 1, 2)
return
}
@@ -79,7 +99,7 @@ func addMeter(grid *gtk.Grid, p *player.PlayerChan) error {
if err != nil {
return err
}
- grid.Attach(widget, 4, 1, 1, 1)
+ grid.Attach(widget, 2, 1, 1, 1)
return nil
}
@@ -99,7 +119,7 @@ func addScrubber(grid *gtk.Grid, p *player.PlayerChan) (err error) {
return true
}, nil)
- grid.Attach(scale, 4, 2, 2, 1)
+ grid.Attach(scale, 2, 2, 2, 1)
return
}
@@ -117,8 +137,21 @@ func addPlayTime(grid *gtk.Grid, p *player.PlayerChan) (err error) {
return true
}, nil)
- grid.Attach(label, 5, 1, 1, 1)
- return nil
+ var cp *gtk.CssProvider
+ if cp, err = gtk.CssProviderNew(); err != nil {
+ return
+ }
+ if err = cp.LoadFromData(".label { font-weight: bold; font-size: 15pt; padding: 3px 12px 3px 2px; }"); err != nil {
+ return
+ }
+ var sc *gtk.StyleContext
+ if sc, err = label.GetStyleContext(); err != nil {
+ return
+ }
+ sc.AddProvider(cp, 600) // TOOD: hardcoded value
+
+ grid.Attach(label, 3, 1, 1, 1)
+ return
}
func getPlayerWidget(p *player.PlayerChan) (gtk.IWidget, error) {
@@ -128,15 +161,9 @@ func getPlayerWidget(p *player.PlayerChan) (gtk.IWidget, error) {
return nil, err
}
grid.SetOrientation(gtk.ORIENTATION_HORIZONTAL)
- grid.SetColumnSpacing(3)
+ grid.SetColumnSpacing(13)
- if err = addPlayButton(grid, p); err != nil {
- return nil, err
- }
- if err = addPauseButton(grid, p); err != nil {
- return nil, err
- }
- if err = addStopButton(grid, p); err != nil {
+ if err = addButtons(grid, p); err != nil {
return nil, err
}
if err = addMeter(grid, p); err != nil {
diff --git a/src/rhlibrary/vumeter_widget.go b/src/rhlibrary/vumeter_widget.go
index afffbf5..3406dda 100644
--- a/src/rhlibrary/vumeter_widget.go
+++ b/src/rhlibrary/vumeter_widget.go
@@ -55,8 +55,8 @@ func getMeterBarCSS() (*gtk.CssProvider, error) {
}
err = meterBarCSS.LoadFromData(`
.level-bar {
- -GtkLevelBar-min-block-width: 17;
- -GtkLevelBar-min-block-height: 10;
+ -GtkLevelBar-min-block-width: 15;
+ -GtkLevelBar-min-block-height: 9;
}
.level-bar.trough {
border: 0;
@@ -230,5 +230,12 @@ func getVUMeterWidget(p *player.PlayerChan) (gtk.IWidget, error) {
if err = addVUMeterGrid(frame, p); err != nil {
return nil, err
}
- return frame, nil
+
+ var box *gtk.Box
+ if box, err = gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 7); err != nil {
+ return nil, err
+ }
+ box.PackStart(frame, false, false, 3)
+
+ return box, nil
}