mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Better font settings window
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include "hex/api/imhex_api.hpp"
|
||||
|
||||
namespace hex::fonts {
|
||||
@@ -118,16 +120,25 @@ namespace hex::fonts {
|
||||
ImGui::PushID(name.c_str());
|
||||
ON_SCOPE_EXIT { ImGui::PopID(); };
|
||||
|
||||
if (ImGui::Button(m_fontFilePicker.getSelectedFontName().c_str(), ImVec2(300_scaled, 0))) {
|
||||
ImGui::OpenPopup("Fonts");
|
||||
bool changed = false;
|
||||
if (ImGui::CollapsingHeader(name.c_str())) {
|
||||
if (ImGuiExt::BeginBox()) {
|
||||
if (m_fontFilePicker.draw("hex.fonts.setting.font.custom_font"_lang)) changed = true;
|
||||
|
||||
ImGui::BeginDisabled(m_fontFilePicker.isPixelPerfectFontSelected());
|
||||
{
|
||||
if (m_fontSize.draw("hex.fonts.setting.font.font_size"_lang)) changed = true;
|
||||
if (m_bold.draw("hex.fonts.setting.font.font_bold"_lang)) changed = true;
|
||||
if (m_italic.draw("hex.fonts.setting.font.font_italic"_lang)) changed = true;
|
||||
if (m_antiAliased.draw("hex.fonts.setting.font.font_antialias"_lang)) changed = true;
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
ImGuiExt::EndBox();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::TextUnformatted(name.c_str());
|
||||
|
||||
ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
|
||||
return drawPopup();
|
||||
return changed;
|
||||
}
|
||||
|
||||
nlohmann::json FontSelector::store() {
|
||||
|
||||
Reference in New Issue
Block a user