Remove deprecated functions

This commit is contained in:
Emil Ernerfeldt 2021-12-30 22:24:18 +01:00
parent 21fe9316d5
commit db110b1690
6 changed files with 6 additions and 157 deletions

View file

@ -198,12 +198,6 @@ impl CollapsingHeader {
self
}
#[deprecated = "Replaced by: CollapsingHeader::new(RichText::new(text).text_style(…))"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
/// If you set this to `false`, the `CollapsingHeader` will be grayed out and un-clickable.
///
/// This is a convenience for [`Ui::set_enabled`].

View file

@ -436,11 +436,6 @@ impl Context {
self.fonts().font_image()
}
#[deprecated = "Renamed font_image"]
pub fn texture(&self) -> Arc<epaint::FontImage> {
self.fonts().font_image()
}
/// Tell `egui` which fonts to use.
///
/// The default `egui` fonts only support latin and cyrillic alphabets,

View file

@ -80,18 +80,6 @@ impl Button {
self
}
#[deprecated = "Replaced by: Button::new(RichText::new(text).color(…))"]
pub fn text_color(mut self, text_color: Color32) -> Self {
self.text = self.text.color(text_color);
self
}
#[deprecated = "Replaced by: Button::new(RichText::new(text).text_style(…))"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
/// Override background fill color. Note that this will override any on-hover effects.
/// Calling this will also turn on the frame.
pub fn fill(mut self, fill: impl Into<Color32>) -> Self {
@ -241,18 +229,6 @@ impl<'a> Checkbox<'a> {
text: text.into(),
}
}
#[deprecated = "Replaced by: Checkbox::new(RichText::new(text).color(…))"]
pub fn text_color(mut self, text_color: Color32) -> Self {
self.text = self.text.color(text_color);
self
}
#[deprecated = "Replaced by: Checkbox::new(RichText::new(text).text_style(…))"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
}
impl<'a> Widget for Checkbox<'a> {
@ -347,18 +323,6 @@ impl RadioButton {
text: text.into(),
}
}
#[deprecated = "Replaced by: RadioButton::new(RichText::new(text).color(…))"]
pub fn text_color(mut self, text_color: Color32) -> Self {
self.text = self.text.color(text_color);
self
}
#[deprecated = "Replaced by: RadioButton::new(RichText::new(text).text_style(…))"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
}
impl Widget for RadioButton {

View file

@ -6,8 +6,13 @@ use crate::*;
///
/// ```
/// # egui::__run_test_ui(|ui| {
/// // These are equivalent:
/// ui.hyperlink("https://github.com/emilk/egui");
/// ui.add(egui::Hyperlink::new("https://github.com/emilk/egui").text("My favorite repo").small());
/// ui.add(egui::Hyperlink::new("https://github.com/emilk/egui"));
///
/// // These are equivalent:
/// ui.hyperlink_to("My favorite repo", "https://github.com/emilk/egui");
/// ui.add(egui::Hyperlink::from_label_and_url("My favorite repo", "https://github.com/emilk/egui"));
/// # });
/// ```
#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]
@ -33,25 +38,6 @@ impl Hyperlink {
text: text.into(),
}
}
#[deprecated = "Use Hyperlink::from_label_and_url instead"]
#[allow(clippy::needless_pass_by_value)]
pub fn text(mut self, text: impl ToString) -> Self {
self.text = text.to_string().into();
self
}
#[deprecated = "Use Hyperlink::from_label_and_url instead"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
#[deprecated = "Use Hyperlink::from_label_and_url instead"]
pub fn small(mut self) -> Self {
self.text = self.text.text_style(TextStyle::Small);
self
}
}
impl Widget for Hyperlink {

View file

@ -43,90 +43,6 @@ impl Label {
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).text_style(…))"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).heading())"]
pub fn heading(mut self) -> Self {
self.text = self.text.heading();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).monospace())"]
pub fn monospace(mut self) -> Self {
self.text = self.text.monospace();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).code())"]
pub fn code(mut self) -> Self {
self.text = self.text.code();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).strong())"]
pub fn strong(mut self) -> Self {
self.text = self.text.strong();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).weak())"]
pub fn weak(mut self) -> Self {
self.text = self.text.weak();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).underline())"]
pub fn underline(mut self) -> Self {
self.text = self.text.underline();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).strikethrough())"]
pub fn strikethrough(mut self) -> Self {
self.text = self.text.strikethrough();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).italics())"]
pub fn italics(mut self) -> Self {
self.text = self.text.italics();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).small())"]
pub fn small(mut self) -> Self {
self.text = self.text.small();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).small_raised())"]
pub fn small_raised(mut self) -> Self {
self.text = self.text.small_raised();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).raised())"]
pub fn raised(mut self) -> Self {
self.text = self.text.raised();
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).background_color(…))"]
pub fn background_color(mut self, background_color: impl Into<Color32>) -> Self {
self.text = self.text.background_color(background_color);
self
}
#[deprecated = "Replaced by Label::new(RichText::new(…).text_color())"]
pub fn text_color(mut self, text_color: impl Into<Color32>) -> Self {
self.text = self.text.color(text_color);
self
}
/// Make the label respond to clicks and/or drags.
///
/// By default, a label is inert and does not respond to click or drags.

View file

@ -34,12 +34,6 @@ impl SelectableLabel {
text: text.into(),
}
}
#[deprecated = "Replaced by: Button::new(RichText::new(text).text_style(…))"]
pub fn text_style(mut self, text_style: TextStyle) -> Self {
self.text = self.text.text_style(text_style);
self
}
}
impl Widget for SelectableLabel {