Button and Toolbar iconsize
Posted: Tue Jun 07, 2011 1:52 pm
I found (I hope, the tests have given a positive answer) how to set the size of icons used for buttons and the toolbar.
Caution: as described in the documentation of the Qt library, you can only reduce the size.
Little brief from Nokia: "... the icons used must be at least of this size as the icons are only scaled down".
Here you can find more information http://doc.qt.nokia.com/4.7/qabstractit ... nSize-prop.
To achieve this goal, I had to move some pieces of source code from the "toolbar.prg" to "control.prg" to allow the same functionality as the definition of the dimension. Also, I removed some definitions (eg "cPicture") that were defined in both "toolbar.prg" and "toolbutton.prg" but already defined in "control.prg".
You can find these two new examples, which illustrate my update: "samples\button\demo_4.prg" and "samples\toolbar\demo_5.prg".
In particular, for the command "DEFINE BUTTON" I had to add a new command in the source "hmg.ch".
It is "IMAGESIZE w, h" which allows you (in the style HMG3/CLIPPER) to define the size of the icon in the button, with OOP you can use <:ImageWidth> AND <ImageHeight>.
ATTENTION: you must define both Width and Height of the icon ELSE the QT default management is used.
My commit is 632 and 633 (I loose the examples: I'm sorry).
Best regards
Caution: as described in the documentation of the Qt library, you can only reduce the size.
Little brief from Nokia: "... the icons used must be at least of this size as the icons are only scaled down".
Here you can find more information http://doc.qt.nokia.com/4.7/qabstractit ... nSize-prop.
To achieve this goal, I had to move some pieces of source code from the "toolbar.prg" to "control.prg" to allow the same functionality as the definition of the dimension. Also, I removed some definitions (eg "cPicture") that were defined in both "toolbar.prg" and "toolbutton.prg" but already defined in "control.prg".
You can find these two new examples, which illustrate my update: "samples\button\demo_4.prg" and "samples\toolbar\demo_5.prg".
In particular, for the command "DEFINE BUTTON" I had to add a new command in the source "hmg.ch".
It is "IMAGESIZE w, h" which allows you (in the style HMG3/CLIPPER) to define the size of the icon in the button, with OOP you can use <:ImageWidth> AND <ImageHeight>.
ATTENTION: you must define both Width and Height of the icon ELSE the QT default management is used.
My commit is 632 and 633 (I loose the examples: I'm sorry).
Best regards