160 Commits

Author SHA1 Message Date
Joonas Javanainen
a7581e73c0
Small updates to test_window_impl 2017-11-06 22:53:37 +02:00
Joonas Javanainen
947a4e2dbe
Add a color button example 2017-11-05 21:54:56 +02:00
Joonas Javanainen
6695f613df
Color button doesn't use ColorFormat :/ 2017-11-05 21:42:55 +02:00
Joonas Javanainen
ad6a5ada1b
Rename enums EditableColor* -> Color* 2017-11-05 21:42:30 +02:00
Joonas Javanainen
c718bce60d
Add set_color_edit_options 2017-11-04 12:18:09 +02:00
Joonas Javanainen
97fa401fa4
Add ColorButton 2017-11-04 12:14:47 +02:00
Joonas Javanainen
76f2089b06
Reformat 2017-11-04 11:17:13 +02:00
Joonas Javanainen
c12d543514
Re-export imgui_sys as sys 2017-11-04 11:14:58 +02:00
Joonas Javanainen
9d47482a11
Add docs, export all config enums 2017-11-04 11:14:44 +02:00
Joonas Javanainen
42150784cb
Fix formatting 2017-11-04 10:44:52 +02:00
Joonas Javanainen
6ac40b1100
Take ref_color by reference 2017-11-04 10:44:16 +02:00
Joonas Javanainen
c9e5db5aa5
Add ColorPicker widget 2017-11-04 10:08:06 +02:00
Joonas Javanainen
b9e0de93b0
Various ImStr/ImString updates 2017-11-04 09:05:43 +02:00
Joonas Javanainen
b31f649c19
Use igTextUnformatted in Ui::text
We already have a slice so this is faster.
2017-11-02 23:57:35 +02:00
Joonas Javanainen
63ceb71d44
Use an enum instead of two booleans 2017-11-02 23:48:36 +02:00
Joonas Javanainen
3b87845d6b
Restore color_edit functionality 2017-11-02 23:12:04 +02:00
Joonas Javanainen
f54fae81f1
Deprecate Window::bg_alpha in preparation for 1.52 2017-11-02 22:06:14 +02:00
Joonas Javanainen
907f9dbdeb
Reformat with rustfmt 0.9.0 2017-11-02 22:01:02 +02:00
Joonas Javanainen
f92e21bf30
Upgrade to bitflags 1.0 and namespacing 2017-11-02 21:52:43 +02:00
Joonas Javanainen
3116430f07
Update cimgui to the latest version 2017-11-02 21:32:19 +02:00
Joonas Javanainen
332ef93633
Adapt to 1.51 changes 2017-11-02 21:01:01 +02:00
Joonas Javanainen
8a27431133
Remove deprecated string functions 2017-10-25 21:50:51 +03:00
Joonas Javanainen
0061a209b6
Concat NUL terminator to dynamic strings before format 2017-10-25 20:08:24 +03:00
Joonas Javanainen
5b0bbc011a
Simplify im_str macro 2017-10-24 20:38:15 +03:00
Joonas Javanainen
b609b6fa70 Merge pull request #75 from onelson/master
expose a method to set font_global_scale
2017-09-05 22:36:57 +03:00
Owen Nelson
29bd647f4d expose a method to set font_global_scale 2017-09-04 12:45:25 -07:00
Nick Palmer
bce412d625
Fixed doc tests 2017-09-02 21:54:15 +01:00
Nick Palmer
f5e9382fbe
Removed explicit returns in favour of the rustier implicit style 2017-09-02 20:09:47 +01:00
Nick Palmer
206056fc9f
Return the bool for pressed from the underlying functions and added
comments documenting example use.
2017-09-02 19:59:14 +01:00
Nick Palmer
5dd0079880
Added functions in lib for radios 2017-08-31 23:05:04 +01:00
Joonas Javanainen
c17157b6ec
Can't have field shorthands in 1.16 :'( 2017-07-14 22:08:10 +03:00
Joonas Javanainen
96fe2a8e15
Builder constructors take &Ui instead 2017-07-13 00:15:13 +03:00
Joonas Javanainen
a48f0bdbd9
Add missing PhantomData to builders
I keep forgetting about this :/ :/ :/
2017-07-12 23:51:24 +03:00
Joonas Javanainen
eca0ad9ec0
Hide all builder "new" functions
These are very unsafe when used outside the Ui::* functions.
2017-07-12 23:39:09 +03:00
Joonas Javanainen
c4cc165c5d
More Into<ImVec2> sizes 2017-07-12 23:35:22 +03:00
Joonas Javanainen
932319256f
Restructure ImString/ImStr creation functions 2017-07-12 23:30:27 +03:00
Benjamin Adamson
0c483e9d44 Use Into<ImVec2> instead of ImVec2 directly 2017-07-08 16:14:19 -07:00
Benjamin Adamson
03c1cccec6 Removed duplicated line from merge 2017-07-08 12:20:48 -07:00
Benjamin Adamson
da0b616f3c Merge branch 'master' into color-var 2017-07-08 12:03:04 -07:00
Benjamin Adamson
2c53c9ed59 Merge branch 'master' into child-frame 2017-07-08 03:50:41 -07:00
Benjamin Adamson
d71612376c Implemented feedback.
Switch color to using Into idiom.
Updated interface of with_color_vars() per suggestion.
2017-07-08 02:26:27 -07:00
Benjamin Adamson
0f52e197c0 Inline functions on the private functions, not public API. 2017-07-08 02:20:51 -07:00
Benjamin Adamson
23de1746f4 Feedback implemented 2017-07-08 02:15:59 -07:00
Benjamin Adamson
f5ed221b4e Expose color variable stack to user.
In order to have colored and wrapped text, I needed to use this
functionality in my game. This PR implements a version similar to
with_style_var().

From my testing it is safe to use a Vec4 for all the variants of the
enumeration, so I didn't bother putting an enumeration in imgui-rs, I
just reused the enumeration defined in imgui-sys directly.

Let me know if you have any feedback on this.
2017-07-08 02:04:13 -07:00
Benjamin Adamson
6cb0b54539 Expose more functionality from imgui.
Implement new_line(), calc_text_size(), and with_style_var_pushed_*()
methods I needed while making a demo.

I'm pretty new to Rust, but ran into this issue and thought I could
maybe solve it while I was learning the library.
https://github.com/Gekkio/imgui-rs/issues/39

I'm curious on your thoughts on these additions. Please LMK if you would
prefer a different direction, I'm pretty new to both Rust and this
library so please let me know if you have any suggestions!

I'm hoping to contribute to this library moving forward, as I work on
my game's UI.
2017-07-08 01:51:11 -07:00
Benjamin Adamson
2f1cc2e9a8 Initial idea for supporting child frame's for windows.
Imgui allows the user to create child frame's, and render into them.
This isn't exposed currently, this is my first idea at how rust can
support child frame's.

Presently it's not the easiest to use, to have a window with a child
frame supported, internally the imgui library must have called
beginWindow() for the parent window, before beginChild() is ever called
for the child frame. Doing this without causing unneeded
allocations/complexity, and making the API ergonomic is something I hope
to work on next / get some feedback on.
2017-07-07 02:30:34 -07:00
Joonas Javanainen
ace021b94a
Let's use encode_utf8 2017-05-12 23:35:43 +03:00
Joonas Javanainen
c6343d207b
ImString/ImStr fixes 2017-05-12 23:25:17 +03:00
ostrosco
3dc807473b - fixing discrepency in pointer type between ARM and other architectures 2017-05-07 00:07:51 -06:00
Joonas Javanainen
cfd887d2ab
Add capacity_with_nul to ImString 2017-04-25 23:26:19 +03:00