1
0
mirror of synced 2025-01-18 00:56:49 +01:00

impr: Use ImGui::SeparatorText to draw headers

This commit is contained in:
WerWolv 2023-11-12 00:57:29 +01:00
parent 60e3a657f0
commit 46b1b0ba17
4 changed files with 6 additions and 14 deletions

View File

@ -308,8 +308,7 @@ namespace ImGui {
void Header(const char *label, bool firstEntry) {
if (!firstEntry)
ImGui::NewLine();
ImGui::TextUnformatted(label);
ImGui::Separator();
ImGui::SeparatorText(label);
}
void HeaderColored(const char *label, ImColor color, bool firstEntry) {

View File

@ -96,8 +96,7 @@ namespace hex::plugin::builtin {
auto provider = ImHexApi::Provider::get();
if (ImHexApi::Provider::isValid() && provider->isReadable()) {
ImGui::TextUnformatted("hex.builtin.view.disassembler.position"_lang);
ImGui::Separator();
ImGui::Header("hex.builtin.view.disassembler.position"_lang, true);
// Draw base address input
ImGui::InputHexadecimal("hex.builtin.view.disassembler.base"_lang, &this->m_baseAddress, ImGuiInputTextFlags_CharsHexadecimal);

View File

@ -101,8 +101,7 @@ namespace hex::plugin::builtin {
void ViewYara::drawContent() {
if (ImGui::Begin(View::toWindowName("hex.builtin.view.yara.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse)) {
ImGui::TextUnformatted("hex.builtin.view.yara.header.rules"_lang);
ImGui::Separator();
ImGui::Header("hex.builtin.view.yara.header.rules"_lang, true);
if (ImGui::BeginListBox("##rules", ImVec2(-FLT_MIN, ImGui::GetTextLineHeightWithSpacing() * 5))) {
for (u32 i = 0; i < this->m_rules->size(); i++) {
@ -149,9 +148,7 @@ namespace hex::plugin::builtin {
ImGui::TextSpinner("hex.builtin.view.yara.matching"_lang);
}
ImGui::NewLine();
ImGui::TextUnformatted("hex.builtin.view.yara.header.matches"_lang);
ImGui::Separator();
ImGui::Header("hex.builtin.view.yara.header.matches"_lang);
auto matchesTableSize = ImGui::GetContentRegionAvail();
matchesTableSize.y *= 3.75 / 5.0;

View File

@ -19,8 +19,7 @@ namespace hex::plugin::windows {
void ViewTTYConsole::drawContent() {
if (ImGui::Begin(View::toWindowName("hex.windows.view.tty_console.name").c_str(), &this->getWindowOpenState())) {
ImGui::TextUnformatted("hex.windows.view.tty_console.config"_lang);
ImGui::Separator();
ImGui::Header("hex.windows.view.tty_console.config"_lang, true);
bool connected = this->m_portHandle != INVALID_HANDLE_VALUE;
@ -107,9 +106,7 @@ namespace hex::plugin::windows {
ImGui::Checkbox("hex.windows.view.tty_console.auto_scroll"_lang, &this->m_shouldAutoScroll);
ImGui::NewLine();
ImGui::TextUnformatted("hex.windows.view.tty_console.console"_lang);
ImGui::Separator();
ImGui::Header("hex.windows.view.tty_console.console"_lang);
auto consoleSize = ImGui::GetContentRegionAvail();
consoleSize.y -= ImGui::GetTextLineHeight() + ImGui::GetStyle().FramePadding.y * 4;