diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rhlibrary/player_widget.go | 28 | ||||
-rw-r--r-- | src/rhlibrary/vumeter_widget.go | 8 |
2 files changed, 23 insertions, 13 deletions
diff --git a/src/rhlibrary/player_widget.go b/src/rhlibrary/player_widget.go index f0e4583..89f2fe5 100644 --- a/src/rhlibrary/player_widget.go +++ b/src/rhlibrary/player_widget.go @@ -42,13 +42,14 @@ func addPlayPauseButton(box *gtk.Box, p *player.PlayerChan) (err error) { if btn, err = gtk.ButtonNew(); err != nil { return } - if playIcon, err = gtk.ImageNewFromIconName("media-playback-start", gtk.ICON_SIZE_DIALOG); err != nil { + if playIcon, err = gtk.ImageNewFromIconName("media-playback-start", gtk.ICON_SIZE_LARGE_TOOLBAR); err != nil { return } - if pauseIcon, err = gtk.ImageNewFromIconName("media-playback-pause", gtk.ICON_SIZE_DIALOG); err != nil { + if pauseIcon, err = gtk.ImageNewFromIconName("media-playback-pause", gtk.ICON_SIZE_LARGE_TOOLBAR); err != nil { return } btn.SetImage(playIcon) + btn.SetSizeRequest(32, 32) btn.SetSensitive(false) btn.Connect("clicked", func(_ *gtk.Button) { @@ -80,9 +81,10 @@ func addPlayPauseButton(box *gtk.Box, 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 { + if btn, err = gtk.ButtonNewFromIconName("media-playback-stop", gtk.ICON_SIZE_LARGE_TOOLBAR); err != nil { return } + btn.SetSizeRequest(32, 32) btn.SetSensitive(false) btn.Connect("clicked", func(_ *gtk.Button) { @@ -111,7 +113,7 @@ func addStopButton(box *gtk.Box, p *player.PlayerChan) (err error) { 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 { + if box, err = gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 2); err != nil { return } @@ -122,7 +124,7 @@ func addButtons(grid *gtk.Grid, p *player.PlayerChan) (err error) { return } - grid.Attach(box, 1, 1, 1, 2) + grid.Attach(box, 1, 1, 1, 1) return } @@ -131,7 +133,14 @@ func addMeter(grid *gtk.Grid, p *player.PlayerChan) error { if err != nil { return err } - grid.Attach(widget, 2, 1, 1, 1) + + var box *gtk.Box + if box, err = gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 2); err != nil { + return err + } + box.PackStart(widget, false, false, 2) + + grid.Attach(box, 2, 1, 1, 1) return nil } @@ -178,7 +187,7 @@ func addScrubber(grid *gtk.Grid, p *player.PlayerChan) (err error) { return true }, nil) - grid.Attach(scale, 2, 2, 2, 1) + grid.Attach(scale, 1, 2, 3, 1) return } @@ -208,7 +217,7 @@ func addPlayTime(grid *gtk.Grid, p *player.PlayerChan) (err error) { return true }, nil) - btn.SetSizeRequest(150, 40) + btn.SetSizeRequest(128, 32) btn.SetRelief(gtk.RELIEF_NONE) btn.SetFocusOnClick(false) btn.SetLabel(getPlayTimeString(duration, pos, countdown)) @@ -222,7 +231,7 @@ func addPlayTime(grid *gtk.Grid, p *player.PlayerChan) (err error) { if cp, err = gtk.CssProviderNew(); err != nil { return } - if err = cp.LoadFromData(".button { font-weight: bold; font-size: 12pt; }"); err != nil { + if err = cp.LoadFromData(".button { border: 1px solid; border-color: #a1a1a1; font-weight: bold; font-size: 11pt; }"); err != nil { return } var sc *gtk.StyleContext @@ -242,6 +251,7 @@ func getPlayerWidget(p *player.PlayerChan) (gtk.IWidget, error) { return nil, err } grid.SetOrientation(gtk.ORIENTATION_HORIZONTAL) + grid.SetRowSpacing(7) grid.SetColumnSpacing(13) if err = addButtons(grid, p); err != nil { diff --git a/src/rhlibrary/vumeter_widget.go b/src/rhlibrary/vumeter_widget.go index 96796d0..f6bda94 100644 --- a/src/rhlibrary/vumeter_widget.go +++ b/src/rhlibrary/vumeter_widget.go @@ -34,8 +34,8 @@ import ( const ( meterDBFloor float64 = 72 // -72 db is the lowest VU value - meterSegmentsGreen float64 = 21 - meterSegmentsOrange float64 = 3 + meterSegmentsGreen float64 = 30 + meterSegmentsOrange float64 = 5 meterSegmentsRed float64 = 1 meterSegmentsTotal float64 = meterSegmentsGreen + meterSegmentsOrange + meterSegmentsRed ) @@ -55,8 +55,8 @@ func getMeterBarCSS() (*gtk.CssProvider, error) { } err = meterBarCSS.LoadFromData(` .level-bar { - -GtkLevelBar-min-block-width: 15; - -GtkLevelBar-min-block-height: 9; + -GtkLevelBar-min-block-width: 13; + -GtkLevelBar-min-block-height: 8; } .level-bar.trough { border: 0; |