Skip to content

Commit

Permalink
style: removed desc and changed folder open text (#44)
Browse files Browse the repository at this point in the history
Jia Wei Lee authored Aug 2, 2022
1 parent 638ecc2 commit c8ba0bc
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/constants/ui.go
Original file line number Diff line number Diff line change
@@ -25,9 +25,9 @@ const (
PREFERENCES_TITLE = "Preferences"

FILE_DIRECTORY_TAB_TITLE = "File Directory"
FILE_DIRECTORY_TAB_DESCRIPTION = "Select the root folder to store all your modules' files."
FILE_DIRECTORY_FOLDER_PATH_DEFAULT = "Folder path not set"
FILE_DIRECTORY_FOLDER_PATH_DEFAULT = "Select the root folder to store all your modules' files."
FILE_DIRECTORY_SELECT_DIRECTORY_TEXT = "Choose folder"
FILE_DIRECTORY_CHOOSE_LOCATION_TEXT = "Choose"

SYNC_TAB_TITLE = "Sync"
SYNC_TAB_DESCRIPTION = "Sync files and more **automatically** at the frequency specified below."
8 changes: 4 additions & 4 deletions internal/ui/preferences.go
Original file line number Diff line number Diff line change
@@ -58,8 +58,6 @@ func getFileDirectoryView(parentWindow fyne.Window) (fyne.CanvasObject, error) {
fyne.TextAlignLeading,
fyne.TextStyle{Bold: true, Italic: false, Monospace: false, TabWidth: 0},
)
description := widget.NewRichTextFromMarkdown(appConstants.FILE_DIRECTORY_TAB_DESCRIPTION)
description.Wrapping = fyne.TextWrapWord

dir := getPreferences().Directory
if dir == "" {
@@ -69,7 +67,7 @@ func getFileDirectoryView(parentWindow fyne.Window) (fyne.CanvasObject, error) {
folderPathLabel := widget.NewLabel(dir)
folderPathLabel.Wrapping = fyne.TextWrapWord
chooseDirButton := widget.NewButton(appConstants.FILE_DIRECTORY_SELECT_DIRECTORY_TEXT, func() {
dialog.ShowFolderOpen(func(lu fyne.ListableURI, dirErr error) {
fileDialog := dialog.NewFolderOpen(func(lu fyne.ListableURI, dirErr error) {
if dirErr != nil {
logs.Logger.Debugln("directory selection cancelled")
dialog.NewInformation(
@@ -116,9 +114,11 @@ func getFileDirectoryView(parentWindow fyne.Window) (fyne.CanvasObject, error) {
logs.Logger.Debugln("directory saved")
folderPathLabel.SetText(preferences.Directory)
}, parentWindow)
fileDialog.SetConfirmText(appConstants.FILE_DIRECTORY_CHOOSE_LOCATION_TEXT)
fileDialog.Show()
})

return container.NewVBox(label, widget.NewSeparator(), description, folderPathLabel, chooseDirButton), nil
return container.NewVBox(label, widget.NewSeparator(), folderPathLabel, chooseDirButton), nil
}

func getSyncView(parentWindow fyne.Window) (fyne.CanvasObject, error) {

0 comments on commit c8ba0bc

Please sign in to comment.