HISE Logo Forum
    • Categories
    • Register
    • Login

    PresetBrowser LAF Scrollbar

    Scheduled Pinned Locked Moved General Questions
    lafpreset browsergraphics
    30 Posts 6 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • StraticahS
      Straticah @d.healey
      last edited by

      @d-healey i got it working thanks to your video :) i replaced the star and the search bar icon. I cand find how to size them tho.

      // Search and Fav Icons
      
      browserLaf.registerFunction("createPresetBrowserIcons", function(id)
      {
          if (id == "favorite_on") {
      	    return; g.fillPath(ICON_NO_4_path, [0, 2, 2, 2]);	    
      
      }      
          
          if (id == "favorite_off")
              return ICON_NO_5_path;
              
          if (id == "searchIcon")
              return ICON_NO_6_path;
      });
      

      building user interfaces in HISE :)
      web: www.vst-design.com

      1 Reply Last reply Reply Quote 0
      • oskarshO
        oskarsh
        last edited by

        @Straticah you can size them by using the area parameter. See this example

                var SIZE = 20;
        	var a = obj.area;
        
        	if (obj.text == 'Add') {
        		g.drawPath(Paths.icons['add'], [a[0], a[1], SIZE, SIZE);
        		return;
        	}
        

        this will place the icon left aligned with a fixed SIZE of 20. It's not recommended to just return them without specifying their bounds

        StraticahS 1 Reply Last reply Reply Quote 1
        • StraticahS
          Straticah @oskarsh
          last edited by Straticah

          @oskarsh i see, so the sizing of the favourite star icons and the search icon works the same way? I thought there might be a difference since the fav icon on top is not the same size like the one in front the presets :) I attached a screenshot below.

          8b296f51-9e8b-406f-b665-bbf05189a5fe-image.png

          building user interfaces in HISE :)
          web: www.vst-design.com

          d.healeyD StraticahS 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @Straticah
            last edited by

            @Straticah In the interface designer look in the floating tile's data property. You can change the search bar and favorite icon bounds there.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            StraticahS 1 Reply Last reply Reply Quote 0
            • StraticahS
              Straticah @d.healey
              last edited by

              @d-healey oooh nice! tx

              building user interfaces in HISE :)
              web: www.vst-design.com

              1 Reply Last reply Reply Quote 0
              • StraticahS
                Straticah @Straticah
                last edited by Straticah

                @d-healey there is no bounds for the search icon tho is there?

                {
                 "ShowSaveButton": true,
                 "ShowExpansionsAsColumn": false,
                 "ShowFolderButton": true,
                 "ShowNotes": true,
                 "ShowEditButtons": true,
                 "EditButtonOffset": 10,
                 "ShowAddButton": true,
                 "ShowRenameButton": true,
                 "ShowDeleteButton": true,
                 "ShowFavoriteIcon": true,
                 "ButtonsInsideBorder": false,
                 "NumColumns": 2,
                 "ColumnWidthRatio": [
                   0.3333333333333333,
                   0.3333333333333333,
                   0.3333333333333333
                 ],
                 "ListAreaOffset": [
                   0,
                   0,
                   0,
                   0
                 ],
                 "ColumnRowPadding": [
                   0,
                   0,
                   0,
                   0
                 ],
                 "SearchBarBounds": [],
                 "MoreButtonBounds": [],
                 "SaveButtonBounds": [],
                 "FavoriteButtonBounds": [
                   75,
                   6,
                   28,
                   28
                 ]
                }
                

                building user interfaces in HISE :)
                web: www.vst-design.com

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Straticah
                  last edited by

                  @Straticah You don't need it. There is a whole laf function - drawPresetBrowserSearchBar

                  This is what mine looks like:

                  e8c39d7c-3110-4c25-bc90-04aed59c0a02-image.png

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  StraticahS 2 Replies Last reply Reply Quote 0
                  • StraticahS
                    Straticah @d.healey
                    last edited by

                    @d-healey ah need to check on that. good job, looks very clean :)

                    building user interfaces in HISE :)
                    web: www.vst-design.com

                    1 Reply Last reply Reply Quote 0
                    • StraticahS
                      Straticah @d.healey
                      last edited by Straticah

                      @d-healey got it to work :)
                      375989d8-7098-4420-8551-d968af3c662e-image.png

                      why does this colour on "favorite_on" cant be applied here? Is it because it is using an id and is different to the obj functions?

                      // Search and Fav Icons
                      
                      browserLaf.registerFunction("createPresetBrowserIcons", function(id)
                      {
                          if (id == "favorite_on")	   
                      	{ 
                      	   
                      	return ICON_NO_4_path; g.setColour(0xFF2EFFE9);       
                          
                      	}
                         
                         
                          if (id == "favorite_off")
                              return ICON_NO_4_path;
                              
                          if (id == "searchIcon")
                              return ICON_NO_6_path;
                      });
                      

                      building user interfaces in HISE :)
                      web: www.vst-design.com

                      LindonL orangeO 2 Replies Last reply Reply Quote 1
                      • LindonL
                        Lindon @Straticah
                        last edited by Lindon

                        @Straticah said in PresetBrowser LAF Scrollbar:

                        @d-healey got it to work :)
                        375989d8-7098-4420-8551-d968af3c662e-image.png

                        why does this colour on "favorite_on" cant be applied here? Is it because it is using an id and is different to the obj functions?

                        // Search and Fav Icons
                        
                        browserLaf.registerFunction("createPresetBrowserIcons", function(id)
                        {
                            if (id == "favorite_on")	   
                        	{ 
                        	   
                        	return ICON_NO_4_path; g.setColour(0xFF2EFFE9);       
                            
                        	}
                           
                           
                            if (id == "favorite_off")
                                return ICON_NO_4_path;
                                
                            if (id == "searchIcon")
                                return ICON_NO_6_path;
                        });
                        

                        you appear to be setting the colour AFTER you have returned from the function - so it never happens...try it the other way round...

                                 g.setColour(0xFF2EFFE9);  
                         	return ICON_NO_4_path;  
                        

                        You will need to specifically reset the colour back to the way you want it in the other if statements...

                        HISE Development for hire.
                        www.channelrobot.com

                        1 Reply Last reply Reply Quote 0
                        • orangeO
                          orange @Straticah
                          last edited by orange

                          @Straticah said in PresetBrowser LAF Scrollbar:

                          why does this colour on "favorite_on" cant be applied here? Is it because it is using an id and is different to the obj functions?

                          As you can see, other LAF functions have g and obj arguments, so we can use obj... and g... functions with them.

                          But that createPresetBrowserIcons LAF uses only icon id's that means g and obj arguments won't work with it. Only icon id's to draw the paths.

                          develop Branch / XCode 13.1
                          macOS Monterey / M1 Max

                          StraticahS 1 Reply Last reply Reply Quote 1
                          • StraticahS
                            Straticah @orange
                            last edited by

                            @orange ah thy, that is what i thought. At what place can i change the colour independent from item colour. Or is there no possible way to colour on and off differently? :)

                            building user interfaces in HISE :)
                            web: www.vst-design.com

                            d.healeyD orangeO 2 Replies Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @Straticah
                              last edited by

                              @Straticah I don't think you can change the colour of the fav icon through LAF, all you can do is set the icon. The colour property is taken from the floating tile colours.

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

                              StraticahS 1 Reply Last reply Reply Quote 0
                              • orangeO
                                orange @Straticah
                                last edited by

                                @Straticah You can change the color of the Favorite icon from the itemColour of the Preset Browser Floating Tile

                                develop Branch / XCode 13.1
                                macOS Monterey / M1 Max

                                1 Reply Last reply Reply Quote 1
                                • StraticahS
                                  Straticah @d.healey
                                  last edited by Straticah

                                  @d-healey @orange ah i see, thats what i did so far, this would mean i will use a different icon for on and off state. I liked the idea of having dark icons that change to gradient ones on selection. But maybe the feature comes in a future update :)
                                  4e5afb4d-8fda-424f-901f-a152aad0a75b-image.png

                                  a377424f-2f24-4f07-93e4-2ad7f858807f-image.png

                                  getting close to my initial figma document tho thanks to you guys help

                                  building user interfaces in HISE :)
                                  web: www.vst-design.com

                                  DanHD 1 Reply Last reply Reply Quote 2
                                  • DanHD
                                    DanH @Straticah
                                    last edited by

                                    @Straticah looks great, well done

                                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                    https://dhplugins.com/ | https://dcbreaks.com/
                                    London, UK

                                    1 Reply Last reply Reply Quote 1
                                    • First post
                                      Last post

                                    16

                                    Online

                                    1.7k

                                    Users

                                    11.9k

                                    Topics

                                    103.2k

                                    Posts