pub(super) struct TagSection {
pub root: PreferencesGroup,
chips: FlowBox,
empty_label: Label,
add_btn: MenuButton,
asset_id: Rc<RefCell<String>>,
tags: Rc<RefCell<Vec<Tag>>>,
context: Rc<RefCell<Option<TagContext>>>,
}Expand description
“Tags” group (matching the EXIF groups) with an add button and wrapping tag pills. Cheap to clone.
Fields§
§root: PreferencesGroup§chips: FlowBox§empty_label: Label§add_btn: MenuButton§asset_id: Rc<RefCell<String>>§context: Rc<RefCell<Option<TagContext>>>Implementations§
Source§impl TagSection
impl TagSection
pub(super) fn new() -> Self
Sourcepub(super) fn bind(&self, ui: Rc<LibraryWindowUi>, on_search: Rc<dyn Fn(Tag)>)
pub(super) fn bind(&self, ui: Rc<LibraryWindowUi>, on_search: Rc<dyn Fn(Tag)>)
Connect the section to the library window; on_search runs when a tag is clicked.
Sourcepub(super) fn clear(&self)
pub(super) fn clear(&self)
Hide until the next asset’s tags arrive (local-only assets never show it).
pub(super) fn show(&self, asset_id: &str, tags: Vec<Tag>)
fn ui(&self) -> Option<Rc<LibraryWindowUi>>
fn rebuild_chips(&self)
Sourcefn chip(&self, tag: &Tag) -> Box
fn chip(&self, tag: &Tag) -> Box
One pill: color dot and label (click to search), plus a remove button.
fn search(&self, tag: Tag)
fn remove_tag(&self, tag: Tag)
Sourcefn add_tag(&self, value: String, existing: Option<Tag>)
fn add_tag(&self, value: String, existing: Option<Tag>)
Tag the current asset, creating the tag first when existing is None.
Sourcefn build_picker(&self) -> Popover
fn build_picker(&self) -> Popover
Popover with a search entry over the server’s tags, refreshed each time it opens.
Trait Implementations§
Source§impl Clone for TagSection
impl Clone for TagSection
Source§fn clone(&self) -> TagSection
fn clone(&self) -> TagSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TagSection
impl !Send for TagSection
impl !Sync for TagSection
impl !UnwindSafe for TagSection
impl Freeze for TagSection
impl Unpin for TagSection
impl UnsafeUnpin for TagSection
Blanket Implementations§
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more