Comments (6)
This is unrelated to the original issue. Please create a new issue with a detailed reproducible.
from avalonia.
I have a similar with ContentPresenter and TextAlignment.
I am using TextAlignment="Center" in a TemplatedControl.
The control display well in designer, but when the control is used in the real app, in a view that is already visible on screen. The texts are empty.
If I resize the window so that Measure of the control is called, or if I change view and get back (e.g. in a tab control), the display is now correct
Same issue with TextAlignment="Right", but no problem with Left.
Avalonia 11.0.1 beta 2
You can repro using the Theme of the HeaderedContentControl and adding TextAlignement="Center" for the ContentPresenter.
from avalonia.
Another example of the issue with TextAlignment=Center: (no issue with HorizontalAlignment=Center)
I can use HorizontalAlignment instead of TextAlignement at the moment, but centering is not exactly the same. HorizontalAlignment is not perfectly centered, and don't work on multilines.
And another issue with text: not sure if it is the same bug or not but sometime the end of the text is not visible in ToolTips.
I display Bounds in a ToolTip:
I am using Segoe UI font in Windows 11 (scale 100%) with 11.1 RC1.
FontSize=12 but I got issue with all Font Sizes with TextAlignment.
from avalonia.
And another issue with text: not sure if it is the same bug or not but sometime the end of the text is not visible in ToolTips.
That seems unrelated, the text is simply too long for the remaining space.
You could use a TextWrapping
value of WrapWithOverflow
or increase the width of the ToolTip.
from avalonia.
And another issue with text: not sure if it is the same bug or not but sometime the end of the text is not visible in ToolTips.
That seems unrelated, the text is simply too long for the remaining space. You could use a
TextWrapping
value ofWrapWithOverflow
or increase the width of the ToolTip.
I double checked and the tooltip is limited to 240 pixels wide with TextWrapping... so there is no reason that the text is truncated.
I also tried WrapWithOverflow instead of Wrap is the result is the same.
May some kind of rounding error, or a measure that is not called.
from avalonia.
Until the bug is fixed, here a ugly workaround for tooltips if someone need:
public class TruncatedToolTipWorkaroundConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is string s)
{
return s + ' ';
}
return value;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
Then in ToolTip theme:
Content="{TemplateBinding Content, Converter={StaticResource TruncatedToolTipWorkaroundConverter}}"
The tooltip is no more truncated at the end, but there is an additional whitespace, so small tooltips are no more centered.
from avalonia.
Related Issues (20)
- The UI will not render correctly when some mouse events occur, HOT 3
- Android screen rotation causes crash HOT 3
- DataGrid DataGridTemplateColumn Button SelectedItem null if row is not selected
- Color binding on slider thumb background property in fluent theme not working properly HOT 5
- Listbox.clear does not go to the top automatically
- GlyphTypeface.Name does not represents the correct family name for extended families
- ComboBox ItemsSource does not support ObservableCollection's View HOT 4
- DrawingContext state is broken in some cases HOT 1
- System.InvalidOperationException: Could not create glyphTypeface on Linux after upgrade to version 11.1.x HOT 4
- Binding OneTime does not work HOT 1
- Incorrect Coordinates Retrieved by PointToScreen on Linux in Loaded and Activated Events HOT 5
- Unsupported IBinding implementation after migration on 11.1 HOT 8
- Can't build in release mode. Can't find SimpleTheme HOT 2
- Tooltip doesn't disapear after mouse moves away HOT 2
- updated to 11.1.2 and the browser project does not build because it does not find the namespace avalonia.browser HOT 1
- WebRTC Support with Avalonia for Android and iOs HOT 2
- Avalonia.Browser RenderWorker and some other new classes shouldn't be public HOT 3
- ToolTip's Tip fails to be passed as CommndParameter HOT 2
- writeablebitmap performance issues HOT 3
- ListBox inside Popup not scrolling with PointWheelChanged HOT 7
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 avalonia.