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

[godot 4] make caret color black by default #446

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions C7/UIElements/Popups/BuildCityDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public partial class BuildCityDialog : Popup

public BuildCityDialog(string defaultName)
{
cityName.Theme = ThemeFactory.DefaultTheme;
cityName.CaretBlink = true;
this.defaultName = defaultName;
alignment = BoxContainer.AlignmentMode.End;
margins = new Margins(right: -10); // 10px margin from the right
Expand Down
15 changes: 15 additions & 0 deletions C7/UIElements/Theme.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Godot;

public static class ThemeFactory {

static ThemeFactory() {
WildWeazel marked this conversation as resolved.
Show resolved Hide resolved
defaultTheme = new Theme();
defaultTheme.SetColor("caret_color", "LineEdit", Colors.Black);
}

private static Theme defaultTheme;

public static Theme DefaultTheme {
get => defaultTheme;
}
}