don't add label to crosshair

This commit is contained in:
ntr committed 2023-08-08 18:18:27 +10:00
1 parent 6b3f1f5338
commit 7d155b17b6
3 files changed
+13 -9

No files matched your search

+11 -6
View File
@@ -14,6 +14,9 @@ namespace CrosshairComponents {
}
public new class UxmlFactory : UxmlFactory<ThreeArmCrosshair, UxmlTraits> { }
public static readonly string ussClassName = "crosshair";
public static readonly string ussLabelClassName = "crosshair__label";
static CustomStyleProperty<Color> s_TrackColor = new CustomStyleProperty<Color>("--track-color");
static CustomStyleProperty<Color> s_ProgressColor = new CustomStyleProperty<Color>("--progress-color");
@@ -39,8 +42,10 @@ namespace CrosshairComponents {
public ThreeArmCrosshair() {
// Create a Label, add a USS class name, and add it to this visual tree.
m_Label = new Label();
Add(m_Label);
// m_Label = new Label();
// m_Label.AddToClassList(ussLabelClassName);
AddToClassList(ussClassName);
// Add(m_Label);
// Register a callback after custom style resolution.
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
@@ -113,7 +118,6 @@ namespace CrosshairComponents {
}
public new class UxmlFactory : UxmlFactory<FourArmCrosshair, UxmlTraits> { }
// These are USS class names for the control overall and the label.
public static readonly string ussClassName = "crosshair";
public static readonly string ussLabelClassName = "crosshair__label";
@@ -141,9 +145,10 @@ namespace CrosshairComponents {
}
public FourArmCrosshair() {
// Create a Label, add a USS class name, and add it to this visual tree.
m_Label = new Label();
Add(m_Label);
// m_Label = new Label();
// m_Label.AddToClassList(ussLabelClassName);
AddToClassList(ussClassName);
// Add(m_Label);
// Register a callback after custom style resolution.
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));