From b8533313f9763baca2bde1107fb75202ef579792 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Sun, 16 Apr 2023 13:26:41 +0200 Subject: [PATCH] component: [API] remove redundant TextField.Alignment The embedded widget.Editor already has Alignment (of type text.Alignment instead of layout.Alignment). TextField.Alignment became ineffective in 64527da when we started laying out the editor in a Flexed child. Signed-off-by: Gordon Klaus --- component/text_field.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/component/text_field.go b/component/text_field.go index e9fadaf..7ed1ccd 100644 --- a/component/text_field.go +++ b/component/text_field.go @@ -25,8 +25,6 @@ type TextField struct { // click detects when the mouse pointer clicks or hovers // within the textfield. click gesture.Click - // Alignment specifies where to anchor the text. - Alignment layout.Alignment // Helper text to give additional context to a field. Helper string @@ -289,16 +287,6 @@ func (in *TextField) Layout(gtx C, th *material.Theme, hint string) D { return layout.Flex{ Axis: layout.Horizontal, Alignment: layout.Middle, - Spacing: func() layout.Spacing { - switch in.Alignment { - case layout.Middle: - return layout.SpaceSides - case layout.End: - return layout.SpaceStart - default: // layout.Start and all others - return layout.SpaceEnd - } - }(), }.Layout( gtx, layout.Rigid(func(gtx C) D { -- 2.45.2