3 Commits

3 changed files with 7 additions and 4 deletions

View File

@@ -75,12 +75,12 @@ func (this *Calendar) OnEdit (callback func ()) {
} }
func (this *Calendar) prevMonth () { func (this *Calendar) prevMonth () {
this.time = firstOfMonth(this.time.Add(24 * time.Hour * 40)) this.time = firstOfMonth(this.time.Add(24 * time.Hour * -20))
this.refresh() this.refresh()
} }
func (this *Calendar) nextMonth () { func (this *Calendar) nextMonth () {
this.time = firstOfMonth(this.time.Add(24 * time.Hour * -20)) this.time = firstOfMonth(this.time.Add(24 * time.Hour * 40))
this.refresh() this.refresh()
} }
@@ -125,9 +125,9 @@ func (this *Calendar) refresh () {
func (this *Calendar) handleScroll (x, y float64) { func (this *Calendar) handleScroll (x, y float64) {
if y < 0 { if y < 0 {
this.nextMonth()
} else {
this.prevMonth() this.prevMonth()
} else {
this.nextMonth()
} }
} }

View File

@@ -12,5 +12,6 @@ func NewLabel (text string) *Label {
this := &Label { TextBox: tomo.NewTextBox() } this := &Label { TextBox: tomo.NewTextBox() }
this.SetRole(tomo.R("objects", "Label", "")) this.SetRole(tomo.R("objects", "Label", ""))
this.SetText(text) this.SetText(text)
this.SetAlign(tomo.AlignStart, tomo.AlignMiddle)
return this return this
} }

View File

@@ -1,5 +1,6 @@
package objects package objects
import "math"
import "image" import "image"
import "git.tebibyte.media/tomo/tomo" import "git.tebibyte.media/tomo/tomo"
import "git.tebibyte.media/tomo/tomo/input" import "git.tebibyte.media/tomo/tomo/input"
@@ -33,6 +34,7 @@ func newSlider (orient string, value float64) *Slider {
}, },
layout: sliderLayout { layout: sliderLayout {
vertical: orient == "vertical", vertical: orient == "vertical",
value: math.NaN(),
}, },
step: 0.05, step: 0.05,
} }