Refine author logo layout
This commit is contained in:
parent
3d0a1973af
commit
8efe123ea3
|
|
@ -1029,8 +1029,8 @@ func buildAuthorMenuTab(state *appState) fyne.CanvasObject {
|
||||||
logoEnableCheck := widget.NewCheck("Embed Logo", nil)
|
logoEnableCheck := widget.NewCheck("Embed Logo", nil)
|
||||||
logoEnableCheck.SetChecked(state.authorMenuLogoEnabled)
|
logoEnableCheck.SetChecked(state.authorMenuLogoEnabled)
|
||||||
|
|
||||||
logoLabel := widget.NewLabel("")
|
logoFileEntry := widget.NewEntry()
|
||||||
logoLabel.Wrapping = fyne.TextWrapWord
|
logoFileEntry.Disable()
|
||||||
logoPreview := canvas.NewImageFromFile("")
|
logoPreview := canvas.NewImageFromFile("")
|
||||||
logoPreview.FillMode = canvas.ImageFillContain
|
logoPreview.FillMode = canvas.ImageFillContain
|
||||||
logoPreview.SetMinSize(fyne.NewSize(96, 96))
|
logoPreview.SetMinSize(fyne.NewSize(96, 96))
|
||||||
|
|
@ -1064,7 +1064,7 @@ func buildAuthorMenuTab(state *appState) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLogoPreview := func() {
|
updateLogoPreview := func() {
|
||||||
logoLabel.SetText(logoDisplayName())
|
logoFileEntry.SetText(logoDisplayName())
|
||||||
if !state.authorMenuLogoEnabled {
|
if !state.authorMenuLogoEnabled {
|
||||||
logoPreviewBox.Hide()
|
logoPreviewBox.Hide()
|
||||||
logoPreviewLabel.SetText("Logo disabled")
|
logoPreviewLabel.SetText("Logo disabled")
|
||||||
|
|
@ -1125,7 +1125,7 @@ func buildAuthorMenuTab(state *appState) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
defer reader.Close()
|
defer reader.Close()
|
||||||
state.authorMenuLogoPath = reader.URI().Path()
|
state.authorMenuLogoPath = reader.URI().Path()
|
||||||
logoLabel.SetText(logoDisplayName())
|
logoFileEntry.SetText(logoDisplayName())
|
||||||
updateLogoPreview()
|
updateLogoPreview()
|
||||||
updateBrandingTitle()
|
updateBrandingTitle()
|
||||||
state.updateAuthorSummary()
|
state.updateAuthorSummary()
|
||||||
|
|
@ -1135,7 +1135,7 @@ func buildAuthorMenuTab(state *appState) fyne.CanvasObject {
|
||||||
logoPickButton.Importance = widget.MediumImportance
|
logoPickButton.Importance = widget.MediumImportance
|
||||||
logoClearButton := widget.NewButton("Clear", func() {
|
logoClearButton := widget.NewButton("Clear", func() {
|
||||||
state.authorMenuLogoPath = ""
|
state.authorMenuLogoPath = ""
|
||||||
logoLabel.SetText(logoDisplayName())
|
logoFileEntry.SetText(logoDisplayName())
|
||||||
logoEnableCheck.SetChecked(false)
|
logoEnableCheck.SetChecked(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -1282,12 +1282,11 @@ func buildAuthorMenuTab(state *appState) fyne.CanvasObject {
|
||||||
logoPreviewSize,
|
logoPreviewSize,
|
||||||
)
|
)
|
||||||
|
|
||||||
logoFileRow := container.NewHBox(
|
logoButtonRow := container.NewHBox(
|
||||||
logoLabel,
|
|
||||||
layout.NewSpacer(),
|
|
||||||
logoPickButton,
|
logoPickButton,
|
||||||
logoClearButton,
|
logoClearButton,
|
||||||
)
|
)
|
||||||
|
logoFileRow := container.NewBorder(nil, nil, nil, logoButtonRow, logoFileEntry)
|
||||||
|
|
||||||
logoPositionRow := container.NewHBox(
|
logoPositionRow := container.NewHBox(
|
||||||
widget.NewLabel("Position:"),
|
widget.NewLabel("Position:"),
|
||||||
|
|
@ -1320,18 +1319,16 @@ func buildAuthorMenuTab(state *appState) fyne.CanvasObject {
|
||||||
menuStructureSelect,
|
menuStructureSelect,
|
||||||
))
|
))
|
||||||
|
|
||||||
brandingContent := container.NewGridWithColumns(2,
|
brandingLeft := container.NewVBox(
|
||||||
container.NewVBox(
|
logoEnableCheck,
|
||||||
logoEnableCheck,
|
widget.NewLabel("Logo File:"),
|
||||||
widget.NewLabel("Logo File:"),
|
logoFileRow,
|
||||||
logoFileRow,
|
logoPositionRow,
|
||||||
logoPositionRow,
|
logoScaleRow,
|
||||||
logoScaleRow,
|
logoMarginRow,
|
||||||
logoMarginRow,
|
safeAreaNote,
|
||||||
safeAreaNote,
|
|
||||||
),
|
|
||||||
logoPreviewGroup,
|
|
||||||
)
|
)
|
||||||
|
brandingContent := container.NewBorder(nil, nil, nil, logoPreviewGroup, brandingLeft)
|
||||||
brandingItem := widget.NewAccordionItem("Branding (Logo Overlay)", brandingContent)
|
brandingItem := widget.NewAccordionItem("Branding (Logo Overlay)", brandingContent)
|
||||||
brandingItem.Open = false
|
brandingItem.Open = false
|
||||||
brandingAccordion := widget.NewAccordion(brandingItem)
|
brandingAccordion := widget.NewAccordion(brandingItem)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user