Enum gdk4::ScrollUnit
source · #[non_exhaustive]
pub enum ScrollUnit {
Wheel,
Surface,
// some variants omitted
}
v4_8
only.Expand description
Specifies the unit of scroll deltas.
When you get Wheel
, a delta of 1.0 means 1 wheel detent
click in the south direction, 2.0 means 2 wheel detent clicks in the south
direction… This is the same logic for negative values but in the north
direction.
If you get Surface
, are managing a scrollable view and get a
value of 123, you have to scroll 123 surface logical pixels right if it’s
@delta_x or down if it’s @delta_y. This is the same logic for negative values
but you have to scroll left instead of right if it’s @delta_x and up instead
of down if it’s @delta_y.
1 surface logical pixel is equal to 1 real screen pixel multiplied by the final scale factor of your graphical interface (the product of the desktop scale factor and eventually a custom scale factor in your app).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Wheel
The delta is in number of wheel clicks.
Surface
The delta is in surface pixels to scroll directly on screen.
Trait Implementations§
source§impl Clone for ScrollUnit
impl Clone for ScrollUnit
source§fn clone(&self) -> ScrollUnit
fn clone(&self) -> ScrollUnit
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScrollUnit
impl Debug for ScrollUnit
source§impl Display for ScrollUnit
impl Display for ScrollUnit
source§impl<'a> FromValue<'a> for ScrollUnit
impl<'a> FromValue<'a> for ScrollUnit
§type Checker = GenericValueTypeChecker<ScrollUnit>
type Checker = GenericValueTypeChecker<ScrollUnit>
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value
. Read moresource§impl Hash for ScrollUnit
impl Hash for ScrollUnit
source§impl Ord for ScrollUnit
impl Ord for ScrollUnit
source§fn cmp(&self, other: &ScrollUnit) -> Ordering
fn cmp(&self, other: &ScrollUnit) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<ScrollUnit> for ScrollUnit
impl PartialEq<ScrollUnit> for ScrollUnit
source§fn eq(&self, other: &ScrollUnit) -> bool
fn eq(&self, other: &ScrollUnit) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ScrollUnit> for ScrollUnit
impl PartialOrd<ScrollUnit> for ScrollUnit
source§fn partial_cmp(&self, other: &ScrollUnit) -> Option<Ordering>
fn partial_cmp(&self, other: &ScrollUnit) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for ScrollUnit
impl StaticType for ScrollUnit
source§fn static_type() -> Type
fn static_type() -> Type
Self
.source§impl ToValue for ScrollUnit
impl ToValue for ScrollUnit
source§impl ValueType for ScrollUnit
impl ValueType for ScrollUnit
§type Type = ScrollUnit
type Type = ScrollUnit
Type
from. Read moreimpl Copy for ScrollUnit
impl Eq for ScrollUnit
impl StructuralEq for ScrollUnit
impl StructuralPartialEq for ScrollUnit
Auto Trait Implementations§
impl RefUnwindSafe for ScrollUnit
impl Send for ScrollUnit
impl Sync for ScrollUnit
impl Unpin for ScrollUnit
impl UnwindSafe for ScrollUnit
Blanket Implementations§
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
source§fn ensure_type()
fn ensure_type()
source§impl<T> ToClosureReturnValue for Twhere
T: ToValue,
impl<T> ToClosureReturnValue for Twhere
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
source§impl<T> ToSendValue for Twhere
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for Twhere
T: Send + ToValue + ?Sized,
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.