♻️ (pagetop): Deshabilita menús con with_disabled()
Cambia `link_disabled()`, `link_blank_disabled()` y `button_disabled()` de `nav::Item` y `dropdown::Item` por `with_disabled(bool)`, como en Button.
This commit is contained in:
parent
5d6852382a
commit
f1fd34f974
12 changed files with 123 additions and 93 deletions
|
|
@ -24,7 +24,7 @@ impl Extension for NavDemo {
|
|||
.with_item(dropdown::Item::header(Lc::n("Danger zone")))
|
||||
.with_item(dropdown::Item::button(Lc::n("Reset settings"))),
|
||||
))
|
||||
.with_item(nav::Item::link_disabled(Lc::n("Disabled"), "#"));
|
||||
.with_item(nav::Item::link(Lc::n("Disabled"), "#").with_disabled(true));
|
||||
|
||||
let user_menu = Dropdown::new()
|
||||
.with_title(Lc::n("Account"))
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ impl Extension for NavbarDemo {
|
|||
)),
|
||||
))
|
||||
.with_item(nav::Item::link(Lc::t("navbar_active", &LOC), "/active").with_active(true))
|
||||
.with_item(nav::Item::link_disabled(
|
||||
Lc::t("navbar_disabled", &LOC),
|
||||
"#",
|
||||
));
|
||||
.with_item(nav::Item::link(Lc::t("navbar_disabled", &LOC), "#").with_disabled(true));
|
||||
|
||||
let navbar = Navbar::brand_left(brand).with_item(navbar::Item::nav(main_nav));
|
||||
|
||||
|
|
|
|||
|
|
@ -106,15 +106,14 @@ fn menus_block() -> Block {
|
|||
))
|
||||
.with_item(dropdown::Item::divider())
|
||||
.with_item(dropdown::Item::label(Lc::t("menus_item_label", &LOC)))
|
||||
.with_item(dropdown::Item::link_disabled(
|
||||
Lc::t("menus_item_disabled", &LOC),
|
||||
"#",
|
||||
)),
|
||||
.with_item(
|
||||
dropdown::Item::link(Lc::t("menus_item_disabled", &LOC), "#")
|
||||
.with_disabled(true),
|
||||
),
|
||||
))
|
||||
.with_item(nav::Item::link_disabled(
|
||||
Lc::t("menus_item_disabled", &LOC),
|
||||
"#",
|
||||
)),
|
||||
.with_item(
|
||||
nav::Item::link(Lc::t("menus_item_disabled", &LOC), "#").with_disabled(true),
|
||||
),
|
||||
))
|
||||
.with_item(navbar::Item::nav(
|
||||
Nav::new()
|
||||
|
|
@ -686,10 +685,7 @@ fn demo_nav() -> Nav {
|
|||
"/something",
|
||||
)),
|
||||
))
|
||||
.with_item(nav::Item::link_disabled(
|
||||
Lc::t("menus_item_disabled", &LOC),
|
||||
"#",
|
||||
))
|
||||
.with_item(nav::Item::link(Lc::t("menus_item_disabled", &LOC), "#").with_disabled(true))
|
||||
}
|
||||
|
||||
fn is_bootsier() -> bool {
|
||||
|
|
|
|||
|
|
@ -46,19 +46,18 @@ impl Extension for ThemeShowcase {
|
|||
Lc::t("showcase_menu_messages", &LOC),
|
||||
"#",
|
||||
))
|
||||
.with_item(dropdown::Item::link_disabled(
|
||||
Lc::t("showcase_menu_disabled", &LOC),
|
||||
"#",
|
||||
)),
|
||||
.with_item(
|
||||
dropdown::Item::link(Lc::t("showcase_menu_disabled", &LOC), "#")
|
||||
.with_disabled(true),
|
||||
),
|
||||
))
|
||||
.with_item(nav::Item::link_blank(
|
||||
Lc::t("showcase_menu_docs", &LOC),
|
||||
"https://docs.rs/pagetop",
|
||||
))
|
||||
.with_item(nav::Item::link_disabled(
|
||||
Lc::t("showcase_menu_disabled", &LOC),
|
||||
"#",
|
||||
));
|
||||
.with_item(
|
||||
nav::Item::link(Lc::t("showcase_menu_disabled", &LOC), "#").with_disabled(true),
|
||||
);
|
||||
|
||||
// Menú de la cuenta al final de la barra y, con Bootsier, el selector de modo de color
|
||||
// (claro, oscuro o automático).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue