Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font issue #1

Closed
ghost1372 opened this issue Apr 22, 2022 · 9 comments
Closed

font issue #1

ghost1372 opened this issue Apr 22, 2022 · 9 comments

Comments

@ghost1372
Copy link
Contributor

using MS Gothic font is not good option, this is my output
Untitled

You should resolve this issue without changing the font.

@AndrewKeepCoding
Copy link
Owner

Hi @ghost1372! Thanks for checking it out! I totally agree with you. I was going to find a way to get the whole width of the input text and use it to offset the Placeholder. I found a few ways to get the width but those were a bit tricky and I wanted this to be as simple as possible. I'll take another look but if you have something in mind, I'd appreciate the help😁

@AndrewKeepCoding
Copy link
Owner

I guess I need to wait for this issue (microsoft/microsoft-ui-xaml#808). There seems to be a difference in the rendering between TextBoxes and TexBlocks.

@ghost1372
Copy link
Contributor Author

tnx
Can we use TextBox instead of the TextBlock? mybe with a little change in style we can make it look like a TextBlock

@AndrewKeepCoding
Copy link
Owner

I followed your suggestion and created a branch. But instead of changing the style, which will be ending pulling the whole TextBox style, I added a TextBox control programmatically. I'll be checking a few things but I think I'll be updating the NuGet package in a day. Thanks again 😀

@ghost1372
Copy link
Contributor Author

ghost1372 commented Apr 25, 2022

tnx but it seems that suggestion is not working
Animation

@AndrewKeepCoding
Copy link
Owner

That's weird. I tested it on a new WinUI 3 project and worked without problems. This is the code.
XAML

<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
    <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
    <winui3:AutoCompleteTextBox SuggestionsSource="{x:Bind DemoSuggestions, Mode=OneWay}"/>
</StackPanel>

*.cs

public sealed partial class MainWindow : Window
{
    private List<string> DemoSuggestions { get; } = new();

    public MainWindow()
    {
        this.InitializeComponent();
        DemoSuggestions.Add("Ted Mosby");
        DemoSuggestions.Add("Marshal Eriksen");
        DemoSuggestions.Add("Barney Stinson");
    }

    private void myButton_Click(object sender, RoutedEventArgs e)
    {
        myButton.Content = "Clicked";
    }
}

Can you try setting IsSuggestionCaseSensitive to false and make sure SuggestionsSource is binded correctly? Ex) missing Mode=OneWay on x:Bind, etc...

@ghost1372
Copy link
Contributor Author

Hi @AndrewKeepCoding sorry for late response. I used your codes and this is result:

Animation

  1. I cant see suggestion!
  2. Foreground property is not working
  3. pressing Right Key from keyboard is working and select suggestion but i cant see suggestion itself

@AndrewKeepCoding
Copy link
Owner

AndrewKeepCoding commented Apr 26, 2022

Finally I got to reproduce the problem by changing my Windows to the Light mode.

These are the facts so far (Windows 11):

  • Foreground is not working when the control is Focused on both Light mode and Dark mode.
    This turned out to be normal behavior...😂
  • It's not showing the suggestion on Light mode.
  • Not sure if SuggestionForeground is working on Light mode.
    This is working fine. I could see it by setting Background to Transparent.

@AndrewKeepCoding
Copy link
Owner

Created new issue #3. Closing this. @ghost1372 see you there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants