MCPcopy Create free account
hub / github.com/chrxh/alien / processWorkspaceSelectionAndFilter

Method processWorkspaceSelectionAndFilter

source/Gui/BrowserWindow.cpp:379–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void BrowserWindow::processWorkspaceSelectionAndFilter()
380{
381 ImGui::Spacing();
382 if (ImGui::BeginTable("##", 2, 0, ImVec2(-1, 0))) {
383 ImGui::TableSetupColumn("##workspaceType");
384 ImGui::TableSetupColumn("##textFilter");
385
386 ImGui::TableNextRow();
387 ImGui::TableSetColumnIndex(0);
388 auto userName = NetworkService::get().getLoggedInUserName();
389 auto privateWorkspaceString = userName.has_value() ? *userName + "'s private workspace" : "Private workspace (need to login)";
390 auto workspaceType_reordered = 2 - _currentWorkspace.workspaceType; //change the order for display
391 if (AlienImGui::Switcher(
392 AlienImGui::SwitcherParameters()
393 .textWidth(48.0f)
394 .tooltip(Const::BrowserWorkspaceTooltip)
395 .values({privateWorkspaceString, std::string("alien-project's workspace"), std::string("Public workspace")}),
396 workspaceType_reordered)) {
397 _selectedTreeTO = nullptr;
398 }
399 _currentWorkspace.workspaceType = 2 - workspaceType_reordered;
400 ImGui::SameLine();
401 AlienImGui::VerticalSeparator();
402
403 ImGui::TableSetColumnIndex(1);
404 if (AlienImGui::InputFilter(AlienImGui::InputFilterParameters(), _filter)) {
405 for (NetworkResourceType resourceType = 0; resourceType < NetworkResourceType_Count; ++resourceType) {
406 for (WorkspaceType workspaceType = 0; workspaceType < WorkspaceType_Count; ++workspaceType) {
407 createTreeTOs(_workspaces.at(WorkspaceId{resourceType, workspaceType}));
408 }
409 }
410 }
411
412 ImGui::EndTable();
413 }
414}
415
416void BrowserWindow::processVerticalMovableSeparator()
417{

Callers

nothing calls this directly

Calls 4

ImVec2Class · 0.85
SwitcherParametersClass · 0.85
getLoggedInUserNameMethod · 0.80

Tested by

no test coverage detected