Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TSBK03 project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adam Nyberg
TSBK03 project
Commits
6a5f4cda
Commit
6a5f4cda
authored
6 months ago
by
Adam Nyberg
Browse files
Options
Downloads
Patches
Plain Diff
Added nicer ImGUI theme, just for fun, completly unnecessary
parent
714bd6b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/MainGUI.cpp
+60
-1
60 additions, 1 deletion
src/MainGUI.cpp
with
60 additions
and
1 deletion
src/MainGUI.cpp
+
60
−
1
View file @
6a5f4cda
...
...
@@ -10,6 +10,64 @@
#include
"include/FluidSimulationApp.h"
void
SetCustomImGuiTheme
()
{
ImGuiStyle
&
style
=
ImGui
::
GetStyle
();
// General spacing and rounding for a clean look
style
.
TabRounding
=
2.0
f
;
// Subtle rounding
style
.
WindowRounding
=
3.0
f
;
// Slight rounding for dockable windows
style
.
ChildRounding
=
2.0
f
;
// Consistent with tabs
style
.
PopupRounding
=
2.0
f
;
style
.
FrameRounding
=
3.0
f
;
// For sliders and buttons
style
.
GrabRounding
=
2.0
f
;
// For slider knobs
style
.
WindowPadding
=
ImVec2
(
4
,
4
);
style
.
FramePadding
=
ImVec2
(
4
,
4
);
style
.
ItemSpacing
=
ImVec2
(
12
,
8
);
style
.
ScrollbarSize
=
15.0
f
;
// Blender/Unity-like Colors (Darker gray with contrasting highlights)
ImVec4
*
colors
=
style
.
Colors
;
// Tab colors
colors
[
ImGuiCol_Tab
]
=
ImVec4
(
0.18
f
,
0.18
f
,
0.18
f
,
1.00
f
);
// Neutral dark gray
colors
[
ImGuiCol_TabHovered
]
=
ImVec4
(
0.28
f
,
0.28
f
,
0.28
f
,
1.00
f
);
// Slightly lighter when hovered
colors
[
ImGuiCol_TabActive
]
=
ImVec4
(
0.25
f
,
0.25
f
,
0.25
f
,
1.00
f
);
// Active tab
colors
[
ImGuiCol_TabUnfocused
]
=
ImVec4
(
0.15
f
,
0.15
f
,
0.15
f
,
1.00
f
);
// Background tabs
colors
[
ImGuiCol_TabUnfocusedActive
]
=
ImVec4
(
0.20
f
,
0.20
f
,
0.20
f
,
1.00
f
);
// Active but unfocused tab
// Docking preview highlight (less intrusive)
colors
[
ImGuiCol_DockingPreview
]
=
ImVec4
(
0.10
f
,
0.10
f
,
0.10
f
,
0.70
f
);
// Window borders and docking separators
colors
[
ImGuiCol_Border
]
=
ImVec4
(
0.20
f
,
0.20
f
,
0.20
f
,
1.00
f
);
// Subtle border
colors
[
ImGuiCol_BorderShadow
]
=
ImVec4
(
0.00
f
,
0.00
f
,
0.00
f
,
0.00
f
);
// No shadow
// Remove overly bright lines on docking highlights
colors
[
ImGuiCol_DockingEmptyBg
]
=
ImVec4
(
0.14
f
,
0.14
f
,
0.14
f
,
1.00
f
);
colors
[
ImGuiCol_Text
]
=
ImVec4
(
0.90
f
,
0.90
f
,
0.90
f
,
1.00
f
);
// White text
colors
[
ImGuiCol_WindowBg
]
=
ImVec4
(
0.14
f
,
0.14
f
,
0.14
f
,
1.00
f
);
// Dark gray background
colors
[
ImGuiCol_Border
]
=
ImVec4
(
0.29
f
,
0.29
f
,
0.29
f
,
0.50
f
);
// Soft borders
colors
[
ImGuiCol_FrameBg
]
=
ImVec4
(
0.21
f
,
0.21
f
,
0.21
f
,
1.00
f
);
// Input background
colors
[
ImGuiCol_FrameBgHovered
]
=
ImVec4
(
0.33
f
,
0.33
f
,
0.33
f
,
1.00
f
);
// Hover effect
colors
[
ImGuiCol_FrameBgActive
]
=
ImVec4
(
0.26
f
,
0.59
f
,
0.98
f
,
0.67
f
);
// Active field
colors
[
ImGuiCol_TitleBg
]
=
ImVec4
(
0.10
f
,
0.10
f
,
0.10
f
,
1.00
f
);
// Title bar
colors
[
ImGuiCol_TitleBgActive
]
=
ImVec4
(
0.15
f
,
0.15
f
,
0.15
f
,
1.00
f
);
// Active title bar
colors
[
ImGuiCol_Button
]
=
ImVec4
(
0.20
f
,
0.20
f
,
0.20
f
,
1.00
f
);
// Buttons
colors
[
ImGuiCol_ButtonHovered
]
=
ImVec4
(
0.30
f
,
0.30
f
,
0.30
f
,
1.00
f
);
// Hovered buttons
colors
[
ImGuiCol_ButtonActive
]
=
ImVec4
(
0.26
f
,
0.59
f
,
0.98
f
,
1.00
f
);
// Active buttons
colors
[
ImGuiCol_Header
]
=
ImVec4
(
0.20
f
,
0.20
f
,
0.20
f
,
1.00
f
);
// Collapsible headers
colors
[
ImGuiCol_HeaderHovered
]
=
ImVec4
(
0.26
f
,
0.26
f
,
0.26
f
,
1.00
f
);
colors
[
ImGuiCol_HeaderActive
]
=
ImVec4
(
0.26
f
,
0.59
f
,
0.98
f
,
0.67
f
);
colors
[
ImGuiCol_ScrollbarBg
]
=
ImVec4
(
0.10
f
,
0.10
f
,
0.10
f
,
1.00
f
);
colors
[
ImGuiCol_ScrollbarGrab
]
=
ImVec4
(
0.30
f
,
0.30
f
,
0.30
f
,
1.00
f
);
colors
[
ImGuiCol_ScrollbarGrabHovered
]
=
ImVec4
(
0.40
f
,
0.40
f
,
0.40
f
,
1.00
f
);
colors
[
ImGuiCol_ScrollbarGrabActive
]
=
ImVec4
(
0.50
f
,
0.50
f
,
0.50
f
,
1.00
f
);
colors
[
ImGuiCol_CheckMark
]
=
ImVec4
(
0.26
f
,
0.59
f
,
0.98
f
,
1.00
f
);
// Checkbox mark
}
void
GLFWKeyCallback
(
GLFWwindow
*
window
,
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
// Retrieve FluidSimulatorApp from window user pointer
FluidSimulation
::
FluidSimulatorApp
*
app
=
static_cast
<
FluidSimulation
::
FluidSimulatorApp
*>
(
glfwGetWindowUserPointer
(
window
));
...
...
@@ -106,8 +164,9 @@ int main(int argc, char** argv) {
fprintf
(
stderr
,
"Failed To Load Font
\n
"
);
}
// Setup Dear ImGui style
ImGui
::
StyleColorsDark
();
//
ImGui::StyleColorsDark();
// ImGui::StyleColorsClassic();
SetCustomImGuiTheme
();
// Setup Platform/Renderer backends
ImGui_ImplGlfw_InitForOpenGL
(
window
,
true
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment