Hello skar,
there are two ways to change the font in the windows caption bar.
1. Set a new font in the code:
You can set a new font in your application code. This is ok if you
just want to use the special font on one window. The the following
sample so get the idea:
var win = new qx.ui.window.Window("First Window");
this.getRoot().add(win, {left:20, top:20});
win.open();
var title = win.getChildControl("title");
title.setFont(new qx.bom.Font(20));
If you want further information on the font object and how to
configure that, take a look at the API documentation
of the font: http://demo.qooxdoo.org/current/apiviewer/#qx.bom.Font
2. Change the appearance
If you have used the create-application.py tool to create your
application, you already have a theme folder in your application and
that folder contains two files we need to change:
- Font.js
add a new font for the window caption bar. This could look look this
(copy of the original font with increased size):
"windowCaption" :
{
size : qx.bom.client.System.WINVISTA ? 30 : 29,
lineHeight : 1.4,
family : qx.bom.client.Platform.MAC ? [ "Lucida Grande" ] :
qx.bom.client.System.WINVISTA ? [ "Segoe UI", "Candara" ] :
[ "Tahoma", "Liberation Sans", "Arial" ],
bold : true
}
- Appearance.js
you have to override the window/titel appearance key (also a copy of
the original with changed font) :
"window/title" :
{
style : function(states)
{
return {
alignY : "middle",
font : "windowCaption",
marginLeft : 6,
marginRight : 12
};
}
}
Both ways change the font size of the window caption bar.
Best,
Martin
Am 17.07.2009 um 13:16 schrieb skar:
> Hi,
>
> How do I increase the font size of the title of a window? The default
> font size looks too small IMO.
>
> I tried the theme page at
> http://qooxdoo.org/documentation/0.8/ui_theming and the following code
> doesn't work.
>
>> qx.Theme.define("qx.theme.modern.Font",
>> {
>> fonts :
>> {
>> "default" :
>> {
>> size : 15,
>> lineHeight : 1.4
>> }
>> }
>> });
>>
>> qx.Class.define("sample.Application",
>> {
>> extend : qx.application.Standalone,
>> members :
>> {
>> main: function()
>> {
>> this.base(arguments);
>> var win = new qx.ui.window.Window("Login");
>> win.setLayout(new qx.ui.layout.VBox(10));
>> //win.setShowStatusbar(true);
>> //win.setStatus("Please enter your username and password");
>> win.setShowMinimize(false);
>> win.setShowMaximize(false);
>> win.setModal(true);
>> win.setMovable(false);
>> win.setShowClose(false);
>> //win.addListener("resize", win.center);
>> //ask parent to center the login window every time it's resized
>> this.getRoot().addListener("resize", function(e) {
>> win.center();
>> });
>> win.open();
>> this.getRoot().add(win);
>>
>> //var atom = new qx.ui.basic.Atom("Please enter your username
>> and password below!!!");
>> //win.add(atom);
>>
>> var label = new qx.ui.basic.Label("Please enter your username
>> and password below!!!").set({
>> font : new qx.bom.Font(12, ["Verdana", "sans-serif"])
>> });
>> win.add(label);
>>
>> }
>> }
>> });
> A pointer/URL to changing style like font size, weight, color etc for
> various widgets like label, window, atom etc would be useful.
>
> cheers,
> skar.
>
> --
> --
> The life so short, the craft so long to learn.
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited
> time,
> vendors submitting new applications to BlackBerry App World(TM) will
> have
> the opportunity to enter the BlackBerry Developer Challenge. See
> full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel