Skip to content

Commit 7d82f4c

Browse files
committed
Remove misc deprecated functions
1 parent 697dc92 commit 7d82f4c

File tree

10 files changed

+1
-142
lines changed

10 files changed

+1
-142
lines changed

crates/ecolor/src/color32.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ impl Color32 {
102102
/// i.e. often taken to mean "no color".
103103
pub const PLACEHOLDER: Self = Self::from_rgba_premultiplied(64, 254, 0, 128);
104104

105-
#[deprecated = "Renamed to PLACEHOLDER"]
106-
pub const TEMPORARY_COLOR: Self = Self::PLACEHOLDER;
107-
108105
/// From RGB with alpha of 255 (opaque).
109106
#[inline]
110107
pub const fn from_rgb(r: u8, g: u8, b: u8) -> Self {

crates/egui/src/containers/scroll_area.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,6 @@ impl ScrollArea {
513513
self
514514
}
515515

516-
/// Turn on/off scrolling on the horizontal/vertical axes.
517-
#[deprecated = "Renamed to `scroll`"]
518-
#[inline]
519-
pub fn scroll2(mut self, direction_enabled: impl Into<Vec2b>) -> Self {
520-
self.direction_enabled = direction_enabled.into();
521-
self
522-
}
523-
524516
/// Control the scrolling behavior.
525517
///
526518
/// * If `true` (default), the scroll area will respond to user scrolling.

crates/egui/src/containers/window.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,6 @@ impl<'open> Window<'open> {
376376
self
377377
}
378378

379-
/// Enable/disable horizontal/vertical scrolling. `false` by default.
380-
#[deprecated = "Renamed to `scroll`"]
381-
#[inline]
382-
pub fn scroll2(mut self, scroll: impl Into<Vec2b>) -> Self {
383-
self.scroll = self.scroll.scroll(scroll);
384-
self
385-
}
386-
387379
/// Enable/disable horizontal scrolling. `false` by default.
388380
#[inline]
389381
pub fn hscroll(mut self, hscroll: bool) -> Self {

crates/egui/src/context.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,13 +1230,6 @@ impl Context {
12301230
.map(|widget_rect| self.get_response(widget_rect))
12311231
}
12321232

1233-
/// Returns `true` if the widget with the given `Id` contains the pointer.
1234-
#[deprecated = "Use Response.contains_pointer or Context::read_response instead"]
1235-
pub fn widget_contains_pointer(&self, id: Id) -> bool {
1236-
self.read_response(id)
1237-
.is_some_and(|response| response.contains_pointer())
1238-
}
1239-
12401233
/// Do all interaction for an existing widget, without (re-)registering it.
12411234
pub(crate) fn get_response(&self, widget_rect: WidgetRect) -> Response {
12421235
use response::Flags;
@@ -2739,21 +2732,6 @@ impl Context {
27392732
.map(|t| t.inverse())
27402733
}
27412734

2742-
/// Move all the graphics at the given layer.
2743-
///
2744-
/// Is used to implement drag-and-drop preview.
2745-
///
2746-
/// This only applied to the existing graphics at the layer, not to new graphics added later.
2747-
///
2748-
/// For a persistent transform, use [`Self::set_transform_layer`] instead.
2749-
#[deprecated = "Use `transform_layer_shapes` instead"]
2750-
pub fn translate_layer(&self, layer_id: LayerId, delta: Vec2) {
2751-
if delta != Vec2::ZERO {
2752-
let transform = emath::TSTransform::from_translation(delta);
2753-
self.transform_layer_shapes(layer_id, transform);
2754-
}
2755-
}
2756-
27572735
/// Transform all the graphics at the given layer.
27582736
///
27592737
/// Is used to implement drag-and-drop preview.

crates/egui/src/data/input.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ pub const NUM_POINTER_BUTTONS: usize = 5;
592592

593593
/// State of the modifier keys. These must be fed to egui.
594594
///
595-
/// The best way to compare [`Modifiers`] is by using [`Modifiers::matches`].
595+
/// The best way to compare [`Modifiers`] is by using [`Modifiers::matches_logically`] or [`Modifiers::matches_exact`].
596596
///
597597
/// NOTE: For cross-platform uses, ALT+SHIFT is a bad combination of modifiers
598598
/// as on mac that is how you type special characters,
@@ -842,11 +842,6 @@ impl Modifiers {
842842
self.cmd_ctrl_matches(pattern)
843843
}
844844

845-
#[deprecated = "Renamed `matches_exact`, but maybe you want to use `matches_logically` instead"]
846-
pub fn matches(&self, pattern: Self) -> bool {
847-
self.matches_exact(pattern)
848-
}
849-
850845
/// Checks only cmd/ctrl, not alt/shift.
851846
///
852847
/// `self` here are the currently pressed modifiers,

crates/egui/src/memory/mod.rs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -993,59 +993,6 @@ impl Memory {
993993
self.focus_mut().focused_widget = None;
994994
}
995995

996-
/// Is any widget being dragged?
997-
#[deprecated = "Use `Context::dragged_id` instead"]
998-
#[inline(always)]
999-
pub fn is_anything_being_dragged(&self) -> bool {
1000-
self.interaction().potential_drag_id.is_some()
1001-
}
1002-
1003-
/// Is this specific widget being dragged?
1004-
///
1005-
/// A widget that sense both clicks and drags is only marked as "dragged"
1006-
/// when the mouse has moved a bit, but `is_being_dragged` will return true immediately.
1007-
#[deprecated = "Use `Context::is_being_dragged` instead"]
1008-
#[inline(always)]
1009-
pub fn is_being_dragged(&self, id: Id) -> bool {
1010-
self.interaction().potential_drag_id == Some(id)
1011-
}
1012-
1013-
/// Get the id of the widget being dragged, if any.
1014-
///
1015-
/// Note that this is set as soon as the mouse is pressed,
1016-
/// so the widget may not yet be marked as "dragged",
1017-
/// as that can only happen after the mouse has moved a bit
1018-
/// (at least if the widget is interesated in both clicks and drags).
1019-
#[deprecated = "Use `Context::dragged_id` instead"]
1020-
#[inline(always)]
1021-
pub fn dragged_id(&self) -> Option<Id> {
1022-
self.interaction().potential_drag_id
1023-
}
1024-
1025-
/// Set which widget is being dragged.
1026-
#[inline(always)]
1027-
#[deprecated = "Use `Context::set_dragged_id` instead"]
1028-
pub fn set_dragged_id(&mut self, id: Id) {
1029-
self.interaction_mut().potential_drag_id = Some(id);
1030-
}
1031-
1032-
/// Stop dragging any widget.
1033-
#[inline(always)]
1034-
#[deprecated = "Use `Context::stop_dragging` instead"]
1035-
pub fn stop_dragging(&mut self) {
1036-
self.interaction_mut().potential_drag_id = None;
1037-
}
1038-
1039-
/// Is something else being dragged?
1040-
///
1041-
/// Returns true if we are dragging something, but not the given widget.
1042-
#[inline(always)]
1043-
#[deprecated = "Use `Context::dragging_something_else` instead"]
1044-
pub fn dragging_something_else(&self, not_this: Id) -> bool {
1045-
let drag_id = self.interaction().potential_drag_id;
1046-
drag_id.is_some() && drag_id != Some(not_this)
1047-
}
1048-
1049996
/// Forget window positions, sizes etc.
1050997
/// Can be used to auto-layout windows.
1051998
pub fn reset_areas(&mut self) {

crates/egui/src/painter.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -582,16 +582,6 @@ impl Painter {
582582
));
583583
}
584584
}
585-
586-
#[deprecated = "Use `Painter::galley` or `Painter::galley_with_override_text_color` instead"]
587-
#[inline]
588-
pub fn galley_with_color(&self, pos: Pos2, galley: Arc<Galley>, text_color: Color32) {
589-
if !galley.is_empty() {
590-
self.add(Shape::galley_with_override_text_color(
591-
pos, galley, text_color,
592-
));
593-
}
594-
}
595585
}
596586

597587
fn tint_shape_towards(shape: &mut Shape, target: Color32) {

crates/egui/src/response.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -395,19 +395,6 @@ impl Response {
395395
self.drag_stopped() && self.ctx.input(|i| i.pointer.button_released(button))
396396
}
397397

398-
/// The widget was being dragged, but now it has been released.
399-
#[inline]
400-
#[deprecated = "Renamed 'drag_stopped'"]
401-
pub fn drag_released(&self) -> bool {
402-
self.drag_stopped()
403-
}
404-
405-
/// The widget was being dragged by the button, but now it has been released.
406-
#[deprecated = "Renamed 'drag_stopped_by'"]
407-
pub fn drag_released_by(&self, button: PointerButton) -> bool {
408-
self.drag_stopped_by(button)
409-
}
410-
411398
/// If dragged, how many points were we dragged and in what direction?
412399
#[inline]
413400
pub fn drag_delta(&self) -> Vec2 {

crates/egui/src/widgets/text_edit/output.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,4 @@ pub struct TextEditOutput {
2323
pub cursor_range: Option<CCursorRange>,
2424
}
2525

26-
impl TextEditOutput {
27-
#[deprecated = "Renamed `self.galley_pos`"]
28-
pub fn text_draw_pos(&self) -> crate::Pos2 {
29-
self.galley_pos
30-
}
31-
}
32-
3326
// TODO(emilk): add `output.paint` and `output.store` and split out that code from `TextEdit::show`.

crates/epaint/src/margin.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,6 @@ impl Margin {
9696
pub const fn is_same(self) -> bool {
9797
self.left == self.right && self.left == self.top && self.left == self.bottom
9898
}
99-
100-
#[deprecated = "Use `rect + margin` instead"]
101-
#[inline]
102-
pub fn expand_rect(self, rect: Rect) -> Rect {
103-
Rect::from_min_max(rect.min - self.left_top(), rect.max + self.right_bottom())
104-
}
105-
106-
#[deprecated = "Use `rect - margin` instead"]
107-
#[inline]
108-
pub fn shrink_rect(self, rect: Rect) -> Rect {
109-
Rect::from_min_max(rect.min + self.left_top(), rect.max - self.right_bottom())
110-
}
11199
}
112100

113101
impl From<i8> for Margin {

0 commit comments

Comments
 (0)