Bug 12407 - [GENERAL] Make QtComponents Theme friendly
: [GENERAL] Make QtComponents Theme friendly
Status: NEW
Product: qt-components
General
: unspecified
: N900 Maemo
: Medium enhancement (vote)
: ---
Assigned To: Jonathan
: general
:
: easyfix
:
:
  Show dependency tree
 
Reported: 2011-09-11 23:03 UTC by Carlos Martín
Modified: 2014-03-08 10:29 UTC (History)
1 user (show)

See Also:


Attachments
commit 71004e69b103c3f125b0dddb89e6f714a85c9d04 constants.ini (2.51 KB, application/octet-stream)
2011-11-24 17:23 UTC, Jonathan
Details
commit 87449f6d5ab8d936562d74cd5b8ff0852c8a3895 constants.ini (2.75 KB, application/octet-stream)
2011-11-25 12:45 UTC, Jonathan
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Carlos Martín (reporter) 2011-09-11 23:03:01 UTC
Although QtComponents make use of meegotouch for image theme support, it still
use magic numbers to layout elements internally. This makes impossible to get a
QtComponents with a Fremantle look and feel.

Required work to get layout, margin, palette etc is already merged into
qt-components, but still is required to make use of this functionality by the
components.

Required work to do:

1)for each Style element into styles dir:
  s/UI.<FEATURE NAME>/theme.constants.<THEME_GROUP>.<THEMEFEATURE_NAME>
  test
2)remove UIConstants.js on Core and constants.js in extras.
Comment 1 Jonathan 2011-11-11 17:25:08 UTC
I've downloaded fremantle-1.0 branch of qt-components. I found UIConstants.js
was still in style files.. 

I don't know how to help for this...
Comment 2 Carlos Martín (reporter) 2011-11-11 18:15:27 UTC
(In reply to comment #1)
> I've downloaded fremantle-1.0 branch of qt-components. I found UIConstants.js
> was still in style files.. 
> 
> I don't know how to help for this...

Don't worry, I can help you ;)

First of all a bit of background:
---------------------------------
Standard qt-components don't make use of inheritance or properties declared on
themes. Instead, they hardcoded them internally on javascript library files
(UIConstants.js). What I'have done is implement a way to fetch that properties
from theme. That allow, for example, change default font, paddings, etc, and
also, allow third party apps to use the same padding and layout params
internally (See butaca for example) 

Theme properties are declared on a constants.ini file inside themes directory.
For examble, for base, contants are declared at
/usr/share/themes/base/meegotouch/constants.ini file. File struct is the
classic ini file.

How to proceed
----------------
First of all, you need to get a proper environment to get this task done. See
https://bugs.maemo.org/show_bug.cgi?id=12456#c13 to know how to set
qt-components and base (or blanco) theme running on QtSimulator.

After that, peek one of the variables available on UIConstants.js file and
locate all qml files that make use of that constant (grep is your friend here). 
you should replace each entry on each qml file with a call to
theme.constants..<ThemeGroup>.<variable>. ThemeGroup is the group (aka [Fonts])
on which <variable> is allocated on constants.init file

Finnaly, build and test to check that everything is ok. To test run examples
availables on examples dir inside qt-components directory. If everything is ok,
send a merge-request to the repo ;)

Example
--------
https://qt.gitorious.org/~inean/qt-components/ineans-qt-components/commit/9155a2acbc9305a90634d1f064219559a1e20ce2
Comment 3 Jonathan 2011-11-21 12:01:45 UTC
Thank you for the instructions..

When i compile qt-components, get the error below: 


