Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions src/uproot_browser/tui/browser.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Screen {
background: $surface-darken-1;
}

Browser Widget {
scrollbar-color: $secondary-darken-1;
scrollbar-color-hover: $secondary-darken-3;
Expand All @@ -15,16 +11,13 @@ Browser Widget {
#tree-view {
display: none;
overflow: auto;
width: 35;
width: 25%;
height: 100%;
dock: left;
background: $surface-darken-1;
border: round $secondary;
padding-top: 1;
}

Tree > .tree--cursor {
background: $secondary-darken-1;
color: $text;
text-style: bold;
}

Expand All @@ -34,23 +27,22 @@ Browser.-show-tree #tree-view {
}

#logo {
border: round $secondary;
content-align: center middle;
}

#plot {
overflow: auto;
min-width: 100%;
padding-left: 1;
padding-right: 1;
}

#error{
overflow: auto;
min-width: 100%;
background: $surface-darken-1;
}

#empty {
border: round $secondary;
text-align: center;
}

Expand All @@ -72,20 +64,3 @@ Footer > .footer--highlight-key {
Footer{
background: $secondary;
}


UprootTree > .uproot-tree--folder {
text-style: bold;
}

UprootTree > .uproot-tree--file {

}

UprootTree > .uproot-tree--extension {
text-style: italic;
}

UprootTree > .uproot-tree--hidden {
color: $text 50%;
}
8 changes: 8 additions & 0 deletions src/uproot_browser/tui/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
# pylint: disable-next=protected-access
plt._dict.themes["default"][1] = light_background

dark_background = 0x1E, 0x1E, 0x1E
dark_text = 0xFF, 0xA6, 0x2B
# pylint: disable-next=protected-access
plt._dict.themes["dark"][0] = dark_background
# pylint: disable-next=protected-access
plt._dict.themes["dark"][1] = dark_background
# pylint: disable-next=protected-access
plt._dict.themes["dark"][2] = dark_text

from uproot_browser.exceptions import EmptyTreeError

Expand Down
9 changes: 1 addition & 8 deletions src/uproot_browser/tui/left_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from pathlib import Path
from typing import Any, ClassVar
from typing import Any

import rich.panel
import rich.repr
Expand All @@ -27,13 +27,6 @@ def __init__(self, upfile: Any, path: str) -> None:
class UprootTree(textual.widgets.Tree[UprootEntry]):
"""currently just extending DirectoryTree, showing current path"""

COMPONENT_CLASSES: ClassVar[set[str]] = {
"uproot-tree--folder",
"uproot-tree--file",
"uproot-tree--extension",
"uproot-tree--hidden",
}

def __init__(self, path: Path, **args: Any) -> None:
self.upfile = uproot.open(path)
data = UprootEntry("/", self.upfile)
Expand Down