How to modify the height of the statusbar in codenameone? - codenameone

How do I modify the height, background, margin and padding of the statusbar in Codename one?
It looks very bad.

Don't base the look of the statusbar on simulator output, this will be different from the looks on real devices.
If you want to style the statusbar, modify UIIDs StatusBar and StatusBarSideMenu to your desire.

As Diamond said, you should modify UIIDs StatusBar and StatusBarSideMenu.
The way to do that is the following:
Open theme.res file
Find the theme under Themes
Open the UIID you want to change, if it is not present, click Add.
Type the name of the UIID
Change the style however you wish
Then call .setUIID() method on the component on which you want to do that. Note that components by default get UIID, for example Label has UIID "Label" and so on, so you won't need to call setUIID.

Related

How is the size of the StatusBar (in the Toolbar) set?

In my app, on iphone as well as in the iPhoneX skin on the simulator, the size of StatusBar (inside the Toolbar) is for some reason too small/thin, so the title of the Form is shown partially hidden by the iPhoneX notch.
I've tried to understand how to fix this, but I simply can't figure out how the size of the StatusBar is set. I don't change the size of the StatusBar UIID in my css file, nor in my code and yet it is smaller than if I create a fresh Hello World example with the iPhoneX.skin.
I first thought it could be the SafeArea which changed the size, but it doesn't seem so. Then I thought the default theme (or the values of the Default UIID in the css) could change the size, but it doesn't seem to be that either. I probably miss something obvious, but I'm stuck so any help would be greatly appreciated.
PS. I could of course force the size of the StatusBar in css myself, but then I'm not sure it will work on the various devices, so I prefer rely on the default value defined by CN1.
The StatusBar UIID is defined internally and is generally hard coded to a value that fits for most themes. This very much depends on the padding in your Title UIID which is often large and works in tandem with the status bar. Assuming your title has 0 padding you might need more padding to the StatusBar.
Assuming you're using CSS you can use something like:
#media platform-ios {
StatusBar {
padding: 7mm;
}
}

How to change the border color in DB-Visualizer?

I am using DB-Visualizer 9.2.10 and I want to change the border color of the editor but I don't see any border option to change. Below image shows the options colors and borders but in my pro version I don't see this option. Is there any other way to accomplish the same.
Thanks
You should be able to change the border by going to Tools -> Properties.
You can either select one of the predefined styles or specify a small image file to use for the border.
You should also be able to change it by going to Database -> Connections

Applying Style Dynamically To MultiButton LineX Labels

I want to apply RoundBorder style to MultiButton Line2 label when horizontal layout is set to true but calling mb.setHorizontalLayout(true); but I can't because LineX labels are not accessible outside the MultiButton.
I know that I can create curved border using theme designer and applying the uiid to the label using any of the setUIIDLineX() method but I don't want to use it because it didn't give me what I want in some device pixel density.
Is there any other way to style MultiButton internal components(Labels) through code?
Again, why is it that LineX labels are not exposed like icon label?
Exposing the LineX labels will equally enable developers to set icons for the individual labels depending on what the developer want to accomplish.
Thanks.
No one asked for that so we didn't add such getters. You can file an RFE for that or submit a pull request which will probably be quicker.
Notice you can style the round border in the current version of the designer so you can use a the UIID's to set the round border too.

partial font styling in spanlabel

I want a spanlabel show text like
codename one
and code is blue and bold, name is red and bold. How do I achieve this?
That isn't supported by SpanLabel. You can either use a BrowserComponent and style the entries or use several different labels in a FlowLayout Container thus giving each of them the ability to be styled on its own.

WPF : Use different icon images as an ImageBrush?

An Icon can contain more than one image. I want to use an icon for an ImageBrush and I want to set which image inside the icon should be use. But somehow it seems I can't do that. The brush always picks the largest image from the icon.
Is there a way to choose the image manually?

Resources