Git Product home page Git Product logo

poly_ui's Introduction

poly_ui

GitHub Actions GitHub Actions License: MIT Gitpod Ready-to-Code

User interface library for Rust using SDL2

Quick start

Gitpod

Just click on the gitpod badge. Opened environment will be ready to work.

Windows

Clone and run. The build script (build.rs) will copy necessary libraries to the root dir of the cloned repository.

Linux

Install necessary SDL2 libraries:

sudo apt-get update -y
sudo apt-get install -y libsdl2-dev
sudo apt-get install -y libsdl2-ttf-dev

Clone and run.

macOS

Install necessary SDL2 libraries:

brew install SDL2
brew install SDL2_ttf

Clone and run.

After running you should see a test window: Image

poly_ui's People

Contributors

piotrsquaresmoscicki avatar

Watchers

 avatar

poly_ui's Issues

Add CanvasLayout

Canvas layout should display allows user for arranging child widgets in any way he wants. Widgets can overlap and have empty spaces between them. User needs to specify their position and size in pixels and they will remain in this position and size all the time.

Implement basic styles engine

It should probably be based on css(?) It would be great if we would be able to use css to style the application.

Other idea is to use RON to store style properties and deserialise it using serde (no need to write custom parser)

Add LinearLayout

Linear layout organizes child widgets in single column or row. The orientation and direction should be controlled by an enum. Maybe it could be a generic struct taking this enum as a type parameter so we could create aliases for it (HorizontalLayout, VerticalLayout, HorizontalReversedLayout, VerticalReversedLayout).

Blocked by:
#5

Implement layout items size generation helper

Calculating heigth and width of an item in the layout is not a trivial task but once done it will work the same in every other layout so we should have items size generation in one place.

Remove add_child and remove child

It shouldn't be possible to add child widget to a widget whichg type we don't know. We allow adding children to layouts and only one child for button for example.

Research signals/events

We need to have some way to notify owner when some button was pressed or text modified. It would be probably more convenient to do this with signals on which we can register rather than bare observer pattern.

Implement PushButton

User should be able to click the button.
Button should invoke some function on click.
Button should have different appearance while hovered, pressed or idle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.