152 Commits

Author SHA1 Message Date
Jack Spira
7b644bf159 init draft 2021-09-04 19:26:20 -07:00
Jack Spira
7122366a43 fixing the stunning amount of clippy errors 2021-09-04 16:56:30 -07:00
Thom Chiovoloni
c68e29f0ae
Merge pull request #463 from dbr/key-by-index 2021-04-03 12:29:02 -07:00
AngelOfSol
42ab8ae591 Modifies build functions to allow returning data from the build
closures.
2021-03-26 01:14:08 -04:00
dbr
165ccc8043 cargo fmt 2021-03-12 12:50:28 +11:00
dbr
738081b14b Remove direct winit dependency from example
Having a requirement on `winit = "..."` complicates testing the examples against various winit versions
2021-03-12 12:05:50 +11:00
dbr
8e27d386d5 Fix 'use' for VirtualKeyCode 2021-03-09 22:14:42 +11:00
dbr
879b9d35af Add back "_index" versions of all the keyboard related methods
Allows accessing the state of any key defined by the IO backend, not just those neatly listed in imgui::Key

Closes #455
2021-03-09 19:53:14 +11:00
dbr
107133c799 Fix functional conflicts
- `ui.same_line()` no longer needs the default value specified \o/
- Doctests now actually being run, need to mark a code block as not-Rust
2021-03-09 10:37:32 +11:00
dbr/Ben
965dd87892
Merge branch 'master' into drawimage 2021-03-09 10:27:23 +11:00
Thom Chiovoloni
d0e2be1678
Merge pull request #457 from dbr/imgui-v1.81 2021-03-06 15:49:11 -08:00
Jonathan Spira
8c328001d0 Added ext function variants to the majority of overloaded functions in ImGui 2021-03-04 10:58:30 -08:00
dbr
507d5d5065 Update to imgui 1.81
Changes:

- No more ListBox::calculate_size(...) as this was deprecated upstream
2021-03-03 15:36:28 +11:00
Jonathan Spira
8ac6bc49ce accidentally broke examples 2021-02-28 21:29:06 -08:00
Jonathan Spira
7e666e8463 fixed up the examples 2021-02-28 21:29:06 -08:00
Jonathan Spira
52b0da64a5 holy god, the suffering 2021-02-28 21:29:05 -08:00
dbr/Ben
c104e7f104
Merge branch 'master' into drawimage 2021-02-25 13:35:17 +11:00
Lukasz Wiklendt
3d3097e222 add input_text hinting 2021-02-18 15:21:30 -08:00
dbr
3c37e67972 Address another clippy lint 2021-02-11 10:40:34 +11:00
dbr
daa08eb90b Remove unused variable in example to apease clippy 2021-02-10 21:01:38 +11:00
dbr
0521a8fa9f cargo fmt custom_textures.rs example 2021-02-10 18:25:07 +11:00
dbr
00d8180671 Add DrawListMut::add_image and friends 2021-02-10 14:56:26 +11:00
nsf
171d86aea1 Refactor WindowDrawList into DrawListMut and fix #413.
- Rename WindowDrawList -> DrawListMut. It's not about window draw lists, but
  about background/foreground draw lists as well. The naming was not an easy
  choice, but seems like in rust it's a common convention to add a Mut suffix for
  mutable entities. Imgui-rs already has DrawList and it acts as an immutable
  reference type for rendering implementations to consume. Hence the name
  DrawListMut, which becomes a mutable reference to draw list with methods
  to modify it.
- Add Ui::get_foreground_draw_list(). Same as Ui::get_background_draw_list()
  but for foreground.
- Add draw_list example which shows the use of all three draw lists
  (window, bg, fg).
