date_picker: Reduce DatePicker popup position. (#195)
This commit is contained in:
parent
169572fa74
commit
9c4411ff2b
2 changed files with 19 additions and 20 deletions
|
|
@ -15,8 +15,7 @@ use ui::{
|
||||||
drawer::Drawer,
|
drawer::Drawer,
|
||||||
h_flex,
|
h_flex,
|
||||||
modal::Modal,
|
modal::Modal,
|
||||||
popover::Popover,
|
popup_menu::PopupMenuExt,
|
||||||
popup_menu::PopupMenu,
|
|
||||||
theme::{ActiveTheme, Theme},
|
theme::{ActiveTheme, Theme},
|
||||||
ContextModal, IconName, Root, Sizable,
|
ContextModal, IconName, Root, Sizable,
|
||||||
};
|
};
|
||||||
|
|
@ -430,23 +429,23 @@ impl Render for LocaleSelector {
|
||||||
.track_focus(&focus_handle)
|
.track_focus(&focus_handle)
|
||||||
.on_action(cx.listener(Self::on_select_locale))
|
.on_action(cx.listener(Self::on_select_locale))
|
||||||
.child(
|
.child(
|
||||||
Popover::new("locale-selector")
|
Button::new("btn", cx)
|
||||||
.anchor(AnchorCorner::TopRight)
|
.small()
|
||||||
.trigger(Button::new("btn", cx).small().ghost().icon(IconName::Globe))
|
.ghost()
|
||||||
.content(move |cx| {
|
.icon(IconName::Globe)
|
||||||
PopupMenu::build(cx, |this, _cx| {
|
.popup_menu(move |this, _| {
|
||||||
this.menu_with_check(
|
this.menu_with_check(
|
||||||
"English",
|
"English",
|
||||||
locale == "en",
|
locale == "en",
|
||||||
Box::new(SelectLocale("en".into())),
|
Box::new(SelectLocale("en".into())),
|
||||||
)
|
)
|
||||||
.menu_with_check(
|
.menu_with_check(
|
||||||
"简体中文",
|
"简体中文",
|
||||||
locale == "zh-CN",
|
locale == "zh-CN",
|
||||||
Box::new(SelectLocale("zh-CN".into())),
|
Box::new(SelectLocale("zh-CN".into())),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}),
|
.anchor(AnchorCorner::TopRight),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ impl Render for DatePicker {
|
||||||
.track_focus(&self.focus_handle)
|
.track_focus(&self.focus_handle)
|
||||||
.occlude()
|
.occlude()
|
||||||
.absolute()
|
.absolute()
|
||||||
.mt_2()
|
.mt_1p5()
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.rounded_lg()
|
.rounded_lg()
|
||||||
.p_3()
|
.p_3()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue