54 releases

✓ Uses Rust 2018 edition

new 0.4.13 Nov 11, 2019
0.4.8 Oct 31, 2019
0.4.1 Jul 28, 2019
0.1.17 Mar 31, 2019

#27 in GUI

Download history 60/week @ 2019-07-29 272/week @ 2019-08-05 19/week @ 2019-08-12 8/week @ 2019-08-19 889/week @ 2019-08-26 281/week @ 2019-09-02 116/week @ 2019-09-09 542/week @ 2019-09-16 65/week @ 2019-09-23 147/week @ 2019-09-30 11/week @ 2019-10-07 49/week @ 2019-10-14 58/week @ 2019-10-21 440/week @ 2019-10-28 168/week @ 2019-11-04

927 downloads per month

Apache-2.0

115KB
2K SLoC

rust-pushrod

Project Description

Build Status docs.rs for rust-pushrod

Cross Platform UI Widget Library for Rust that uses SDL2.

Draws inspiration from lots of GUI libraries.

If you like this library, please consider donating to this project!

Philosophy

The reason I created this library instead of extending another library was that I wanted to keep these specific design ideas in mind:

  • Maintainable with little effort
  • Easily extensible
  • Lightweight enough to run on minimalist hardware
  • Easy to use and understand

These design ideas are critical. Keep it simple. Keep it stupid simple.

(Ever Evolving) Screenshot of Sample

0.4.x Status

Soon to follow will be:

  • Support for Layouts
    • Horizontal Layout
    • Vertical Layout
    • Dialog or Form Layout
    • Grid Layout
  • Vertical Space Widget
  • Horizontal Space Widget
  • Menu Bar Widget
  • Simple Popup Menu Widget
  • Drop Down Menu Widget
  • Drop Down Menu Button Widget
  • Grid Widget
  • Toolbox Widget
  • Tab Widget
  • Group Box Widget
  • Split Container Widget
  • Slider Widget
  • Viewport Widget that adjusts a viewable area with scrolling

Additional Items

  • Port engine from Piston to SDL2
  • Text Widget
    • OpenSans Font Included
  • Image Widget
  • Progress Bar Widget
  • Timer Widget
  • Push Button Widget
  • Image Button Widget
  • Toggle Button Widget
  • Checkbox Widget
  • Fix build so that it builds on TravisCI for both OSes properly
  • New traits for optimization:
    • Drawable
    • InjectableSystemEvents
    • InjectableCustomEvents
  • Update Piston to the latest release
  • Fix hidden object traversal in main draw loop
  • Pass in event system trait so that Widgets have access to the Widgets from the WidgetStore
  • Add helper methods to access widgets by name and invalidate via Widget vector
  • Add Callbacks:
    • On Click without number of clicks
    • Mouse Moved
    • Widget Toggled
    • Timer Tick
    • Mouse Button Down
    • Mouse Button Up
    • Mouse Entered
    • Mouse Exited
  • Modify Event system so that it is a single trait
  • Get rid of Point and Size, use array value types instead
  • Fix all Widgets so that they draw to a texture
  • Fix Invalidation such that it walks the children so that drawing is done in order
  • Horizontal Layout sample application
  • Vertical Layout sample application
  • Update documentation
  • Widget offset updates (adding a child origin based on parent)
  • Optimizations to screen invalidation
  • Optimizations to drawing (every object is a 3D texture, not just blitting to a master texture)
  • Layout Manager optimizations (call do_update at the end of layout)
  • PageWidget: page controller to contain and swap displays of different pages of containers
  • GridLayoutContainer: layout objects equally sized in a grid
  • ToolboxWidget: layout that displays clickable images and captioned text
  • HorizontalSpaceWidget: horizontal spacer for layout containers
  • VerticalSpaceWidget: vertical spacer for layout containers
  • DropdownMenuWidget: displays a dropdown menu with selectable items in a list
  • SplitContainerWidget: splits two displays horizontally or vertically by a resizable spacer
  • GridWidget: displays a grid (either by lines or dots) evenly spaced by a grid snap offset
  • TabWidget: displays a series of tabs that can be used with the PageWidget to control page switching
  • PopupMenuWidget: displays a dropdown menu anywhere on the screen based on the mouse offset
  • Viewport: container that is larger than the screen that can be repositioned
  • SliderWidget: displays a slideable box in a bounding box, allowing for content to be scrolled
  • MenuBar: creates a menu bar at the top of the window that can be used to interact with the app
  • Layout for dialog boxes and/or form displays
  • Modal Alert box either by a new window or by a static modal dialog box that disables the top-level container
  • (De)serialization library for widgets to file
  • Modification of main application to use (de)serialization for layout

Please see here for more details on issues.

Prerequisites for Pushrod

Pushrod only requires:

Library Version
SDL2 0.32

Ubuntu

sudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev

Dependencies

~2.5MB
~52K SLoC