In Aframe I'm trying to change the mouse cursor for different elements, i.e. to show resize handle when something can be resized.
I've seen this
How do you change the mouse pointer style in A-Frame
And have tried giving entities a class attribute i.e. class: 'hotspot'
and adding something like
.a-canvas.hotspot.a-grab-cursor:hover{cursor: e-resize !important}
But to no avail
Related
I have created my own custom QTreeWidget, and overrided the mouseMoveEvent.
It looks something like the below,
MyTreeWidget::mouseMoveEvent(QMouseEvent* aEvent)
{
QTreeWidget::mouseMoveEvent(aEvent); // This line causes the issue
// My logic
}
I'm getting a hovering effect on the treewidget, when mouseMove happens (This is not expected). I have also set the focus (Qt::WA_MacShowFocusRect) to be false. But still, see the hover effect when I move the mouse in and out. I found out this is because of the line - QTreeWidget::mouseMoveEvent(aEvent), which calls the base class implementation which sets the hover. But, I need that to be called to support reorder of tree items, when mouseTracking is enabled.
I don't find any way to unset the hover events. Any help around this?
In my web UI, i would like to have totally different response to mouse and touch events in the same screen area. I see the solution to position a blank container (either div or SVG rect) over the area in order to capture only the touch events for the entire space, while mouse events would reach out to the specific objects underneath.
The question is: how do i make this container sensitive to touch events (as if it had CSS property pointer-events: visible;) but transparent for mouse event (as if it had CSS property pointer-events: none;)?
Unfortunately, the mentioned CSS property modifies the behavior together for mouse and touch.
Thanks!
After trying to find a solution for Centering Text on a Button with Offset, I'm doing now a custom component.
The goal is to make a button-like component that has an icon on one side and a centered text filling the rest of the button.
The component contains either two Label/ Buttons to display the Icon and text. Both of them have a background Image, defined in css.
The css looks like this for Icon and the text with exchanged image as background for text
#button-icon-cancel{
-fx-font-family: "Arial";
-fx-padding: 0,0,0,0;
-fx-background-color: transparent;
-fx-font-size: 28px;
-fx-graphic: url('images/button/cancel.png');
}
#button-icon-cancel:pressed{
-fx-graphic: url('images/button/cancel-pressed.png');
}
The images are loaded by setId(). Currently both components are added to a Panel before passing to the stage. They contain an OnClickEvent for processing.
Now to the actual question
How can I achieve that if one Component is clicked, the other one is getting the :pressed from css as well?
Adding the ClickEvent to the Panel is doing nothing (regarding clicking on either Label/ Button)
Adding both of them to a HBox, adding the Event to the HBox work in that regard, that I can click either component and the Event gets fired, BUT the :pressed State is only applied to the component you clicked.
Is it possible to give all childs the notification, that they should behave like they got pressed? Since we have a lot of small Icon, but only one background for the text, placing a Label over the whole thing create a lot of unneeded wasted Image space. Also this would cause the problematic for changing font color if not all css are changed at once (the label-over-button-solution with .setMouseTransparent(true) wouldn't change the font color of the text label since the label doesn't notice button is pressed)
First of all, JFX-8 will support wider range of css improvements, which will allow you to solve the issue easier.
To solve your issue, i can suggest the following : each node have a pressed property. You can add a listener on this property, and when it changes to true, use setStyle(String) method on needed nodes, and use setStyle(null | "") on changing to false.
I have a canvas with a scrollbar and I would like to disable the scrollbar in some way that keeps the thumb visible, but not selectable. I just want to let the user know that there is more information below, but I do not want to let him use the scroll to move down(this will be done with the movement of the arrows). I tried using the properties enabled but it does not work.
Any ideas???
Thanks.
Canvas has verticalScrollBarStyleName used for scrollbar skinning. This is name of CSS style which will be assigned to vertical Scrollbar, which in turn has following styles:
thumbUpSkin, thumbOverSkin, thumbDownSkin. You need some custom class for thumb with mouseEnabled=false. Set these styles to this thumb class name.
I want to implement an image/div drag functionality like the one in the tinymce,
when the user click on the image, its border are selected and one can move the image/div around in the editor, and in the meanwhile it generate inline css as well..
Thanks...
You probably want something like jQuery UI's draggables, which allows you to make dragging movements with your mouse which will alter the dragged element's CSS accordingly. Use the start and stop events if you want to change the border color when it is being dragged.