mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 22:48:34 +00:00
Remove deprecated things
This commit is contained in:
parent
2677cb0cb7
commit
21d85afee0
@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Removed
|
||||
|
||||
- Various things that were deprecated in imgui-rs 0.0.18
|
||||
|
||||
## [0.0.19] - 2018-08-12
|
||||
|
||||
### Added
|
||||
|
||||
@ -748,7 +748,6 @@ output your content because that would create a feedback loop.",
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
fn show_example_app_fixed_overlay(ui: &Ui, opened: &mut bool) {
|
||||
const DISTANCE: f32 = 10.0;
|
||||
let window_pos = (DISTANCE, DISTANCE);
|
||||
|
||||
@ -86,13 +86,6 @@ pub enum ImGuiCol {
|
||||
DragDropTarget,
|
||||
}
|
||||
impl ImGuiCol {
|
||||
#[deprecated(
|
||||
since = "0.0.19", note = "ComboBg has been merged with PopupBg. Please use PopupBg instead"
|
||||
)]
|
||||
pub const ComboBg: ImGuiCol = ImGuiCol::PopupBg;
|
||||
#[deprecated(since = "0.0.19", note = "please use ChildBg instead")]
|
||||
pub const ChildWindowBg: ImGuiCol = ImGuiCol::ChildBg;
|
||||
|
||||
pub fn values() -> &'static [ImGuiCol] {
|
||||
use ImGuiCol::*;
|
||||
static values: &'static [ImGuiCol] = &[
|
||||
@ -169,11 +162,6 @@ pub enum ImGuiStyleVar {
|
||||
}
|
||||
pub const ImGuiStyleVar_COUNT: usize = 17;
|
||||
|
||||
impl ImGuiStyleVar {
|
||||
#[deprecated(since = "0.0.19", note = "please use ChildRounding instead")]
|
||||
pub const ChildWindowRounding: ImGuiStyleVar = ImGuiStyleVar::ChildRounding;
|
||||
}
|
||||
|
||||
/// A key identifier (ImGui-side enum)
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
@ -316,8 +304,6 @@ bitflags!(
|
||||
pub struct ImGuiTreeNodeFlags: c_int {
|
||||
const Selected = 1;
|
||||
const Framed = 1 << 1;
|
||||
#[deprecated(since = "0.0.19", note = "please use AllowItemOverlap instead")]
|
||||
const AllowOverlapMode = 1 << 2;
|
||||
const AllowItemOverlap = 1 << 2;
|
||||
const NoTreePushOnOpen = 1 << 3;
|
||||
const NoAutoOpenOnLog = 1 << 4;
|
||||
@ -1015,12 +1001,6 @@ extern "C" {
|
||||
pub fn igShowUserGuide();
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(since = "0.0.19", note = "please use igShowDemoWindow instead")]
|
||||
pub unsafe fn igShowTestWindow(opened: *mut bool) {
|
||||
igShowDemoWindow(opened)
|
||||
}
|
||||
|
||||
// Window
|
||||
extern "C" {
|
||||
pub fn igBegin(name: *const c_char, open: *mut bool, flags: ImGuiWindowFlags) -> bool;
|
||||
@ -1085,16 +1065,6 @@ extern "C" {
|
||||
pub fn igGetStateStorage() -> *mut ImGuiStorage;
|
||||
}
|
||||
|
||||
/// Set next window content's width.
|
||||
///
|
||||
/// Original non-deprecated version preserved last Y value set by
|
||||
/// [`igSetNextWindowContentSize`].
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(since = "0.0.19", note = "please use igSetNextWindowContentSize instead")]
|
||||
pub unsafe fn igSetNextWindowContentWidth(width: c_float) {
|
||||
igSetNextWindowContentSize(ImVec2 { x: width, y: 0.0 })
|
||||
}
|
||||
|
||||
// Parameter stack (shared)
|
||||
extern "C" {
|
||||
pub fn igPushFont(font: *mut ImFont);
|
||||
@ -1154,12 +1124,6 @@ extern "C" {
|
||||
pub fn igGetFrameHeightWithSpacing() -> c_float;
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(since = "0.0.19", note = "please use igGetFrameHeightWithSpacing instead")]
|
||||
pub unsafe fn igGetItemsLineHeightWithSpacing() -> c_float {
|
||||
igGetFrameHeightWithSpacing()
|
||||
}
|
||||
|
||||
// Columns
|
||||
extern "C" {
|
||||
pub fn igColumns(count: c_int, id: *const c_char, border: bool);
|
||||
@ -1843,30 +1807,6 @@ extern "C" {
|
||||
);
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(
|
||||
since = "0.0.19", note = "please use igIsWindowFocused(ImGuiFocusedFlags::RootWindow) instead"
|
||||
)]
|
||||
pub unsafe fn igIsRootWindowFocused() -> bool {
|
||||
igIsWindowFocused(ImGuiFocusedFlags::RootWindow)
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(
|
||||
since = "0.0.19",
|
||||
note = "please use igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows) instead"
|
||||
)]
|
||||
pub unsafe fn igIsRootWindowOrAnyChildFocused() -> bool {
|
||||
igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows)
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(
|
||||
since = "0.0.19",
|
||||
note = "please use igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows) instead"
|
||||
)]
|
||||
pub unsafe fn igIsRootWindowOrAnyChildHovered(_flags: ImGuiHoveredFlags) -> bool {
|
||||
igIsWindowHovered(ImGuiHoveredFlags::RootAndChildWindows)
|
||||
}
|
||||
|
||||
// DrawList
|
||||
extern "C" {
|
||||
pub fn igGetOverlayDrawList() -> *mut ImDrawList;
|
||||
|
||||
@ -556,10 +556,6 @@ impl<'ui> Ui<'ui> {
|
||||
sys::igShowStyleEditor(style as *mut ImGuiStyle);
|
||||
}
|
||||
}
|
||||
#[deprecated(since = "0.0.19", note = "please use show_demo_window instead")]
|
||||
pub fn show_test_window(&self, opened: &mut bool) {
|
||||
self.show_demo_window(opened)
|
||||
}
|
||||
pub fn show_demo_window(&self, opened: &mut bool) {
|
||||
unsafe {
|
||||
sys::igShowDemoWindow(opened);
|
||||
|
||||
@ -20,11 +20,3 @@ pub enum StyleVar {
|
||||
GrabMinSize(f32),
|
||||
ButtonTextAlign(ImVec2),
|
||||
}
|
||||
|
||||
impl StyleVar {
|
||||
#[allow(non_snake_case)]
|
||||
#[deprecated(since = "0.0.19", note = "please use ChildRounding instead")]
|
||||
pub fn ChildWindowRounding(value: f32) -> Self {
|
||||
StyleVar::ChildRounding(value)
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ use std::marker::PhantomData;
|
||||
use std::ptr;
|
||||
use sys;
|
||||
|
||||
use super::{ImGuiCond, ImGuiStyleVar, ImGuiWindowFlags, ImStr, ImVec2, Ui};
|
||||
use super::{ImGuiCond, ImGuiWindowFlags, ImStr, ImVec2, Ui};
|
||||
|
||||
#[must_use]
|
||||
pub struct Window<'ui, 'p> {
|
||||
@ -13,8 +13,6 @@ pub struct Window<'ui, 'p> {
|
||||
name: &'p ImStr,
|
||||
opened: Option<&'p mut bool>,
|
||||
flags: ImGuiWindowFlags,
|
||||
// Deprecated. Should be removed along with Window::show_borders
|
||||
border: bool,
|
||||
_phantom: PhantomData<&'ui Ui<'ui>>,
|
||||
}
|
||||
|
||||
@ -28,7 +26,6 @@ impl<'ui, 'p> Window<'ui, 'p> {
|
||||
name,
|
||||
opened: None,
|
||||
flags: ImGuiWindowFlags::empty(),
|
||||
border: false,
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
@ -90,12 +87,6 @@ impl<'ui, 'p> Window<'ui, 'p> {
|
||||
self
|
||||
}
|
||||
#[inline]
|
||||
#[deprecated(since = "0.0.19", note = "please use StyleVar instead")]
|
||||
pub fn show_borders(mut self, value: bool) -> Self {
|
||||
self.border = value;
|
||||
self
|
||||
}
|
||||
#[inline]
|
||||
pub fn save_settings(mut self, value: bool) -> Self {
|
||||
self.flags.set(ImGuiWindowFlags::NoSavedSettings, !value);
|
||||
self
|
||||
@ -152,9 +143,6 @@ impl<'ui, 'p> Window<'ui, 'p> {
|
||||
if !self.size_cond.is_empty() {
|
||||
sys::igSetNextWindowSize(self.size.into(), self.size_cond);
|
||||
}
|
||||
if self.border {
|
||||
sys::igPushStyleVar(ImGuiStyleVar::WindowBorderSize, 1.0);
|
||||
}
|
||||
sys::igBegin(
|
||||
self.name.as_ptr(),
|
||||
self.opened
|
||||
@ -168,9 +156,6 @@ impl<'ui, 'p> Window<'ui, 'p> {
|
||||
}
|
||||
unsafe {
|
||||
sys::igEnd();
|
||||
if self.border {
|
||||
sys::igPopStyleVar(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user