Replies: 5 comments 22 replies
|
popupmenu in Juce is not a component so the only way to style it is via lookandfeel. drawPopupMenuItem exists, it's everywhere in the ctrlr menuBar: |
|
ok- starting to begin to get my head around this ... or at least finding out where to look for conversations about it that can give some clues. thus, i glean: so now in theory i can have closest thing is: don't know if that is valid, ( ... and now i'm seeing a JUCE discussion about |
|
been diggin' a bit over at JUCE forum, searching for topics with 'popupMenu' and 'background'. ('what i'm studying tonight') which all looks quite familiar. or here, something else, about 'opaqueness', and something about a default white background default for 'opaque': (these are in no particular order) another one on that: more on transparency: more chats on LookAndFeel: oh look more, and now about Font: this is what PopupMenu::Options looks like: (nope, not there. wtf... why is this so hard) lastly the original reference: |
|
Besides what you are trying to achieve with the Lua class, this is the way to do it in Ctrlr.. In the init file: Then add a new method that contains: But that doesn't work. And it's because of: panel:getComponent(nameOfTheComponent):setCustomLookAndFeel(lf). When you create the PopupMenu and name it "mainMenu", it doesn't work because it isn't a physical (?) component. Setting it to the button (PCM) won't matter because only the "button" l&F would apply. One thing to try is to apply the lookAndFeel to the canvas because every component should take the L&F applied to it. But even then it's not applied to the PopupMenu. Like I said last time.. some things are not bound/ linked right. And I can't tell if it's Juce or if it's Ctrlr (probably the latter). But when you add the scripts mentioned above and add a combo box... guess what? Yup, it has a red background in the drop-down menu. What I meant by "adding a class" is adding a class that binds the Juce "Options" class to Lua (Source/Lua/JuceClasses folder of the repository) in the luabind folder. It isn't there yet in Ctrlr, period. Writing your own Lua class/function won't help that much because you simply do not have access to the L&F class from Juce. But if the class is added to the JuceClasses, then it should be a little step to make use of "drawPopupMenuBackgroundWithOptions" which should offer a way to set the background of a popup menu. *Edit, lua class/function = the one you tried to write in posts mentioned before mine. |
|
@Ted-juh ChatGPT identified a lot of the issues i'm seeing mentioned. must've been hanging out at JUCE forums. i would expect to be able to do this. i'm not the only person asking about it, it's on the JUCE forum. if i can conceive of a popup menu, i immediately think "oh what if that could be transparent with luminous text?' (like tomcruise in monetaryreport) - so we can only assume that there wasn't time for this. but i also see these being referred to as 'combos', which is the word we use for a specific modulator type. should i therefore forget about (very cool and easy) popup menu and use combo instead? no: you can't have submenus in Ctrlr combos. HOW? is there a 'how'? or forget about it? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hello folks,
trying to figure out how to change the background and highlight bar colours in popup menus.
https://docs.juce.com/master/classPopupMenu.html
but apparently Ctrlr does not have access to this directly, and requires writing a class to hook it up, according to chatGPT, which gave the following:
but we can give items a text colour when we create them. what about background colour?
there is this, 'colourIds', with the enumerator: 'backgroundColourId ':
https://docs.juce.com/master/classPopupMenu.html#a0888091ddab0f599bb9d2fab28153f6b
also 'headerTextColourId', 'highlightedBackgroundColourId', 'highlightedTextColourId'. that's what i'm looking for.
there is a link to this: LookAndFeel::setColour
https://docs.juce.com/master/classLookAndFeel.html#a167a1e914771f32e433a0d45aaba45e3
what would that look like?
edit: cannot find mention of 'drawPopupMenuItem' - did chatGPT make that up? just googled it. oh no, here it is:
https://docs.juce.com/master/structPopupMenu_1_1LookAndFeelMethods.html
All reactions