mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Floating scroll bars (#3539)
* Move scroll bar spacing settings to a `struct ScrollSpacing` * Add a demo for changing scroll bar appearance * Add setting for ScrollBarVisibility in demo * Add `#[inline]` to a `ScrollArea` builder methods * Refactor how scroll bar show/hide is computed * Add support for floating scroll bars * Tweak color and opacity of the scroll handle * Allow allocating a fixed size even for floating scroll bars * Add three pre-sets of scroll bars: solid, thin, floating * Use floating scroll bars as the default * Fix id-clash with bidir scroll areas * Improve demo * Fix doclink * Remove reset button from demo * Fix doclinks * Fix visual artifact with thin rounded rectangles * Fix doclink * typos
This commit is contained in:
@@ -274,6 +274,16 @@ impl Vec2 {
|
||||
self.x.max(self.y)
|
||||
}
|
||||
|
||||
/// Swizzle the axes.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn yx(self) -> Vec2 {
|
||||
Vec2 {
|
||||
x: self.y,
|
||||
y: self.x,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub fn clamp(self, min: Self, max: Self) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user