-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement custom titlebars that can be configured in Python #42
Conversation
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored by: Abhik Ahuja <[email protected]>
…ages, or Padding Co-authored by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored by: Abhik Ahuja <[email protected]>
…ages, or Padding Co-authored by: Abhik Ahuja <[email protected]>
…into jonah/titlebar
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks really great that was super fast!!
I dropped some comments, mostly related to the typing of the message
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored by: Abhik Ahuja <[email protected]>
…ages, or Padding Co-authored by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored by: Abhik Ahuja <[email protected]>
…ages, or Padding Co-authored by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
…tons and an optional focus image Co-authored-by: Abhik Ahuja <[email protected]>
…into jonah/titlebar
Co-authored-by: Abhik Ahuja <[email protected]>
Co-authored-by: Abhik Ahuja <[email protected]>
After discussions about appearance when scaled down and general security with regards to sending the difference as a string, we made the following changes:
Given this new setup, the same example from before now works as follows: buttons = (
TitlebarButton(
text="Getting Started",
icon=None,
href="https://nerf.studio",
variant="outlined",
),
TitlebarButton(
text="Github",
icon="GitHub",
href="https://github.com/nerfstudio-project/nerfstudio",
variant="outlined",
),
TitlebarButton(
text="Documentation",
icon="Description",
href="https://docs.nerf.studio",
variant="outlined",
),
TitlebarButton(
text="Viewport Controls",
icon="Keyboard",
href="https://docs.nerf.studio",
variant="outlined",
),
)
image = TitlebarImage(
image_url="https://docs.nerf.studio/en/latest/_static/imgs/logo.png",
image_alt="NerfStudio Logo",
href=None,
)
titlebar_theme = TitlebarConfig(buttons=buttons, image=image)
server.configure_theme(
canvas_background_color=(2, 230, 230),
titlebar_content=titlebar_theme,
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great, thanks @jonahbedouch! Merging because I want to start resolving conflicts with the mantine PR, but I made some small tweaks to the types and example so if you could double-check that that'd be appreciated. :)
…io-project#42) * Introduce base titlebar component without functionality Co-authored-by: Abhik Ahuja <[email protected]> * Implement button, image, and padding insertion without backend Co-authored by: Abhik Ahuja <[email protected]> * Implement Python Interface for toggling Navbar and adding Buttons, Images, or Padding Co-authored by: Abhik Ahuja <[email protected]> * Introduce base titlebar component without functionality Co-authored-by: Abhik Ahuja <[email protected]> * Implement button, image, and padding insertion without backend Co-authored by: Abhik Ahuja <[email protected]> * Implement Python Interface for toggling Navbar and adding Buttons, Images, or Padding Co-authored by: Abhik Ahuja <[email protected]> * Resolve Build Warnings in Python Co-authored-by: Abhik Ahuja <[email protected]> * Resolve Formatting Issues Co-authored-by: Abhik Ahuja <[email protected]> * Introduce base titlebar component without functionality Co-authored-by: Abhik Ahuja <[email protected]> * Implement button, image, and padding insertion without backend Co-authored by: Abhik Ahuja <[email protected]> * Implement Python Interface for toggling Navbar and adding Buttons, Images, or Padding Co-authored by: Abhik Ahuja <[email protected]> * Introduce base titlebar component without functionality Co-authored-by: Abhik Ahuja <[email protected]> * Implement button, image, and padding insertion without backend Co-authored by: Abhik Ahuja <[email protected]> * Implement Python Interface for toggling Navbar and adding Buttons, Images, or Padding Co-authored by: Abhik Ahuja <[email protected]> * Resolve Build Warnings in Python Co-authored-by: Abhik Ahuja <[email protected]> * Resolve Formatting Issues Co-authored-by: Abhik Ahuja <[email protected]> * Add Support for TypedDicts to the Typescript Type Syncer Co-authored-by: Abhik Ahuja <[email protected]> * Update Titlebar Interface to rely on a fixed layout consisting of buttons and an optional focus image Co-authored-by: Abhik Ahuja <[email protected]> * Add docstrings to titlebar config objects Co-authored-by: Abhik Ahuja <[email protected]> * Remove old Titlebar interface from _message_api.py Co-authored-by: Abhik Ahuja <[email protected]> * Delete viser/.vscode directory * Move theming to separate example * Tweak types * Run ruff --------- Co-authored-by: Abhik Ahuja <[email protected]> Co-authored-by: Brent Yi <[email protected]>
Adds a toggleable navbar to Viser and piggybacks off of PR 40 to expose a Python Interface for adding custom buttons, images, and padding to the navbar. Example below:
Resulting in:

Relevant to (and in theory closes) #20