Toolbar position - eclipse-rcp

I am developing a RCP4 application, where I used toolbar. In some system toolbar and part label are same alignment. But some system toolbar is coming another line of part tab. Why this kind of things are happening?

It looks like this is because the height of the icons in the tool bar are bigger than the calculated height of the part tab area. This causes CTabFolder to move them to the next line.
You can set the height of a CTabFolder in the CSS using swt-tab-height. For the part stack folder this may work:
.MPartStack
{
swt-tab-height: 22px;
}

Related

Show titlebar separator when hovering? (macOS)

I'm creating an NSWindow with title bar (.titled) or tool bar and I tried to adopt a new look for macOS Big Sur.
For example, the titlebar effect of TextEdit is perfect:
As you can see above, when I hover above the title bar, the titlebar's separator shows with transition. Then the separator disappeared after the mouse left.
I found NSTitlebarSeparatorStyle in Apple Documentation:
The automatic style doesn't provide an auto changing separator.
So how can I achieve this? Any good advise? :)
The .automatic style does provide the separator hover effect, but only when the window's content view consumes the full size of the window, that is, the .fullSizeContentView style mask.
So to have the effect you want, you will need to add .fullSizeContentView to your window's style mask:
window.styleMask.insert(.fullSizeContentView)

Set toolbar button width appropriately in Interface Builder

I've created a blank project, and added a toolbar to the main window. To it, I've added two "Textured Rounded Button[s]" from the object library. I've left one as-is, and the other I've customized by setting the image.
At runtime, they look correct, with the correct width automatically inferred:
However, this doesn't match the interface builder preview:
The button's width was set when it used to have the title "Textured Rounded", but it didn't readjust its width after removing the title and adding the icon.
It bugs me that my IB preview and runtime UI don't match. Of course, I can hand-tweak the button width, but that:
Suggests to me I'm doing it wrong
Is going to break in the future, similar to how my mis-configured toolbar buttons started looking wonky in Big Sur.
What's the correct way to add a button to a toolbar, in interface builder?

Swift - Auto constraints

I am trying to use the auto size classes from the storyboard on xcode 7 to position UI elements in a controller. The problem that I'm running into is that when I try to use the "Add missing constraints" function (located at the bottom right corner of the console), it positions my UI elements correctly except for the last elements (pictures describe better). The first image below shows the storyboard file where I just want 3 buttons (stacked above eachother) to be the same width and length to be on the top right corner of any screen.
However, when I add constraints and run the simulations, it seems like the top two buttons are positioned correctly with the correct length and width but the third button is out of place (image below).
So my question is, am I forgetting a step to make all buttons position themselves? Or should I try to convert everything to a percentage and place UI elements based on the percentage of the screen (if so, how would I go about doing that)?
I've also tried adding another blank button (removing the button label) underneath the 3rd button and adding constraints like that but it didn't work for me. Let me know if you have any suggestions, thanks!
In you case, Autolayout the constraints you need to give to UIButton is 4 constrains.
Leading
Trailing
Width
Height
If you miss any of them, then surely you will get an error. So, what's your error is?
To the third UIButton, you have not given the height, while to the above two buttons you have given.
So, just remove the bottom constraint of UIButton and give the equal height to above UIButton.
FYI, never use Add Missing Constraints without any confirmation from your side.
Update:
Check this video to remove trailing or leading margin:
http://sendvid.com/1h8deg18
You can actually see the solution in action if you use the Preview screen while setting up your auto layout constraints. I just created a similar view and buttons and stepped through the process. I coloured the buttons and named them to make things obvious.
I added the three buttons. At this point, none of the buttons show up in the preview.
I then setup the auto layout constraints for Button1. If you want the buttons anchored to the top right, then you don't need to worry about the leading constraint. You need width, height, top, and trailing.
Now Button1 will snap to it's position in the top right corner of the preview screen.
Now do the same thing for Button2. Set width, height, top (vertical space to Button1), and trailing.
Button2 will now snap into place in the preview.
Now the same thing again for Button3. You anchored the first button to the top right of the screen. Then Button2 to the bottom of Button1 and the right edge of the screen. Then again for Button3. You could also align the edges of the 2nd and 3rd buttons, if you prefer that to trailing space.
Now you'll see in the preview that your buttons are correctly positioned, regardless of device.
As long as you specify height and width for each button, you don't need to worry about the left edge or the bottom edge of the screen at all. They each know to "stick" to the top right and they know what size to be.
** Note: If you're not familiar with the "Preview" option...
With your storyboard open, hold Option and select storyboard again to get another copy of the storyboard on the right side. Highlight the view controller you are interested in on the left side. On the right side, select the Preview option as shown below.
Now you have your storyboard and the preview side by side, so you can see the exact impact of any auto layout changes you make. You can also add or remove devices to the preview.

Indent UIWebview content / Move Scrollbar back to edge of screen

I have a UIWebView to show local content in HTML. I want the content indented on each side so as to not touch the side of the screen. The problem is the content is in the UiWebView, so when I resize the webview the scroll bar sticks out (see picture below).
I'm at my wit's end trying to fix this.
Make the UIWebView edge to edge, then you can either inject the following CSS code, or add it directly to the files (since you say they are in the app bundle).
div.myContent {
padding-right:50px;
padding-left:50px;
}
You can of course change div.myContent to whatever you want.
This way, scroll bar stays on edge but content indents on both sides.

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.