Skip to content

Commit 701e45f

Browse files
committed
Fixed poor saturation with certain styles
1 parent a10abde commit 701e45f

11 files changed

Lines changed: 108 additions & 96 deletions

File tree

Sources/OvCore/src/OvCore/ECS/Components/CPointLight.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,22 @@ void OvCore::ECS::Components::CPointLight::OnInspector(OvUI::Internal::WidgetCon
9494
auto& constantPreset = presetsRoot.CreateWidget<OvUI::Widgets::Buttons::Button>("Constant");
9595
constantPreset.ClickedEvent += [this] { m_data.constant = 1.f, m_data.linear = m_data.quadratic = 0.f; };
9696
constantPreset.lineBreak = false;
97-
constantPreset.backgroundColor = OVUI_STYLE(Warning);
98-
constantPreset.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
99-
constantPreset.clickedBackgroundColor = OVUI_STYLE(WarningActive);
97+
constantPreset.backgroundColor = OVUI_STYLE(WarningButton);
98+
constantPreset.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
99+
constantPreset.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
100100

101101
auto& linearPreset = presetsRoot.CreateWidget<OvUI::Widgets::Buttons::Button>("Linear");
102102
linearPreset.ClickedEvent += [this] { m_data.linear = 1.f, m_data.constant = m_data.quadratic = 0.f; };
103103
linearPreset.lineBreak = false;
104-
linearPreset.backgroundColor = OVUI_STYLE(Warning);
105-
linearPreset.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
106-
linearPreset.clickedBackgroundColor = OVUI_STYLE(WarningActive);
104+
linearPreset.backgroundColor = OVUI_STYLE(WarningButton);
105+
linearPreset.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
106+
linearPreset.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
107107

108108
auto& quadraticPreset = presetsRoot.CreateWidget<OvUI::Widgets::Buttons::Button>("Quadratic");
109109
quadraticPreset.ClickedEvent += [this] { m_data.quadratic = 1.f, m_data.constant = m_data.linear = 0.f; };
110-
quadraticPreset.backgroundColor = OVUI_STYLE(Warning);
111-
quadraticPreset.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
112-
quadraticPreset.clickedBackgroundColor = OVUI_STYLE(WarningActive);
110+
quadraticPreset.backgroundColor = OVUI_STYLE(WarningButton);
111+
quadraticPreset.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
112+
quadraticPreset.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
113113

114114
GUIDrawer::DrawScalar<float>(p_root, "Constant", m_data.constant, 0.005f, 0.f);
115115
GUIDrawer::DrawScalar<float>(p_root, "Linear", m_data.linear, 0.005f, 0.f);

Sources/OvCore/src/OvCore/ECS/Components/CSpotLight.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,22 @@ void OvCore::ECS::Components::CSpotLight::OnInspector(OvUI::Internal::WidgetCont
121121
auto& constantPreset = presetsRoot.CreateWidget<OvUI::Widgets::Buttons::Button>("Constant");
122122
constantPreset.ClickedEvent += [this] { m_data.constant = 1.f, m_data.linear = m_data.quadratic = 0.f; };
123123
constantPreset.lineBreak = false;
124-
constantPreset.backgroundColor = OVUI_STYLE(Warning);
125-
constantPreset.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
126-
constantPreset.clickedBackgroundColor = OVUI_STYLE(WarningActive);
124+
constantPreset.backgroundColor = OVUI_STYLE(WarningButton);
125+
constantPreset.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
126+
constantPreset.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
127127

128128
auto& linearPreset = presetsRoot.CreateWidget<OvUI::Widgets::Buttons::Button>("Linear");
129129
linearPreset.ClickedEvent += [this] { m_data.linear = 1.f, m_data.constant = m_data.quadratic = 0.f; };
130130
linearPreset.lineBreak = false;
131-
linearPreset.backgroundColor = OVUI_STYLE(Warning);
132-
linearPreset.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
133-
linearPreset.clickedBackgroundColor = OVUI_STYLE(WarningActive);
131+
linearPreset.backgroundColor = OVUI_STYLE(WarningButton);
132+
linearPreset.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
133+
linearPreset.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
134134

135135
auto& quadraticPreset = presetsRoot.CreateWidget<OvUI::Widgets::Buttons::Button>("Quadratic");
136136
quadraticPreset.ClickedEvent += [this] { m_data.quadratic = 1.f, m_data.constant = m_data.linear = 0.f; };
137-
quadraticPreset.backgroundColor = OVUI_STYLE(Warning);
138-
quadraticPreset.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
139-
quadraticPreset.clickedBackgroundColor = OVUI_STYLE(WarningActive);
137+
quadraticPreset.backgroundColor = OVUI_STYLE(WarningButton);
138+
quadraticPreset.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
139+
quadraticPreset.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
140140

141141
GUIDrawer::DrawScalar<float>(p_root, "Constant", m_data.constant, 0.005f, 0.f);
142142
GUIDrawer::DrawScalar<float>(p_root, "Linear", m_data.linear, 0.005f, 0.f);

Sources/OvEditor/src/OvEditor/Core/ProjectHub.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ namespace OvEditor::Core
6565

6666
_UpdateGoButton({});
6767

68-
openProjectButton.backgroundColor = OVUI_STYLE(Warning);
69-
openProjectButton.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
70-
openProjectButton.clickedBackgroundColor = OVUI_STYLE(WarningActive);
71-
newProjectButton.backgroundColor = OVUI_STYLE(Success);
72-
newProjectButton.hoveredBackgroundColor = OVUI_STYLE(SuccessHovered);
73-
newProjectButton.clickedBackgroundColor = OVUI_STYLE(SuccessActive);
68+
openProjectButton.backgroundColor = OVUI_STYLE(WarningButton);
69+
openProjectButton.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
70+
openProjectButton.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
71+
newProjectButton.backgroundColor = OVUI_STYLE(SuccessButton);
72+
newProjectButton.hoveredBackgroundColor = OVUI_STYLE(SuccessButtonHovered);
73+
newProjectButton.clickedBackgroundColor = OVUI_STYLE(SuccessButtonActive);
7474

7575
openProjectButton.ClickedEvent += [this] {
7676
OvWindowing::Dialogs::OpenFileDialog dialog("Open project");
@@ -141,12 +141,12 @@ namespace OvEditor::Core
141141
auto& openButton = actions.CreateWidget<OvUI::Widgets::Buttons::Button>("Open");
142142
auto& deleteButton = actions.CreateWidget<OvUI::Widgets::Buttons::Button>("Delete");
143143

144-
openButton.backgroundColor = OVUI_STYLE(Warning);
145-
openButton.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
146-
openButton.clickedBackgroundColor = OVUI_STYLE(WarningActive);
147-
deleteButton.backgroundColor = OVUI_STYLE(Danger);
148-
deleteButton.hoveredBackgroundColor = OVUI_STYLE(DangerHovered);
149-
deleteButton.clickedBackgroundColor = OVUI_STYLE(DangerActive);
144+
openButton.backgroundColor = OVUI_STYLE(WarningButton);
145+
openButton.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
146+
openButton.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
147+
deleteButton.backgroundColor = OVUI_STYLE(DangerButton);
148+
deleteButton.hoveredBackgroundColor = OVUI_STYLE(DangerButtonHovered);
149+
deleteButton.clickedBackgroundColor = OVUI_STYLE(DangerButtonActive);
150150

151151
openButton.ClickedEvent += [this, &text, &actions, project] {
152152
if (!_TryFinish({ project }))
@@ -183,9 +183,9 @@ namespace OvEditor::Core
183183
void _UpdateGoButton(const std::string& p_path)
184184
{
185185
const bool validPath = !p_path.empty();
186-
m_goButton->backgroundColor = validPath ? OVUI_STYLE(Success) : OVUI_STYLE(Button);
187-
m_goButton->hoveredBackgroundColor = validPath ? OVUI_STYLE(SuccessHovered) : OVUI_STYLE(ButtonHovered);
188-
m_goButton->clickedBackgroundColor = validPath ? OVUI_STYLE(SuccessActive) : OVUI_STYLE(ButtonActive);
186+
m_goButton->backgroundColor = validPath ? OVUI_STYLE(SuccessButton) : OVUI_STYLE(Button);
187+
m_goButton->hoveredBackgroundColor = validPath ? OVUI_STYLE(SuccessButtonHovered) : OVUI_STYLE(ButtonHovered);
188+
m_goButton->clickedBackgroundColor = validPath ? OVUI_STYLE(SuccessButtonActive) : OVUI_STYLE(ButtonActive);
189189
m_goButton->disabled = !validPath;
190190
}
191191

Sources/OvEditor/src/OvEditor/Panels/AssetBrowser.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -915,22 +915,22 @@ OvEditor::Panels::AssetBrowser::AssetBrowser
915915
auto& refreshButton = CreateWidget<Buttons::Button>("Refresh");
916916
refreshButton.ClickedEvent += std::bind(&AssetBrowser::Refresh, this);
917917
refreshButton.lineBreak = false;
918-
refreshButton.backgroundColor = OVUI_STYLE(Success);
919-
refreshButton.hoveredBackgroundColor = OVUI_STYLE(SuccessHovered);
920-
refreshButton.clickedBackgroundColor = OVUI_STYLE(SuccessActive);
918+
refreshButton.backgroundColor = OVUI_STYLE(SuccessButton);
919+
refreshButton.hoveredBackgroundColor = OVUI_STYLE(SuccessButtonHovered);
920+
refreshButton.clickedBackgroundColor = OVUI_STYLE(SuccessButtonActive);
921921

922922
auto& importButton = CreateWidget<Buttons::Button>("Import Asset");
923923
importButton.ClickedEvent += EDITOR_BIND(ImportAsset, EDITOR_CONTEXT(projectAssetsPath).string());
924-
importButton.backgroundColor = OVUI_STYLE(Warning);
925-
importButton.hoveredBackgroundColor = OVUI_STYLE(WarningHovered);
926-
importButton.clickedBackgroundColor = OVUI_STYLE(WarningActive);
924+
importButton.backgroundColor = OVUI_STYLE(WarningButton);
925+
importButton.hoveredBackgroundColor = OVUI_STYLE(WarningButtonHovered);
926+
importButton.clickedBackgroundColor = OVUI_STYLE(WarningButtonActive);
927927
importButton.lineBreak = false;
928928

929929
auto& codeEditorButton = CreateWidget<Buttons::Button>("Open Code Editor");
930930
codeEditorButton.ClickedEvent += [this] { EDITOR_EXEC(OpenInCodeEditor(EDITOR_CONTEXT(projectFolder))); };
931-
codeEditorButton.backgroundColor = OVUI_STYLE(Accent);
932-
codeEditorButton.hoveredBackgroundColor = OVUI_STYLE(AccentHovered);
933-
codeEditorButton.clickedBackgroundColor = OVUI_STYLE(AccentActive);
931+
codeEditorButton.backgroundColor = OVUI_STYLE(AccentButton);
932+
codeEditorButton.hoveredBackgroundColor = OVUI_STYLE(AccentButtonHovered);
933+
codeEditorButton.clickedBackgroundColor = OVUI_STYLE(AccentButtonActive);
934934

935935
m_assetList = &CreateWidget<Layout::Group>();
936936

Sources/OvEditor/src/OvEditor/Panels/AssetProperties.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ void OvEditor::Panels::AssetProperties::Preview()
143143
void OvEditor::Panels::AssetProperties::CreateHeaderButtons()
144144
{
145145
m_applyButton = &CreateWidget<OvUI::Widgets::Buttons::Button>("Apply");
146-
m_applyButton->backgroundColor = OVUI_STYLE(Success);
147-
m_applyButton->hoveredBackgroundColor = OVUI_STYLE(SuccessHovered);
148-
m_applyButton->clickedBackgroundColor = OVUI_STYLE(SuccessActive);
146+
m_applyButton->backgroundColor = OVUI_STYLE(SuccessButton);
147+
m_applyButton->hoveredBackgroundColor = OVUI_STYLE(SuccessButtonHovered);
148+
m_applyButton->clickedBackgroundColor = OVUI_STYLE(SuccessButtonActive);
149149
m_applyButton->tooltip = "Save changes and reimport the asset with the new settings";
150150
m_applyButton->enabled = false;
151151
m_applyButton->lineBreak = false;
@@ -166,9 +166,9 @@ void OvEditor::Panels::AssetProperties::CreateHeaderButtons()
166166

167167
m_resetButton = &CreateWidget<OvUI::Widgets::Buttons::Button>("Reset");
168168
m_resetButton->tooltip = "Reset all settings to default values";
169-
m_resetButton->backgroundColor = OVUI_STYLE(Danger);
170-
m_resetButton->hoveredBackgroundColor = OVUI_STYLE(DangerHovered);
171-
m_resetButton->clickedBackgroundColor = OVUI_STYLE(DangerActive);
169+
m_resetButton->backgroundColor = OVUI_STYLE(DangerButton);
170+
m_resetButton->hoveredBackgroundColor = OVUI_STYLE(DangerButtonHovered);
171+
m_resetButton->clickedBackgroundColor = OVUI_STYLE(DangerButtonActive);
172172
m_resetButton->enabled = false;
173173
m_resetButton->lineBreak = false;
174174
m_resetButton->ClickedEvent += [this] {

Sources/OvEditor/src/OvEditor/Panels/Console.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ OvEditor::Panels::Console::Console
9191
toolbar.horizontal = true;
9292

9393
auto& clearButton = toolbar.CreateWidget<Buttons::Button>("Clear");
94-
clearButton.backgroundColor = OVUI_STYLE(Danger);
95-
clearButton.hoveredBackgroundColor = OVUI_STYLE(DangerHovered);
96-
clearButton.clickedBackgroundColor = OVUI_STYLE(DangerActive);
94+
clearButton.backgroundColor = OVUI_STYLE(DangerButton);
95+
clearButton.hoveredBackgroundColor = OVUI_STYLE(DangerButtonHovered);
96+
clearButton.clickedBackgroundColor = OVUI_STYLE(DangerButtonActive);
9797
clearButton.ClickedEvent += [this]
9898
{
9999
Clear();

Sources/OvEditor/src/OvEditor/Panels/MaterialEditor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ void OvEditor::Panels::MaterialEditor::OnShaderDropped()
196196
void OvEditor::Panels::MaterialEditor::CreateHeaderButtons()
197197
{
198198
auto& saveButton = CreateWidget<Buttons::Button>("Save");
199-
saveButton.backgroundColor = OVUI_STYLE(Success);
200-
saveButton.hoveredBackgroundColor = OVUI_STYLE(SuccessHovered);
201-
saveButton.clickedBackgroundColor = OVUI_STYLE(SuccessActive);
199+
saveButton.backgroundColor = OVUI_STYLE(SuccessButton);
200+
saveButton.hoveredBackgroundColor = OVUI_STYLE(SuccessButtonHovered);
201+
saveButton.clickedBackgroundColor = OVUI_STYLE(SuccessButtonActive);
202202
saveButton.tooltip = "Save the current material to file";
203203
saveButton.lineBreak = false;
204204
saveButton.ClickedEvent += [this] {
@@ -258,9 +258,9 @@ void OvEditor::Panels::MaterialEditor::CreateHeaderButtons()
258258
previewButton.ClickedEvent += std::bind(&MaterialEditor::Preview, this);
259259

260260
auto& resetButton = CreateWidget<Buttons::Button>("Reset");
261-
resetButton.backgroundColor = OVUI_STYLE(Danger);
262-
resetButton.hoveredBackgroundColor = OVUI_STYLE(DangerHovered);
263-
resetButton.clickedBackgroundColor = OVUI_STYLE(DangerActive);
261+
resetButton.backgroundColor = OVUI_STYLE(DangerButton);
262+
resetButton.hoveredBackgroundColor = OVUI_STYLE(DangerButtonHovered);
263+
resetButton.clickedBackgroundColor = OVUI_STYLE(DangerButtonActive);
264264
resetButton.tooltip = "Reset the current material to its default state";
265265
resetButton.ClickedEvent += std::bind(&MaterialEditor::Reset, this);
266266
}

Sources/OvEditor/src/OvEditor/Panels/ProjectSettings.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ OvEditor::Panels::ProjectSettings::ProjectSettings(const std::string & p_title,
2727
m_projectFile(EDITOR_CONTEXT(projectSettings))
2828
{
2929
auto& saveButton = CreateWidget<Buttons::Button>("Apply");
30-
saveButton.backgroundColor = OVUI_STYLE(Success);
31-
saveButton.hoveredBackgroundColor = OVUI_STYLE(SuccessHovered);
32-
saveButton.clickedBackgroundColor = OVUI_STYLE(SuccessActive);
30+
saveButton.backgroundColor = OVUI_STYLE(SuccessButton);
31+
saveButton.hoveredBackgroundColor = OVUI_STYLE(SuccessButtonHovered);
32+
saveButton.clickedBackgroundColor = OVUI_STYLE(SuccessButtonActive);
3333
saveButton.ClickedEvent += [this]
3434
{
3535
EDITOR_CONTEXT(ApplyProjectSettings());
@@ -39,9 +39,9 @@ OvEditor::Panels::ProjectSettings::ProjectSettings(const std::string & p_title,
3939
saveButton.lineBreak = false;
4040

4141
auto& resetButton = CreateWidget<Buttons::Button>("Reset");
42-
resetButton.backgroundColor = OVUI_STYLE(Danger);
43-
resetButton.hoveredBackgroundColor = OVUI_STYLE(DangerHovered);
44-
resetButton.clickedBackgroundColor = OVUI_STYLE(DangerActive);
42+
resetButton.backgroundColor = OVUI_STYLE(DangerButton);
43+
resetButton.hoveredBackgroundColor = OVUI_STYLE(DangerButtonHovered);
44+
resetButton.clickedBackgroundColor = OVUI_STYLE(DangerButtonActive);
4545
resetButton.ClickedEvent += [this]
4646
{
4747
EDITOR_CONTEXT(ResetProjectSettings());

Sources/OvUI/include/OvUI/Styling/Style.h

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,33 @@ namespace OvUI::Styling
143143
// ---- Semantic colors ----
144144
// Reuse ImGui built-in fields (e.g. Text, TextDisabled, Button) wherever possible.
145145
// These are for cases that need intent-specific colors beyond what ImGui provides.
146-
Types::Color Success;
147-
Types::Color SuccessHovered;
148-
Types::Color SuccessActive;
149146

147+
// Text/label foreground colors — bright and readable as foreground text.
148+
Types::Color Success;
150149
Types::Color Danger;
151-
Types::Color DangerHovered;
152-
Types::Color DangerActive;
153-
154150
Types::Color Warning;
155-
Types::Color WarningHovered;
156-
Types::Color WarningActive;
157-
158151
Types::Color Accent;
159-
Types::Color AccentHovered;
160-
Types::Color AccentActive;
161-
162152
Types::Color Info;
163153
Types::Color InspectorTitle;
164154
Types::Color Highlight;
165155

156+
// Button background colors — muted enough to work as interactive backgrounds.
157+
Types::Color SuccessButton;
158+
Types::Color SuccessButtonHovered;
159+
Types::Color SuccessButtonActive;
160+
161+
Types::Color DangerButton;
162+
Types::Color DangerButtonHovered;
163+
Types::Color DangerButtonActive;
164+
165+
Types::Color WarningButton;
166+
Types::Color WarningButtonHovered;
167+
Types::Color WarningButtonActive;
168+
169+
Types::Color AccentButton;
170+
Types::Color AccentButtonHovered;
171+
Types::Color AccentButtonActive;
172+
166173
private:
167174
Style();
168175

Sources/OvUI/include/OvUI/Widgets/Buttons/Toggle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ namespace OvUI::Widgets::Buttons
3939
std::string labelB;
4040
bool state = false;
4141

42-
Types::ColorEffector activeColor = OVUI_STYLE(Warning);
43-
Types::ColorEffector activeHoveredColor = OVUI_STYLE(WarningHovered);
44-
Types::ColorEffector activePressedColor = OVUI_STYLE(WarningActive);
42+
Types::ColorEffector activeColor = OVUI_STYLE(WarningButton);
43+
Types::ColorEffector activeHoveredColor = OVUI_STYLE(WarningButtonHovered);
44+
Types::ColorEffector activePressedColor = OVUI_STYLE(WarningButtonActive);
4545
Types::ColorEffector inactiveColor = OVUI_STYLE(Button);
4646
Types::ColorEffector inactiveHoveredColor = OVUI_STYLE(ButtonHovered);
4747
Types::ColorEffector inactivePressedColor = OVUI_STYLE(ButtonActive);

0 commit comments

Comments
 (0)