GWT designing a Button - css

I would like to do some notification stuff for my website.
I am done with the backend coding but i would like to display properly in the VIEW.
So exactly what i need to do is when ever there is a message i would like my button to change its color.I mean i want to do something which indicates that there is a message waiting for the user.
So basically i need to make my button blinking or change color so that it indicates the user that he has some message waiting for him
So can you please suggest me any button which can have an image as a display and a corresponding css file which i need to use which can blink when ever there is a message.

Both PushButton and ToggleButton allow setting an image as the face of the button. However, you should be able to make a normal Button "blink" just by using CSS and a Timer. Use addStyleName() and removeStyleName() in combination with the Timer - on new message, add your "blink" style (it's up to you to come up with it ;)), add a Timer and in its run() method removeStyleName() the "blink" style.
PS: See this blog post, to see how the Google team created the cross-browser, customizable buttons in GMail - but that's an overkill in this situation, IMHO ;)

Related

Make WKInterfaceButton keypress clearer in watchOS 2

I find the graphical feedback when pressing buttons (WKInterfaceButton) in watchOS2 is very weak. It is hard to see and even Apple seems to thinks this is the case as they e.g. in the unlock screen change the background to white on active buttons. The default behaviour is to dim the whole button.
How can I make a button press cleared in watchOS 2? I can e.g. change the button text color on activity but how do I easily change it back when it is no longer active?
There is currently no way to detect touch-down, or other events, on WKInterfaceButtons like you can on UIButtons on iOS. The only touch event you can detect is touch-up-inside, which calls the IBAction method.
Therefore what you wish to accomplish cannot be accomplished. Something you might consider is animating the button appearance once the action has been triggered. For example in my app upon button tap I animate the button's background color, then animate it back to the original color. That provides more visual confirmation to the user so they are certain the button was tapped.
I'd encourage you to file an enhancement request at bugreport.apple.com if you'd like to have more control with touch events.

iOS7 Custom Button Fading with UIActionSheet

I'm running into an issue where for navigation, we have to use a custom back button, which we are matching to iOS7. So we're creating a UIButton with a background image and then setting it as a custom view of a UIBarButtonItem.
The issue is that when an Action sheet is presented by iOS7, the background is faded. However, the custom button does not and it looks mismatched. Question is - is there a property that can be set to provide the image for the faded state? (though this can be done with delegation, I wanted to see if there was a simpler solution before going that route).
I have tried to set a faded image for UIControlStateDisabled, UIControlStateSystem, UIControlStateReserved with no avail.
Screen shot below:
I ended up using delegation. When the action sheet is presented, my controller received a message and switched the button to faded. When action sheet was dismissed, my controller again received a messaged and switched button to normal.
Actionsheet was subclassed here, which is why I had to do this dance.
I have actually resolved this issue without delegation. The solution is to have a png with clear background. So just the blue of the back arrow. In that case, iOS handles the fading and desaturating. If you add background, it will not.

in Qt how to know which component (placed on a widget or form ) is currently focused?

I am doing work on Qt. i am not using android. It's just a desktop application running on windows/linux.how to know which component (placed on a widget or form ) is currently focused ?
i have onscreen keyboard which appears when a QLineEdit,QTextEdit or QPlainTextEdit get focused and hide when these lost focus.But when i switch focuse from one TextEdit(or lineEdit,PlainTextEdit) to Another TextEdit(or lineEdit,PlainTextEdit) my keyboard hide and again show.I just want to stop this
If you want to stop the keyboard from flickering when the widget it's coming from and the one it's going to are similar then you could perhaps implement a timer. I imagine you have the lost focus signals going to your code that is hiding the keyboard. Instead of really hiding it, you can start a timer like
QTimer::singleShot(500, this, SLOT(really_close_keyb()));
Within that really_close_keyb() slot you could implement code to check if the widget that currently has focus should have a keyboard or not, and if it should then you don't hide it.
With this your keyboard will be up for 1/2 sec after the user focuses out of a line edit, giving enough time to focus on another one without losing the keyboard. Adjust the timing to suit.

How to make a slide up modal page in Meego?

I'm developing an app which works more or less like the Notes app. When user click the + button a modal window with TextEdits is to be slided up,just like the Notes app did. However I was unable to locate any resource mentioning this kind of thing. Any clues?
I think you are looking for the QML Sheet element. You will need to implement the TextEdit part yourself.

How to make Qt widgets do not react on mouse click

I need on my form ordinary widgets (e.g. buttons) do not react on mouse clicks but NOT to be disabled (it change look to grayed one -- not good).
I wonder is there some neat small hack for this?
You could stick in an event filter and filter out the mouse events before passing the remaining events on for processing, but I'm not sure that not giving the user a visual clue that certain elements are effectively disabled is such a good idea.
You could try using style sheets to control how the disabled mode of the buttons in your form get styled. Unfortunately I'm not sure exactly how to do that but you could have a look at the style sheet docs to get you started.

Resources