GtkRange's built-in scroll controller moved a slider by its page increment (10%) per wheel detent, ignored the tilt wheel and returned GDK_EVENT_STOP for every scroll event, including a touchpad's vertical swipe it did nothing with. So scrolling a list stopped dead whenever a slider passed under the pointer and changed that stream's volume instead. Sliders now replace that controller with one that asks MoonBit (@model.SliderWheel) synchronously where each event goes: - while the list is moving (it moved or was sent a scroll < 600 ms ago, kinetic deceleration included) events keep scrolling the list; - otherwise a mouse wheel changes the volume by 2% per detent, fractional for high-resolution wheels, tilt wheel included; - a touchpad gesture is decided at its first movement: mainly vertical scrolls the list (kinetic), mainly horizontal moves the knob with the fingers (physical direction). Measured under Xvfb with XTest and 8 playback streams: 12 wheel notches over a row title used to scroll 3 times and drop a stream from 100% to 20%; now the list scrolls to the end and no volume changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
122 lines
2.9 KiB
Plaintext
122 lines
2.9 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "geordi/moonmix/gtk"
|
|
|
|
import {
|
|
"moonbitlang/core/debug",
|
|
}
|
|
|
|
// Values
|
|
pub fn app_icon(String) -> String
|
|
|
|
pub fn dropdown((Int32) -> Unit) -> (Widget, Int32)
|
|
|
|
pub fn has_icon(String) -> Bool
|
|
|
|
pub fn hbox(Int32) -> Widget
|
|
|
|
pub fn image(String, Int32) -> Widget
|
|
|
|
pub fn init_gtk() -> Bool
|
|
|
|
pub fn label(String) -> Widget
|
|
|
|
pub fn level_bar() -> Widget
|
|
|
|
pub fn load_css(String) -> Unit
|
|
|
|
pub fn notebook(on_switch? : (Int32) -> Unit) -> Widget
|
|
|
|
pub fn now_us() -> Int64
|
|
|
|
pub fn prefers_dark() -> Bool
|
|
|
|
pub fn quit() -> Unit
|
|
|
|
pub fn resolve_icon(Array[String]) -> String
|
|
|
|
pub fn run() -> Unit
|
|
|
|
pub fn scale(Double, Double, (Double) -> Unit, on_scroll? : (ScrollEvent) -> Double?) -> (Widget, Int32)
|
|
|
|
pub fn scrolled(Widget) -> Widget
|
|
|
|
pub fn separator() -> Widget
|
|
|
|
pub fn set_accent_css(String) -> Unit
|
|
|
|
pub fn set_color_scheme(Int32) -> Unit
|
|
|
|
pub fn timeout(Int32, () -> Unit) -> Unit
|
|
|
|
pub fn toggle(String, String, (Bool) -> Unit) -> (Widget, Int32)
|
|
|
|
pub fn unregister(Int32) -> Unit
|
|
|
|
pub fn updating(() -> Unit) -> Unit
|
|
|
|
pub fn vbox(Int32) -> Widget
|
|
|
|
pub fn watch_appearance((Appearance) -> Unit) -> Bool
|
|
|
|
pub fn window(String, Int32, Int32, on_close? : () -> Unit) -> Widget
|
|
|
|
// Errors
|
|
|
|
// Types and methods
|
|
pub(all) struct Appearance {
|
|
accent : (Double, Double, Double)
|
|
color_scheme : Int32
|
|
}
|
|
|
|
pub(all) struct ScrollEvent {
|
|
phase : ScrollPhase
|
|
pixels : Bool
|
|
dx : Double
|
|
dy : Double
|
|
since_list_us : Int64
|
|
value : Double
|
|
extent : Double
|
|
}
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum ScrollPhase {
|
|
Begin
|
|
Scroll
|
|
End
|
|
}
|
|
|
|
#external
|
|
pub type Widget
|
|
pub fn Widget::add_css_class(Self, String) -> Unit
|
|
pub fn Widget::append(Self, Self) -> Unit
|
|
pub fn Widget::append_page(Self, Self, String, icon? : String) -> Unit
|
|
pub fn Widget::present(Self) -> Unit
|
|
pub fn Widget::remove(Self, Self) -> Unit
|
|
pub fn Widget::remove_css_class(Self, String) -> Unit
|
|
pub fn Widget::reorder_after(Self, Self, Self?) -> Unit
|
|
pub fn Widget::save_png(Self, String) -> Bool
|
|
pub fn Widget::set_active(Self, Bool) -> Unit
|
|
pub fn Widget::set_button_icon(Self, String) -> Unit
|
|
pub fn Widget::set_child(Self, Self) -> Unit
|
|
pub fn Widget::set_halign_center(Self) -> Unit
|
|
pub fn Widget::set_hexpand(Self, Bool) -> Unit
|
|
pub fn Widget::set_icon(Self, String) -> Unit
|
|
pub fn Widget::set_items(Self, Array[String], Int32) -> Unit
|
|
pub fn Widget::set_level(Self, Double) -> Unit
|
|
pub fn Widget::set_margins(Self, Int32) -> Unit
|
|
pub fn Widget::set_page(Self, Int32) -> Unit
|
|
pub fn Widget::set_pixel_size(Self, Int32) -> Unit
|
|
pub fn Widget::set_sensitive(Self, Bool) -> Unit
|
|
pub fn Widget::set_text(Self, String) -> Unit
|
|
pub fn Widget::set_tooltip(Self, String) -> Unit
|
|
pub fn Widget::set_valign_center(Self) -> Unit
|
|
pub fn Widget::set_value(Self, Double) -> Unit
|
|
pub fn Widget::set_vexpand(Self, Bool) -> Unit
|
|
pub fn Widget::set_visible(Self, Bool) -> Unit
|
|
pub fn Widget::set_width_chars(Self, Int32) -> Unit
|
|
pub fn Widget::value(Self) -> Double
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|