[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:
ohowe
2023-01-01 21:05:09 -07:00
committed by GitHub
parent f0fa8205ac
commit b0c6724eed
16 changed files with 254 additions and 100 deletions

View File

@@ -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;
}