How to change a UI's color when its being hovered over - lua

I'm trying to make a UI that changes to a lighter color when its hovered over (roblox's default is darker)
MouseEnter and MouseLeave have already been tested and don't work the way I want it to. MouseEnter keeps the darkening and makes my target color darker than it should be.
Is this possible, if so, how would it be used?

MouseEnter and MouseLeave will work, you just need to disable your button's AutoButtonColor property.
From the docs :
The AutoButtonColor determines whether the button automatically changes color when the user’s Mouse hovers over or clicks on it.
If true, the button will automatically change color when the mouse hovers over or clicks on it. If false, the button will not change.

Related

mat-flat-button color is getting changed once it is clicked and coming back to normal color only after a blur event

I am having a button that is mat-flat-button with background color as light blue. When it is clicked, some popup will come as per my requirement. I observed that the button's background color is getting darken once I clicked. Once I closed that popup, the mat-flat-button's background color has to come into normal color which is light blue. But, that is not happening and the button's background color is still in darken mode. That normal background color is coming to normal light blue color only if I performed a mouse blue event. Why this is happening for mat-flat-button? I am new to Angular and I tried lot to resolve this with no luck. Is there any alternative way to achieve this?
Thanks.
This is come from material design. You have more status. Have focus, hover, active (etc..) status. This background color indicates the active focused element. When you click the button, and the dialog opened the focus moves to the dialog, and when the dialog is closed the focus return to the button. This is why your button works so wierd. This background color comes from the theme colors. You can change this behavior whit some css rules.

Default Button with VCL Styles

I am puzzled by the styling of TButtons that have Default:=True. The issue is that at least with some styles (Luna, for example), the most recently focused button is highlighted orange, which is the same styling used for a default button. As a result, I am concerned that users might be confused as to which button is the default or will at least think it odd that two buttons are highlighted. This behavior can be seen in XE7 (and according to a comment, also in XE8).
Questions:
Is this considered a modern way (relatively to unstyled VCL) to present default buttons?
If this is not considered standard behavior I can work around it in my own dialogs by strategically enabling/disabling the default button, but I was wondering whether I missed some setting that controls the relation between default buttons and the most-recently focused button. Is there a setting that controls this?
I suspect that this is a VCL styles bug. Create a default VCL application that uses the standard OS theme. Then add two buttons and an edit control. Make one of the buttons be the default button.
Now use the tab key to cycle round the focus. When the edit control has the focus, the default button is highlighted. That indicates that if you press ENTER then that button will be pressed.
However, if either of the buttons has the focus, then the button with the focus is highlighted. That's because if you press ENTER when a button has the focus, the focused button is pressed, irrespective of whether it is the default button.
The rules are as follows:
If a button has the focus, it is highlighted as the default button.
If a control other than a button has the focus, the default button, if there is one, is highlighted.
So, here's what the application looks like in XE7 with the system theme. The non-default button has the focus.
Note that only one button is highlighted, and it is not the default button.
And here is the same application in XE7 with the Luna style.
Here we have the default button, and the button with the focus, both being highlighted. I would regard that to be a bug, and it should be reported.

Delphi TImage Over A TSpeedButton

I want to put a TButton or TSpeedButton over top of a TImage and make the button transparent so you can still click it, but you see the image rather than the button. I can't seem to get this to work though, I changed the TSpeedButton to transparent, but it didn't seem to do anything.
I also tried making Visible false for the button, but then it becomes unclickable. Is there a way to make a button invisible without losing its functionality?
Thanks.
You don't need a button. Delete it and handle the image's OnClick event instead.
If you need to know the point on the image that was clicked, call GetMessagePos from your event handler.

Firemonkey: TSpeedButton IsPressed no visible Effect?

How do I set a TSpeedButton (on a TToolbar) to look pressed down? It's only highlighted when clicking but gets normal when the mouse leaves it. I set the property Stayspressed to True and indeed the property IsPressed becomes and stays True, but this state is not visible.
What style are you using? Some of the included ones do not have every effect included.
First, revert back to the windows style. If that works, then it's definitely a styling issue, rather than a code issue.
If you want to add an effect (actually an animation) to another style:
Right click on a button and select Edit Default Style.
Find the Fill.Color property of the Rectangle you want to show the anmimation.
Click the animation icon and add a TColorAnimation
Set: the StartValue (the existing value).
The StopValue
The Trigger: IsPressed=True
Repeat the above to add a second animation with the Start and StopValues reversed and Trigger of IsPressed=False
This is a tough one - the standard TButton style includes effects which work - the button will look pressed when "IsPressed" is true. However, other styles (and especially your own) can be much more problematic. I have found the best solution is to have 2 styles and change the style when the button is pressed.
I found it pretty impossible to get "mouseover" animation to work with "pressed" animation in buttons - normally you want to highlight the button slightly when the mouse passes over and then add an effect when you press - especially when you don't want the default shadow effect but a colour effect (which I prefer, I don't like the inner shadow effect of a default button press), but I always seemed to end up with issues. Either one effect wouldn't fire OR the button state wouldn't return to what you'd expect (visually I mean).
My advice - add a little bit of extra code to change the style for the pressed button, you might go mad otherwise :-)

iOS how to change default onPress button color

I have been trying to figure out this problem for a while now and no avail. I have a program I inherited and it uses a a white background image for the buttons. You can change what image you want easily from UI editor. When the user presses down on that button the white background image is switched out for a different image, showing a blue highlight instead. For the life of me I can't find where that is being referenced at. I even tried adding a new button and it is the stock highlight color.
Where is that onPress reference probably at? Or where can I re-reference this new button to have a new onPress image background?
Thank you!
Select the button in Interface Builder. Open the attributes inspector for that button. Under Button you can choose the "State Config". Change that to "Highlighted". Now you can change the Image config for the highlighted state.

Resources