Skip to content

Commit

Permalink
change ButtonHovered etc to PseudoHovered etc
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Li <sirbrandonthenerd@gmail.com>
  • Loading branch information
aspiringLich committed Jul 21, 2024
1 parent 761eb11 commit 299e0a5
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
16 changes: 8 additions & 8 deletions Content.Client/Stylesheets/Redux/Sheetlets/ButtonSheetlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ public static void MakeButtonRules<T>(IButtonConfig _,
{
rules.AddRange(new StyleRule[]
{
E<T>().MaybeClass(styleclass).ButtonNormal().Modulate(palette.Element),
E<T>().MaybeClass(styleclass).ButtonHovered().Modulate(palette.HoveredElement),
E<T>().MaybeClass(styleclass).ButtonPressed().Modulate(palette.PressedElement),
E<T>().MaybeClass(styleclass).ButtonDisabled().Modulate(palette.DisabledElement),
E<T>().MaybeClass(styleclass).PseudoNormal().Modulate(palette.Element),
E<T>().MaybeClass(styleclass).PseudoHovered().Modulate(palette.HoveredElement),
E<T>().MaybeClass(styleclass).PseudoPressed().Modulate(palette.PressedElement),
E<T>().MaybeClass(styleclass).PseudoDisabled().Modulate(palette.DisabledElement),
});
}

Expand All @@ -86,12 +86,12 @@ public static void MakeButtonRules(IButtonConfig _,
{
rules.AddRange(new StyleRule[]
{
E().MaybeClass(styleclass).ButtonNormal().Prop(Control.StylePropertyModulateSelf, palette.Element),
E().MaybeClass(styleclass).ButtonHovered().Prop(Control.StylePropertyModulateSelf, palette.HoveredElement),
E().MaybeClass(styleclass).ButtonPressed().Prop(Control.StylePropertyModulateSelf, palette.PressedElement),
E().MaybeClass(styleclass).PseudoNormal().Prop(Control.StylePropertyModulateSelf, palette.Element),
E().MaybeClass(styleclass).PseudoHovered().Prop(Control.StylePropertyModulateSelf, palette.HoveredElement),
E().MaybeClass(styleclass).PseudoPressed().Prop(Control.StylePropertyModulateSelf, palette.PressedElement),
E()
.MaybeClass(styleclass)
.ButtonDisabled()
.PseudoDisabled()
.Prop(Control.StylePropertyModulateSelf, palette.DisabledElement),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ public override StyleRule[] GetRules(PalettedStylesheet sheet, object config)
.Prop(ContainerButton.StylePropertyStyleBox, buttonContext),
E<ExamineButton>()
.Class(ExamineButton.StyleClassExamineButton)
.ButtonNormal()
.PseudoNormal()
.Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContext),
E<ExamineButton>()
.Class(ExamineButton.StyleClassExamineButton)
.ButtonHovered()
.PseudoHovered()
.Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContextHover),
E<ExamineButton>()
.Class(ExamineButton.StyleClassExamineButton)
.ButtonPressed()
.PseudoPressed()
.Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContextPressed),
E<ExamineButton>()
.Class(ExamineButton.StyleClassExamineButton)
.ButtonDisabled()
.PseudoDisabled()
.Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContextDisabled),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ public override StyleRule[] GetRules(PalettedStylesheet sheet, object config)
.Box(box),
E<ContainerButton>()
.Class(ListContainer.StyleClassListContainerButton)
.ButtonNormal()
.PseudoNormal()
.Modulate(new Color(55, 55, 68)),
E<ContainerButton>()
.Class(ListContainer.StyleClassListContainerButton)
.ButtonHovered()
.PseudoHovered()
.Modulate(new Color(75, 75, 86)),
E<ContainerButton>()
.Class(ListContainer.StyleClassListContainerButton)
.ButtonPressed()
.PseudoPressed()
.Modulate(new Color(75, 75, 86)),
E<ContainerButton>()
.Class(ListContainer.StyleClassListContainerButton)
.ButtonDisabled()
.PseudoDisabled()
.Modulate(new Color(10, 10, 12)),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public override StyleRule[] GetRules(PalettedStylesheet sheet, object config)
return
[
E<VScrollBar>().Prop(ScrollBar.StylePropertyGrabber, vScrollBarGrabberNormal),
E<VScrollBar>().ButtonHovered().Prop(ScrollBar.StylePropertyGrabber, vScrollBarGrabberHover),
E<VScrollBar>().ButtonPressed().Prop(ScrollBar.StylePropertyGrabber, vScrollBarGrabberGrabbed),
E<VScrollBar>().PseudoHovered().Prop(ScrollBar.StylePropertyGrabber, vScrollBarGrabberHover),
E<VScrollBar>().PseudoPressed().Prop(ScrollBar.StylePropertyGrabber, vScrollBarGrabberGrabbed),
E<HScrollBar>().Prop(ScrollBar.StylePropertyGrabber, hScrollBarGrabberNormal),
E<HScrollBar>().ButtonHovered().Prop(ScrollBar.StylePropertyGrabber, hScrollBarGrabberHover),
E<HScrollBar>().ButtonPressed().Prop(ScrollBar.StylePropertyGrabber, hScrollBarGrabberGrabbed),
E<HScrollBar>().PseudoHovered().Prop(ScrollBar.StylePropertyGrabber, hScrollBarGrabberHover),
E<HScrollBar>().PseudoPressed().Prop(ScrollBar.StylePropertyGrabber, hScrollBarGrabberGrabbed),
];
}
}
10 changes: 5 additions & 5 deletions Content.Client/Stylesheets/Redux/StylesheetHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ public static MutableSelector AlignMode(this MutableSelector selector, Label.Ali
return selector.Prop(Label.StylePropertyAlignMode, mode);
}

// Button helpers
// Pseudo class helpers

public static MutableSelectorElement ButtonNormal(this MutableSelectorElement selector)
public static MutableSelectorElement PseudoNormal(this MutableSelectorElement selector)
{
return selector.Pseudo(ContainerButton.StylePseudoClassNormal);
}

public static MutableSelectorElement ButtonHovered(this MutableSelectorElement selector)
public static MutableSelectorElement PseudoHovered(this MutableSelectorElement selector)
{
return selector.Pseudo(ContainerButton.StylePseudoClassHover);
}

public static MutableSelectorElement ButtonPressed(this MutableSelectorElement selector)
public static MutableSelectorElement PseudoPressed(this MutableSelectorElement selector)
{
return selector.Pseudo(ContainerButton.StylePseudoClassPressed);
}

public static MutableSelectorElement ButtonDisabled(this MutableSelectorElement selector)
public static MutableSelectorElement PseudoDisabled(this MutableSelectorElement selector)
{
return selector.Pseudo(ContainerButton.StylePseudoClassDisabled);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Stylesheets/Redux/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- Eh, most of it anyway
- [x] Make all `StyleClass` conform to naming conventions
- [x] Separate out `FontKind` maybe
- [ ] change `ButtonHovered` and friends to `PseudoHovered`
- [x] change `ButtonHovered` and friends to `PseudoHovered`
- [x] `IPanelPalette` is unnecessary now
- [ ] What the fuck is `StyleSpace` get rid of it
- [ ] Fix the codepen
Expand Down

0 comments on commit 299e0a5

Please sign in to comment.