Skip to content

Commit

Permalink
Make the search always accessible, and allow no checked boxes, which …
Browse files Browse the repository at this point in the history
…always returns zero results.
  • Loading branch information
DaleStan committed May 17, 2024
1 parent 17cb3c6 commit 0899d5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
8 changes: 1 addition & 7 deletions Yafc/Windows/MainScreen.PageListSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,7 @@ public void Build(ImGui gui, Action updatePageList) {

void buildCheckbox(ImGui gui, string text, ref bool isChecked) {
if (gui.BuildCheckBox(text, isChecked, out isChecked)) {
if (checkboxValues.Any(x => x)) {
updatePageList();
}
else {
// Don't let the user uncheck the last checkbox.
isChecked = true;
}
updatePageList();
}
}

Expand Down
14 changes: 6 additions & 8 deletions Yafc/Windows/MainScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,13 @@ private void BuildTabBar(ImGui gui) {
gui.allocator = RectAllocator.RightRow;
var spaceForDropdown = gui.AllocateRect(2.1f, 2.1f);
tabBar.Build(gui);
if (project.hiddenPages > 0 || tabBar.maxScroll > 0f) {
if (gui.isBuilding) {
gui.DrawIcon(spaceForDropdown.Expand(-0.3f), Icon.DropDown, SchemeColor.BackgroundText);
}
if (gui.isBuilding) {
gui.DrawIcon(spaceForDropdown.Expand(-0.3f), Icon.DropDown, SchemeColor.BackgroundText);
}

if (gui.BuildButton(spaceForDropdown, SchemeColor.None, SchemeColor.Grey)) {
updatePageList();
ShowDropDown(gui, spaceForDropdown, missingPagesDropdown, new Padding(0f, 0f, 0f, 0.5f), 30f);
}
if (gui.BuildButton(spaceForDropdown, SchemeColor.None, SchemeColor.Grey)) {
updatePageList();
ShowDropDown(gui, spaceForDropdown, missingPagesDropdown, new Padding(0f, 0f, 0f, 0.5f), 30f);
}
}
if (gui.isBuilding) {
Expand Down

0 comments on commit 0899d5f

Please sign in to comment.