Remove deprecated functions (#3692)
This commit is contained in:
@@ -173,13 +173,6 @@ impl Area {
|
||||
self
|
||||
}
|
||||
|
||||
#[deprecated = "Use `constrain_to` instead"]
|
||||
#[inline]
|
||||
pub fn drag_bounds(mut self, constrain_rect: Rect) -> Self {
|
||||
self.constrain_rect = Some(constrain_rect);
|
||||
self
|
||||
}
|
||||
|
||||
/// Where the "root" of the area is.
|
||||
///
|
||||
/// For instance, if you set this to [`Align2::RIGHT_TOP`]
|
||||
|
||||
@@ -424,36 +424,6 @@ impl CollapsingHeader {
|
||||
self
|
||||
}
|
||||
|
||||
/// Can the [`CollapsingHeader`] be selected by clicking it? Default: `false`.
|
||||
#[deprecated = "Use the more powerful egui::collapsing_header::CollapsingState::show_header"] // Deprecated in 2022-04-28, before egui 0.18
|
||||
#[inline]
|
||||
pub fn selectable(mut self, selectable: bool) -> Self {
|
||||
self.selectable = selectable;
|
||||
self
|
||||
}
|
||||
|
||||
/// If you set this to 'true', the [`CollapsingHeader`] will be shown as selected.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// # egui::__run_test_ui(|ui| {
|
||||
/// let mut selected = false;
|
||||
/// let response = egui::CollapsingHeader::new("Select and open me")
|
||||
/// .selectable(true)
|
||||
/// .selected(selected)
|
||||
/// .show(ui, |ui| ui.label("Body"));
|
||||
/// if response.header_response.clicked() {
|
||||
/// selected = true;
|
||||
/// }
|
||||
/// # });
|
||||
/// ```
|
||||
#[deprecated = "Use the more powerful egui::collapsing_header::CollapsingState::show_header"] // Deprecated in 2022-04-28, before egui 0.18
|
||||
#[inline]
|
||||
pub fn selected(mut self, selected: bool) -> Self {
|
||||
self.selected = selected;
|
||||
self
|
||||
}
|
||||
|
||||
/// Should the [`CollapsingHeader`] show a background behind it? Default: `false`.
|
||||
///
|
||||
/// To show it behind all [`CollapsingHeader`] you can just use:
|
||||
|
||||
@@ -152,12 +152,6 @@ impl Frame {
|
||||
self
|
||||
}
|
||||
|
||||
#[deprecated = "Renamed inner_margin in egui 0.18"]
|
||||
#[inline]
|
||||
pub fn margin(self, margin: impl Into<Margin>) -> Self {
|
||||
self.inner_margin(margin)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn shadow(mut self, shadow: Shadow) -> Self {
|
||||
self.shadow = shadow;
|
||||
|
||||
@@ -209,15 +209,6 @@ impl<'open> Window<'open> {
|
||||
self
|
||||
}
|
||||
|
||||
#[deprecated = "Use `constrain_to` instead"]
|
||||
#[inline]
|
||||
pub fn drag_bounds(mut self, constrain_rect: Rect) -> Self {
|
||||
#![allow(deprecated)]
|
||||
|
||||
self.area = self.area.drag_bounds(constrain_rect);
|
||||
self
|
||||
}
|
||||
|
||||
/// Where the "root" of the window is.
|
||||
///
|
||||
/// For instance, if you set this to [`Align2::RIGHT_TOP`]
|
||||
|
||||
@@ -707,16 +707,6 @@ impl Context {
|
||||
})
|
||||
}
|
||||
|
||||
/// Read-write access to [`Fonts`].
|
||||
#[inline]
|
||||
#[deprecated = "This function will be removed"]
|
||||
pub fn fonts_mut<R>(&self, writer: impl FnOnce(Option<&mut Fonts>) -> R) -> R {
|
||||
self.write(move |ctx| {
|
||||
let pixels_per_point = ctx.pixels_per_point();
|
||||
writer(ctx.fonts.get_mut(&pixels_per_point.into()))
|
||||
})
|
||||
}
|
||||
|
||||
/// Read-only access to [`Options`].
|
||||
#[inline]
|
||||
pub fn options<R>(&self, reader: impl FnOnce(&Options) -> R) -> R {
|
||||
|
||||
@@ -572,15 +572,6 @@ impl Modifiers {
|
||||
command: false,
|
||||
};
|
||||
|
||||
#[deprecated = "Use `Modifiers::ALT | Modifiers::SHIFT` instead"]
|
||||
pub const ALT_SHIFT: Self = Self {
|
||||
alt: true,
|
||||
ctrl: false,
|
||||
shift: true,
|
||||
mac_cmd: false,
|
||||
command: false,
|
||||
};
|
||||
|
||||
/// The Mac ⌘ Command key
|
||||
pub const MAC_CMD: Self = Self {
|
||||
alt: false,
|
||||
|
||||
@@ -111,14 +111,6 @@ pub struct PlatformOutput {
|
||||
}
|
||||
|
||||
impl PlatformOutput {
|
||||
/// Open the given url in a web browser.
|
||||
///
|
||||
/// If egui is running in a browser, the same tab will be reused.
|
||||
#[deprecated = "Use Context::open_url instead"]
|
||||
pub fn open_url(&mut self, url: impl ToString) {
|
||||
self.open_url = Some(OpenUrl::same_tab(url));
|
||||
}
|
||||
|
||||
/// This can be used by a text-to-speech system to describe the events (if any).
|
||||
pub fn events_description(&self) -> String {
|
||||
// only describe last event:
|
||||
|
||||
@@ -37,11 +37,6 @@ impl Id {
|
||||
/// though obviously it will lead to a lot of collisions if you do use it!
|
||||
pub const NULL: Self = Self(0);
|
||||
|
||||
#[deprecated = "Use Id::NULL"]
|
||||
pub fn null() -> Self {
|
||||
Self(0)
|
||||
}
|
||||
|
||||
pub(crate) const fn background() -> Self {
|
||||
Self(1)
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ pub struct Memory {
|
||||
///
|
||||
/// This will be saved between different program runs if you use the `persistence` feature.
|
||||
///
|
||||
/// To store a state common for all your widgets (a singleton), use [`Id::null`] as the key.
|
||||
/// To store a state common for all your widgets (a singleton), use [`Id::NULL`] as the key.
|
||||
pub data: crate::util::IdTypeMap,
|
||||
|
||||
// ------------------------------------------
|
||||
@@ -666,21 +666,6 @@ impl Memory {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set an event filter for a widget.
|
||||
///
|
||||
/// You must first give focus to the widget before calling this.
|
||||
#[deprecated = "Use set_focus_lock_filter instead"]
|
||||
pub fn lock_focus(&mut self, id: Id, lock_focus: bool) {
|
||||
self.set_focus_lock_filter(
|
||||
id,
|
||||
EventFilter {
|
||||
tab: lock_focus,
|
||||
arrows: lock_focus,
|
||||
escape: false,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// Give keyboard focus to a specific widget.
|
||||
/// See also [`crate::Response::request_focus`].
|
||||
#[inline(always)]
|
||||
|
||||
@@ -83,16 +83,6 @@ impl Painter {
|
||||
pub(crate) fn set_invisible(&mut self) {
|
||||
self.fade_to_color = Some(Color32::TRANSPARENT);
|
||||
}
|
||||
|
||||
#[deprecated = "Use Painter::with_clip_rect"] // Deprecated in 2022-04-18, before egui 0.18
|
||||
pub fn sub_region(&self, rect: Rect) -> Self {
|
||||
Self {
|
||||
ctx: self.ctx.clone(),
|
||||
layer_id: self.layer_id,
|
||||
clip_rect: rect.intersect(self.clip_rect),
|
||||
fade_to_color: self.fade_to_color,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// ## Accessors etc
|
||||
|
||||
@@ -318,7 +318,7 @@ use crate::Id;
|
||||
///
|
||||
/// Values can either be "persisted" (serializable) or "temporary" (cleared when egui is shut down).
|
||||
///
|
||||
/// You can store state using the key [`Id::null`]. The state will then only be identified by its type.
|
||||
/// You can store state using the key [`Id::NULL`]. The state will then only be identified by its type.
|
||||
///
|
||||
/// ```
|
||||
/// # use egui::{Id, util::IdTypeMap};
|
||||
|
||||
@@ -193,11 +193,6 @@ impl<'t> TextEdit<'t> {
|
||||
self
|
||||
}
|
||||
|
||||
#[deprecated = "Use .font(…) instead"]
|
||||
pub fn text_style(self, text_style: TextStyle) -> Self {
|
||||
self.font(text_style)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn text_color(mut self, text_color: Color32) -> Self {
|
||||
self.text_color = Some(text_color);
|
||||
|
||||
Reference in New Issue
Block a user