diff options
| -rw-r--r-- | area.go | 2 | ||||
| -rw-r--r-- | debug.go | 2 | ||||
| -rw-r--r-- | mainCloudBox.go | 6 | ||||
| -rw-r--r-- | splash.go | 24 | ||||
| -rw-r--r-- | structs.go | 9 |
5 files changed, 15 insertions, 28 deletions
@@ -25,7 +25,7 @@ func makeSplashArea(ah *AreaHandler) { // There should be another way to do this (?) newB := CreateFontButton("AREA") - ah.Attrstr = makeAttributedString() + // ah.Attrstr = makeAttributedString() ah.Area = ui.NewArea(ah) newB.A = ah.Area Data.AllButtons[1].A = ah.Area @@ -82,7 +82,7 @@ func runTestHide(b *ButtonMap) { log.Println("runTestHide START") Data.Window1.Box1.Hide() Data.Window1.Box2.Hide() - time.Sleep(2000 * time.Millisecond) + // time.Sleep(2000 * time.Millisecond) Data.State = "HIDE" log.Println("runTestHide END") } diff --git a/mainCloudBox.go b/mainCloudBox.go index 9ab998d..42529ce 100644 --- a/mainCloudBox.go +++ b/mainCloudBox.go @@ -208,7 +208,7 @@ func ShowMainTab() { } func GoMainWindow() { - Data.Window1 = new(WindowMap) + // Data.Window1 = new(WindowMap) ui.Main(makeCloudWindow) } @@ -235,8 +235,8 @@ func makeCloudWindow() { Data.Window1.W.SetChild(Data.Window1.T) Data.Window1.W.SetMargined(true) - text := makeAttributedString() - Data.Window1.Box1 = ShowSplashBox(text) + // text := makeAttributedString() + Data.Window1.Box1 = ShowSplashBox(Data.Window1.AreaText) Data.Window1.T.Append("WIT Splash", Data.Window1.Box1) Data.Window1.T.SetMargined(0, true) @@ -49,29 +49,7 @@ func ShowSplashBox(newText *ui.AttributedString) *ui.Box { okButton := CreateButton(nil, nil, "OK", "AREA", nil) newbox.Append(okButton, false) + newbox.Append(CreateButton(nil, nil, "NEWTEXT", "NEWTEXT", nil), false) return newbox } - -func makeAttributedString() *ui.AttributedString { - newText := ui.NewAttributedString("") - - appendWithAttributes(newText, "Welcome to the Cloud Control Panel\n", ui.TextSize(16), ui.TextColor{0.0, 0.0, 0.8, .8}) // "RGBT" - - appendWithAttributes(newText, "(alpha)\n\n", ui.TextSize(10)) - - appendWithAttributes(newText, "This control panel was designed to be an interface to your 'private' cloud. ", ui.TextWeightBold) - appendWithAttributes(newText, "The concept of a private cloud means that you can use a providers system, or, seemlessly, use your own hardware in your own datacenter. ", ui.TextWeightBold) - - newText.AppendUnattributed("\n") - newText.AppendUnattributed("\n") - appendWithAttributes(newText, "This control panel requires:\n") - newText.AppendUnattributed("\n") - appendWithAttributes(newText, "IPv6\n") - appendWithAttributes(newText, "newText, Your hostname in DNS\n") - newText.AppendUnattributed("\n\n\n\n\n") - - appendWithAttributes(newText, "<click or press any key>\n", ui.TextSize(10)) - - return newText -} @@ -1,6 +1,7 @@ package gui import "image/color" +import "golang.org/x/image/font" import "github.com/andlabs/ui" import _ "github.com/andlabs/ui/winmanifest" @@ -92,6 +93,14 @@ type WindowMap struct { Box2 *ui.Box AH *AreaHandler + AreaText *ui.AttributedString +} + +type FontString struct { + S string + Size int + F font.Face + W font.Weight } type ButtonMap struct { |
