Comments (5)
If you turn off scrolling then the returned minimum size will be different.
Items that have scrolling turned on will always return a minsize that represents the smallest area that is usable.
from fyne.
// Scroll can be used to turn off the scrolling of our entry when Wrapping is WrapNone.
//
// Since: 2.4
Scroll widget.ScrollDirection
entry.Wrapping = fyne.TextWrapBreak
testE := widget.Entry{
Text: "test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n",
MultiLine: true,
Wrapping: fyne.TextWrapBreak,
}
s := testE.MinSize()
log.Debug("testE MinSize: %v", s)
testE2 := widget.Entry{
Text: "test\ntest\ntest\ntest\ntest\ntest\ntest\ntest",
MultiLine: true,
Wrapping: fyne.TextWrapBreak,
}
s = testE2.MinSize()
log.Debug("testE2 MinSize: %v", s)
2024/04/24 11:37:25.842972 DEBG: testE MinSize: {36.703125 73.234375}
2024/04/24 11:37:25.843474 DEBG: testE2 MinSize: {36.703125 73.234375}
I turn off scroll of the entry. but, The function of Entry.MinSize() still return same size.
from fyne.
testE := widget.Entry{
Text: "test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n",
MultiLine: true,
// Wrapping: fyne.TextWrapWord,
}
s := testE.MinSize()
log.Debug("testE MinSize: %v", s)
testE2 := widget.Entry{
Text: "test\ntest\ntest\ntest\ntest\ntest\ntest\ntest",
MultiLine: true,
Wrapping: fyne.TextWrapWord,
}
s = testE2.MinSize()
log.Debug("testE2 MinSize: %v", s)
testTg := widget.NewTextGridFromString("test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n")
s2 := testTg.MinSize()
log.Debug("testGrid MinSize: %v", s2)
testTg = widget.NewTextGridFromString("test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n")
s2 = testTg.MinSize()
log.Debug("testGrid2 MinSize MinSize: %v", s2)
I was considering using TextGrid, but it seems unsuitable for a log viewer as it does not support drag and select functionality
from fyne.
I turn off scroll of the entry. but, The function of Entry.MinSize() still return same size.
No, you didn't turn off scrolling.
from fyne.
Moving this to a discussion as it is a question. Please use the issue tracker for bugs and feature requests.
from fyne.
Related Issues (20)
- Add support for changing device orientation using mobile simulator HOT 2
- Incorrect scaling on Steam Deck screen HOT 1
- Feature Request: Entry responding to mouse events HOT 3
- How do I delete the default "Quit" in the system tray? HOT 1
- FormLayout calls MinSize twice
- Possible deadlocks around BaseWidget.Theme access HOT 6
- Memory leak in widget.Table due to constantly creating cells to cache.Renderer(impl) while table.Refresh() HOT 13
- [develop - android build] error while building to android HOT 1
- Custom fonts use memory that is never freed HOT 1
- Sometimes the last list row that should be visible doesn't show HOT 1
- UpdateHeader func of a table with header is being called multiple times whenever a cell in the table's body is refreshed HOT 2
- Don't show title when mouse hover on Systray menu HOT 1
- Table passes negative index to onSelected function HOT 5
- Tidy the fyne CLI (in tools repo) HOT 2
- When scroll bar is expanded, clicking above or below the bar should scroll up or down HOT 1
- Widget Entry with a custom icon HOT 3
- Fyne Demo not runnable on macOS Ventura VM (OpenGL related) HOT 3
- Unable to run some apps on M1 Macbook Pro HOT 2
- Build fails with transparent image for iOS icon HOT 3
- Disabled app tabs can still be selected in popup menu HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fyne.