patitotective / imthemes Goto Github PK
View Code? Open in Web Editor NEWDear ImGui style browser and editor written in Nim
License: MIT License
Dear ImGui style browser and editor written in Nim
License: MIT License
Would it be possible to add support for exporting JSON?
The toml
export wouldn't be hard to convert from, but JSON is already supported for sharing themes by the implementation of ImGui I'm looking at.
It would look like:
{
"Author": "[optional]",
"Description": "[optional]",
"Colors": {
"Success": [0, 1, 0, 1],
"Warning": [1, 1, 0, 1],
...
},
"Options": {
"Alpha": 1.0,
"DisabledAlpha": 0.6,
...
}
}
Thanks for the great tool!
I love the idea of this app and would like to use it on macOS. How hard would it be to add support for it?
I'm happy to try compiling but I've never worked with nim. I'd appreciate any links to guides or resources.
I have a very basic question, I want to create a text like a title that is more eye-catching than normal ImGui::Text
, with a larger font and different colors.
I checked the documentation and this can be achieved with different fonts.
Load multiple fonts:
// Init
ImGuiIO& io = ImGui::GetIO();
ImFont* font1 = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels);
ImFont* font2 = io.Fonts->AddFontFromFileTTF("anotherfont.otf", size_pixels);
// In application loop: select font at runtime
ImGui::Text("Hello"); // use the default font (which is the first loaded font)
ImGui::PushFont(font2);
ImGui::Text("Hello with another font");
ImGui::PopFont();
As I was on an open source project to make some modifications, The project is structured like this
├─Project
│ │ GUI.cpp
│ │ GUI.hpp
│ │ Hooks.cpp
│ │ Hooks.hpp
In GUI.cpp
ImGui::Begin();
//Title ImGui Text Here
ImGui::PushFont(font_title);
ImGui::Text("Title");
ImGui::PopFont();
//Normal ImGui Text Here
ImGui::Text("Normal");
ImGui::End();
In Hook.cpp
static void init_imgui(void* device, bool is_d3d11 = false) noexcept
{
ImGui::CreateContext();
auto& style{ ImGui::GetStyle() };
// init style
auto& io{ ImGui::GetIO() };
io.IniFilename = nullptr;
io.LogFilename = nullptr;
io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
if (PWSTR pathToFonts; SUCCEEDED(::SHGetKnownFolderPath(FOLDERID_Fonts, 0, nullptr, &pathToFonts))) {
const std::filesystem::path path{ pathToFonts };
::CoTaskMemFree(pathToFonts);
ImFontConfig cfg;
cfg.SizePixels = 15.0f;
io.Fonts->AddFontFromFileTTF((path / "tahoma.ttf").string().c_str(), 15.0f, &cfg, ranges);
cfg.MergeMode = true;
io.Fonts->AddFontFromFileTTF((path / "malgun.ttf").string().c_str(), 16.0f, &cfg, getFontGlyphRangesKr());
io.Fonts->AddFontFromFileTTF((path / "simhei.ttf").string().c_str(), 12.0f, &cfg, io.Fonts->GetGlyphRangesChineseFull());
cfg.MergeMode = false;
}
// init d3d device
}
Now my question is where should I add my title font and how do I use it in GUI.cpp.
Sorry, this seems like a very rookie question, but I have checked all the documentation I can read, and since this is a small open source project and not all code in one file, So I don't quite understand how to do.
The Discord Invite Link is Expired, Please Update It.
Thanks.
I was trying this out and noticed it doesn't have the two docking branch colors. Any plans to add them?
ImGuiCol_DockingPreview, // 38
ImGuiCol_DockingEmptyBg, // 39
Hi there,
I'm currently having issues getting this to build under MacOS and am experiencing the following
Verifying dependencies for [email protected]
Info: Dependency on unittest2@any version already satisfied
Verifying dependencies for [email protected]
Info: Dependency on stb_image@>= 2.5 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on https://github.com/status-im/nim-zippy@>= 0.5.7 already satisfied
Verifying dependencies for [email protected]
Installing [email protected]
Building ImThemes/ImThemes using cpp backend
/private/var/folders/54/92yz5g0s3d5c7n1clszfx67m0000gn/T/nimble_57957/githubcom_PatitotectiveImThemes/src/utils.nim(402, 39) Warning: use `char` or `uint8` instead; cuchar is deprecated [Deprecated]
/private/var/folders/54/92yz5g0s3d5c7n1clszfx67m0000gn/T/nimble_57957/githubcom_PatitotectiveImThemes/src/browseview.nim(192, 22) Error: attempting to call undeclared routine: 'downloaded'
Prompt: Build failed for 'https://github.com/Patitotective/[email protected]', would you like to try installing 'https://github.com/Patitotective/ImThemes@#head' (latest unstable)? [y/N]
Answer: n
Tip: 116 messages have been suppressed, use --verbose to show them.
Error: Aborting installation due to build failure
I took a look at downit and i didn't see any routines called "downloaded" but I did find "finished," is that the routine that should have been called?
https://github.com/Patitotective/downit/blob/main/downit.nim#L117
I'd like to request proxy support if possible. I have to get off of the company VPN in order to use this app successfully. Love your app <3.
Hi,
Nice handy tool 😀
It would be nice to add a "C#" tab in the tool behind the "Get It" button.
I think the Soft Cherry theme C# code would look like this :
style.Alpha = 1.0f;
style.DisabledAlpha = 0.4000000059604645f;
style.WindowPadding = new Vector2(10.0f, 10.0f);
style.WindowRounding = 4.0f;
style.WindowBorderSize = 0.0f;
style.WindowMinSize = new Vector2(50.0f, 50.0f);
style.WindowTitleAlign = new Vector2(0.5f, 0.5f);
style.WindowMenuButtonPosition =ImGuiDir.Left;
style.ChildRounding = 0.0f;
style.ChildBorderSize = 1.0f;
style.PopupRounding = 1.0f;
style.PopupBorderSize = 1.0f;
style.FramePadding = new Vector2(5.0f, 3.0f);
style.FrameRounding = 3.0f;
style.FrameBorderSize = 0.0f;
style.ItemSpacing = new Vector2(6.0f, 6.0f);
style.ItemInnerSpacing = new Vector2(3.0f, 2.0f);
style.CellPadding = new Vector2(3.0f, 3.0f);
style.IndentSpacing = 6.0f;
style.ColumnsMinSpacing = 6.0f;
style.ScrollbarSize = 13.0f;
style.ScrollbarRounding = 16.0f;
style.GrabMinSize = 20.0f;
style.GrabRounding = 4.0f;
style.TabRounding = 4.0f;
style.TabBorderSize = 1.0f;
var r = new RgbaFloat(0, 0, 0, 0);
style.TabMinWidthForCloseButton = 0.0f;
style.ColorButtonPosition =ImGuiDir.Right;
style.ButtonTextAlign = new Vector2(0.5f, 0.5f);
style.SelectableTextAlign = new Vector2(0.0f, 0.0f);
style.Colors[(int)ImGuiCol.Text] = new Vector4(0.8588235378265381f, 0.929411768913269f, 0.886274516582489f, 1.0f);
style.Colors[(int)ImGuiCol.TextDisabled] = new Vector4(0.5215686559677124f, 0.5490196347236633f, 0.5333333611488342f, 1.0f);
style.Colors[(int)ImGuiCol.WindowBg] = new Vector4(0.1294117718935013f, 0.1372549086809158f, 0.168627455830574f, 1.0f);
style.Colors[(int)ImGuiCol.ChildBg] = new Vector4(0.1490196138620377f, 0.1568627506494522f, 0.1882352977991104f, 1.0f);
style.Colors[(int)ImGuiCol.PopupBg] = new Vector4(0.2000000029802322f, 0.2196078449487686f, 0.2666666805744171f, 1.0f);
style.Colors[(int)ImGuiCol.Border] = new Vector4(0.1372549086809158f, 0.1137254908680916f, 0.1333333402872086f, 1.0f);
style.Colors[(int)ImGuiCol.BorderShadow] = new Vector4(0.0f, 0.0f, 0.0f, 1.0f);
style.Colors[(int)ImGuiCol.FrameBg] = new Vector4(0.168627455830574f, 0.1843137294054031f, 0.2313725501298904f, 1.0f);
style.Colors[(int)ImGuiCol.FrameBgHovered] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.FrameBgActive] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.TitleBg] = new Vector4(0.2313725501298904f, 0.2000000029802322f, 0.2705882489681244f, 1.0f);
style.Colors[(int)ImGuiCol.TitleBgActive] = new Vector4(0.501960813999176f, 0.07450980693101883f, 0.2549019753932953f, 1.0f);
style.Colors[(int)ImGuiCol.TitleBgCollapsed] = new Vector4(0.2000000029802322f, 0.2196078449487686f, 0.2666666805744171f, 1.0f);
style.Colors[(int)ImGuiCol.MenuBarBg] = new Vector4(0.2000000029802322f, 0.2196078449487686f, 0.2666666805744171f, 1.0f);
style.Colors[(int)ImGuiCol.ScrollbarBg] = new Vector4(0.239215686917305f, 0.239215686917305f, 0.2196078449487686f, 1.0f);
style.Colors[(int)ImGuiCol.ScrollbarGrab] = new Vector4(0.3882353007793427f, 0.3882353007793427f, 0.3725490272045135f, 1.0f);
style.Colors[(int)ImGuiCol.ScrollbarGrabHovered] = new Vector4(0.6941176652908325f, 0.6941176652908325f, 0.686274528503418f, 1.0f);
style.Colors[(int)ImGuiCol.ScrollbarGrabActive] = new Vector4(0.6941176652908325f, 0.6941176652908325f, 0.686274528503418f, 1.0f);
style.Colors[(int)ImGuiCol.CheckMark] = new Vector4(0.658823549747467f, 0.1372549086809158f, 0.1764705926179886f, 1.0f);
style.Colors[(int)ImGuiCol.SliderGrab] = new Vector4(0.6509804129600525f, 0.1490196138620377f, 0.3450980484485626f, 1.0f);
style.Colors[(int)ImGuiCol.SliderGrabActive] = new Vector4(0.7098039388656616f, 0.2196078449487686f, 0.2666666805744171f, 1.0f);
style.Colors[(int)ImGuiCol.Button] = new Vector4(0.6509804129600525f, 0.1490196138620377f, 0.3450980484485626f, 1.0f);
style.Colors[(int)ImGuiCol.ButtonHovered] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.ButtonActive] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.Header] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.HeaderHovered] = new Vector4(0.6509804129600525f, 0.1490196138620377f, 0.3450980484485626f, 1.0f);
style.Colors[(int)ImGuiCol.HeaderActive] = new Vector4(0.501960813999176f, 0.07450980693101883f, 0.2549019753932953f, 1.0f);
style.Colors[(int)ImGuiCol.Separator] = new Vector4(0.4274509847164154f, 0.4274509847164154f, 0.4980392158031464f, 1.0f);
style.Colors[(int)ImGuiCol.SeparatorHovered] = new Vector4(0.09803921729326248f, 0.4000000059604645f, 0.7490196228027344f, 1.0f);
style.Colors[(int)ImGuiCol.SeparatorActive] = new Vector4(0.09803921729326248f, 0.4000000059604645f, 0.7490196228027344f, 1.0f);
style.Colors[(int)ImGuiCol.ResizeGrip] = new Vector4(0.6509804129600525f, 0.1490196138620377f, 0.3450980484485626f, 1.0f);
style.Colors[(int)ImGuiCol.ResizeGripHovered] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.ResizeGripActive] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.Tab] = new Vector4(0.1764705926179886f, 0.3490196168422699f, 0.5764706134796143f, 1.0f);
style.Colors[(int)ImGuiCol.TabHovered] = new Vector4(0.2588235437870026f, 0.5882353186607361f, 0.9764705896377563f, 1.0f);
style.Colors[(int)ImGuiCol.TabActive] = new Vector4(0.196078434586525f, 0.407843142747879f, 0.6784313917160034f, 1.0f);
style.Colors[(int)ImGuiCol.TabUnfocused] = new Vector4(0.06666667014360428f, 0.1019607856869698f, 0.1450980454683304f, 1.0f);
style.Colors[(int)ImGuiCol.TabUnfocusedActive] = new Vector4(0.1333333402872086f, 0.2588235437870026f, 0.4235294163227081f, 1.0f);
style.Colors[(int)ImGuiCol.PlotLines] = new Vector4(0.8588235378265381f, 0.929411768913269f, 0.886274516582489f, 1.0f);
style.Colors[(int)ImGuiCol.PlotLinesHovered] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.PlotHistogram] = new Vector4(0.3098039329051971f, 0.7764706015586853f, 0.196078434586525f, 1.0f);
style.Colors[(int)ImGuiCol.PlotHistogramHovered] = new Vector4(0.4549019634723663f, 0.196078434586525f, 0.2980392277240753f, 1.0f);
style.Colors[(int)ImGuiCol.TableHeaderBg] = new Vector4(0.1882352977991104f, 0.1882352977991104f, 0.2000000029802322f, 1.0f);
style.Colors[(int)ImGuiCol.TableBorderStrong] = new Vector4(0.3098039329051971f, 0.3098039329051971f, 0.3490196168422699f, 1.0f);
style.Colors[(int)ImGuiCol.TableBorderLight] = new Vector4(0.2274509817361832f, 0.2274509817361832f, 0.2470588237047195f, 1.0f);
style.Colors[(int)ImGuiCol.TableRowBg] = new Vector4(0.0f, 0.0f, 0.0f, 1.0f);
style.Colors[(int)ImGuiCol.TableRowBgAlt] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
style.Colors[(int)ImGuiCol.TextSelectedBg] = new Vector4(0.3843137323856354f, 0.6274510025978088f, 0.9176470637321472f, 1.0f);
style.Colors[(int)ImGuiCol.DragDropTarget] = new Vector4(1.0f, 1.0f, 0.0f, 1.0f);
style.Colors[(int)ImGuiCol.NavHighlight] = new Vector4(0.2588235437870026f, 0.5882353186607361f, 0.9764705896377563f, 1.0f);
style.Colors[(int)ImGuiCol.NavWindowingHighlight] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
style.Colors[(int)ImGuiCol.NavWindowingDimBg] = new Vector4(0.800000011920929f, 0.800000011920929f, 0.800000011920929f, 1.0f);
style.Colors[(int)ImGuiCol.ModalWindowDimBg] = new Vector4(0.800000011920929f, 0.800000011920929f, 0.800000011920929f, 0.300000011920929f);
Sometimes when I go to use ImThemes, it just won't open. I've tried running it normally, as admin, and even running it in cmd to see if it outputted any errors, but nothing. I've tried building it from source, but nimble keeps complaining about "invalid indentation".
Heres an example with Process Hacker open:
(running as admin stopped the recording, but it didn't open even running as admin)
Any fixes/solutions?
Using v0.2.4 (but the zip is labeled as v0.2.3 so whichever version this actually is)
Consistently when I alt-tab multiple times, especially when a text input is active, I get crashes from the input handler.
I also noticed this issue happens whenever the window is idle for too long. I do not have an exact time measurement but it has happened twice whenever I went away from the keyboard.
If you click on the Bootstrap tag in the Bootstrap dark theme, the app crashes because it is not a valid theme.
Eg dearpygui
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.