pub struct TopMenuItems {Show 14 fields
tray_ui: DynamicUiRef<SystemTray>,
tray_close_desktop: MenuItem,
tray_create_desktop: MenuItem,
tray_sep1: MenuSeparator,
pub tray_smooth_switch: MenuItem,
tray_settings_menu: Menu,
tray_request_admin_at_startup: MenuItem,
tray_icon_menu: Menu,
tray_icon_types: Vec<MenuItem>,
tray_quick_switch_menu: Menu,
tray_quick_switch_items: Vec<MenuItem>,
tray_auto_start_menu: Menu,
tray_auto_start_items: Vec<MenuItem>,
tray_sep2: MenuSeparator,
}
Fields§
§tray_ui: DynamicUiRef<SystemTray>
§tray_close_desktop: MenuItem
§tray_create_desktop: MenuItem
§tray_sep1: MenuSeparator
§tray_smooth_switch: MenuItem
§tray_request_admin_at_startup: MenuItem
§tray_icon_types: Vec<MenuItem>
One menu item per icon type.
tray_quick_switch_items: Vec<MenuItem>
One menu item per quick switch option.
tray_auto_start_items: Vec<MenuItem>
One menu item per auto start option.
tray_sep2: MenuSeparator
Implementations§
Source§impl TopMenuItems
Handle clicked menu items.
impl TopMenuItems
Handle clicked menu items.
fn close_current_desktop(&self)
fn create_desktop(&self)
fn toggle_smooth_switch(&self)
fn toggle_request_admin_at_startup(&self)
Source§impl TopMenuItems
Helper methods.
impl TopMenuItems
Helper methods.
fn update_label_for_request_admin_at_startup(&self)
fn update_label_for_smooth_switch(&self)
fn check_selected_tray_icon(&self, selected: TrayIconType)
fn check_selected_quick_switch(&self, selected: QuickSwitchMenu)
fn check_selected_auto_start(&self, selected: AutoStart)
Trait Implementations§
Source§impl Default for TopMenuItems
impl Default for TopMenuItems
Source§fn default() -> TopMenuItems
fn default() -> TopMenuItems
Returns the “default value” for a type. Read more
Source§impl DynamicUiHooks<SystemTray> for TopMenuItems
impl DynamicUiHooks<SystemTray> for TopMenuItems
Source§fn before_partial_build(
&mut self,
tray_ui: &Rc<SystemTray>,
_should_build: &mut bool,
) -> Option<(ControlHandle, TypeId)>
fn before_partial_build( &mut self, tray_ui: &Rc<SystemTray>, _should_build: &mut bool, ) -> Option<(ControlHandle, TypeId)>
Called before the item has been built. The returned parent will be
passed to [
nwg::PartialUi::build_partial
] and used by controls in
structs that make use of the [nwd::NwgPartial
] derive macro. Read moreSource§fn after_partial_build(&mut self, tray_ui: &Rc<SystemTray>)
fn after_partial_build(&mut self, tray_ui: &Rc<SystemTray>)
Called right after the ui has finished building. Read more
Source§fn before_rebuild(&mut self, tray_ui: &Rc<SystemTray>)
fn before_rebuild(&mut self, tray_ui: &Rc<SystemTray>)
Do some cleanup before the plugin is built again. By default this resets
the state to its default value.
Source§fn after_process_events(
&self,
dynamic_ui: &Rc<SystemTray>,
evt: Event,
_evt_data: &EventData,
handle: ControlHandle,
_window: ControlHandle,
)
fn after_process_events( &self, dynamic_ui: &Rc<SystemTray>, evt: Event, _evt_data: &EventData, handle: ControlHandle, _window: ControlHandle, )
Run right after [
nwg::PartialUi::process_event
] and allows easily
doing some extra processing. Useful since the original method might be
implemented by a derive macro which would make it difficult to modify.Source§fn after_handles<'a>(
&'a self,
_dynamic_ui: &Rc<T>,
_handles: &mut Vec<&'a ControlHandle>,
)
fn after_handles<'a>( &'a self, _dynamic_ui: &Rc<T>, _handles: &mut Vec<&'a ControlHandle>, )
Run right after [
nwg::PartialUi::handles
] and allows modifying its
result.Source§fn need_raw_events_for_children(&self) -> bool
fn need_raw_events_for_children(&self) -> bool
Called after
DynamicUiHooks::after_handles
to check if we should
bind raw event handlers for child controls as well.Source§fn process_raw_event(
&self,
_dynamic_ui: &Rc<T>,
_hwnd: isize,
_msg: u32,
_w: usize,
_l: isize,
_window: ControlHandle,
) -> Option<isize>
fn process_raw_event( &self, _dynamic_ui: &Rc<T>, _hwnd: isize, _msg: u32, _w: usize, _l: isize, _window: ControlHandle, ) -> Option<isize>
Listen to raw window events (not filtered or processed by
[
native_windows_gui
]). The first result that returns Some
will be
used as the actual return value for the event. Read moreSource§fn need_rebuild(&self, _dynamic_ui: &Rc<T>) -> bool
fn need_rebuild(&self, _dynamic_ui: &Rc<T>) -> bool
Indicate that this item needs to be rebuilt. Maybe because its part of a
context menu and its items need to be changed. Read more
Source§fn is_ordered_in_parent(&self) -> bool
fn is_ordered_in_parent(&self) -> bool
Indicates if this item has a specific position relative to other items
in its parent. If this returns
true
then the item will be rebuilt
after previous siblings (items that share the same parent) are rebuilt. Read moreSource§impl PartialUi for TopMenuItems
impl PartialUi for TopMenuItems
Source§fn build_partial<W: Into<ControlHandle>>(
data: &mut Self,
_parent: Option<W>,
) -> Result<(), NwgError>
fn build_partial<W: Into<ControlHandle>>( data: &mut Self, _parent: Option<W>, ) -> Result<(), NwgError>
Should initialize the GUI components. Similar to
NativeUi::build_ui
except it doesn’t handle event binding. Read moreSource§fn process_event<'a>(
&self,
_evt: Event,
_evt_data: &EventData,
_handle: ControlHandle,
)
fn process_event<'a>( &self, _evt: Event, _evt_data: &EventData, _handle: ControlHandle, )
Should process the events of the partial. This method will probably be called from an event handler bound in the parent GUI structure. Read more
Source§impl TrayPlugin for TopMenuItems
impl TrayPlugin for TopMenuItems
fn on_settings_changed( &self, _tray_ui: &Rc<SystemTray>, prev: &Arc<UiSettings>, settings: &Arc<UiSettings>, )
Source§fn on_desktop_event(&self, _tray_ui: &Rc<SystemTray>, _event: &DesktopEvent)
fn on_desktop_event(&self, _tray_ui: &Rc<SystemTray>, _event: &DesktopEvent)
React to Virtual Desktop events.
fn on_current_desktop_changed( &self, _tray_ui: &Rc<SystemTray>, _current_desktop_index: u32, )
fn on_desktop_count_changed( &self, _tray_ui: &Rc<SystemTray>, _new_desktop_count: u32, )
Handle keyboard button press on tray context menu. The first return
value that is
Some
will be used; if there is no such return value then
MenuKeyPressEffect::Ignore
will be used. Read morefn on_windows_mode_changed(&self, _tray_ui: &Rc<SystemTray>)
Auto Trait Implementations§
impl !Freeze for TopMenuItems
impl !RefUnwindSafe for TopMenuItems
impl !Send for TopMenuItems
impl !Sync for TopMenuItems
impl Unpin for TopMenuItems
impl !UnwindSafe for TopMenuItems
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
Source§impl<T> DynWithDefault for T
impl<T> DynWithDefault for T
Source§fn with_default_mut(
&mut self,
f: &mut dyn FnMut(&mut dyn DynWithDefault, &mut (dyn Any + 'static)),
)
fn with_default_mut( &mut self, f: &mut dyn FnMut(&mut dyn DynWithDefault, &mut (dyn Any + 'static)), )
Create a temporary default value of the current type and provide it in a
closure. The callback’s first argument is
self
and the second argument
is the new temporary default value. The callback can then modify the
value as needed.Source§fn clear_and_inspect_old(
&mut self,
f: &mut dyn FnMut(&mut dyn DynWithDefault, &mut (dyn Any + 'static)),
)
fn clear_and_inspect_old( &mut self, f: &mut dyn FnMut(&mut dyn DynWithDefault, &mut (dyn Any + 'static)), )
Set
self
to a new default value and inspect the previous value as the
second argument to the callback.fn clear(&mut self)
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PartialUiDyn for Twhere
T: PartialUi,
impl<T> PartialUiDyn for Twhere
T: PartialUi,
Source§fn build_partial_dyn(
&mut self,
parent: Option<ControlHandle>,
) -> Result<(), NwgError>
fn build_partial_dyn( &mut self, parent: Option<ControlHandle>, ) -> Result<(), NwgError>
Forwards calls to [
nwg::PartialUi::build_partial
].Source§fn process_event_dyn(
&self,
evt: Event,
evt_data: &EventData,
handle: ControlHandle,
)
fn process_event_dyn( &self, evt: Event, evt_data: &EventData, handle: ControlHandle, )
Forwards calls to [
nwg::PartialUi::process_event
].Source§fn handles_dyn(&self) -> Vec<&ControlHandle>
fn handles_dyn(&self) -> Vec<&ControlHandle>
Forwards calls to [
nwg::PartialUi::handles
].§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.