Closed watchdesigner closed 13 years ago
The observation is correct, yet the conclusion is wrong. The normal button is hidden, thus showing the depressed button which lies directly underneath it.
Ad codestyle: it would be best to create a pull request or at least a separate issue. This is not related to the buttons not being shown.
No. I made a test using modified bitmaps which are very well visible. So I am 100% sure, the depressed button is not underneath it. It's just not there. Please check. Thanks
-----Original Message----- From: Marek Kubica [mailto:reply+i-1594377- da4379c4637ebbde64e1e5988b677750bd3d9632@reply.github.com] Sent: Thursday, September 08, 2011 5:44 PM To: watchdesigner Subject: Re: [floatinghands] depressed buttons are not being shown (#8)
The observation is correct, yet the conclusion is wrong. The normal button is hidden, thus showing the depressed button which lies directly underneath it.
And yeah, you're right about the button behaviour. I assumed the behavior of, uh, regular computer buttons. Easily changed, though.
Ad codestyle: it would be best to create a pull request or at least a separate issue. This is not related to the buttons not being shown.
Reply to this email directly or view it on GitHub: https://github.com/Leonidas-from-XIV/floatinghands/issues/8#issuecomment- 2041051
I just tested your fix. A problem is that, in contrast to your explanations, the pressed image is not shown underneath it, but above it. So now the pushers look a bit wrong.
Changing the z-order so that the pressed image is under the normal image would fix the flaw for now (I tried to do that but failed for a reason I don't understand). However, the idea that the normal image needs to be hiding (= entirely covering) the pressed image sort of reduces the pressed image ad absurdum. We could as easily just merge the pressed images with the main background image of the watch. That would probably work for like 99% of all watches. But there might be 1% watches that require switching from one to another bitmap, e.g. because they use a lever or so.
Therefore I am still quite in favor of showing the pressed image at mousedown and hiding it at mouseup.
Btw, I saw that the source code, additionally to the images "normal" and "pressed", also looks for a key named "image" - what would that be for?
Ok, so no easy fix. But I don't have time for a different fix today. I am a bit unhappy with the current state of the buttons (this also explains why you can't set a z-index for the images, because they go through a different codepath than the z-index-aware layers), maybe I can think of a nicer solution.
image
is the codepath for the other layers, like hands or whatever else.
Yes, changing things around a bit will probably be good, though I cannot think of an exact proposal right now.
I think one thing I can see is the following: in the current example we're using images that have all the same size. But the library itself would support hand images in a different size (even if the comfort functions I wanted to add don't). However looking at the example, I think the button images would not work in different sizes, as we're just passing coordinates for the hotspots, but not for the button images themselves.
-----Original Message----- From: Marek Kubica [mailto:reply+i-1594377- da4379c4637ebbde64e1e5988b677750bd3d9632@reply.github.com] Sent: Thursday, September 08, 2011 9:08 PM To: watchdesigner Subject: Re: [floatinghands] depressed buttons are not being shown (#8)
Ok, so no easy fix. But I don't have time for a different fix today. I am a bit unhappy with the current state of the buttons (this also explains why you can't set a z-index for the images, because they go through a different codepath than the z-index-aware layers), maybe I can think of a nicer solution.
image
is the codepath for the other layers, like hands or whatever else.Reply to this email directly or view it on GitHub: https://github.com/Leonidas-from-XIV/floatinghands/issues/8#issuecomment- 2043421
Fixed that problem while reworking the pusher definition list. Now the normal
and pressed
images can have Z indices, so they can be layered at will, just like the other layers.
Coming soon: complete layer and image unification, to remove redundant code.
if you take a close look while clicking a button, I think the depressed image is not shown at all. So it looks a bit like you're pushing it in, but acutally it just disappears at mouseDown and shows up again at mouseUp. Looking at the source code confirms my assumption. In the mouseDown procedure you hide something and in the mouseUp procedure you show something, but nothing is done vice versa. Thx.
Btw, if you look at the lines 199 - 202 in the source code. I think that is not good style. You have:
to me it seems that you could just replace that by: