kepler.gl: how to add a new icon on tooltip of datasets title - react-redux

Dataset Title icon tooltip
Describe the issue
I need to add a new Icon and trigger an action like the "remove dataset" icon does.
I've tried to replace DatasetTitleFactory with Component Dependency Injection but I'm not figuring out how to add icon on tooltip
Additional context
https://github.com/keplergl/kepler.gl
Thanks

Related

How to add tooltips to NSButtonCell that is within a NSMatrix

I am currently instantiating an NSMatrix w/ NSButtonCell subclasses through IB
I use the identity inspector to change the Tool Tip property
But the tooltip doesn't show on the button cell.
If I set a tooltip on the NSMatrix object, a tooltip still doesn't show
If I add an NSButton to the same view, and add a tooltip to that, it does show
Why won't my tooltips on NSMatrix or NSButtonCell show?
I don't know why it can not be set in the Interface Builder (It seems like a long standing issue), but you can set them at least programmatically.
[self.matrix setToolTip:#"Tooltip for first item" forCell:[self.matrix cellAtRow:0 column:0]];
[self.matrix setToolTip:#"Tooltip for second item" forCell:[self.matrix cellAtRow:1 column:0]];
Careful, if in InterfaceBuilder you click the button, you can add the tooltip to the button, and the class displayed under "Custom Class", top right, is NSButton. But, if you click the button again, as you do while selecting stuff in xcode, what is selected is the NSButtonCell, which appears to have a separate tooltip. If you're not careful you add your tooltip to the NSButtonCell instead of the NSButton, and it won't show in your running application.
So, the problem may be that you have clicked the button one more time in IB, and you thought to enter the tooltip for the NSButton, but you didn't.
Personally I think it may be a bug, why would you want to add a tooltip for the button cell?

Rounded rect button in NSToolbar

How do you change the width of a button in a tool bar on Mac? I can change the width in interface builder but it only updates if the width is larger than the current size. If I try to make it smaller it doesn't change in tool bar.
Not sure if you found an answer yet, but I was recently looking to do this as well for a popup button. The answer is to create the button outside the toolbar first. Then once you create it you can drag it onto the toolbar area and it will be added as a toolbar item.
For example, I created a popup button on my main window and set it to the width that I wanted. Then I opened the toolbar section and dragged that button onto it... and it worked.
Good luck.

Label at a toolbar

Is it possible to use a label at a toolbar?
I would like to display a number in a label. It is easy in a view but now I want it to be displayed in the toolbar.
I can drag a label to the toolbar, no problem, but the content is not visible there, even if the name Label is visible in the IB.
More info: If I drag a label into toolbar on an single view it works perfectly to display any text or number in the label even in the toolbar.
But the problem I seem to have is it does not work at a toolbar if the view is a scrollview!!
Buttons, bar buttons, no problem, but just the label does not show up when I run the app.
Why are the toolbar items behaving differently if the view is a scrollview?
It is better not to use a label for a toolbar but a UIBarButtonItem. Then you select in IB plain style and you can display the text in title.

Why can't I set a layout for a page in a QStackedWidget in designer?

Steps to reproduce in designer for Qt 4.8.0
I create a new dialog form in Qt Designer
I add a QStackedWidget to the dialog
I set the layout of the dialog to make the stacked layout size with the dialog
I add a few controls to page one in the stacked widget
I select the first page in the stacked widget in the right hand tree view of controls
The icon next to that page (which is a QWidget) shows the page is missing a layout
When I click one of the layout buttons above, it doesn't change the layout of the page QWidget, it changes the layout of the dialog even though I had explicitly selected the page.
Is this a bug in designer? Am I missing something? I really don't want to add the layouts programatically as that prevents me from being able to layout the pages in designer in the same .ui file
Clicking a widget page in the object tree brings that page to the top of the stack, but it does not select it.
In fact, it is not possible to select a widget page itself - only its child widgets can be selected (as well as, of course, the parent stacked-widget).
The easiest way to set a layout for a widget page is to:
bring it to the top by clicking the little arrows on the top-right
corner of its parent stacked-widget
set the appropriate layout using the buttons on the toolbar
Note that it is not possible to set a layout on a widget that does not have any child widgets.
(If there is a bug here, it is that the toolbar buttons should really be greyed-out when clicking on a widget page in the object tree that has no child widgets. When the stacked-widget arrows are used, the toolbar buttons are greyed-out correctly).
It's not a bug in designer, but it's not very intuitive either. You need to click within the stacked widget page itself (where your controls are) and then click one of the layout buttons in the toolbar. Clicking the page in the tree view won't select the page for you.

NSWindow's title as indicator popup button

I'm trying to make my first Cocoa app (previously I was making iOS apps) and what I wish to do for my custom view is make it's title clickable with indicator (accessory) triangle facing down.
Clicking the title would open a popup/menu with my items.
How is that doneable in Cocoa?
Rdelmar's answer is probably the easiest way to go, but may not do exactly what you might want to do (which is replace the actual title with a pop up item, instead of having a popup button under the title in the toolbar area). With respect to functionality your application will probably work just as well using the toolbar.
If, however, you truly want to replace the actual title, the means of going about this would be to set the NSWindow title text to #"" to hide it, and redraw it by sticking in your own view.
[[[theWindow contentView] superview] addSubview:theSubview];
This basically tells the superview of the main content view to add another subview (direct "translation" from the code), and you'll have to tinker with the frame of this new subview to have it be positioned where the title should be positioned (as now it's free to be placed anywhere in the window frame, including on top of the title bar, as opposed to simply inside the content view).
theSubview can be your popup button, or whatever you want, and you'll also probably have to custom draw the popup button to match the original drawing of the window title.
You can do this by adding a toolbar to your window in IB. Once, you add the toolbar, you can double click on it to open the customizer view of it. Drag a popup button into the Allowable Toolbar Items area and after it is inserted there you can drag it into the bottom area which shows the layout of the toolbar -- you can also drag out any of the default items there that you don't want.

Resources