portico/Sources/Portico/Generated/ShortcutsWindow.swift

42 lines
1.7 KiB
Swift

// Generated by PorticoGen. DO NOT EDIT. See Sources/PorticoGen to make changes.
import Adw
import Gtk
import Gio
import Gdk
// PorticoGen: generateModifierExtension | source: Gtk.ShortcutsWindow
/// Modifiers for `Gtk.ShortcutsWindow`, available on every Portico view whose
/// backing widget is `Gtk.ShortcutsWindow` or one of its subclasses.
extension WidgetView where Target: Gtk.ShortcutsWindow {
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ShortcutsWindow.connectClose(_:)
/// Emitted when the user uses a keybinding to close the window.
///
/// This is a [keybinding signal](class.SignalAction.html).
///
/// The default binding for this signal is the <kbd>Escape</kbd> key.
///
/// - Parameter handler: Invoked when the widget emits the `close` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onClose(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectClose { _ in handler() })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ShortcutsWindow.connectSearch(_:)
/// Emitted when the user uses a keybinding to start a search.
///
/// This is a [keybinding signal](class.SignalAction.html).
///
/// The default binding for this signal is <kbd>Control</kbd>+<kbd>F</kbd>.
///
/// - Parameter handler: Invoked when the widget emits the `search` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onSearch(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectSearch { _ in handler() })
}
}
}