mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[glass] Add hamburger menu icon to titlebars (#4874)
This does the same thing as right clicking, but provides a visual indicator. The icon disappears if the window is too small or docked (right click keeps working).
This commit is contained in:
@@ -62,18 +62,21 @@ void glass::DisplayLog(LogData* data, bool autoScroll) {
|
||||
}
|
||||
|
||||
void LogView::Display() {
|
||||
if (ImGui::BeginPopupContextItem()) {
|
||||
ImGui::Checkbox("Auto-scroll", &m_autoScroll);
|
||||
if (ImGui::Selectable("Clear")) {
|
||||
m_data->Clear();
|
||||
}
|
||||
const auto& buf = m_data->GetBuffer();
|
||||
if (ImGui::Selectable("Copy to Clipboard", false,
|
||||
buf.empty() ? ImGuiSelectableFlags_Disabled : 0)) {
|
||||
ImGui::SetClipboardText(buf.c_str());
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
DisplayLog(m_data, m_autoScroll);
|
||||
}
|
||||
|
||||
void LogView::Settings() {
|
||||
ImGui::Checkbox("Auto-scroll", &m_autoScroll);
|
||||
if (ImGui::Selectable("Clear")) {
|
||||
m_data->Clear();
|
||||
}
|
||||
const auto& buf = m_data->GetBuffer();
|
||||
if (ImGui::Selectable("Copy to Clipboard", false,
|
||||
buf.empty() ? ImGuiSelectableFlags_Disabled : 0)) {
|
||||
ImGui::SetClipboardText(buf.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
bool LogView::HasSettings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user