2020-12-31 20:20:36 -08:00
henbr
1ea6073821 fix, make items_count non-optional 2020-12-31 13:06:29 -08:00
henbr
936e63bdfa Add ListClipper wrapper 2020-12-31 13:06:29 -08:00
dskkato
126d5184f6 Use Path to extract file name. 2020-12-16 17:40:30 -08:00
dkato
02b8c13174 Use MAIN_SEPARATOR to make consistent behavior. 2020-12-16 17:40:30 -08:00
Willem Verstraeten
9210130872 added richer support for ListBox 2020-12-13 10:54:35 -08:00
Thom Chiovoloni
3a1aa3a684 Format again 2020-12-05 23:32:54 -08:00
Thom Chiovoloni
e585291e4d fix lint errors and ensure examples actually are linted 2020-12-05 23:32:54 -08:00
JMS55
4b22569aac Fix some of imgui-glium-renderer 2020-10-05 12:15:15 -04:00
Joonas Javanainen
646d7d6de4
Damn you, rustfmt 2020-09-19 20:24:50 +03:00
Joonas Javanainen
dfbe4231a8
Add basic slider examples 2020-09-19 20:02:58 +03:00
Joonas Javanainen
806608740a
Update slider API slightly 2020-09-19 14:54:03 +03:00
Joonas Javanainen
03ad6b10e0
Overhaul the drag slider API 2020-09-19 14:47:09 +03:00
Cosmic Chip Socket
d6e30ba457 Format example 2020-07-14 19:08:27 -04:00
Cosmic Chip Socket
f2b4e4c482 Use SamplerBehavior in the Texture struct 2020-07-14 18:54:15 -04:00
Cosmic Chip Socket
d0c65f534d Rename TextureEntry to Texture 2020-07-14 18:54:15 -04:00
Cosmic Chip Socket
d9cc6c7499
Merge branch 'master' into glium-change-texture-filter 2020-07-13 21:06:46 -04:00
Benoit Eudier
e889b1163f Add tabs in test_window_impl following the c library example 2020-07-08 12:13:13 +09:00
Benoit Eudier
6314e72b9e implementation of TabBar and TabItem 2020-07-08 09:54:44 +09:00
Joonas Javanainen
c575dec15b
Change update_delta_time to accept a Duration
Fixes #333
2020-07-07 23:08:00 +03:00
Cosmic Chip Socket
0544e3bed6 Fix example 2020-06-29 17:49:22 -04:00
Joonas Javanainen
8b1a1d2e16
Increase height slightly to avoid scrollbar 2020-03-16 12:09:52 +02:00
Joonas Javanainen
a5a0be44e3
Redesign tree node / collapsing header API 2020-03-16 12:02:52 +02:00
Joonas Javanainen
db2b8b729a
Upgrade examples to image 0.23 2020-02-15 12:45:50 +02:00
Joonas Javanainen
befcc23bc1
Upgrade to glium 0.26 2020-02-15 12:18:11 +02:00
Nokola
feaed95eca Fix for panic in multiple_fonts.ts due to leaked FontStackToken
Fix for panic:
thread 'main' panicked at 'A FontStackToken was leaked. Did you call .pop()?', D:\Repos\GitHub\imgui-rs\src\stacks.rs:178:13

stack backtrace:
   0: backtrace::backtrace::trace_unsynchronized
             at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.34\src\backtrace\mod.rs:66
   1: std::sys_common::backtrace::_print
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\sys_common\backtrace.rs:47
   2: std::sys_common::backtrace::print
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\sys_common\backtrace.rs:36
   3: std::panicking::default_hook::{{closure}}
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\panicking.rs:200
   4: std::panicking::default_hook
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\panicking.rs:214
   5: std::panicking::rust_panic_with_hook
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\panicking.rs:477
   6: std::panicking::begin_panic
   7: <imgui::stacks::FontStackToken as core::ops::drop::Drop>::drop
   8: imgui:🪟:Window::build
   9: <std::sync::mpsc::sync::Packet<T> as core::ops::drop::Drop>::drop
  10: <std::sys_common::poison::PoisonError<T> as core::fmt::Debug>::fmt
  11: std::rt::lang_start_internal::{{closure}}
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\rt.rs:49
  12: std::panicking::try::do_call<closure-0,i32>
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\panicking.rs:296
  13: panic_unwind::__rust_maybe_catch_panic
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libpanic_unwind\lib.rs:80
  14: std::panicking::try
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\panicking.rs:275
  15: std::panic::catch_unwind
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\panic.rs:394
  16: std::rt::lang_start_internal
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\rt.rs:48
  17: main
  18: invoke_main
             at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  19: __scrt_common_main_seh
             at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  20: BaseThreadInitThunk
  21: RtlUserThreadStart
2019-10-14 01:11:01 -07:00
Joonas Javanainen
46d099f40f
Require explicit ending/popping of almost all stack tokens
This is probably going to be controversial...
Calling end/pop in the Drop implementation causes way too many problems,
and interacts very badly with panics.

There are closure-based simpler implementations of almost everything
except parameter stacks that are still convenient to use. However, if we
end up switching to &mut Ui in most functions (very much possible in the
future!), closures will complicate matters so push/pop and begin/end
pairs are still relevant.
2019-07-13 17:19:32 +03:00
Joonas Javanainen
83c2503134
Redesign menu API 2019-07-13 15:28:51 +03:00