-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btdu.ui.browser: Move the info panels to the left
Reduce visual distance between items and details, especially on large terminal sizes.
- Loading branch information
1 parent
82a119c
commit a327b19
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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; | ||
|
@@ -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(); | ||
|
@@ -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, | ||
|
@@ -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 ? '╣' : | ||
'║' | ||
); | ||
}); | ||
|