GithubHelp home page GithubHelp logo

rust_gui's Introduction

GUI for Rust

Crates.io Build Status

You can finde a demo here and the code here.

Little an simple gui library for Rust inspired by react. gui and uses nanovg as default backend library for rendering. More information can be found in the docs.

Everything should be abstracted into the widget api including all drawing-operations. This allows to switch the backend without changing the api. Aditionaly it simplifyes the usage of the api because there are only some widgets you should know about and not more.

build

it should normaly compile with cargo build if not follow the instructions for nanovg which could be the reason why failed.

Ideas

random thoughts not jet implemented

animation

idea with animation

let animated = Animation::new(component, |c, x|{
	c.x = x;
	c.y = y;
}, Linear);

c.add(1, animated);

this means to just use a wrapper component which takes the component which should be animated and manages the state of the animation. on every tick event it calls the clusure modifying the component with the current paramer.

styling

The context handles the style if a element is not styled the values returned from style are the default values. If there is something specified, this style will be applied to the component if not overridden. This way each component can be easily styled. Later in the process I might develop a small css like style language to make styling applications as easy as styling html.

let b = Button{
	..c.style("agree")
};
c.add(1, b);

Macros

this is not jet implemented and might change

pattern description
[...] container for child nodes
{...} indicates some code for this context
` $event:ident
$name:ident(...) a new widget
data!(
	Group[
		Path("M12,54L4,4L34,100"),
		Button(text="Hallo")|event|{
			//handle the events here
			//
		}//==Button("Hallo")
	]
);
widget! Button(
	(
		text: &str = "",
		icon: Option<Icon> = None,
	){
		Path(...)
	}
);
Button{
	x: 10
	y: 100
	text: "test"

	Name{
		x: 100
		y: 10
		text: "wer auch immer"
	}
}

TODO:

Screenshots

rust ide

rust_gui's People

Contributors

enex avatar killercup avatar

Watchers

 avatar  avatar

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.