Skip to content

widget.ImageSegment can't be aligned. #3505

Closed
@alexballas

Description

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

When using the new widget.ImageSegment functionality, I can't seem to be able to define the alignment for it or control its position. When I resize the window text seems to align fine as per my code example, but image stays on the same position.

How to reproduce

check description, code examples and screenshot

Screenshots

Screenshot from 2022-12-27 01-09-16

Example code

package main

import (
	fyne "fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

var currentmfolder string

func main() {

	myApp := app.New()
	myWindow := myApp.NewWindow("Test Dialog")
	richhead := widget.NewRichTextFromMarkdown(`
![Go2TV](go2tv-icon-small.png)

Cast your media files to UPnP/DLNA Media Renderers and Smart TVs

---
`)
	for i := range richhead.Segments {
		if seg, ok := richhead.Segments[i].(*widget.TextSegment); ok {
			seg.Style.Alignment = fyne.TextAlignCenter
		}

	}
	myWindow.SetContent(richhead)
	myWindow.ShowAndRun()
}

Fyne version

v2.3.0

Go compiler version

1.19.4

Operating system

Linux

Operating system version

Ubuntu 18.04

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions