diff --git a/bin/nwg-drawer b/bin/nwg-drawer index 9a69c7e..7a5106a 100755 Binary files a/bin/nwg-drawer and b/bin/nwg-drawer differ diff --git a/main.go b/main.go index 1ea4d72..7aac751 100644 --- a/main.go +++ b/main.go @@ -83,8 +83,7 @@ var desktopEntries []desktopEntry // UI elements var ( - resultWindow *gtk.ScrolledWindow - //fileSearchResults map[string]string + resultWindow *gtk.ScrolledWindow fileSearchResults []string searchEntry *gtk.SearchEntry phrase string @@ -92,7 +91,6 @@ var ( fileSearchResultFlowBox *gtk.FlowBox buttonsWrapper *gtk.Box buttonBox *gtk.EventBox - confirmationBox *gtk.Box userDirsMap map[string]string appFlowBox *gtk.FlowBox appSearchResultWrapper *gtk.Box @@ -334,7 +332,6 @@ func main() { fileSearchResultWrapper.SetSizeRequest(appFlowBox.GetAllocatedWidth(), 1) categoriesWrapper.SetSizeRequest(1, categoriesWrapper.GetAllocatedHeight()*2) - //searchEntry.GrabFocus() t := time.Now() println(fmt.Sprintf("UI created in %v ms. Thank you for your patience.", t.Sub(timeStart).Milliseconds())) gtk.Main() diff --git a/tools.go b/tools.go index 8cbb1e3..dd7d0b8 100644 --- a/tools.go +++ b/tools.go @@ -667,18 +667,3 @@ func mapOutputs() (map[string]*gdk.Monitor, error) { } return result, nil } - -func listMonitors() ([]gdk.Monitor, error) { - var monitors []gdk.Monitor - display, err := gdk.DisplayGetDefault() - if err != nil { - return nil, err - } - - num := display.GetNMonitors() - for i := 0; i < num; i++ { - monitor, _ := display.GetMonitor(i) - monitors = append(monitors, *monitor) - } - return monitors, nil -} diff --git a/uicomponents.go b/uicomponents.go index bb589c3..95cc774 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -48,7 +48,9 @@ func setUpPinnedFlowBox() *gtk.FlowBox { name = entry.Name } if len(name) > 20 { - name = fmt.Sprintf("%s ...", name[:17]) + r := []rune(name) + name = string(r[:20]) + name = fmt.Sprintf("%s…", name) } btn.SetLabel(name) @@ -223,7 +225,9 @@ func flowBoxButton(entry desktopEntry) *gtk.Button { button.SetImagePosition(gtk.POS_TOP) name := entry.NameLoc if len(name) > 20 { - name = fmt.Sprintf("%s ...", name[:17]) + r := []rune(name) + name = string(r[:20]) + name = fmt.Sprintf("%s…", name) } button.SetLabel(name) @@ -383,7 +387,7 @@ func setUpUserDirButton(iconName, displayName, entryName string, userDirsMap map button.SetImage(img) if len(displayName) > *nameLimit { - displayName = fmt.Sprintf("%s...", displayName[:*nameLimit-3]) + displayName = fmt.Sprintf("%s…", displayName[:*nameLimit-3]) } button.SetLabel(displayName) @@ -409,7 +413,7 @@ func setUpUserFileSearchResultButton(fileName, filePath string) *gtk.Box { tooltipText := "" if len(fileName) > *nameLimit { tooltipText = fileName - fileName = fmt.Sprintf("%s...", fileName[:*nameLimit-3]) + fileName = fmt.Sprintf("%s…", fileName[:*nameLimit-3]) } button.SetLabel(fileName) if tooltipText != "" {