From 1defd4e759271d9693831ecd5fd974fc468954b9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 6 Nov 2019 11:42:33 +0100 Subject: [PATCH] widget/material: clean up package docs, add license, rename file Signed-off-by: Elias Naur --- widget/material/button.go | 1 - widget/material/{chekable.go => checkable.go} | 2 ++ widget/material/checkbox.go | 1 - widget/material/doc.go | 22 ++++++++++--------- widget/material/icon.go | 1 - widget/material/radiobutton.go | 1 - 6 files changed, 14 insertions(+), 14 deletions(-) rename widget/material/{chekable.go => checkable.go} (97%) diff --git a/widget/material/button.go b/widget/material/button.go index 10cc26c6..ae79ca84 100644 --- a/widget/material/button.go +++ b/widget/material/button.go @@ -1,6 +1,5 @@ // SPDX-License-Identifier: Unlicense OR MIT -// Package material implements the Material design. package material import ( diff --git a/widget/material/chekable.go b/widget/material/checkable.go similarity index 97% rename from widget/material/chekable.go rename to widget/material/checkable.go index 278b8d3e..ed3e7b17 100644 --- a/widget/material/chekable.go +++ b/widget/material/checkable.go @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: Unlicense OR MIT + package material import ( diff --git a/widget/material/checkbox.go b/widget/material/checkbox.go index 4d1537d3..33014b60 100644 --- a/widget/material/checkbox.go +++ b/widget/material/checkbox.go @@ -1,6 +1,5 @@ // SPDX-License-Identifier: Unlicense OR MIT -// Package material implements the Material design. package material import ( diff --git a/widget/material/doc.go b/widget/material/doc.go index eafca5b7..4fd1a251 100644 --- a/widget/material/doc.go +++ b/widget/material/doc.go @@ -11,12 +11,12 @@ // // This snippet defines a button that prints a message when clicked: // -// var gtx *layout.Context -// button := new(widget.Button) +// var gtx *layout.Context +// button := new(widget.Button) // -// for button.Clicked(gtx) { -// fmt.Println("Clicked!") -// } +// for button.Clicked(gtx) { +// fmt.Println("Clicked!") +// } // // Use a Theme to draw the button: // @@ -24,26 +24,28 @@ // // th.Button("Click me!").Layout(gtx, button) // +// Customization +// // Quite often, a program needs to customize the theme provided defaults. Several // options are available, depending on the nature of the change: // -// - Mandatory parameters. Some parameters are not part of the widget state but +// Mandatory parameters: Some parameters are not part of the widget state but // have no obvious default. In the program above, the button text is a // parameter to the Theme.Button method. // -// - Theme-global parameters. For changing the look of all widgets drawn with a +// Theme-global parameters: For changing the look of all widgets drawn with a // particular theme, adjust the `Theme` fields: // // theme.Color.Primary = color.RGBA{...} // -// - Widget-local parameters. For changing the look of a particular widget, +// Widget-local parameters: For changing the look of a particular widget, // adjust the widget specific theme object: // // btn := th.Button("Click me!") // btn.Font.Style = text.Italic // btn.Layout(gtx) // -// - Widget variants. A widget can have several distinct representations even +// Widget variants: A widget can have several distinct representations even // though the underlying state is the same. A widget.Button can be drawn as a // round icon button: // @@ -51,7 +53,7 @@ // // th.IconButton(icon).Layout(gtx, button) // -// - Specialized widgets. Theme both define a generic Label method +// Specialized widgets: Theme both define a generic Label method // that takes a text size, and specialized methods for standard text // sizes such as Theme.H1 and Theme.Body2. package material diff --git a/widget/material/icon.go b/widget/material/icon.go index 24df0e98..6931bff9 100644 --- a/widget/material/icon.go +++ b/widget/material/icon.go @@ -1,6 +1,5 @@ // SPDX-License-Identifier: Unlicense OR MIT -// Package material implements the Material design. package material import ( diff --git a/widget/material/radiobutton.go b/widget/material/radiobutton.go index 9a9a008b..c690e22e 100644 --- a/widget/material/radiobutton.go +++ b/widget/material/radiobutton.go @@ -1,6 +1,5 @@ // SPDX-License-Identifier: Unlicense OR MIT -// Package material implements the Material design. package material import (