How change the font size for Signature Component - codenameone

I'm using the Signature component in my App. I would like to reduce the font size for buttons CANCEL, RESET of Signature component. Please let me know if any functions available to change the size or style for buttons of Signature component.
Thanks

This isn't available right now. But it makes sense to have something like that so for the next update (which will be out on Friday June 15th 2018) we'll add the following 3 theme constants:
sigButtonOKUIID
sigButtonResetUIID
sigButtonCancelUIID
So if you want cancel and reset to have a smaller font just create a theme entry matching a small font button (you can derive from Button). Lets say you named it SmallFontButton. Then in the theme constants you just define the sigButtonResetUIID=SmallFontButton and do the same for the cancel button.
That should provide you with full control over the appearance of these widgets.

Related

How do I change the colours of the Switch component?

I want to change the colour of the thumb of the Switch component to green instead of the standard black.
According to the documentation "You can customize the look and feel of a switch using styles, either directly in the theme.res file or in CSS." and "The thumb will be rendered using Switch's Style.getFgColor(). It will use the selected style, when in the "on" position, the unselected style when in the "off" position,"
https://www.codenameone.com/javadoc/com/codename1/components/Switch.html
I have tried adding a "Switch" style to the theme.res file. In the theme preview I see my changes. When I run the app in the simulator, there is no change.
I also tried changing the style in code:
swPrdp.setUIID("Switch");
I still get the standard black thumb.
I also tried:
swPrdp.getAllStyles().setBgColor(0xcccccc, true);
swPrdp.getSelectedStyle().setFgColor( 0x59925A, true);
with and without the second argument (true). Still no change.
I am trying to keep the app size to a minimum, so I don't want to go the route of specifying images.
Where am I going wrong?
This should work in the theme too and works for me in the style object (which is easier to write here:
Form hi = new Form("Switch", BoxLayout.y());
Switch s = new Switch();
s.getAllStyles().setFgColor(0xff0000);
s.getAllStyles().setBgColor(0xff);
hi.add(s);
hi.show();

how to change the size of trigger and time selection box

As the picture show I want change the size of trigger and time selection box. I once try some methods but no use.
So, i built a fiddle: FIDDLE
According to your image you're using Neptune theme, so did i. But you haven't provided a version so i used the latest one.
Lets start with picker size. Setting width was pretty easy, but height required some css works. I define picker sizes: wSize &hSize, and fontSize at the top of the function, so you can change it.
Now about trigger size. Well trigger comes with one image of containing all sort of trigger images inside, that could be displayed(focus, hover etc.):
So i had to change parameters for all of them. I have overriden ext css classes and the thing, that you must be aware of, is that its all about proportions. For example the default size of trigger image is 110x22 and it includes 5 images of 22x22 size each. I changed the size from 22 to 33 so i had to change everything proportionally:
background-size: 110 to 165
background-position(click): 44 to 66
background-position(over): 66 to 99
...(you can see it in index.html)
So if you're going to change the size of trigger, you'll have to do some calculations.
Still there are some components inside the picker which needs to be stretched to look good, but i think you can do it yourself by taking this code as an example.

Dynamic appbar icon WP8

I'm going to implement showing text inside the circle of appbar icon. For example, user presses some button on the screen and the number in circle appbar icon increases like a counter.
I see the only way to implement it: generate dynamically the icon with the number and update the icon in appbar. Does anybody have such experience? Looks like it's possible, but I don't know how to do that.
Would dynamic icon generation require much time on runtime? Which tools (libraries) could help me in generating appbar icon dynamically?
You can render bitmap from control witch contains text. You can use
WitableBitmap
. Then you save local img and set it path as source
IconUri

Drupal 7 Bartik theme main menu

I am dabbling fresh with Drupal 7 and so far having little success with getting the Menu to behave the way I want it to. My CSS and PHP basics are strong, but understanding Drupal's system is in itself a huge challenge and hence my doubts.
For those acquainted with the Bartik theme, the main menu defaults itself in the header.
I am trying to create a floating/persistent menu that encapsulates the entire width of the website. But I am not sure where I need to go in and make the required changes.
One option I have is to remove the main menu from the Bartik header and then introduce the main menu block in the 'featured' region. Here the menu is rendering itself horizontally instead of vertically the way i want it to be.
Essentially the question is, How do I alter the main menu in the Bartik theme? Where do I need to get in and make changes.OH, and I have sub-themed it, just to let you know.
Thanks much !
Parijat
I'm not sure I follow but it sounds like you need to create a new region to put the menu in. You add these in the themes .info file.
region[region_name] = Region name
Print the regions contents out in your themes page.tpl.php file.
Clear the cache and it will show up in the blocks page.
You can the style it how ever you want.

How do I specify the default font sizer in CK Editor v3

How do I specify the default font size for CKEditor. I tried changing contents.css (body -> font-size) and I tried changing config.js (config.fontSize_defaultLabel) without any success. Does anyone know where i should be looking?
You seem to be on the right track with the contents.css file.
Is your problem that the font size while working in the editor is not correct or is it that the font size isn't being carried over to the page where you actually display the content?
As you know, ckeditor/contents.css is the default style sheet that is loaded while working in the editor, but if you use "config.contentsCss" to call another style sheet, contents.css won't be loaded.
You can call multiple style sheets like this:
config.contentsCss = ['/contents.css', '/css/anotherstylesheet.css'];
If the font size isn't being carried over to the actual page display, you'll need to set the font size in the style sheet used for the actual pages, the default font size used in the editor isn't inserted into the content output by the editor.
"config.fontSize_defaultLabel" is a label only, it doesn't have any effect on the content. Normally, when you load the editor, the font size selector will display "Size". If you set "fontSize_defaultLabel", the font size selector will display whatever value you entered.
If you can provide more details about the problem, I'll try to post a more accurate answer.
Be Well,
Joe

Resources