From 101a87583717bf906cc04b163b043422d81df3ca Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Tue, 7 Apr 2026 21:52:57 -0700 Subject: [PATCH] Revert "Right-align dropdown actions" This reverts commit 81f1bcfca8b05357f5e994ea1c278bac0f327a33. --- main.go | 59 ++++++++++++--------------------------------------------- 1 file changed, 12 insertions(+), 47 deletions(-) diff --git a/main.go b/main.go index 74795bf..88c941e 100644 --- a/main.go +++ b/main.go @@ -5554,39 +5554,27 @@ func (u *ui) mainMenu(gtx layout.Context) layout.Dimensions { return compactCard(gtx, func(gtx layout.Context) layout.Dimensions { return layout.Flex{Axis: layout.Vertical}.Layout(gtx, layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.showEntries, "Entries") - }) + return tonedButton(gtx, u.theme, &u.showEntries, "Entries") }), layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.showRecycle, "Recycle Bin") - }) + return tonedButton(gtx, u.theme, &u.showRecycle, "Recycle Bin") }), layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.showAPITokens, "API Tokens") - }) + return tonedButton(gtx, u.theme, &u.showAPITokens, "API Tokens") }), layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.showAPIAudit, "API Audit") - }) + return tonedButton(gtx, u.theme, &u.showAPIAudit, "API Audit") }), layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.showAbout, "About") - }) + return tonedButton(gtx, u.theme, &u.showAbout, "About") }), layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.openSecuritySettings, "Settings") - }) + return tonedButton(gtx, u.theme, &u.openSecuritySettings, "Settings") }), ) }) @@ -5727,26 +5715,20 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions { } return layout.Flex{Axis: layout.Vertical}.Layout(gtx, layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.shareCurrentVault, "Share Vault") - }) + return tonedButton(gtx, u.theme, &u.shareCurrentVault, "Share Vault") }), layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), ) }), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.openAdvancedSync, "Open Advanced Sync") - }) + return tonedButton(gtx, u.theme, &u.openAdvancedSync, "Open Advanced Sync") }), } if u.shouldShowRemoteSyncSetupShortcut() { rows = append(rows, layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.useSavedAdvancedSyncRemote, u.remoteSyncSetupShortcutLabel()) - }) + return tonedButton(gtx, u.theme, &u.useSavedAdvancedSyncRemote, u.remoteSyncSetupShortcutLabel()) }), ) } @@ -5754,9 +5736,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions { rows = append(rows, layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.openSelectedVaultRemote, u.directRemoteSyncShortcutLabel()) - }) + return tonedButton(gtx, u.theme, &u.openSelectedVaultRemote, u.directRemoteSyncShortcutLabel()) }), ) } @@ -5764,9 +5744,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions { rows = append(rows, layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.useSavedAdvancedSyncRemote, u.remoteSyncSettingsShortcutLabel()) - }) + return tonedButton(gtx, u.theme, &u.useSavedAdvancedSyncRemote, u.remoteSyncSettingsShortcutLabel()) }), ) } @@ -5774,9 +5752,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions { rows = append(rows, layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout), layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return rightAlignedMenuButton(gtx, func(gtx layout.Context) layout.Dimensions { - return tonedButton(gtx, u.theme, &u.removeSelectedRemoteBinding, u.removeRemoteSyncShortcutLabel()) - }) + return tonedButton(gtx, u.theme, &u.removeSelectedRemoteBinding, u.removeRemoteSyncShortcutLabel()) }), ) } @@ -7446,17 +7422,6 @@ func syncChoiceButton(gtx layout.Context, th *material.Theme, click *widget.Clic return btn.Layout(gtx) } -func rightAlignedMenuButton(gtx layout.Context, child layout.Widget) layout.Dimensions { - return layout.Flex{Alignment: layout.Middle}.Layout(gtx, - layout.Flexed(1, func(gtx layout.Context) layout.Dimensions { - return layout.Dimensions{} - }), - layout.Rigid(func(gtx layout.Context) layout.Dimensions { - return child(gtx) - }), - ) -} - func syncDialogSectionLabel(th *material.Theme, text string) layout.Widget { return func(gtx layout.Context) layout.Dimensions { lbl := material.Label(th, unit.Sp(12), strings.ToUpper(text))