~jackmordaunt

Australia

https://jackmordaunt.srht.site

Software Developer that enjoys clean, well structured code.

~jackmordaunt/public-inbox

Last active 20 days ago

~jackmordaunt/gio-planet

Last active a month ago

~jackmordaunt/kanban-ci

Last active 8 months ago

~jackmordaunt/audiotube-devel

Last active 11 months ago

~jackmordaunt/audiotube-announce

Last active 11 months ago
View more

Recent activity

Re: [PATCH chat v1 1/3] widget/plato: make row safe to use with nil state 2 days ago

From Jack Mordaunt to ~gioverse/chat


> On 30 Jul 2021, at 12:51 am, Chris Waldon <christopher.waldon.dev@gmail.com> wrote:
> 
> Hey Jack,
> 
> The rest of the patchset looks great. I have one gripe on this one,
> but I've merged anyway.
> 
> Cheers,
> Chris
> 
>> On Tue Jul 27, 2021 at 3:46 AM EDT, Jack Mordaunt wrote:
>> Avoid panicking when caller passes nil'd values.

[PATCH chat v3 8/8] layout: minimize heap allocation 2 days ago

From Jack Mordaunt to ~gioverse/chat

When number of RowChild is small, use a stack allocated array.

The hope is to define a static array large-enough to avoid needing a
heap allocation for the majority of use-cases.

If however the number of RowChild is large, we fallback to relying on
slice append to allocate as needed.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 layout/row.go | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/layout/row.go b/layout/row.go
[message trimmed]

[PATCH chat v3 7/8] layout: space entire row evenly 2 days ago

From Jack Mordaunt to ~gioverse/chat

Correctly reflect that this margin spaces the internal rows from each
other, not just the content widget.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 layout/row.go | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/layout/row.go b/layout/row.go
index 92ebe2f..8e2b3cd 100644
--- a/layout/row.go
+++ b/layout/row.go
@@ -63,25 +63,25 @@ func (r Row) Layout(gtx C, w ...RowChild) D {
			if w[ii].Content == nil {
[message trimmed]

[PATCH chat v3 6/8] layout,widget/{material,plato}: correctly name spacing as a margin 2 days ago

From Jack Mordaunt to ~gioverse/chat

This kind of spacing is not internal to the row, and therefor should be
called 'margin', not 'padding'.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 layout/row.go          | 5 +++--
 widget/material/row.go | 8 ++++----
 widget/plato/row.go    | 4 ++--
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/layout/row.go b/layout/row.go
index ee6cb55..92ebe2f 100644
--- a/layout/row.go
+++ b/layout/row.go
[message trimmed]

[PATCH chat v3 5/8] widget/plato: migrate RowStyle to use Row layout 2 days ago

From Jack Mordaunt to ~gioverse/chat

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 widget/plato/row.go | 79 ++++++++++++++++++---------------------------
 1 file changed, 32 insertions(+), 47 deletions(-)

diff --git a/widget/plato/row.go b/widget/plato/row.go
index 0c40d45..ee9f22e 100644
--- a/widget/plato/row.go
+++ b/widget/plato/row.go
@@ -21,8 +21,7 @@ import (
// In particular, RowStyle is repsonsible for gutters and anchoring of
// messages.
type RowStyle struct {
	OuterMargin chatlayout.VerticalMarginStyle
[message trimmed]

[PATCH chat v3 4/8] widget/material: migrate RowStyle to use Row layout 2 days ago

From Jack Mordaunt to ~gioverse/chat

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 widget/material/row.go | 64 ++++++++++++++++--------------------------
 1 file changed, 24 insertions(+), 40 deletions(-)

diff --git a/widget/material/row.go b/widget/material/row.go
index 09b13d4..923b777 100644
--- a/widget/material/row.go
+++ b/widget/material/row.go
@@ -16,8 +16,7 @@ import (
// RowStyle configures the presentation of a chat message within
// a vertical list of chat messages.
type RowStyle struct {
	OuterMargin chatlayout.VerticalMarginStyle
[message trimmed]

[PATCH chat v3 3/8] widget/material: split RowStyle into file 2 days ago

From Jack Mordaunt to ~gioverse/chat

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 widget/material/message.go | 134 --------------------------------
 widget/material/row.go     | 152 +++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+), 134 deletions(-)
 create mode 100644 widget/material/row.go

diff --git a/widget/material/message.go b/widget/material/message.go
index 401e9aa..f6fec65 100644
--- a/widget/material/message.go
+++ b/widget/material/message.go
@@ -3,7 +3,6 @@ package material
import (
	"image"
[message trimmed]

[PATCH chat v3 2/8] layout: introduce unified row 2 days ago

From Jack Mordaunt to ~gioverse/chat

Unified rows don't have any gutters, letting a row child span the full width of the row.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 layout/row.go | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/layout/row.go b/layout/row.go
index 5d7c337..ee6cb55 100644
--- a/layout/row.go
+++ b/layout/row.go
@@ -32,6 +32,7 @@ type RowChild struct {
	Left    layout.Widget
	Content layout.Widget
[message trimmed]

[PATCH chat v3 1/8] layout: capture row logic 2 days ago

From Jack Mordaunt to ~gioverse/chat

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
---
 layout/row.go | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 layout/row.go

diff --git a/layout/row.go b/layout/row.go
new file mode 100644
index 0000000..5d7c337
--- /dev/null
+++ b/layout/row.go
@@ -0,0 +1,83 @@
package layout

[message trimmed]

[PATCH chat v3 0/8] row layout 2 days ago

From Jack Mordaunt to ~gioverse/chat

Improves on v2 by using a better strategy for minimizing heap allocations.
See the final commit for details.

Thank!

Jack Mordaunt (8):
  layout: capture row logic
  layout: introduce unified row
  widget/material: split RowStyle into file
  widget/material: migrate RowStyle to use Row layout
  widget/plato: migrate RowStyle to use Row layout
  layout,widget/{material,plato}: correctly name spacing as a margin
  layout: space entire row evenly
  layout: minimize heap allocation