Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename fn scroll2 to fn scroll #4282

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions crates/egui/src/containers/scroll_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,16 @@ impl ScrollArea {
}

/// Turn on/off scrolling on the horizontal/vertical axes.
///
/// You can pass in `false`, `true`, `[false, true]` etc.
#[inline]
pub fn scroll(mut self, scroll_enabled: impl Into<Vec2b>) -> Self {
self.scroll_enabled = scroll_enabled.into();
self
}

/// Turn on/off scrolling on the horizontal/vertical axes.
#[deprecated = "Renamed to `scroll`"]
#[inline]
pub fn scroll2(mut self, scroll_enabled: impl Into<Vec2b>) -> Self {
self.scroll_enabled = scroll_enabled.into();
Expand Down
12 changes: 11 additions & 1 deletion crates/egui/src/containers/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,19 @@ impl<'open> Window<'open> {
}

/// Enable/disable horizontal/vertical scrolling. `false` by default.
///
/// You can pass in `false`, `true`, `[false, true]` etc.
#[inline]
pub fn scroll(mut self, scroll: impl Into<Vec2b>) -> Self {
self.scroll = self.scroll.scroll(scroll);
self
}

/// Enable/disable horizontal/vertical scrolling. `false` by default.
#[deprecated = "Renamed to `scroll`"]
#[inline]
pub fn scroll2(mut self, scroll: impl Into<Vec2b>) -> Self {
self.scroll = self.scroll.scroll2(scroll);
self.scroll = self.scroll.scroll(scroll);
self
}

Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_lib/src/demo/code_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl super::Demo for CodeExample {
.open(open)
.min_width(375.0)
.default_size([390.0, 500.0])
.scroll2(false)
.scroll(false)
.resizable([true, false])
.show(ctx, |ui| self.ui(ui));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_lib/src/demo/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl super::Demo for InputTest {
.default_width(800.0)
.open(open)
.resizable(true)
.scroll2(false)
.scroll(false)
.show(ctx, |ui| {
use super::View as _;
self.ui(ui);
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_lib/src/demo/window_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl super::Demo for WindowOptions {
.constrain(constrain)
.collapsible(collapsible)
.title_bar(title_bar)
.scroll2(scroll2)
.scroll(scroll2)
.enabled(enabled);
if closable {
window = window.open(open);
Expand Down
Loading