Skip to content

Commit

Permalink
Fix #992. Add scroll bar to activity panel (appears when needed).
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyer committed Nov 15, 2023
1 parent 45c8482 commit a2395d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
32 changes: 17 additions & 15 deletions nion/swift/ActivityPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,23 @@ def activity_changed(key: str, value: Activity.Activity, index: int) -> None:
self.__activity_removed_listener = self.activities.item_removed_event.listen(activity_changed)

u = Declarative.DeclarativeUI()
self.ui_view = u.create_column(
u.create_stack(
u.create_column(
u.create_label(text=_("No activities.")),
u.create_stretch(),
self.ui_view = u.create_scroll_area(
u.create_column(
u.create_stack(
u.create_column(
u.create_label(text=_("No activities.")),
u.create_stretch(),
),
u.create_column(
u.create_column(items="activities.items", item_component_id="activity", spacing=6),
u.create_stretch(),
),
current_index="@binding(stack_index.value)"
),
u.create_column(
u.create_column(items="activities.items", item_component_id="activity", spacing=6),
u.create_stretch(),
),
current_index="@binding(stack_index.value)"
),
u.create_stretch(),
spacing=8,
margin=8
u.create_stretch(),
spacing=8,
margin=8
)
)

def close(self) -> None:
Expand Down Expand Up @@ -149,7 +151,7 @@ async def later() -> None:
Activity.append_activity(drink)
await asyncio.sleep(3.0)
eat = XActivity("Eat")
eat = Activity.Activity("eat", "Eat")
Activity.append_activity(eat)
await asyncio.sleep(3.0)
Expand Down
4 changes: 4 additions & 0 deletions nion/swift/resources/changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
{
"version": "Unreleased",
"notes": [
{
"issues": ["https://github.com/nion-software/nionswift/issues/992"],
"summary": "Add scroll bar to activity panel to prevent it growing beyond its available height."
},
{
"issues": ["https://github.com/nion-software/nionswift/issues/5"],
"summary": "Hovering over items in grid browser shows info about the item."
Expand Down

0 comments on commit a2395d1

Please sign in to comment.