Skip to content

Commit

Permalink
btdu.ui.browser: Move the info panels to the left
Browse files Browse the repository at this point in the history
Reduce visual distance between items and details, especially on large
terminal sizes.
  • Loading branch information
CyberShadow committed Sep 8, 2024
1 parent 82a119c commit a327b19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/btdu/ui/browser.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020, 2021, 2022, 2023 Vladimir Panteleev <[email protected]>
* Copyright (C) 2020, 2021, 2022, 2023, 2024 Vladimir Panteleev <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
Expand Down Expand Up @@ -1196,7 +1196,7 @@ struct Browser
// Items
auto infoWidth = min(60, (width - 1) / 2);
auto itemsWidth = width - infoWidth - 1;
withWindow(0, 0, itemsWidth, height, {
withWindow(infoWidth + 1, 0, itemsWidth, height, {
itemScrollContext.y.contentSize = items.length;
itemScrollContext.y.contentAreaSize = height - 1;
itemScrollContext.y.cursor = selection && items ? items.countUntil(selection) : 0;
Expand All @@ -1218,7 +1218,7 @@ struct Browser

// "Viewing:"
auto currentInfoHeight = selection ? height / 2 : height;
withWindow(itemsWidth + 1, 0, infoWidth, currentInfoHeight, {
withWindow(0, 0, infoWidth, currentInfoHeight, {
if (currentPath is &marked)
{
updateMark();
Expand All @@ -1230,7 +1230,7 @@ struct Browser

// "Selected:"
if (selection)
withWindow(itemsWidth + 1, currentInfoHeight, infoWidth, height - currentInfoHeight, {
withWindow(0, currentInfoHeight, infoWidth, height - currentInfoHeight, {
auto moreButton = fmtIf(
selection.firstChild !is null,
fmtSeq(button(""), " ", button("i")).valueFunctor,
Expand All @@ -1241,10 +1241,10 @@ struct Browser

// Vertical separator
foreach (y; 0 .. height)
at(itemsWidth, y, {
at(infoWidth, y, {
write(
y == 0 ? '' :
y == currentInfoHeight ? '' :
y == currentInfoHeight ? '' :
''
);
});
Expand Down

0 comments on commit a327b19

Please sign in to comment.