g++ -c -pipe -O2 -D_REENTRANT -Wall -W -fPIC
-DUSE_DEPRECATED_SCREEN_WIDTH_HEIGHT -DTHEME_DIR=\""/usr/share/themes"\"
-DCACHE_DIR=\""/opt/var/cache"\" -DDEFAULT_THEME=\""base"\" -DFORCE_LOCAL_THEME
-DHAVE_SENSORS -DHAVE_SYSTEMINFO -DHAVE_SHADER -DQT_NO_DEBUG -DQT_PLUGIN
-DQT_DECLARATIVE_LIB -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB
-DQT_CORE_LIB -DQ_COMPONENTS_MAEMO -DHAVE_MOBILITY
-I/home/maemo/QtSDK/Simulator/Qt/gcc/mkspecs/default -I.
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtCore
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtNetwork
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtGui
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtSvg
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtDeclarative
-I/home/maemo/QtSDK/Simulator/Qt/gcc/include -I.
-I/home/maemo/projects/ineans-qt-components/src/fremantle/indicators
-I/usr/X11R6/include -I.release -o .release/mdeclarativescreen.o
mdeclarativescreen.cpp
mdeclarativescreen.cpp:55:33: error: qorientationsensor.h: No such file or
directory
mdeclarativescreen.cpp:82: error: expected constructor, destructor, or type
conversion before ‘static’
mdeclarativescreen.cpp:153: error: ‘QOrientationSensor’ does not name a type
mdeclarativescreen.cpp: In constructor
‘MDeclarativeScreenPrivate::MDeclarativeScreenPrivate(MDeclarativeScreen*)’:
mdeclarativescreen.cpp:237: error: class ‘MDeclarativeScreenPrivate’ does not
have any field named ‘orientationSensor’
mdeclarativescreen.cpp:244: error: ‘DEFAULT_WIDTH’ was not declared in this
scope
mdeclarativescreen.cpp: In member function ‘void
MDeclarativeScreenPrivate::initMobilityBackends()’:
mdeclarativescreen.cpp:306: error: ‘orientationSensor’ was not declared in this
scope
mdeclarativescreen.cpp: In member function ‘QString
MDeclarativeScreenPrivate::topEdgeValue() const’:
mdeclarativescreen.cpp:506: error: ‘orientationSensor’ was not declared in this
scope
mdeclarativescreen.cpp:509: error: ‘orientationSensor’ was not declared in this
scope
mdeclarativescreen.cpp:510: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp:511: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp:512: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp:513: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp:514: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp:515: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp:516: error: ‘QOrientationReading’ has not been declared
mdeclarativescreen.cpp: In member function ‘virtual bool
MDeclarativeScreen::eventFilter(QObject*, QEvent*)’:
mdeclarativescreen.cpp:551: error: ‘class MDeclarativeScreenPrivate’ has no
member named ‘orientationSensor’
mdeclarativescreen.cpp:567: error: ‘class MDeclarativeScreenPrivate’ has no
member named ‘orientationSensor’
make: *** [.release/mdeclarativescreen.o] Error 1



/QtSDK/Simulator/Qt/gcc doesn't have the include file qorientationsensor.h
which can be found under the directory /QtSDK/Simulator/QtMobility/gcc.. how
can i set up the environment to resolve this problem??
Comment 4 Carlos Martín (reporter) 2011-11-21 17:46:49 UTC
> /QtSDK/Simulator/Qt/gcc doesn't have the include file qorientationsensor.h
> which can be found under the directory /QtSDK/Simulator/QtMobility/gcc.. how
> can i set up the environment to resolve this problem??

Yep, you are missing includes to /QtSDK/Simulator/QtMobility... headers on
compilation output, which is weird, It should be included with -mobility flag
at configuration time.

Be sure that you have 'com.nokia.ndk.api.qtmobility.simulatorgcc package on
file components.xml under your QtSDK installation (use grep). If not, install
it. If you have it installed, maybe your SDK installation is broken. Try
reinstall it again.

In the meantime, you could build fremantle without QtMobility support passing
-no-mobility at ./configure command line. You loose Device orientation support,
but at least is usable.

