Skip to content

Commit

Permalink
Merge pull request #415 from qor5/feat-ui-reborn
Browse files Browse the repository at this point in the history
Feat UI reborn
  • Loading branch information
danni-cool authored Aug 2, 2024
2 parents effd252 + 1da72fb commit e1cf348
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion presets/listing_compo.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ func (c *ListingCompo) actionsComponent(ctx context.Context) (r h.HTMLComponent)
}

buttons = append(buttons, VBtn(c.lb.mb.getLabel(ba.NameLabel)).
Color(cmp.Or(ba.buttonColor, ColorPrimary)).Variant(VariantFlat).Class("ml-2").
Color(cmp.Or(ba.buttonColor, ColorPrimary)).Variant(VariantElevated).Class("ml-2").
Attr("@click", stateful.PostAction(ctx, c, c.OpenActionDialog, OpenActionDialogRequest{
Name: ba.name,
}).Go()),
Expand Down
28 changes: 16 additions & 12 deletions presets/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (b *Builder) menuItem(ctx *web.EventContext, m *ModelBuilder, isSub bool) (
VListItemTitle(
h.Text(m.Info().LabelName(ctx, false)),
),
).Class("rounded-lg").
).Class("rounded").
Value(m.label)
// .ActiveClass("bg-red")
// Attr("color", "primary")
Expand Down Expand Up @@ -628,7 +628,8 @@ func (b *Builder) CreateMenus(ctx *web.EventContext) (r h.HTMLComponent) {
Class("primary--text").
Density(DensityCompact).
Attr("v-model:opened", "locals.menuOpened").
Attr("v-model:selected", "locals.selection"),
Attr("v-model:selected", "locals.selection").
Attr("color", "transparent"),
// .Attr("v-model:selected", h.JSONString([]string{"Pages"})),
).VSlot("{ locals }").Init(
fmt.Sprintf(`{ menuOpened: ["%s"]}`, activeMenuItem),
Expand Down Expand Up @@ -722,11 +723,14 @@ func (b *Builder) RunSwitchLanguageFunc(ctx *web.EventContext) (r h.HTMLComponen
_ = oldIcon
return VMenu().Children(
h.Template().Attr("v-slot:activator", "{isActive, props}").Children(
VRow(
VCol(
VIcon("mdi-translate")).Cols(1),
VCol(VIcon("mdi-menu-down")).Cols(1),
).Attr("v-bind", "props"),
h.Div(
VBtn("").Children(
languageSwitchIcon,
//VIcon("mdi-menu-down"),
).Attr("variant", "text").
Attr("icon", "").
Class("i18n-switcher-btn"),
).Attr("v-bind", "props").Style("display: inline-block;"),
),
VList(
languages...,
Expand Down Expand Up @@ -965,13 +969,13 @@ func (b *Builder) defaultLayout(in web.PageFunc, cfg *LayoutConfig) (out web.Pag
// VIcon("mdi-menu-down"),
// ).Attr("variant", "plain").
// Attr("icon", ""),
).Cols(3),

).Cols(3).Class("text-right"),
VDivider().Attr("vertical", true).Class("i18n-divider"),
VCol(
VAppBarNavIcon().Attr("icon", "mdi-menu").
Class("text-grey-darken-1").
Class("text-grey-darken-1 menu-control-icon").
Attr("@click", "vars.navDrawer = !vars.navDrawer").Density(DensityCompact),
).Cols(2),
).Cols(2).Class("position-relative"),
).Attr("align", "center").Attr("justify", "center"),
)

Expand Down Expand Up @@ -1053,7 +1057,7 @@ func (b *Builder) defaultLayout(in web.PageFunc, cfg *LayoutConfig) (out web.Pag
toolbar,
VCard(
menu,
).Class("menu-content my-4 ml-4 pr-4").Variant(VariantText),
).Class("menu-content mt-2 mb-4 ml-4 pr-4").Variant(VariantText),
),
// VDivider(),
profile,
Expand Down

0 comments on commit e1cf348

Please sign in to comment.