how to remove the focus on disclosure panel's header - gwt

i noticed that whenever i click the disclosure panel's header, it got focused, namely you can see the black dotted border around the header, is there any way i can get rid of that? Thanks.

You can achieve this by setting css style outline:0 on the Disclosure header:
.gwt-DisclosurePanel .header {
outline:0;
}
See also http://css-tricks.com/removing-the-dotted-outline/
Basically you need to remove the outline from the a anchor element.

Related

Change the border's color of a button in Unity3D

I began to work with Unity3D since one month and I'm trying to do an application which contains a menu, composed by a panel and several buttons. At this moment, I'm trying to customize the menu, I change the fill color of the panel and buttons, but until now I could not change the border color of the buttons. There is any way to customize the border's color of the UI buttons? I would appreciate your help. :)
The easiest way to add an outline to your button is to use the Outline component (doc).
Simply add the Outline component where your button image or text is. Then configure it how you like it :)
The above results in the following button:
No, you can not change just border color. If you use default buttons, take a look at Source image. It is basically a grey square with black borders. So when you change color of image black color remains black.
To customize buttons as you want you need either create nested UI elements:
or create sprites with colors you want and replace source image
I find nested UI elements to be the easiest way to do something like this. Simple example:
Start out by creating a panel and change the scale until you get the desired size for your button. This will be your "borders".
Next create another panel as a child of the panel you just made and change the scale to be just slightly smaller than your first panel and change the color.
In the Inspector for your panel, add component and type in Button and add it as a component.
Finally, add a text as a child of your panel for a label and you're done.

Alignment Text View trouble?

When I add a UITextView and I fill it with words, then I go to Attribute inspector and set its text Alignment to Left by clicking the first option as you can see in the picture below. It works properly but if I try to align the text to center or I try to set its alignment as Justify as shown in the picture below, it gives me an error.
Does anyone know why?
Picture

GWT Horizontal panel with horizontal scrolling

Is there a way to get horizontal scrolling implemented in a horizontal panel ?
or any other panel can be used to achieve the functionality mentioned below -
The requirement is that i am creating a search bar where search items are being added as and when user inputs them (something similar to this - http://documentcloud.github.com/visualsearch/)
Well i got the functionality working and even the looks are similar but struggling on the horizontal panel. I am using a horizontal panel as a search bar and it has a suggest box embedded in it. so when user inputs data the search items are added to the horizontal panel. but as and when search items are added the horizontal panel grows in size and moves out of the screen and browser's horizontal scroll bar appears. But i wanted a scroll bar on the horizontal panel itself.
Can this be achieved ?
want some ideas ... any help is appreciated.
Thanks.
You may want to use the css overflow-x attribute. If you want it to scroll set the value to scroll or auto. If you need to constraint the size of the div in specific ways you may need to control it progamatically.
I don't see any other solution than place your HorizontalPanel inside a scroll panel.
Then I would add a CSS property to prevent the vertical scrollbar from showing.
Here's an ui.xml excerpt:
<ui:style>
.scrollHorizontal{
overflow-y: hidden !important;
/* !important used to force override the style "overflow:scroll"
of the ScrollPanel */
}
</ui:style>
<g:ScrollPanel addStyleNames="scrollHorizontal">
<g:HorizontalPanel ui:field="resultsPanel" />
</g:ScrollPanel>
You may need to check the client height of your scroll panel so as to adjust the height of the items inside the horizontal panel, depending on your layout.

how to remove the scrolll bar in the gwt listbox?

i have a list box in my application, but i don't want to show the
vertical scroll bar on the right side, is there any way to remove it?
here is my code:
<g:ListBox visibleItemCount='3' width="15em">
<g:item>Last 7 Days</g:item>
<g:item>Last Week</g:item>
<g:item>Last Month</g:item>
</g:ListBox>
Thanks!
I believe the correct answer to this is simply: "You can't"
The ListBox (HTML Select) vertical scroll bar cannot be completely removed.
You could create your own custom control using a div to do the same thing. but I believe that may be outside of the abilities of GWT.
Hide vertical scrollbar in <select> element
Will provide additional information.
I assure you the correct answer to this is simply: "You can".
Just add the line:
overflow: hidden !important;
to your css style sheet and make sure your visible item count is higher than it's total item count.

How to remove "selected" border around GtkButton?

In GTK+, how to remove this dotted border around a GtkButton, which gets drawn after we click the button?
This is the "focus" indicator. To get rid of this, remove support for keyboard-controlled focus from the button, like this:
GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(button), GTK_WIDGET_CAN_FOCUS);