Keep me posted.
Comment 5 Jonathan 2011-11-22 05:39:55 UTC
(In reply to comment #4)
> > /QtSDK/Simulator/Qt/gcc doesn't have the include file qorientationsensor.h
> > which can be found under the directory /QtSDK/Simulator/QtMobility/gcc.. how
> > can i set up the environment to resolve this problem??
> 
> Yep, you are missing includes to /QtSDK/Simulator/QtMobility... headers on
> compilation output, which is weird, It should be included with -mobility flag
> at configuration time.
> 
> Be sure that you have 'com.nokia.ndk.api.qtmobility.simulatorgcc package on
> file components.xml under your QtSDK installation (use grep). If not, install
> it. If you have it installed, maybe your SDK installation is broken. Try
> reinstall it again.
> 
> In the meantime, you could build fremantle without QtMobility support passing
> -no-mobility at ./configure command line. You loose Device orientation support,
> but at least is usable.
> 
> Keep me posted.


I reinstalled the qtsimulator & qtmobility api, the error is gone.. and new
error appears:


/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:263: error:
expected ‘,’ or ‘...’ before ‘value’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:263:
error: ‘void QGLShaderProgram::setUniformValue(int, int)’ cannot be overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:238:
error: with ‘void QGLShaderProgram::setUniformValue(int, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:266:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:267:
error: ‘GLint’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:267:
error: ‘void QGLShaderProgram::setUniformValue(const char*, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:266:
error: with ‘void QGLShaderProgram::setUniformValue(const char*, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:268:
error: ‘GLuint’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:268:
error: ‘void QGLShaderProgram::setUniformValue(const char*, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:266:
error: with ‘void QGLShaderProgram::setUniformValue(const char*, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:269:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:269:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:270:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:270:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:270:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:271:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:271:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:271:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:271:
error: ‘GLfloat’ has not been declared
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:289:
error: ISO C++ forbids declaration of ‘GLfloat’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:289:
error: expected ‘,’ or ‘...’ before ‘value’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:289:
error: ‘void QGLShaderProgram::setUniformValue(const char*, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:266:
error: with ‘void QGLShaderProgram::setUniformValue(const char*, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:290:
error: ISO C++ forbids declaration of ‘GLfloat’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:290:
error: expected ‘,’ or ‘...’ before ‘value’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:290:
error: ‘void QGLShaderProgram::setUniformValue(const char*, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:266:
error: with ‘void QGLShaderProgram::setUniformValue(const char*, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:291:
error: ISO C++ forbids declaration of ‘GLfloat’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:291:
error: expected ‘,’ or ‘...’ before ‘value’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:291:
error: ‘void QGLShaderProgram::setUniformValue(const char*, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:266:
error: with ‘void QGLShaderProgram::setUniformValue(const char*, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:294:
error: ISO C++ forbids declaration of ‘GLfloat’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:294:
error: expected ‘,’ or ‘...’ before ‘*’ token
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:295:
error: ISO C++ forbids declaration of ‘GLint’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:295:
error: expected ‘,’ or ‘...’ before ‘*’ token
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:295:
error: ‘void QGLShaderProgram::setUniformValueArray(int, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:294:
error: with ‘void QGLShaderProgram::setUniformValueArray(int, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:296:
error: ISO C++ forbids declaration of ‘GLuint’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:296:
error: expected ‘,’ or ‘...’ before ‘*’ token
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:296:
error: ‘void QGLShaderProgram::setUniformValueArray(int, int)’ cannot be
overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:294:
error: with ‘void QGLShaderProgram::setUniformValueArray(int, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:310:
error: ISO C++ forbids declaration of ‘GLfloat’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:310:
error: expected ‘,’ or ‘...’ before ‘*’ token
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:311:
error: ISO C++ forbids declaration of ‘GLint’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:311:
error: expected ‘,’ or ‘...’ before ‘*’ token
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:311:
error: ‘void QGLShaderProgram::setUniformValueArray(const char*, int)’ cannot
be overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:310:
error: with ‘void QGLShaderProgram::setUniformValueArray(const char*, int)’
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:312:
error: ISO C++ forbids declaration of ‘GLuint’ with no type
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:312:
error: expected ‘,’ or ‘...’ before ‘*’ token
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:312:
error: ‘void QGLShaderProgram::setUniformValueArray(const char*, int)’ cannot
be overloaded
/home/maemo/QtSDK/Simulator/Qt/gcc/include/QtOpenGL/qglshaderprogram.h:310:
error: with ‘void QGLShaderProgram::setUniformValueArray(const char*, int)’
In file included from shadereffectitem/shadereffectitem.h:50,
                 from plugin.cpp:68:
shadereffectitem/shadereffectsource.h:164: error: ‘GLuint’ has not been
declared
In file included from shadereffectitem/geometry.h:44,
                 from shadereffectitem/shadereffectitem.h:51,
                 from plugin.cpp:68:
shadereffectitem/3d/qglattributedescription.h:57: error: ‘GLenum’ has not been
declared
shadereffectitem/3d/qglattributedescription.h:64: error: ‘GLenum’ does not name
a type
shadereffectitem/3d/qglattributedescription.h:65: error: ‘GLenum’ has not been
declared
shadereffectitem/3d/qglattributedescription.h:77: error: ‘GLenum’ does not name
a type
shadereffectitem/3d/qglattributedescription.h: In constructor
‘QGLAttributeDescription::QGLAttributeDescription()’:
shadereffectitem/3d/qglattributedescription.h:83: error: class
‘QGLAttributeDescription’ does not have any field named ‘m_type’
shadereffectitem/3d/qglattributedescription.h:83: error: ‘GL_FLOAT’ was not
declared in this scope
shadereffectitem/3d/qglattributedescription.h: At global scope:
shadereffectitem/3d/qglattributedescription.h:89: error: ‘GLenum’ has not been
declared
shadereffectitem/3d/qglattributedescription.h: In constructor
‘QGLAttributeDescription::QGLAttributeDescription(QGL::VertexAttribute, int,
int, int)’:
shadereffectitem/3d/qglattributedescription.h:90: error: class
‘QGLAttributeDescription’ does not have any field named ‘m_type’
shadereffectitem/3d/qglattributedescription.h: At global scope:
shadereffectitem/3d/qglattributedescription.h:111: error: ‘GLenum’ does not
name a type
shadereffectitem/3d/qglattributedescription.h:116: error: variable or field
‘setType’ declared void
shadereffectitem/3d/qglattributedescription.h:116: error: ‘GLenum’ was not
declared in this scope
In file included from shadereffectitem/shadereffectitem.h:51,
                 from plugin.cpp:68:
shadereffectitem/geometry.h:57: error: ‘GLenum’ has not been declared
shadereffectitem/geometry.h:85: error: ‘GLenum’ has not been declared
shadereffectitem/geometry.h:86: error: ‘GLenum’ does not name a type
In file included from shadereffectitem/shadereffectitem.h:51,
                 from plugin.cpp:68:
shadereffectitem/geometry.h:112: error: ‘GLenum’ does not name a type
In file included from shadereffectitem/shadereffectitem.h:51,
                 from plugin.cpp:68:
shadereffectitem/geometry.h:57: error: ‘GL_UNSIGNED_SHORT’ was not declared in
this scope
make: *** [.release/plugin.o] Error 1


-----------------------

is that because i should setup opengl es enviroment?
Comment 6 Jonathan 2011-11-22 06:05:42 UTC
when i installed libgl1-mesa-dev & libglu1-mesa-dev, it compiled successfully..

"To test run examples
availables on examples dir inside qt-components directory."

1/ cd examples/fremantle & make
2/ i can run examples under simulator..

is that correct?
Comment 7 Carlos Martín (reporter) 2011-11-22 17:47:02 UTC
(In reply to comment #6)
> when i installed libgl1-mesa-dev & libglu1-mesa-dev, it compiled successfully..
> 
> "To test run examples
> availables on examples dir inside qt-components directory."
> 
> 1/ cd examples/fremantle & make
> 2/ i can run examples under simulator..
> 
> is that correct?

yes :)
Comment 8 Jonathan 2011-11-23 09:46:56 UTC
i've done some work.. you can check :
https://qt.gitorious.org/~micro/qt-components/micros-ineans-qt-components

when i check ToolBarLayout.qml, i find some values aren't in constants.ini.
should i add these values in that file?
Comment 9 Carlos Martín (reporter) 2011-11-23 11:57:48 UTC
(In reply to comment #8)
> i've done some work.. you can check :
> https://qt.gitorious.org/~micro/qt-components/micros-ineans-qt-components

Good job!. Follow that way; one component (Component + /omponent+tyle) per
commit. That way its easy to review/merge commits.

> when i check ToolBarLayout.qml, i find some values aren't in constants.ini.
> should i add these values in that file?

toolbar height and width constants are defined under 'Sizes' section on base's
constants.ini file ;)
Comment 10 Jonathan 2011-11-23 16:20:26 UTC
> > when i check ToolBarLayout.qml, i find some values aren't in constants.ini.
> > should i add these values in that file?
> 
> toolbar height and width constants are defined under 'Sizes' section on base's
> constants.ini file ;)

constants.ini file:

HEIGHT_NAVIGATIONBAR_LANDSCAPE          = 56;
HEIGHT_NAVIGATIONBAR_PORTRAIT           = 72;

UIConstants.js file:

var TOOLBAR_HEIGHT_PORTRAIT = 72;
var TOOLBAR_HEIGHT_LANDSCAPE = 56;

do you mean these constants above the same?

--------------------------

UIConstants.js file:
var SCROLLDECORATOR_SHORT_MARGIN = 8;
var SCROLLDECORATOR_LONG_MARGIN = 4;

these two constants can't be found in constants.ini, i added them in it.
Comment 11 Jonathan 2011-11-23 16:39:03 UTC
i find Style file have property real/double/int.
how could i decide to choose?

all i added to Style file property is int..
Comment 12 Jonathan 2011-11-23 17:00:07 UTC
i find TextArea & TextFiled have many codes the same.. should change
UI.constants the same?
Comment 13 Carlos Martín (reporter) 2011-11-23 17:36:09 UTC
(In reply to comment #10)
> > > when i check ToolBarLayout.qml, i find some values aren't in constants.ini.
> > > should i add these values in that file?
> > 
> > toolbar height and width constants are defined under 'Sizes' section on base's
> > constants.ini file ;)
> 
> constants.ini file:
> 
> HEIGHT_NAVIGATIONBAR_LANDSCAPE          = 56;
> HEIGHT_NAVIGATIONBAR_PORTRAIT           = 72;
> 
> UIConstants.js file:
> 
> var TOOLBAR_HEIGHT_PORTRAIT = 72;
> var TOOLBAR_HEIGHT_LANDSCAPE = 56;
> 
> do you mean these constants above the same?

Right
> --------------------------
> 
> UIConstants.js file:
> var SCROLLDECORATOR_SHORT_MARGIN = 8;
> var SCROLLDECORATOR_LONG_MARGIN = 4;
> 
> these two constants can't be found in constants.ini, i added them in it.
Good
Comment 14 Carlos Martín (reporter) 2011-11-23 17:45:27 UTC
(In reply to comment #11)
> i find Style file have property real/double/int.
> how could i decide to choose?
> 
> all i added to Style file property is int..

How to choose the correct property type (sorted by preference):

int: Only use it when property is going to be always an integer, (1, 200, font
size measured in pixels, etc)

double: If it's a decimal or value could be expressed with decimals (real
numbers, 70,5%, etc)

url: If it's an url, wit an schema (http://, ftp:// etc)

string: otherwise
Comment 15 Carlos Martín (reporter) 2011-11-23 17:47:18 UTC
(In reply to comment #12)
> i find TextArea & TextFiled have many codes the same.. should change
> UI.constants the same?

Yes :)
Comment 16 Jonathan 2011-11-24 07:07:28 UTC
thanks for your reply.. another 2 more question

a) i find EditBubble.js include UIConstants.js, how could i get it work?

b) constants.ini have value:
FONT_DEFAULT_FAMILY = "Nokia Sans"
but i don't find any file under fremantle use it.. is it useful?

TextFileStyle.qml use FONT_FAMILY_LIGHT, should i change FONT_DEFAULT_FAMILY to
FONT_FAMILY_LIGHT in constants.ini?
Comment 17 Jonathan 2011-11-24 10:06:01 UTC
UIConstants.js and constants.js have different values:

UIConstants.js:
var COLOR_BUTTON_FOREGROUND            = "#000000" //text color
constants.js:
var COLOR_BUTTON_FOREGROUND = "#191919"; // Text color
Comment 18 Jonathan 2011-11-24 10:23:38 UTC
i am doing this under extras directory and find many files using constants.js
don't have a style file. should i add new style files or replace the constants
directly?
Comment 19 Carlos Martín (reporter) 2011-11-24 11:22:36 UTC
(In reply to comment #16)
> thanks for your reply.. another 2 more question
> 
> a) i find EditBubble.js include UIConstants.js, how could i get it work?

8 don't know!! :p . I need to investigate this. Depends of how EditBubble.js is
declared...

> b) constants.ini have value:
> FONT_DEFAULT_FAMILY = "Nokia Sans"
> but i don't find any file under fremantle use it.. is it useful?

There's a variable on UIConstants.js for font stuff. But yes, there's variables
that arent of use for qtcomponents. Exists becouse they were present on
original (meegotouch) constants file

> TextFileStyle.qml use FONT_FAMILY_LIGHT, should i change FONT_DEFAULT_FAMILY to
> FONT_FAMILY_LIGHT in constants.ini?

On constants.ini we shnould have:

FONT_FAMILY or FONT_DEFAULT_FAMILY which match FONT_FAMILY on UiConstants.js
FONT_DEFAULT_FAMILY_LIGHT or FONT_FAMILY_LIGHT which should match
FONT_FAMILY_LIGHT
Comment 20 Carlos Martín (reporter) 2011-11-24 11:29:30 UTC
(In reply to comment #17)
> UIConstants.js and constants.js have different values:
> 
> UIConstants.js:
> var COLOR_BUTTON_FOREGROUND            = "#000000" //text color
> constants.js:
> var COLOR_BUTTON_FOREGROUND = "#191919"; // Text color

Its on blanco's constants.ini file right? If so, it,s an iconsistence between
meegotouch blanco theme an nokia qtcomponents. Color is almost the same so let
it as is
Comment 21 Jonathan 2011-11-24 11:31:24 UTC
> > b) constants.ini have value:
> > FONT_DEFAULT_FAMILY = "Nokia Sans"
> > but i don't find any file under fremantle use it.. is it useful?
> 
> There's a variable on UIConstants.js for font stuff. But yes, there's variables
> that arent of use for qtcomponents. Exists becouse they were present on
> original (meegotouch) constants file
> 
> > TextFileStyle.qml use FONT_FAMILY_LIGHT, should i change FONT_DEFAULT_FAMILY to
> > FONT_FAMILY_LIGHT in constants.ini?
> 
> On constants.ini we shnould have:
> 
> FONT_FAMILY or FONT_DEFAULT_FAMILY which match FONT_FAMILY on UiConstants.js
> FONT_DEFAULT_FAMILY_LIGHT or FONT_FAMILY_LIGHT which should match
> FONT_FAMILY_LIGHT

oh, so i should add FONT_FAMILY_LIGHT & FONT_FAMILY_BOLD to constants.ini.
Comment 22 Jonathan 2011-11-24 11:33:18 UTC
(In reply to comment #20)
> (In reply to comment #17)
> > UIConstants.js and constants.js have different values:
> > 
> > UIConstants.js:
> > var COLOR_BUTTON_FOREGROUND            = "#000000" //text color
> > constants.js:
> > var COLOR_BUTTON_FOREGROUND = "#191919"; // Text color
> 
> Its on blanco's constants.ini file right? If so, it,s an iconsistence between
> meegotouch blanco theme an nokia qtcomponents. Color is almost the same so let
> it as is

i've checked constants.ini under base theme dir..

ok, i use the same COLOR_BUTTON_FOREGROUND from constants.ini..
Comment 23 Jonathan 2011-11-24 11:39:44 UTC
in extras dir, there are some values undifined in InfoBanner, e.g.
platformStyle.backgroundInteractive : platformStyle.backgroundNormal.

i don't know what's InfoBanner should look like. i can't see anything changed
when i tried QmlGalleryExtras/InfoBanner examples show on my N900..
Comment 24 Carlos Martín (reporter) 2011-11-24 12:35:16 UTC
(In reply to comment #18)
> i am doing this under extras directory and find many files using constants.js
> don't have a style file. should i add new style files or replace the constants
> directly?

if there's more than one variable to replace, yes
Comment 25 Carlos Martín (reporter) 2011-11-24 12:41:10 UTC
(In reply to comment #23)
> in extras dir, there are some values undifined in InfoBanner, e.g.
> platformStyle.backgroundInteractive : platformStyle.backgroundNormal.
> 
> i don't know what's InfoBanner should look like. i can't see anything changed
> when i tried QmlGalleryExtras/InfoBanner examples show on my N900..

right now InfoBanner is an hybrid with symbian version and it's a WIP so don't
worry too much about that component.I wll take care of that ;)
Comment 26 Jonathan 2011-11-24 17:23:42 UTC
Created an attachment (id=3434) [details]
commit 71004e69b103c3f125b0dddb89e6f714a85c9d04 constants.ini
Comment 27 Jonathan 2011-11-24 17:27:08 UTC
(From update of attachment 3434 [details])
i sent a merge request to your repo, and there's a new constants.ini needed.
Comment 28 Jonathan 2011-11-25 12:43:08 UTC
(In reply to comment #25)
> (In reply to comment #23)
> > in extras dir, there are some values undifined in InfoBanner, e.g.
> > platformStyle.backgroundInteractive : platformStyle.backgroundNormal.
> > 
> > i don't know what's InfoBanner should look like. i can't see anything changed
> > when i tried QmlGalleryExtras/InfoBanner examples show on my N900..
> 
> right now InfoBanner is an hybrid with symbian version and it's a WIP so don't
> worry too much about that component.I wll take care of that ;)

everything is ok under extras dir except InfoBanner component...

do you need me to change InfoBanner?
Comment 29 Jonathan 2011-11-25 12:45:59 UTC
Created an attachment (id=3435) [details]
commit 87449f6d5ab8d936562d74cd5b8ff0852c8a3895 constants.ini

for commit 87449f6d5ab8d936562d74cd5b8ff0852c8a3895 under my repo