Add opening settings and logs with keyboard shortcuts
This commit is contained in:
parent
17f8016d3d
commit
603d3165bb
|
@ -120,7 +120,8 @@ void main_window(bool latest_log_entries_read, ImFont* monospace_font, LogcatThr
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Settings") && !*show_settings_window) {
|
bool ctrl_comma_pressed = ImGui::IsKeyPressed(ImGuiMod_Shortcut | ImGuiKey_Comma);
|
||||||
|
if ((ImGui::Button("Settings") || ctrl_comma_pressed) && !*show_settings_window) {
|
||||||
inactive_config.logcat_command = active_config.logcat_command;
|
inactive_config.logcat_command = active_config.logcat_command;
|
||||||
inactive_config.normal_font_size = active_config.normal_font_size;
|
inactive_config.normal_font_size = active_config.normal_font_size;
|
||||||
inactive_config.monospace_font_size = active_config.monospace_font_size;
|
inactive_config.monospace_font_size = active_config.monospace_font_size;
|
||||||
|
@ -129,8 +130,9 @@ void main_window(bool latest_log_entries_read, ImFont* monospace_font, LogcatThr
|
||||||
*show_settings_window = true;
|
*show_settings_window = true;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
bool ctrl_l_pressed = ImGui::IsKeyPressed(ImGuiMod_Shortcut | ImGuiKey_L);
|
||||||
bool open_logs = latest_log_entries_read ? ImGui::Button("Logs") : ImGui::RedButton("Logs");
|
bool open_logs = latest_log_entries_read ? ImGui::Button("Logs") : ImGui::RedButton("Logs");
|
||||||
if (open_logs) {
|
if (open_logs || ctrl_l_pressed) {
|
||||||
*show_logs_window = true;
|
*show_logs_window = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue