1. 22 Sep, 2020 5 commits
  2. 19 Sep, 2020 2 commits
    • Albert Gräf's avatar
      Fix case-sensitive search in the browser's findbox. · 558ca830
      Albert Gräf authored
      This uses findAndReplaceDOMText(), which apparently looks for
      case-sensitive matches, but the search text entered by the user is
      *always* converted to lowercase. This means that mixed case search terms
      just won't be found, which is bad. (E.g., try searching for "GEM" in the
      toc to see this bug in action.)
      
      Fixed by just removing the call to toLowerCase() on the search text,
      case-sensitive searches now work as expected, problem solved.
      558ca830
    • Albert Gräf's avatar
      Fix broken keyboard navigation in the help browser. · 5f9e9435
      Albert Gräf authored
      This resolves a long-standing bug (the relevant code is 4-5 years old).
      While it is just one little missing check in the keyboard event handler,
      which is surely just an oversight, this has the dire consequence of
      breaking navigation with the Tab key.
      
      - The root cause for this issue is in the document.body event listener
        callback, where we always reset the focus to the search text input if
        there's *any* keyboard input (other than a LF or CR on the file
        browser and bookmark buttons) while the focus is on something
        else (such as an item in the toc or in the search results). The
        intention there surely was to enable the user to just start
        typing *anywhere* in the dialog, which is convenient, but has the
        unwanted side-effect of breaking Tab navigation (as well as the cursor
        keys).
      
      - The fix is simply to *not* reset the focus if the key event is the Tab
        key. Besides Tab, we also treat the modifier and cursor keys in the
        same fashion, so that these will be handled on the spot rather than
        being forwarded to the search text input. By these means, you can
        still start typing your search terms from anywhere in the dialog, but
        navigation with Tab and Shift+Tab and the cursor keys now also work as
        expected.
      
      - Also, why is the div holding the toc items created again and again for
        each item in display_toc()? I moved the corresponding statement,
        div = document.createElement("div"), right before the toc.forEach()
        loop now, which I think is where it really belongs.
      5f9e9435
  3. 18 Sep, 2020 3 commits
    • Jonathan Wilkes's avatar
      bump to 2.14.1 · 99634144
      Jonathan Wilkes authored
      99634144
    • Albert Gräf's avatar
      Disable the bookmark icon in situations where bookmarking isn't possible... · ccd7ef05
      Albert Gräf authored
      Disable the bookmark icon in situations where bookmarking isn't possible (search results, doc directory).
      ccd7ef05
    • Albert Gräf's avatar
      Various fixes for bugs and cross-platform issues. · 8873a206
      Albert Gräf authored
      - Use canonical paths just about everywhere in the help browser. We want
        to stick to portable, normalized paths as much as possible, to avoid
        funky Windows path names, especially in bookmark files which should be
        portable across different platforms.
      
      - Fix the generated click_toc() call in display_toc(); we need to
        properly stringify the callback argument there.
      
      - Update the search field after opening a directory via the file
        browser, so that the search text matches the directory display. Is
        there a reason that we're not already doing this? I don't think so,
        because we're doing the same when clicking a link in the toc.
      
      - Prevent the doc directory from being bookmarked. There's nothing
        interesting to see there anyway (just subdirectories, no help
        patches). Also, since the toc lives there (in a virtual sense, i.e.,
        the current browser directory is set to this directory whenever the
        toc is displayed), we also avoid an interesting race condition which
        arises if we try to update the toc while we're displaying it. (This
        doesn't seem to happen on all platforms, but I've seen it on the Mac
        at least.)
      
      - Fix a purely cosmetic issue with the bookmark entries. (Entries with a
        null description were stored as is and then written to the bookmarks
        file. Now the description is just omitted in that case.)
      8873a206
  4. 17 Sep, 2020 4 commits
    • Albert Gräf's avatar
      Add a clickable bookmark indicator. · 230602cb
      Albert Gräf authored
      This takes the form of a little bookmark icon to the right of the file
      browser icon. Just the plain icon indicates that the current directory
      hasn't been bookmarked yet, and that clicking on it will bookmark it.
      If you do this, a little red cross appears on the icon, which reminds
      you that the directory has been bookmarked, and that clicking on the
      icon will remove the bookmark again.
      
      Note that in general a directory may have been bookmarked multiple
      times, by using the keyboard shortcut (Ctrl-D). In this case the red
      cross will stick until the last instance of the bookmark has been
      removed.
      
      The icons come from the Manjaro KDE Breath theme (a variation of the
      KDE Breeze theme), and we also replaced the folder icon with a matching
      icon from the same theme. Thanks are due to the Manjaro and KDE teams!
      
      While we were at it, we also fixed the vertical alignment of the icons
      with respect to the search field, they are properly aligned to the
      middle now.
      230602cb
    • Albert Gräf's avatar
      Add a simple bookmark facility to the help browser. · c049be4f
      Albert Gräf authored
      The Ctrl+D keyboard command in the help browser adds a bookmark for the
      current browser directory, Shift+Ctrl+D removes it again. Note that the
      same directory can be bookmarked multiple times (using Ctrl+D), in which
      case the same number of delete commands (Shift+Ctrl+D) are required to
      delete all instances of the bookmark again; at any time, the oldest
      instance will be removed first.
      
      This also provides a (really simplistic) way to reorder bookmarks, since
      you can re-add an existing bookmark and delete its older instance
      afterwards, which effectively moves the bookmark to the end of the
      bookmarks section. It goes without saying that this becomes rather
      laborious if you have to manage a lot of bookmarks, so in that case you
      might prefer to just edit the bookmarks file (see below) in your
      favorite text editor instead.
      
      Bookmarks are shown in their own "Bookmarks" section at the bottom of
      the toc, after the built-in toc sections. The "Bookmarks" section title
      will be visible only if there are any bookmarks. As with the built-in
      toc items, clicking on the title of a bookmark takes you to the
      corresponding directory, which may be in the doc or extra hierarchy, or
      anywhere else on your hard disk. If a <dir>-meta.pd file in pddp format
      is present in the bookmarked directory, the browser will try to extract
      title and description from the NAME and DESCRIPTION tags in that file,
      otherwise it simply uses the basename of the directory as title and
      leaves the description empty.
      
      The bookmarks are stored permanently on disk as a JSON file in the users
      home directory, named .purr-data/bookmarks.json on Linux and the Mac,
      and AppData/Roaming/Purr-Data/bookmarks.json on Windows. This file is
      read each time the help browser opens, so the bookmarks persist across
      program invocations, and you can even edit the file manually and reopen
      the help browser to make it pick up your changes while Purr Data keeps
      running.
      c049be4f
    • Ivica Bukvic's avatar
    • Ivica Bukvic's avatar
      Removed excess y size in the VU dialog · d43c0afb
      Ivica Bukvic authored
      d43c0afb
  5. 15 Sep, 2020 2 commits
    • Albert Gräf's avatar
      Help browser: add an index cache to speed up launch times. · 77819826
      Albert Gräf authored
      Features:
      
      - Rebuilds and caches the search index if there is no cache yet, or if
        the cache is outdated (i.e., any cached directory or its parent was
        removed or modified since the cache was last created).
      
      - Keeps track of the modification times of all cached directories of
        help files, as well as their parent directories, in order to determine
        when the cache is outdated. The parents are tracked to catch changes
        where new sibling directories are added. This may produce some false
        positives and still isn't 100% foolproof, but it is as close as we can
        get if we still want to achieve substantial speedups.
      
      - Automatically rebuilds the index (and cache) from scratch, as soon as
        the help browser is relaunched after changes to the browser
        configuration in the gui prefs. So there's no need any more to
        relaunch Purr Data to have these changes take effect.
      
      Both the index cache and the directory timestamps are maintained as
      ordinary text files with a straightforward syntax (basically
      colon-delimited csv) in the user's home directory. The files are located
      in configuration directories (.purr-data on Linux and Mac,
      AppData/Roaming/Purr-Data on Windows). Thus it's easily possible to
      modify these files with external tools (e.g., if we want to upgrade the
      file format in the future.)
      77819826
    • Guillem Bartrina's avatar
  6. 14 Sep, 2020 1 commit
  7. 13 Sep, 2020 8 commits
    • Albert Gräf's avatar
    • Albert Gräf's avatar
      Add user-defined GUI presets. · 6006f94e
      Albert Gräf authored
      This discovers user-defined GUI presets (css files) in the css
      subdirectory of the gui folder, and adds them at the end of the
      corresponding dropdown menu in the GUI prefs. It is a convenience
      intended for users and developers who want to experiment with their own
      GUI styles.
      
      The predefined presets are still hardcoded in the dialog_prefs.html
      file, and are always available (and displayed first in the dropdown
      menu). If the preset saved in the prefs doesn't exist anymore (e.g.,
      because the user removed its css file), it will be ignored at startup
      and the default style will be used instead.
      
      Note that this isn't entirely foolproof since the fallback may not exist
      if the user also removed the default.css file. But this could also
      happen previously when the css directory gets messed up, and in such a
      case the user simply gets what he or she deserves.
      6006f94e
    • Albert Gräf's avatar
    • Albert Gräf's avatar
    • Albert Gräf's avatar
      Make Alt the key to temporarily change to run mode. · 2517cfab
      Albert Gräf authored
      In one fell swoop, this solves all usability issues we have with the
      Ctrl key we currently employ for that purpose, which interferes with all
      our menu keybindings, and makes temporary run mode unusable on the Mac.
      2517cfab
    • Albert Gräf's avatar
      Fix the findbox regression, part 3. · 1747a89e
      Albert Gräf authored
      Make Ctrl+F work if the canvas is in edit mode. In this case,
      canvas_key(), upon receiving the Ctrl keydown event from the Ctrl+F
      shortcut, temporarily switches to run mode, but never gets the
      corresponding keyup event which goes to the findbox, so temporary run
      mode remains in effect when the findbox opens.
      
      This shouldn't actually be much of a problem, but the real trouble is
      that while canvas_key() informs the GUI about the change to run mode, it
      doesn't update the state of the canvas-local gl_edit variable
      accordingly. So when dofind() switches on edit mode later, the engine
      still thinks that it's in edit mode and thus doesn't trigger the
      necessary update.
      
      The easy fix is to just update gl_edit in canvas_key() when edit mode is
      temporarily disabled.
      1747a89e
    • Albert Gräf's avatar
      Fix the findbox regression, part 2. · 12ab314b
      Albert Gräf authored
      This gets rid of some race conditions in the find operation, by ensuring
      that edit mode is only updated *after* mapping a subpatch window.
      
      This bug manifested itself when searching for objects in subpatches
      which are not visible at the time the find operation gets invoked. In
      this case, on the GUI side we both have to create the subpatch window
      and put it in edit mode. In the previous implementation these two
      operations would be executed separately and asynchronously. The end
      result was that usually the latter operation setting the edit mode in
      the GUI would win out, and the edit mode would later get overwritten
      again when the window was created.
      
      We fixed that race condition by ensuring that the engine is queried for
      its current edit mode status after creating a canvas window. The engine
      replies with a call to gui_canvas_set_editmode() in the GUI and thus the
      edit mode in the GUI now properly reflects the status in the engine
      after a window is mapped.
      
      TL;DR: This fix should now make sure that edit mode on the GUI side
      reflects that of the engine at all times.
      12ab314b
    • Albert Gräf's avatar
      Fix the findbox regression, part 1. · df2fd7fd
      Albert Gräf authored
      This makes Ctrl+F work again, by making sure that edit mode is set
      correctly in the GUI even if glob_ctrl is set (because the Ctrl key up
      event goes to the find box and is thus is never received by the canvas).
      df2fd7fd
  8. 11 Sep, 2020 2 commits
  9. 10 Sep, 2020 1 commit
    • Ivica Bukvic's avatar
      Proper fix and improvements to the prefs window · 0f72e7be
      Ivica Bukvic authored
      * Tab bar is 100% width
      
      * Startup tab has proper right margins
      
      * Startup tab buttons are properly aligned
      
      * All select (dropdown) boxes are the same height as the numboxes
      
      * Better spacing on midi in and out labels and between select boxes
      
      * Better spacing and sizing on the audio input and output select boxes, associated channel numbers, and labels
      
      * More spacing between audio input and output
      0f72e7be
  10. 09 Sep, 2020 12 commits