Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ofxImGui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wt
ofxImGui
Commits
8685c93c
Commit
8685c93c
authored
Dec 09, 2019
by
w4t
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example-addons fix theme
parent
a9a31eff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
3 deletions
+95
-3
MyTheme.cpp
example-addons/src/MyTheme.cpp
+69
-0
MyTheme.h
example-addons/src/MyTheme.h
+12
-0
ofApp.cpp
example-addons/src/ofApp.cpp
+13
-2
ofApp.h
example-addons/src/ofApp.h
+1
-1
No files found.
example-addons/src/MyTheme.cpp
0 → 100644
View file @
8685c93c
#include "MyTheme.h"
ofColor
getRandomColor
()
{
return
ofColor
(
ofRandom
(
0
,
255
),
ofRandom
(
0
,
255
),
ofRandom
(
0
,
255
),
255
);
}
void
MyTheme
::
setup
()
{
ImGuiStyle
*
style
=
&
ImGui
::
GetStyle
();
style
->
WindowMinSize
=
ImVec2
(
160
,
65
);
style
->
FramePadding
=
ImVec2
(
4
,
2
);
style
->
ItemSpacing
=
ImVec2
(
6
,
2
);
style
->
ItemInnerSpacing
=
ImVec2
(
6
,
4
);
style
->
Alpha
=
1.0
f
;
style
->
WindowRounding
=
0.0
f
;
style
->
FrameRounding
=
0.0
f
;
style
->
IndentSpacing
=
6.0
f
;
style
->
ItemInnerSpacing
=
ImVec2
(
2
,
4
);
style
->
ColumnsMinSpacing
=
50.0
f
;
style
->
GrabMinSize
=
14.0
f
;
style
->
GrabRounding
=
0.0
f
;
style
->
ScrollbarSize
=
12.0
f
;
style
->
ScrollbarRounding
=
0.0
f
;
style
->
Colors
[
ImGuiCol_Text
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_TextDisabled
]
=
ImVec4
(
getRandomColor
(),
0.58
f
);
style
->
Colors
[
ImGuiCol_WindowBg
]
=
ImVec4
(
getRandomColor
(),
0.70
f
);
style
->
Colors
[
ImGuiCol_ChildWindowBg
]
=
ImVec4
(
getRandomColor
(),
0.58
f
);
style
->
Colors
[
ImGuiCol_Border
]
=
ImVec4
(
getRandomColor
(),
0.00
f
);
style
->
Colors
[
ImGuiCol_BorderShadow
]
=
ImVec4
(
getRandomColor
(),
0.00
f
);
style
->
Colors
[
ImGuiCol_FrameBg
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_FrameBgHovered
]
=
ImVec4
(
getRandomColor
(),
0.78
f
);
style
->
Colors
[
ImGuiCol_FrameBgActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_TitleBg
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_TitleBgCollapsed
]
=
ImVec4
(
getRandomColor
(),
0.75
f
);
style
->
Colors
[
ImGuiCol_TitleBgActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_MenuBarBg
]
=
ImVec4
(
getRandomColor
(),
0.47
f
);
style
->
Colors
[
ImGuiCol_ScrollbarBg
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_ScrollbarGrab
]
=
ImVec4
(
getRandomColor
(),
0.21
f
);
style
->
Colors
[
ImGuiCol_ScrollbarGrabHovered
]
=
ImVec4
(
getRandomColor
(),
0.78
f
);
style
->
Colors
[
ImGuiCol_ScrollbarGrabActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_CheckMark
]
=
ImVec4
(
getRandomColor
(),
0.80
f
);
style
->
Colors
[
ImGuiCol_SliderGrab
]
=
ImVec4
(
getRandomColor
(),
0.14
f
);
style
->
Colors
[
ImGuiCol_SliderGrabActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_Button
]
=
ImVec4
(
getRandomColor
(),
0.14
f
);
style
->
Colors
[
ImGuiCol_ButtonHovered
]
=
ImVec4
(
getRandomColor
(),
0.86
f
);
style
->
Colors
[
ImGuiCol_ButtonActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_Header
]
=
ImVec4
(
getRandomColor
(),
0.76
f
);
style
->
Colors
[
ImGuiCol_HeaderHovered
]
=
ImVec4
(
getRandomColor
(),
0.86
f
);
style
->
Colors
[
ImGuiCol_HeaderActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_Separator
]
=
ImVec4
(
getRandomColor
(),
0.32
f
);
style
->
Colors
[
ImGuiCol_SeparatorHovered
]
=
ImVec4
(
getRandomColor
(),
0.78
f
);
style
->
Colors
[
ImGuiCol_SeparatorActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_ResizeGrip
]
=
ImVec4
(
getRandomColor
(),
0.04
f
);
style
->
Colors
[
ImGuiCol_ResizeGripHovered
]
=
ImVec4
(
getRandomColor
(),
0.78
f
);
style
->
Colors
[
ImGuiCol_ResizeGripActive
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_PlotLines
]
=
ImVec4
(
getRandomColor
(),
0.63
f
);
style
->
Colors
[
ImGuiCol_PlotLinesHovered
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_PlotHistogram
]
=
ImVec4
(
getRandomColor
(),
0.63
f
);
style
->
Colors
[
ImGuiCol_PlotHistogramHovered
]
=
ImVec4
(
getRandomColor
(),
1.00
f
);
style
->
Colors
[
ImGuiCol_TextSelectedBg
]
=
ImVec4
(
getRandomColor
(),
0.43
f
);
style
->
Colors
[
ImGuiCol_PopupBg
]
=
ImVec4
(
getRandomColor
(),
0.92
f
);
style
->
Colors
[
ImGuiCol_ModalWindowDarkening
]
=
ImVec4
(
getRandomColor
(),
0.73
f
);
}
\ No newline at end of file
example-addons/src/MyTheme.h
0 → 100644
View file @
8685c93c
#pragma once
#include "BaseTheme.h"
#include "ofMain.h"
class
MyTheme
:
public
ofxImGui
::
BaseTheme
{
public:
void
setup
()
override
;
};
\ No newline at end of file
example-addons/src/ofApp.cpp
View file @
8685c93c
...
...
@@ -1812,6 +1812,16 @@ void ofApp::draw() {
//ImGui::Text("Num texture bindings per frame: %d",gImGuiNumTextureBindingsPerFrame);
ImGui
::
Text
(
"Application average %.3f ms/frame (%.1f FPS)"
,
1000.0
f
/
ImGui
::
GetIO
().
Framerate
,
ImGui
::
GetIO
().
Framerate
);
if
(
ImGui
::
IsItemHovered
())
ImGui
::
SetTooltip
(
"%s"
,
"Consider that we're using
\n
just a single extra texture
\n
with all the icons (numbers)."
);
if
(
ImGui
::
Button
(
"CUSTOM THEME"
))
{
gui
.
setTheme
(
new
MyTheme
());
}
ImGui
::
SameLine
();
if
(
ImGui
::
Button
(
"DEFAULT THEME"
))
{
gui
.
setTheme
(
new
ofxImGui
::
DefaultTheme
());
}
}
ImGui
::
End
();
}
...
...
@@ -1955,9 +1965,10 @@ void ofApp::keyPressed(int key) {
}
else
if
(
key
==
'r'
){
ImGui
::
StyleColorsClassic
();
}
else
if
(
key
==
't'
){
gui
.
setTheme
(
new
ThemeTest
());
gui
.
setTheme
(
new
MyTheme
());
}
else
if
(
key
==
'z'
){
gui
.
setDefaultTheme
();
//gui.setDefaultTheme();
gui
.
setTheme
(
new
ofxImGui
::
DefaultTheme
());
}
}
...
...
example-addons/src/ofApp.h
View file @
8685c93c
...
...
@@ -2,7 +2,7 @@
#include "ofMain.h"
#include "ofxImGui.h"
#include "
ThemeTest
.h"
#include "
MyTheme
.h"
#include "mydefines.h"
#include "imgui_user.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment