Make logcat command input box monospace

This commit is contained in:
blankie 2023-02-23 14:46:28 +07:00
parent 361689a945
commit 1cd369e6c0
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
3 changed files with 10 additions and 4 deletions

View File

@ -51,7 +51,7 @@ void event_loop(ImFont* monospace_font, Config& active_config, LogcatThread& log
#endif
if (show_settings_window) {
settings_window(active_config, inactive_config, &show_settings_window);
settings_window(monospace_font, active_config, inactive_config, &show_settings_window);
}
if (show_filters_window) {

View File

@ -14,13 +14,17 @@ static void try_write_config(const Config& config) {
}
}
void settings_window(Config& __restrict active_config, Config& __restrict inactive_config, bool* p_open) {
void settings_window(ImFont* monospace_font, Config& __restrict active_config, Config& __restrict inactive_config, bool* p_open) {
if (!ImGui::BeginWithCloseShortcut("Settings", p_open)) {
ImGui::End();
return;
}
ImGui::TextUnformatted("Logcat command only takes effect when logcat is not running");
ImGui::InputTextWithHint("Logcat command", default_logcat_command, &inactive_config.logcat_command);
ImGui::PushFont(monospace_font);
ImGui::InputTextWithHint("##logcat_command", default_logcat_command, &inactive_config.logcat_command);
ImGui::PopFont();
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
ImGui::TextUnformatted("Logcat command");
ImGui::TextWrapped("Font sizes only take effect when LogMeow is restarted (using non-integer values may cause spacing issues)");
#ifdef USE_FONTCONFIG

View File

@ -1,5 +1,7 @@
#pragma once
struct ImFont; // forward declaration from imgui/imgui.h
struct Config; // forward declaration from ../config.h
void settings_window(Config& __restrict active_config, Config& __restrict inactive_config, bool* p_open);
void settings_window(ImFont* monospace_font, Config& __restrict active_config, Config& __restrict inactive_config, bool* p_open);