commit 0fa8770a5566743737ef2812d1f4e6c04d968cda Author: Slávek Banko Date: Tue Apr 5 02:46:02 2016 +0200 Initial import of kde-style-domino 0.4 diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..9f465c8 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,3 @@ +Michael Lentner +based on the KDE style Plastik: +Sandro Giessl diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..96bdc08 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/COPYING.LIB b/COPYING.LIB new file mode 100644 index 0000000..b6bd517 --- /dev/null +++ b/COPYING.LIB @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..6c4f802 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,39 @@ + +0.4 +* new option for indented / non indented menu items +* new option for highlighted tool button icons on mouse over +* the button look for tool(bar) buttons is now optional +* new rubberband options +* smaller tabWidget margins +* respects Gwenview's / Kicker's taskbar applet / Konversation's own mousewheel handling for scrollviews +* clipped popup menu edges, for a better look with KWin's shadows (Beryl seems not to support it). +* fixes pixmaps on PowerPC architecture +* fixes functionality of some popup QToolButtons and adapts their look and behavior to KToolBarButtons +* the content of popup menus with a side pixmap is visible again (Amarok, Digikam) +* adapts KMenu's section header style +* fixes Kickoff's tab icon alignment +* fixes possible crash with enabled text effect +* lets apps using their own label colors on tabs (if they're not defaulting to a fixed color like konsole) +* decoration: option "dark window frame" draws a darker frame +* decoration: borders are hidden when in maximized mode and moving / resizing of maximized windows is not allowed. + + +0.3 +* decoration buttons on inactive windows are now visible if the mouse is over the titlebar +* a new thinner contour for the buttons (raised and sunken) +* different button contour colors for mousehover, pressed and default states +* mouseclick on LineEdits hides the cursor +* disabled toolButtons in non KDE applications are now drawn grayed out and with 50 % reduced transparency +* buttons respect background pixmaps +* text effect option +* animated progressbar +* configurable groupbox background color +* configurable selected popupmenu item color +* deactivatable popupmenu gradient +* faster smooth scrolling +* it's now possible to switch tabs with the mousewheel +* colors can now be drag between the tabs in the configurations dialog +* disables popupmenu (fake) transparency (they are cheap and broken) +* some speed improvements, especially the groupbox +* fixes mousewheel not switching desktops +* fixes diverse crashes diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..28fadaa --- /dev/null +++ b/INSTALL @@ -0,0 +1,181 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..55d4b5d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,11 @@ + +AUTOMAKE_OPTIONS = foreign 1.5 +DISTCLEANFILES = inst-apps +MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files + +include admin/deps.am + +include admin/Doxyfile.am + +#SUBDIRS=$(TOPSUBDIRS) +SUBDIRS = domino dominoConfig client diff --git a/Makefile.cvs b/Makefile.cvs new file mode 100644 index 0000000..4c0afd1 --- /dev/null +++ b/Makefile.cvs @@ -0,0 +1,10 @@ +all: + @echo "This Makefile is only for the CVS repository" + @echo "This will be deleted before making the distribution" + @echo "" + $(MAKE) -f admin/Makefile.common cvs + +dist: + $(MAKE) -f admin/Makefile.common dist + +.SILENT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/client/Makefile.am b/client/Makefile.am new file mode 100644 index 0000000..3ee503b --- /dev/null +++ b/client/Makefile.am @@ -0,0 +1,16 @@ + +INCLUDES = $(all_includes) -I$(kde_includes)/kwin + +SUBDIRS = . config + +kde_module_LTLIBRARIES = kwin3_domino.la + +kwin3_domino_la_SOURCES = dominoclient.cpp +kwin3_domino_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -L/usr/X11R6/lib +kwin3_domino_la_LIBADD = $(LIB_KDECORE) $(kde_libraries)/libkdecorations.la -lXext -lX11 $(LIB_QT) + +METASOURCES = AUTO +noinst_HEADERS = dominoclient.h + +lnkdir = $(kde_datadir)/kwin +lnk_DATA = domino.desktop diff --git a/client/clientData.h b/client/clientData.h new file mode 100644 index 0000000..d777214 --- /dev/null +++ b/client/clientData.h @@ -0,0 +1,237 @@ +/* + Copyright (C) 2006 Michael Lentner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + + +#ifndef _QEMBED_CLIENTDATA +#define _QEMBED_CLIENTDATA +#include +#include +static const QRgb client_bottom_lines_dark_data[] = { + 0x18000000,0x18000000,0x18000000,0x18000000,0x18000000,0x18000000,0x18000000,0x18000000,0x18000000,0x18000000,0x44000000,0x44000000,0x44000000,0x44000000, + 0x44000000,0x44000000,0x44000000,0x44000000,0x44000000,0x44000000 +}; + +/* Generated by qembed */ +static const QRgb client_bottomLines_data[] = { + 0x6000000,0x6000000,0x6000000,0x6000000,0x6000000,0x6000000,0x6000000,0x6000000,0x6000000,0x6000000,0x13000000,0x13000000,0x13000000,0x13000000, + 0x13000000,0x13000000,0x13000000,0x13000000,0x13000000,0x13000000 +}; + +static const QRgb clientButtonContour_data[] = { + 0x0,0x0,0x0,0x0,0x2000000,0x9000000,0xe000000,0xf000000,0xf000000,0xe000000,0x9000000,0x2000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0x7000000,0x27000000,0x8c000000,0xc4000000,0xc9000000,0xc9000000,0xc4000000,0x8c000000,0x27000000, + 0x7000000,0x1000000,0x0,0x0,0x0,0x0,0xa000000,0x64000000,0xca000000,0x6a000000,0x1b000000,0xf000000,0xf000000,0x1b000000, + 0x6a000000,0xca000000,0x64000000,0xa000000,0x1000000,0x0,0x0,0x7000000,0x5f000000,0xb5000000,0x23000000,0x8000000,0x1000000,0x0, + 0x0,0x1000000,0x8000000,0x23000000,0xb5000000,0x5f000000,0x7000000,0x0,0x2000000,0x20000000,0xbd000000,0x1e000000,0x3000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x3000000,0x1e000000,0xbd000000,0x20000000,0x2000000,0x9000000,0x88000000,0x62000000,0x7000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7000000,0x62000000,0x88000000,0x9000000,0xe000000,0xc2000000, + 0x1a000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x1a000000,0xc2000000,0xe000000, + 0xf000000,0xc9000000,0xf000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf000000, + 0xc9000000,0xf000000,0xf000000,0xc9000000,0xf000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0xf000000,0xc9000000,0xf000000,0xe000000,0xc2000000,0x19000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1000000,0x19000000,0xc2000000,0xe000000,0x9000000,0x88000000,0x62000000,0x7000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x7000000,0x62000000,0x88000000,0x9000000,0x2000000,0x20000000,0xbd000000,0x1e000000,0x3000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x3000000,0x1e000000,0xbd000000,0x20000000,0x2000000,0x0,0x7000000,0x5f000000,0xb5000000, + 0x23000000,0x7000000,0x1000000,0x0,0x0,0x1000000,0x7000000,0x23000000,0xb5000000,0x5f000000,0x7000000,0x0,0x0,0x1000000, + 0xa000000,0x64000000,0xca000000,0x6a000000,0x1b000000,0xf000000,0xf000000,0x1b000000,0x6a000000,0xca000000,0x64000000,0xa000000,0x1000000,0x0, + 0x0,0x0,0x1000000,0x7000000,0x27000000,0x8c000000,0xc4000000,0xc9000000,0xc9000000,0xc4000000,0x8c000000,0x27000000,0x7000000,0x1000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x9000000,0xe000000,0xf000000,0xf000000,0xe000000,0x9000000,0x2000000, + 0x0,0x0,0x0,0x0 +}; + +static const QRgb clientButtonPressed_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xb151515,0x400b0b0b,0x420d0d0d,0x420d0d0d,0x41090909,0xb151515,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x39131313,0x6d010101,0x68000000,0x62000000,0x62000000,0x67000000, + 0x70000000,0x50070707,0x1000000,0x0,0x0,0x0,0x0,0x0,0x1000000,0x5a040404,0x62000000,0x51000000,0x44000000,0x3e000000, + 0x3d000000,0x43000000,0x4e000000,0x5f000000,0x51070707,0x1000000,0x0,0x0,0x0,0x0,0x3d0b0b0b,0x5a000000,0x42000000,0x32000000, + 0x27000000,0x24000000,0x24000000,0x26000000,0x30000000,0x41000000,0x58000000,0x45060606,0x0,0x0,0x0,0x91a1a1a,0x5e000000,0x41000000, + 0x2b000000,0x1e000000,0x18000000,0x16000000,0x15000000,0x18000000,0x1d000000,0x29000000,0x40000000,0x5b000000,0x12000000,0x0,0x0,0x28090909, + 0x4a000000,0x2e000000,0x1b000000,0x14000000,0x11000000,0x10000000,0x10000000,0x10000000,0x13000000,0x1b000000,0x2c000000,0x49000000,0x31040404,0x0, + 0x0,0x33050505,0x3d000000,0x22000000,0x14000000,0xf000000,0xd000000,0xd000000,0xd000000,0xd000000,0xe000000,0x14000000,0x21000000,0x3c000000, + 0x2d070707,0x0,0x0,0x2f040404,0x34000000,0x1b000000,0xf000000,0xb000000,0xa000000,0xa000000,0xa000000,0xa000000,0xb000000,0xf000000, + 0x1b000000,0x34000000,0x2a050505,0x0,0x0,0x2d020202,0x32000000,0x18000000,0xc000000,0x9000000,0x8000000,0x8000000,0x8000000,0x8000000, + 0x9000000,0xd000000,0x19000000,0x33000000,0x28020202,0x0,0x0,0x14000000,0x35000000,0x1a000000,0xc000000,0x7000000,0x6000000,0x6000000, + 0x6000000,0x6000000,0x7000000,0xd000000,0x1b000000,0x37000000,0xf000000,0x0,0x0,0x0,0x2b000000,0x23000000,0x12000000,0xa000000, + 0x7000000,0x6000000,0x6000000,0x7000000,0xa000000,0x13000000,0x24000000,0x29000000,0x0,0x0,0x0,0x0,0x1000000,0x26000000, + 0x1e000000,0x12000000,0xc000000,0xa000000,0xa000000,0xc000000,0x13000000,0x1f000000,0x25000000,0x1000000,0x0,0x0,0x0,0x0, + 0x0,0x2000000,0x23000000,0x23000000,0x1b000000,0x16000000,0x16000000,0x1b000000,0x24000000,0x23000000,0x1000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x8000000,0x1c000000,0x19000000,0x19000000,0x1b000000,0x7000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0 +}; + +static const QRgb clientButtonShadow_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x16fdfdfd,0x52fdfdfd,0x6ffdfdfd,0x6ffdfdfd,0x50fdfdfd,0x16fdfdfd,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xafdfdfd,0x7bfcfcfc,0x78fdfdfd,0x65ffffff,0x6ffdfdfd,0x6ffdfdfd,0x65ffffff, + 0x77fdfdfd,0x7afdfdfd,0x9fdfdfd,0x0,0x0,0x0,0x0,0x0,0xcfdfdfd,0x7bfdfdfd,0x69fdfdfd,0x4cfcfcfc,0x40ffffff,0x3bffffff, + 0x3bffffff,0x40ffffff,0x4bffffff,0x69fdfdfd,0x7afcfcfc,0x9fdfdfd,0x0,0x0,0x0,0x3ffffff,0x66fcfcfc,0x58ffffff,0x37fcfcfc,0x2dffffff, + 0x2bffffff,0x2bffffff,0x2bffffff,0x2bffffff,0x2dfbfbfb,0x37ffffff,0x58fcfcfc,0x64fdfdfd,0x3ffffff,0x0,0x0,0x25fdfdfd,0x50f9f9f9,0x32fafafa, + 0x26f8f8f8,0x25f8f8f8,0x25f8f8f8,0x25f8f8f8,0x25f8f8f8,0x25f8f8f8,0x25f8f8f8,0x26f8f8f8,0x31fafafa,0x51f9f9f9,0x20fdfdfd,0x0,0x4bfbfbf,0x69fafafa, + 0x3cf1f1f1,0x22e8e8e8,0x20e7e7e7,0x20e7e7e7,0x20e7e7e7,0x20e7e7e7,0x20e7e7e7,0x20e7e7e7,0x20e7e7e7,0x20e7e7e7,0x22e8e8e8,0x3cf3f3f3,0x66fafafa,0x3ffffff, + 0xcffffff,0x8cfcfcfc,0x2fe5e5e5,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x1acdcdcd,0x2fe5e5e5, + 0x8afbfbfb,0xaffffff,0x12f2f2f2,0x91f8f8f8,0x29d6d6d6,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa,0x15aaaaaa, + 0x15aaaaaa,0x28d7d7d7,0x91f8f8f8,0x10f0f0f0,0x12f2f2f2,0x81f8f8f8,0x2acdcdcd,0x11777777,0x106f6f6f,0x106f6f6f,0x106f6f6f,0x106f6f6f,0x106f6f6f,0x106f6f6f, + 0x106f6f6f,0x106f6f6f,0x11777777,0x2bcecece,0x80f8f8f8,0x10f0f0f0,0xcffffff,0x5cf8f8f8,0x31cacaca,0x167f7f7f,0xc151515,0xb000000,0xb000000,0xb000000, + 0xb000000,0xb000000,0xb000000,0xc151515,0x168b8b8b,0x37d5d5d5,0x55f8f8f8,0xbe9e9e9,0x4ffffff,0x32fafafa,0x78f2f2f2,0x24a8a8a8,0x17777777,0xe121212, + 0xd000000,0xd000000,0xd000000,0xd000000,0xe121212,0x17797979,0x25ababab,0x7df3f3f3,0x2bffffff,0x3ffffff,0x0,0x15f3f3f3,0x66fcfcfc,0x64e9e9e9, + 0x29acacac,0x1e858585,0x19707070,0x143f3f3f,0x143f3f3f,0x196e6e6e,0x1e858585,0x2aadadad,0x6debebeb,0x63f9f9f9,0x12ffffff,0x0,0x0,0x3ffffff, + 0x26ffffff,0x7afafafa,0x7ff1f1f1,0x3cc4c4c4,0x30adadad,0x2ba6a6a6,0x2ba4a4a4,0x30afafaf,0x3ec3c3c3,0x84f1f1f1,0x77fafafa,0x22ffffff,0x3ffffff,0x0, + 0x0,0x0,0x5ffffff,0x27f9f9f9,0x52fcfcfc,0x80f9f9f9,0x96f6f6f6,0x85f2f2f2,0x86f2f2f2,0x97f6f6f6,0x81fafafa,0x4ffcfcfc,0x20f8f8f8,0x4ffffff, + 0x0,0x0,0x0,0x0,0x0,0x4bfbfbf,0xeffffff,0x32fafafa,0x3ffcfcfc,0x50fcfcfc,0x4ffcfcfc,0x3ffcfcfc,0x2ffafafa,0xef2f2f2, + 0x3ffffff,0x0,0x0,0x0 +}; + +static const QRgb client_close_6x6_data[] = { + 0x6c2a2a2a,0x6b2a2a2a,0x0,0x0,0x6b2a2a2a,0x702a2a2a,0x7b2a2a2a,0xd62a2a2a,0x5c2a2a2a,0x792a2a2a,0xd62a2a2a,0x782a2a2a,0x0,0x7b2a2a2a, + 0xd62a2a2a,0xd62a2a2a,0x782a2a2a,0x0,0x0,0x7b2a2a2a,0xd62a2a2a,0xd62a2a2a,0x782a2a2a,0x0,0x7b2a2a2a,0xd62a2a2a,0x782a2a2a,0x5e2a2a2a, + 0xd62a2a2a,0x782a2a2a,0x6c2a2a2a,0x782a2a2a,0x0,0x0,0x5e2a2a2a,0x6c2a2a2a +}; + +static const QRgb client_dot_4x4_data[] = { + 0x422a2a2a,0x9b2a2a2a,0x9b2a2a2a,0x422a2a2a,0x9b2a2a2a,0xb02a2a2a,0xb02a2a2a,0x9b2a2a2a,0x9b2a2a2a,0xb02a2a2a,0xb02a2a2a,0x9b2a2a2a,0x422a2a2a,0x9b2a2a2a, + 0x9b2a2a2a,0x422a2a2a +}; + +static const QRgb client_edges_dark_data[] = { + 0x0,0x0,0x0,0x34000000,0x35000000,0x35000000,0x34000000,0x0,0x0,0x0,0x0,0x0,0x34000000,0x2b000000, + 0xe000000,0xe000000,0x2b000000,0x34000000,0x0,0x0,0x0,0x39000000,0x23000000,0x10000000,0x3000000,0x3000000,0x10000000,0x23000000, + 0x39000000,0x0,0x3000000,0x38000000,0x11000000,0x3000000,0x0,0x0,0x3000000,0x11000000,0x38000000,0x3000000,0x34000000,0x2a000000, + 0x5000000,0x1000000,0x0,0x0,0x1000000,0x5000000,0x2a000000,0x34000000,0x35000000,0x1e000000,0x3000000,0x0,0x0,0x0, + 0x0,0x3000000,0x1e000000,0x35000000,0x37000000,0x20000000,0x3000000,0x0,0x0,0x0,0x0,0x3000000,0x20000000,0x37000000, + 0x38000000,0x2c000000,0x6000000,0x1000000,0x0,0x0,0x1000000,0x6000000,0x2c000000,0x38000000,0x4000000,0x3d000000,0x13000000,0x3000000, + 0x0,0x0,0x3000000,0x13000000,0x3d000000,0x4000000,0x0,0x40000000,0x28000000,0x13000000,0x4000000,0x4000000,0x13000000,0x28000000, + 0x40000000,0x0,0x0,0x0,0x41000000,0x36000000,0x12000000,0x12000000,0x36000000,0x41000000,0x0,0x0,0x0,0x0, + 0x0,0x41000000,0x44000000,0x44000000,0x41000000,0x0,0x0,0x0 +}; + +static const QRgb client_edges_data[] = { + 0x0,0x0,0x0,0x2fffffff,0x31ffffff,0x31ffffff,0x2fffffff,0x0,0x0,0x0,0x0,0x0,0x2effffff,0x25ffffff, + 0x11ffffff,0x11ffffff,0x25ffffff,0x2effffff,0x0,0x0,0x0,0x34ffffff,0x1fffffff,0xeffffff,0x3ffffff,0x3ffffff,0xeffffff,0x1fffffff, + 0x34ffffff,0x0,0x2ffffff,0x33ffffff,0xeffffff,0x3ffffff,0x0,0x0,0x3ffffff,0xeffffff,0x33ffffff,0x2ffffff,0x2fffffff,0x1fffffff, + 0x4ffffff,0x1ffffff,0x0,0x0,0x1ffffff,0x4ffffff,0x1fffffff,0x2fffffff,0x2dffffff,0x12ffffff,0x2ffffff,0x0,0x0,0x0, + 0x0,0x2ffffff,0x12ffffff,0x2dffffff,0x27ebebeb,0x18f5f5f5,0x3ffffff,0x0,0x0,0x0,0x0,0x3ffffff,0x18f5f5f5,0x27ebebeb, + 0x28e5e5e5,0x1bcacaca,0x6ffffff,0x1ffffff,0x0,0x0,0x1ffffff,0x6ffffff,0x1bcacaca,0x28e5e5e5,0x1000000,0x1c888888,0xbb9b9b9,0x3ffffff, + 0x0,0x0,0x3ffffff,0xbb9b9b9,0x1c888888,0x1000000,0x0,0x1d838383,0x11696969,0xab2b2b2,0x4ffffff,0x4ffffff,0xab2b2b2,0x11696969, + 0x1d838383,0x0,0x0,0x0,0x12000000,0x15616161,0xcaaaaaa,0xcaaaaaa,0x15616161,0x12000000,0x0,0x0,0x0,0x0, + 0x0,0x12000000,0x13000000,0x13000000,0x12000000,0x0,0x0,0x0 +}; + +static const QRgb client_help_5x8_data[] = { + 0x22a2a2a,0x772a2a2a,0xc22a2a2a,0xbd2a2a2a,0x302a2a2a,0x3b2a2a2a,0xd22a2a2a,0x612a2a2a,0x862a2a2a,0xbd2a2a2a,0x22a2a2a,0x22a2a2a,0x0,0x5b2a2a2a, + 0xba2a2a2a,0x0,0x0,0x462a2a2a,0xbd2a2a2a,0x3e2a2a2a,0x0,0x0,0xd12a2a2a,0x682a2a2a,0x0,0x0,0x0,0x542a2a2a, + 0x2a2a2a2a,0x0,0x0,0x0,0xb82a2a2a,0x5b2a2a2a,0x0,0x0,0x0,0x262a2a2a,0x82a2a2a,0x0 +}; + +static const QRgb client_line_6x2_data[] = { + 0x852a2a2a,0xbe2a2a2a,0xbe2a2a2a,0xbe2a2a2a,0xbe2a2a2a,0x852a2a2a,0x432a2a2a,0x5f2a2a2a,0x5f2a2a2a,0x5f2a2a2a,0x5f2a2a2a,0x432a2a2a +}; + +static const QRgb client_max_8x8_data[] = { + 0x0,0x0,0x0,0x852a2a2a,0x442a2a2a,0x0,0x0,0x0,0x0,0x0,0x0,0xbe2a2a2a,0x602a2a2a,0x0, + 0x0,0x0,0x12a2a2a,0x12a2a2a,0x0,0xbe2a2a2a,0x602a2a2a,0x0,0x0,0x0,0x852a2a2a,0xbe2a2a2a,0xbe2a2a2a,0xbe2a2a2a, + 0xbe2a2a2a,0xbe2a2a2a,0xbe2a2a2a,0x852a2a2a,0x442a2a2a,0x602a2a2a,0x602a2a2a,0xbe2a2a2a,0x902a2a2a,0x622a2a2a,0x632a2a2a,0x452a2a2a,0x0,0x0, + 0x0,0xbd2a2a2a,0x602a2a2a,0x0,0x0,0x0,0x0,0x0,0x0,0xbd2a2a2a,0x612a2a2a,0x0,0x0,0x0, + 0x0,0x0,0x0,0x852a2a2a,0x442a2a2a,0x0,0x0,0x0 +}; + +static const QRgb client_right_lines2_data[] = { + 0xfffffff,0x24ffffff,0xfffffff,0x24ffffff,0xfffffff,0x24ffffff,0xfffffff,0x24ffffff,0xfffffff,0x24ffffff,0xfffffff,0x24ffffff,0xfffffff,0x24ffffff, + 0xfffffff,0x24ffffff,0xfffffff,0x24ffffff,0xfffffff,0x24ffffff +}; + +static const QRgb client_right_lines_dark_data[] = { + 0x19000000,0x36000000,0x19000000,0x36000000,0x19000000,0x36000000,0x19000000,0x36000000,0x19000000,0x36000000,0x19000000,0x36000000,0x19000000,0x36000000, + 0x19000000,0x36000000,0x19000000,0x36000000,0x19000000,0x36000000 +}; + +static const QRgb client_topLines2_data[] = { + 0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x39ffffff,0x11ffffff,0x11ffffff,0x11ffffff,0x11ffffff, + 0x11ffffff,0x11ffffff,0x11ffffff,0x11ffffff,0x11ffffff,0x11ffffff +}; + +static const QRgb client_top_lines_dark_data[] = { + 0x36000000,0x36000000,0x36000000,0x36000000,0x36000000,0x36000000,0x36000000,0x36000000,0x36000000,0x36000000,0x13000000,0x13000000,0x13000000,0x13000000, + 0x13000000,0x13000000,0x13000000,0x13000000,0x13000000,0x13000000 +}; + +static const QRgb client_upArrow_6x8_data[] = { + 0x0,0x0,0x492a2a2a,0x142a2a2a,0x0,0x0,0x0,0x4a2a2a2a,0xb92a2a2a,0xa82a2a2a,0x1e2a2a2a,0x0,0x572a2a2a,0xb92a2a2a, + 0xb92a2a2a,0xb82a2a2a,0xac2a2a2a,0x1d2a2a2a,0x0,0x0,0xb92a2a2a,0x5c2a2a2a,0x0,0x0,0x0,0x0,0xb92a2a2a,0x5c2a2a2a, + 0x0,0x0,0x0,0x0,0xb92a2a2a,0x5c2a2a2a,0x0,0x0,0x0,0x0,0xb92a2a2a,0x5c2a2a2a,0x0,0x0, + 0x0,0x0,0x812a2a2a,0x402a2a2a,0x0,0x0 +}; + + +static struct EmbedImage { + int width, height, depth; + const unsigned char *data; + int numColors; + const QRgb *colorTable; + bool alpha; + const char *name; +} embed_image_vec[] = { + { 10, 2, 32, (const unsigned char*)client_bottom_lines_dark_data, 0, 0, TRUE, "client_bottomLines_dark" }, + { 10, 2, 32, (const unsigned char*)client_bottomLines_data, 0, 0, TRUE, "client_bottomLines" }, + { 16, 16, 32, (const unsigned char*)clientButtonContour_data, 0, 0, TRUE, "clientButtonContour" }, + { 16, 16, 32, (const unsigned char*)clientButtonPressed_data, 0, 0, TRUE, "clientButtonPressed" }, + { 16, 16, 32, (const unsigned char*)clientButtonShadow_data, 0, 0, TRUE, "clientButtonShadow" }, + { 6, 6, 32, (const unsigned char*)client_close_6x6_data, 0, 0, TRUE, "closeButtonIcon" }, + { 4, 4, 32, (const unsigned char*)client_dot_4x4_data, 0, 0, TRUE, "onAllDesktopsButtonIcon" }, + { 10, 12, 32, (const unsigned char*)client_edges_dark_data, 0, 0, TRUE, "client_edges_dark" }, + { 10, 12, 32, (const unsigned char*)client_edges_data, 0, 0, TRUE, "client_edges" }, + { 5, 8, 32, (const unsigned char*)client_help_5x8_data, 0, 0, TRUE, "helpButtonIcon" }, + { 6, 2, 32, (const unsigned char*)client_line_6x2_data, 0, 0, TRUE, "minButtonIcon" }, + { 8, 8, 32, (const unsigned char*)client_max_8x8_data, 0, 0, TRUE, "maxButtonIcon" }, + { 2, 10, 32, (const unsigned char*)client_right_lines2_data, 0, 0, TRUE, "client_rightLines" }, + { 2, 10, 32, (const unsigned char*)client_right_lines_dark_data, 0, 0, TRUE, "client_rightLines_dark" }, + { 10, 2, 32, (const unsigned char*)client_topLines2_data, 0, 0, TRUE, "client_topLines" }, + { 10, 2, 32, (const unsigned char*)client_top_lines_dark_data, 0, 0, TRUE, "client_topLines_dark" }, + { 6, 8, 32, (const unsigned char*)client_upArrow_6x8_data, 0, 0, TRUE, "aboveButtonIcon" }, + { 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const QImage& qembed_findImage( const QString& name ) +{ + static QDict dict; + QImage* img = dict.find( name ); + if ( !img ) { + for ( int i = 0; embed_image_vec[i].data; i++ ) { + if ( strcmp(embed_image_vec[i].name, name.latin1()) == 0 ) { + img = new QImage((uchar*)embed_image_vec[i].data, + embed_image_vec[i].width, + embed_image_vec[i].height, + embed_image_vec[i].depth, + (QRgb*)embed_image_vec[i].colorTable, + embed_image_vec[i].numColors, + QImage::BigEndian ); + if ( embed_image_vec[i].alpha ) + img->setAlphaBuffer( TRUE ); + dict.insert( name, img ); + break; + } + } + if ( !img ) { + static QImage dummy; + return dummy; + } + } + return *img; +} + +#endif diff --git a/client/config/Makefile.am b/client/config/Makefile.am new file mode 100644 index 0000000..d33a23e --- /dev/null +++ b/client/config/Makefile.am @@ -0,0 +1,10 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = kwin_domino_config.la + +kwin_domino_config_la_SOURCES = config.cpp +kwin_domino_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kwin_domino_config_la_LIBADD = $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE) + +METASOURCES = AUTO +noinst_HEADERS = config.h diff --git a/client/config/config.cpp b/client/config/config.cpp new file mode 100644 index 0000000..d7648f0 --- /dev/null +++ b/client/config/config.cpp @@ -0,0 +1,288 @@ +/* + Copyright (C) 2006 Michael Lentner + + based on KDE2 Default configuration widget: + Copyright (c) 2001 + Karol Szwed + http://gallium.n3.net/ + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include +#include +#include +#include +#include +#include +#include + +extern "C" +{ + KDE_EXPORT QObject* allocate_config( KConfig* config, QWidget* parent ) + { + return(new DominoConfig(config, parent)); + } +} + +// NOTE: +// 'config' is a pointer to the kwindecoration modules open kwin config, +// and is by default set to the "Style" group. +// 'parent' is the parent of the QObject, which is a VBox inside the +// Configure tab in kwindecoration + +DominoConfig::DominoConfig( KConfig* config, QWidget* parent ) + : QObject( parent ) +{ + conf = new KConfig("kwindominorc"); + + KGlobal::locale()->insertCatalogue("kwin_clients"); + + vBox = new QVBox( parent ); + + customBorderColor = new QCheckBox( i18n("Custom border color"), vBox ); + QHBox *hbox1 = new QHBox(vBox); + hbox1->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + borderColor = new KColorButton(hbox1); + + customButtonColor = new QCheckBox( i18n("Custom button color"), vBox ); + QHBox *hbox2 = new QHBox(vBox); + hbox2->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + buttonColor = new KColorButton(hbox2); + + customButtonIconColor = new QCheckBox( i18n("Custom button icon color"), vBox ); + QHBox *hbox3 = new QHBox(vBox); + hbox3->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + buttonIconColor = new KColorButton(hbox3); + + customGradientColors = new QCheckBox( i18n("Custom gradient colors"), vBox); + QHBox *hbox4 = new QHBox(vBox); + hbox4->layout()->addItem(new QSpacerItem(22, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + QVBox *vbox1 = new QVBox(hbox4); + new QLabel( i18n("Top gradient color"), vbox1); + topGradientColor = new KColorButton(vbox1); + new QLabel(i18n("Bottom gradient color"), vbox1); + bottomGradientColor = new KColorButton(vbox1); + + showInactiveButtons = new QCheckBox( i18n("Show inactive buttons"), vBox ); + showButtonIcons = new QCheckBox( i18n("Show button icons"), vBox ); + darkFrame = new QCheckBox( i18n("Dark window frame"), vBox ); + + + /////////////////////////////////////// + + + QGroupBox* colorGb = new QGroupBox(vBox); + colorGb->setTitle(i18n("Button contour colors:")); + colorGb->setColumnLayout(0, Qt::Vertical ); + colorGb->layout()->setSpacing( 6 ); + colorGb->layout()->setMargin( 11 ); + + QGridLayout* gbLayout = new QGridLayout( colorGb->layout(), 4, 2 ); + gbLayout->setAlignment( Qt::AlignTop ); + + QLabel* labelSC = new QLabel(i18n("Standard color:"), colorGb); + buttonContourColor = new KColorButton(colorGb); + buttonContourColor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + QLabel* labelMC = new QLabel(i18n("Mouseover color:"), colorGb); + buttonMouseOverContourColor = new KColorButton(colorGb); + QLabel* labelPC = new QLabel(i18n("Pressed color:"), colorGb); + buttonPressedContourColor = new KColorButton(colorGb); + + useDominoStyleContourColors = new QCheckBox( i18n("Use domino style contour colors"), colorGb ); + gbLayout->addMultiCellWidget(useDominoStyleContourColors, 0, 0, 0, 1); + + gbLayout->addWidget(labelSC, 1, 0); + gbLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Minimum) ); + gbLayout->addWidget(buttonContourColor, 1, 1); + + gbLayout->addWidget(labelMC, 2, 0); + gbLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Minimum) ); + gbLayout->addWidget(buttonMouseOverContourColor, 2, 1); + + gbLayout->addWidget(labelPC, 3, 0); + gbLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Minimum) ); + gbLayout->addWidget(buttonPressedContourColor, 3, 1); + + + + + + + + + + /////////////////////////////////////// + + // Load configuration options + load(config); + + // Ensure we track user changes properly + connect(customGradientColors, SIGNAL(toggled(bool)), topGradientColor, SLOT(setEnabled(bool))); + connect(customGradientColors, SIGNAL(toggled(bool)), bottomGradientColor, SLOT(setEnabled(bool))); + + connect(customBorderColor, SIGNAL(toggled(bool)), borderColor, SLOT(setEnabled(bool))); + connect(customButtonColor, SIGNAL(toggled(bool)), buttonColor, SLOT(setEnabled(bool))); + connect(customButtonIconColor, SIGNAL(toggled(bool)), buttonIconColor, SLOT(setEnabled(bool))); + + connect(customGradientColors, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(topGradientColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + connect(bottomGradientColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + + + connect(customBorderColor, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(borderColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + + connect(customButtonColor, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(buttonColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + connect(customButtonIconColor, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(buttonIconColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + + connect(showInactiveButtons, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(showButtonIcons, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(darkFrame, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + + connect(useDominoStyleContourColors, SIGNAL(clicked()), this, SLOT(loadButtonContourColors())); + connect(useDominoStyleContourColors, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(buttonContourColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + connect(buttonMouseOverContourColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + connect(buttonPressedContourColor, SIGNAL(changed(const QColor&)), this, SLOT(slotSelectionChanged())); + + + // Make the widgets visible in kwindecoration valueChanged + vBox->show(); +} + + +DominoConfig::~DominoConfig() +{ + delete vBox; + delete conf; +} + + +void DominoConfig::slotSelectionChanged() +{ + emit changed(); +} + + +// Loads the configurable options from the kwinrc config file +// It is passed the open config from kwindecoration to improve efficiency +void DominoConfig::load(KConfig*) +{ + conf->setGroup("General"); + + customBorderColor->setChecked(conf->readBoolEntry("customBorderColor", true)); + borderColor->setEnabled(customBorderColor->isChecked()); + borderColor->setColor(conf->readEntry("borderColor", "#777B7F")); + customButtonColor->setChecked(conf->readBoolEntry( "customButtonColor", false)); + buttonColor->setEnabled(customButtonColor->isChecked()); + buttonColor->setColor(conf->readEntry("buttonColor", "#212121")); + customButtonIconColor->setChecked(conf->readBoolEntry( "customButtonIconColor", false)); + buttonIconColor->setEnabled(customButtonIconColor->isChecked()); + buttonIconColor->setColor(conf->readEntry("buttonIconColor", "#000000")); + + customGradientColors->setChecked(conf->readBoolEntry( "customGradientColors", false)); + topGradientColor->setEnabled(customGradientColors->isChecked()); + bottomGradientColor->setEnabled(customGradientColors->isChecked()); + topGradientColor->setColor(conf->readEntry("topGradientColor", "#ffffff")); + bottomGradientColor->setColor(conf->readEntry("bottomGradientColor", "#000000")); + + showInactiveButtons->setChecked(conf->readBoolEntry("showInactiveButtons", false)); + showButtonIcons->setChecked(conf->readBoolEntry("showButtonIcons", false)); + darkFrame->setChecked(conf->readBoolEntry("darkFrame", false)); + + useDominoStyleContourColors->setChecked(conf->readBoolEntry("useDominoStyleContourColors", true)); + + loadButtonContourColors(); + +} + + +// Saves the configurable options to the kwinrc config file +void DominoConfig::save(KConfig*) +{ + conf->setGroup("General"); + + conf->writeEntry("customBorderColor", customBorderColor->isChecked()); + conf->writeEntry("borderColor", borderColor->color().name()); + conf->writeEntry("customButtonColor", customButtonColor->isChecked()); + conf->writeEntry("buttonColor", buttonColor->color().name()); + conf->writeEntry("customButtonIconColor", customButtonIconColor->isChecked()); + conf->writeEntry("buttonIconColor", buttonIconColor->color().name()); + conf->writeEntry("showInactiveButtons", showInactiveButtons->isChecked()); + conf->writeEntry("showButtonIcons", showButtonIcons->isChecked()); + + conf->writeEntry("customGradientColors", customGradientColors->isChecked()); + conf->writeEntry("topGradientColor", topGradientColor->color().name()); + conf->writeEntry("bottomGradientColor", bottomGradientColor->color().name()); + conf->writeEntry("darkFrame", darkFrame->isChecked()); + + conf->writeEntry("useDominoStyleContourColors", useDominoStyleContourColors->isChecked()); + conf->writeEntry("buttonContourColor", buttonContourColor->color().name()); + conf->writeEntry("buttonMouseOverContourColor", buttonMouseOverContourColor->color().name()); + conf->writeEntry("buttonPressedContourColor", buttonPressedContourColor->color().name()); + + conf->sync(); +} + + +// Sets UI widget defaults which must correspond to style defaults +void DominoConfig::defaults() +{ + + QColor background = vBox->paletteBackgroundColor(); + + customBorderColor->setChecked(true); + borderColor->setColor("#777B7F"); + customButtonColor->setChecked(false); + buttonColor->setColor("#212121"); + customButtonIconColor->setChecked(false); + buttonIconColor->setColor("#000000"); + showInactiveButtons->setChecked(false); + showButtonIcons->setChecked(false); + customGradientColors->setChecked(false); + topGradientColor->setColor("#ffffff"); + bottomGradientColor->setColor("#000000"); + darkFrame->setChecked(false); + + useDominoStyleContourColors->setChecked(true); + buttonContourColor->setColor(background.dark(250).name()); + buttonMouseOverContourColor->setColor(background.dark(250).name()); + buttonPressedContourColor->setColor(background.dark(250).name()); + +} + +void DominoConfig::loadButtonContourColors() { + + QColor background = vBox->paletteBackgroundColor(); + if(useDominoStyleContourColors->isChecked()) { + QSettings s; + buttonContourColor->setColor(s.readEntry("/domino/Settings/buttonContourColor", background.dark(250).name())); + buttonMouseOverContourColor->setColor(s.readEntry("/domino/Settings/buttonMouseOverContourColor", background.dark(250).name())); + buttonPressedContourColor->setColor(s.readEntry("/domino/Settings/buttonPressedContourColor", background.dark(250).name())); + } + else { + buttonContourColor->setColor(conf->readEntry("buttonContourColor", background.dark(250).name())); + buttonMouseOverContourColor->setColor(conf->readEntry("buttonMouseOverContourColor", background.dark(250).name())); + buttonPressedContourColor->setColor(conf->readEntry("buttonPressedContourColor", background.dark(250).name())); + } + +} + +#include "config.moc" + diff --git a/client/config/config.h b/client/config/config.h new file mode 100644 index 0000000..3ccdc1a --- /dev/null +++ b/client/config/config.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2006 Michael Lentner + + based on KDE2 Default configuration widget: + Copyright (c) 2001 + Karol Szwed + http://gallium.n3.net/ + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef DOMINOCONFIG_H +#define DOMINOCONFIG_H + +#include +#include +#include +#include + +class DominoConfig: public QObject +{ + Q_OBJECT + + public: + DominoConfig( KConfig* config, QWidget* parent ); + ~DominoConfig(); + + // These public signals/slots work similar to KCM modules + signals: + void changed(); + + public slots: + void load(KConfig* config); + void save(KConfig* config); + void defaults(); + + protected slots: + void slotSelectionChanged(); // Internal use + void loadButtonContourColors(); + private: + KConfig* conf; + QVBox* vBox; + QCheckBox* customBorderColor; + KColorButton* borderColor; + QCheckBox* customButtonColor; + KColorButton* buttonColor; + QCheckBox* customButtonIconColor; + KColorButton* buttonIconColor; + + QCheckBox* showInactiveButtons; + QCheckBox* showButtonIcons; + QCheckBox* customGradientColors; + KColorButton* topGradientColor; + KColorButton* bottomGradientColor; + QCheckBox* darkFrame; + + QCheckBox* useDominoStyleContourColors; + KColorButton* buttonContourColor; + KColorButton* buttonMouseOverContourColor; + KColorButton* buttonPressedContourColor; + +}; + +#endif diff --git a/client/domino.desktop b/client/domino.desktop new file mode 100644 index 0000000..bdaca29 --- /dev/null +++ b/client/domino.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Encoding=UTF-8 +Icon= +Name=Domino +X-KDE-Library=kwin3_domino diff --git a/client/dominoclient.cpp b/client/dominoclient.cpp new file mode 100644 index 0000000..4fee0cd --- /dev/null +++ b/client/dominoclient.cpp @@ -0,0 +1,1195 @@ +/* + Copyright (C) 2006 Michael Lentner + + based on KDE2 Default KWin client: + Copyright (C) 1999, 2001 Daniel Duley + Matthias Ettrich + Karol Szwed + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +#include "dominoclient.h" +#include "clientData.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace Domino +{ + +static DominoHandler* clientHandler; +static bool Domino_initialized = false; +const int titleEdgeTop = 3; +const int titleEdgeBottom = 1; +static int titleHeight; + +static QPixmap* buttonPix; +static QPixmap* buttonHidePix; +static QPixmap* titleBarPix; +static QPixmap* borderTopLeftPix; +static QPixmap* borderTopRightPix; +static QPixmap* borderBottomPix; +static QPixmap* borderBottomLeftPix; +static QPixmap* borderBottomRightPix; +static QPixmap* borderLeftPix; +static QPixmap* borderRightPix; + + +static QPixmap* closeButtonIcon; +static QPixmap* minButtonIcon; +static QPixmap* maxButtonIcon; +static QPixmap* helpButtonIcon; +static QPixmap* onAllDesktopsButtonIcon; +static QPixmap* shadeButtonIcon; +static QPixmap* aboveButtonIcon; +static QPixmap* belowButtonIcon; + +static QPixmap* pressedCloseButtonIcon; +static QPixmap* pressedMinButtonIcon; +static QPixmap* pressedMaxButtonIcon; +static QPixmap* pressedHelpButtonIcon; +static QPixmap* pressedOnAllDesktopsButtonIcon; +static QPixmap* pressedShadeButtonIcon; +static QPixmap* pressedAboveButtonIcon; +static QPixmap* pressedBelowButtonIcon; + +static QPixmap* mouseOverCloseButtonIcon; +static QPixmap* mouseOverMinButtonIcon; +static QPixmap* mouseOverMaxButtonIcon; +static QPixmap* mouseOverHelpButtonIcon; +static QPixmap* mouseOverOnAllDesktopsButtonIcon; +static QPixmap* mouseOverShadeButtonIcon; +static QPixmap* mouseOverAboveButtonIcon; +static QPixmap* mouseOverBelowButtonIcon; + +static bool buttonInputShape; +static QBitmap* buttonShapeBitmap; + +static QColor background; +static QColor topGradientColor; +static QColor bottomGradientColor; +static QColor topBorderGradientColor; +static QColor bottomBorderGradientColor; +static bool showButtonIcons; +static bool showInactiveButtons; + +const int titleGradientHeight = 10; +const int bottomBorderHeight = 8; +const int borderWidth = 5; + +// =========================================================================== + +DominoHandler::DominoHandler() +{ + int ignore, maj, min; + + if(XShapeQueryExtension(qt_xdisplay(), &ignore, &ignore) && + XShapeQueryVersion(qt_xdisplay(), &maj, &min) && + maj >= 1 && min >= 1) { + + buttonInputShape = true; + } + else + buttonInputShape = false; + + clientHandler = this; + readConfig( false ); + createPixmaps(); + Domino_initialized = true; +} + + +DominoHandler::~DominoHandler() +{ + Domino_initialized = false; + freePixmaps(); + clientHandler = NULL; +} + +KDecoration* DominoHandler::createDecoration( KDecorationBridge* b ) +{ + return new DominoClient( b, this ); +} + +bool DominoHandler::reset( unsigned long changed ) +{ + Domino_initialized = false; + changed |= readConfig( true ); + if( changed & SettingColors ) + { // pixmaps need to be recreated + freePixmaps(); + createPixmaps(); + } + Domino_initialized = true; + // SettingButtons is handled by KCommonDecoration + bool need_recreate = ( changed & ( SettingDecoration | SettingFont | SettingBorder )) != 0; + if( need_recreate ) // something else than colors changed + return true; + resetDecorations( changed ); + return false; +} + + +unsigned long DominoHandler::readConfig( bool update ) +{ + unsigned long changed = 0; + KConfig conf("kwindominorc"); + conf.setGroup("General"); + + titleHeight = QMAX(QFontMetrics(options()->font(true)).height(), 16); + background = qApp->palette().active().background(); + + customBorderColor = conf.readBoolEntry("customBorderColor", true); + borderColor = customBorderColor ? conf.readEntry("borderColor", "#777B7F") : background; + + customButtonColor = conf.readBoolEntry("customButtonColor", false); + buttonColor = customButtonColor ? conf.readEntry("buttonColor", "#212121") : background; + customButtonIconColor = conf.readBoolEntry("customButtonIconColor", false); + buttonIconColor = customButtonIconColor ? conf.readEntry("buttonIconColor", "#000000") : "#000000"; + showInactiveButtons = conf.readBoolEntry("showInactiveButtons", false); + showButtonIcons = conf.readBoolEntry("showButtonIcons", false); + darkLines = conf.readBoolEntry("darkFrame", false); + + if(!conf.readBoolEntry( "customGradientColors", false)) { + topGradientColor = alphaBlendColors(background, Qt::white, 180); + bottomGradientColor = alphaBlendColors(background, Qt::black, 230); + topBorderGradientColor = alphaBlendColors(borderColor, Qt::white, 180); + bottomBorderGradientColor = alphaBlendColors(borderColor, Qt::black, 230); + } + else { + topGradientColor = conf.readEntry("topGradientColor", "#ffffff"); + bottomGradientColor = conf.readEntry("bottomGradientColor", "#000000"); + topBorderGradientColor = topGradientColor; + bottomBorderGradientColor = bottomGradientColor; + } + + if( update ) { + changed |= SettingColors; // just recreate the pixmaps and repaint + } + + if(conf.readBoolEntry("useDominoStyleContourColors", true)) { + QSettings s; + buttonContourColor = s.readEntry("/domino/Settings/buttonContourColor", background.dark(250).name()); + buttonMouseOverContourColor = s.readEntry("/domino/Settings/buttonMouseOverContourColor", background.dark(250).name()); + buttonPressedContourColor = s.readEntry("/domino/Settings/buttonPressedContourColor", background.dark(250).name()); + } + else { + buttonContourColor = conf.readEntry("buttonContourColor", background.dark(250).name()); + buttonMouseOverContourColor = conf.readEntry("buttonMouseOverContourColor", background.dark(250).name()); + buttonPressedContourColor= conf.readEntry("buttonPressedContourColor", background.dark(250).name()); + } + + return changed; +} + + +// This paints the button pixmaps upon loading the style. +void DominoHandler::createPixmaps() +{ + + QImage edges; + QImage topLines; + QImage rightLines; + QImage bottomLines; + + if(darkLines) { + edges = qembed_findImage("client_edges_dark"); + topLines = qembed_findImage("client_topLines_dark"); + rightLines = qembed_findImage("client_rightLines_dark"); + bottomLines = qembed_findImage("client_bottomLines_dark"); + } + else { + edges = qembed_findImage("client_edges"); + topLines = qembed_findImage("client_topLines"); + rightLines = qembed_findImage("client_rightLines"); + bottomLines = qembed_findImage("client_bottomLines"); + } + + + + + int titleBarHeight = titleHeight+titleEdgeTop+titleEdgeBottom; + QWMatrix m; + m.rotate(180); + + titleBarPix = new QPixmap(QSize(10, titleBarHeight)); + titleBarPix->fill(background); + QRect r(titleBarPix->rect()); + QPainter p(titleBarPix); + QRect rect(r.x(), r.y(), r.width(), titleGradientHeight); + renderGradient(&p, rect, topGradientColor, background, "titleBar"); + p.drawPixmap(0, 0, topLines); + p.end(); + + + + ///////// borders + // sides + QPixmap sideLinesRight = rightLines; + + borderRightPix = new QPixmap(5, 10); + borderRightPix->fill(borderColor); + p.begin(borderRightPix); + p.drawPixmap(3, 0, sideLinesRight); + p.end(); + + borderLeftPix = new QPixmap(borderRightPix->xForm(m)); + // edges + borderTopLeftPix = new QPixmap(QSize(5, titleBarHeight)); + borderTopLeftPix->fill(borderColor); + p.begin(borderTopLeftPix); + r = QRect(0, 0, 5, titleGradientHeight); + // if the gradient color is equal to the background color, we make the border also flat. + renderGradient(&p, r, topGradientColor == background ? borderColor : topBorderGradientColor, borderColor, "borderTopLeftPix"); + borderTopRightPix = new QPixmap(*borderTopLeftPix); + p.drawPixmap(0, 1, edges, 0, 0, 5, 6); + p.drawTiledPixmap(0, 7, 2, titleBarHeight, sideLinesRight.xForm(m)); + p.end(); + p.begin(borderTopRightPix); + p.drawPixmap(0, 1, edges, 5, 0, 5, 6); + p.drawTiledPixmap(3, 7, 2, titleBarHeight, sideLinesRight); + p.end(); + + + borderBottomRightPix = new QPixmap(QSize(5, bottomBorderHeight)); + borderBottomRightPix->fill(borderColor); + p.begin(borderBottomRightPix); + r = QRect(0, bottomBorderHeight-6, 5, 6); + renderGradient(&p, r, borderColor, bottomGradientColor == background ? borderColor : bottomBorderGradientColor, "borderBottomRightPix"); + borderBottomLeftPix = new QPixmap(*borderBottomRightPix); + p.drawPixmap(0, bottomBorderHeight-7, edges, 5, 6, 5, 6); + p.drawPixmap(3, 0, sideLinesRight, 0, 0, 2, borderBottomLeftPix->height()-7); + p.end(); + + + p.begin(borderBottomLeftPix); + p.drawPixmap(0, bottomBorderHeight-7, edges, 0, 6, 5 ,6); + p.drawPixmap(0, 0, sideLinesRight.xForm(m), 0, 0, 2, borderBottomLeftPix->height()-7); + p.end(); + + borderBottomPix = new QPixmap(QSize(10, bottomBorderHeight)); + borderBottomPix->fill(background); + p.begin(borderBottomPix); + r = QRect(0, bottomBorderHeight-6, 10, 6); + renderGradient(&p, r, background, bottomGradientColor, "borderBottom"); + p.drawPixmap(0, bottomBorderHeight-2, bottomLines); + p.end(); + + + + ///////// buttons + //////////////////////////////////////////////////////////////////////// + + if(buttonInputShape) { + QRegion buttonClip(6,2,6,1); + buttonClip += QRegion(5,3,8,1); + buttonClip += QRegion(4,4,10,1); + buttonClip += QRegion(3,5,12,1); + buttonClip += QRegion(2,6,14,6); + buttonClip += QRegion(3,12,12,1); + buttonClip += QRegion(4,13,10,1); + buttonClip += QRegion(5,14,8,1); + buttonClip += QRegion(6,15,6,1); + + buttonShapeBitmap = new QBitmap(16, titleBarHeight, true); + QPainter p(buttonShapeBitmap); + p.setClipRegion(buttonClip); + p.fillRect(QRect(0, 0, 16, titleBarHeight), Qt::color1); + } + + QPixmap* buttonShadow = new QPixmap(qembed_findImage("clientButtonShadow")); + QPixmap* buttonPressed = new QPixmap(qembed_findImage("clientButtonPressed")); + + buttonPix = new QPixmap(QSize(16, titleBarHeight)); + p.begin(buttonPix); + p.drawTiledPixmap(0, 0, titleBarHeight, titleBarHeight, *titleBarPix, 0, titleEdgeTop); + + //////////// custom color + r = QRect(buttonPix->rect()); + QRegion buttonClip(5,2,6,1); + buttonClip += QRegion(4,3,8,1); + buttonClip += QRegion(3,4,10,1); + buttonClip += QRegion(2,5,12,6); + buttonClip += QRegion(3,11,10,1); + buttonClip += QRegion(4,12,8,1); + buttonClip += QRegion(5,13,6,1); + + p.setClipRegion(buttonClip); + p.fillRect(QRect(0, 0, r.width(), r.height()), buttonColor); + QRect gr(0, -3, r.width(), titleGradientHeight); + renderGradient(&p, gr, topGradientColor, buttonColor, "titleBar"); + p.setClipping(false); + /////////// + p.drawPixmap(0, 0, *buttonShadow); + p.end(); + + + QPixmap* pressedButtonPix = new QPixmap(*buttonPix); + p.begin(pressedButtonPix); + p.drawPixmap(0, 0, tintImage(qembed_findImage("clientButtonContour"), buttonPressedContourColor)); + p.drawPixmap(0, 0, *buttonPressed); + p.end(); + + + QPixmap* mouseOverButtonPix = new QPixmap(*buttonPix); + p.begin(mouseOverButtonPix); + p.drawPixmap(0, 0, tintImage(qembed_findImage("clientButtonContour"), buttonMouseOverContourColor)); + p.end(); + + + p.begin(buttonPix); + p.drawPixmap(0, 0, tintImage(qembed_findImage("clientButtonContour"), buttonContourColor)); + p.end(); + + + buttonHidePix = new QPixmap(QSize(buttonPix->width(), titleBarHeight)); + p.begin(buttonHidePix); + p.drawTiledPixmap(0, 0, buttonHidePix->width(), buttonHidePix->height(), *titleBarPix, 0, titleEdgeTop); + p.end(); + + + + + ///////// icons + /////////////////////////////////////////////////////////////////////// + + QPixmap* icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("closeButtonIcon"), buttonIconColor) : qembed_findImage("closeButtonIcon")); + closeButtonIcon = new QPixmap(*buttonPix); + bitBlt(closeButtonIcon, 5, 5, icon); + pressedCloseButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedCloseButtonIcon, 5, 5, icon); + mouseOverCloseButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverCloseButtonIcon, 5, 5, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("maxButtonIcon"), buttonIconColor) : qembed_findImage("maxButtonIcon")); + maxButtonIcon = new QPixmap(*buttonPix); + bitBlt(maxButtonIcon, 4, 4, icon); + pressedMaxButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedMaxButtonIcon, 4, 4, icon); + mouseOverMaxButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverMaxButtonIcon, 4, 4, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("minButtonIcon"), buttonIconColor) : qembed_findImage("minButtonIcon")); + minButtonIcon = new QPixmap(*buttonPix); + bitBlt(minButtonIcon, 5, 9, icon); + pressedMinButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedMinButtonIcon, 5, 9, icon); + mouseOverMinButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverMinButtonIcon, 5, 9, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("helpButtonIcon"), buttonIconColor) : qembed_findImage("helpButtonIcon")); + helpButtonIcon = new QPixmap(*buttonPix); + bitBlt(helpButtonIcon, 5, 4, icon); + pressedHelpButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedHelpButtonIcon, 5, 4, icon); + mouseOverHelpButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverHelpButtonIcon, 5, 4, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("onAllDesktopsButtonIcon"), buttonIconColor) : qembed_findImage("onAllDesktopsButtonIcon")); + onAllDesktopsButtonIcon = new QPixmap(*buttonPix); + bitBlt(onAllDesktopsButtonIcon, 6, 6, icon); + pressedOnAllDesktopsButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedOnAllDesktopsButtonIcon, 6, 6, icon); + mouseOverOnAllDesktopsButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverOnAllDesktopsButtonIcon, 6, 6, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("aboveButtonIcon"), buttonIconColor) : qembed_findImage("aboveButtonIcon")); + aboveButtonIcon = new QPixmap(*buttonPix); + bitBlt(aboveButtonIcon, 5, 4, icon); + pressedAboveButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedAboveButtonIcon, 5, 4, icon); + mouseOverAboveButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverAboveButtonIcon, 5, 4, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("aboveButtonIcon").xForm(m), buttonIconColor) : qembed_findImage("aboveButtonIcon").xForm(m)); + belowButtonIcon = new QPixmap(*buttonPix); + bitBlt(belowButtonIcon, 5, 4, icon); + pressedBelowButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedBelowButtonIcon, 5, 4, icon); + mouseOverBelowButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverBelowButtonIcon, 5, 4, icon); + delete icon; + + icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("minButtonIcon"), buttonIconColor) : qembed_findImage("minButtonIcon")); + shadeButtonIcon = new QPixmap(*buttonPix); + bitBlt(shadeButtonIcon, 5, 5, icon); + pressedShadeButtonIcon = new QPixmap(*pressedButtonPix); + bitBlt(pressedShadeButtonIcon, 5, 5, icon); + mouseOverShadeButtonIcon = new QPixmap(*mouseOverButtonPix); + bitBlt(mouseOverShadeButtonIcon, 5, 5, icon); + delete icon; + + delete mouseOverButtonPix; + delete pressedButtonPix; +} + +void DominoHandler::freePixmaps() +{ + + delete buttonPix; + delete buttonHidePix; + buttonPix = 0; + delete titleBarPix; + delete borderTopRightPix; + delete borderTopLeftPix; + delete borderBottomRightPix; + delete borderBottomLeftPix; + delete borderLeftPix; + delete borderRightPix; + delete borderBottomPix; + + delete closeButtonIcon; + delete maxButtonIcon; + delete minButtonIcon; + delete helpButtonIcon; + delete onAllDesktopsButtonIcon; + delete aboveButtonIcon; + delete belowButtonIcon; + delete shadeButtonIcon; + + delete pressedCloseButtonIcon; + delete pressedMaxButtonIcon; + delete pressedMinButtonIcon; + delete pressedHelpButtonIcon; + delete pressedOnAllDesktopsButtonIcon; + delete pressedAboveButtonIcon; + delete pressedBelowButtonIcon; + delete pressedShadeButtonIcon; + + delete mouseOverCloseButtonIcon; + delete mouseOverMinButtonIcon; + delete mouseOverMaxButtonIcon; + delete mouseOverHelpButtonIcon; + delete mouseOverOnAllDesktopsButtonIcon; + delete mouseOverShadeButtonIcon; + delete mouseOverAboveButtonIcon; + delete mouseOverBelowButtonIcon; + + + + if(buttonInputShape) + delete buttonShapeBitmap; + +} + +bool DominoHandler::supports( Ability ability ) +{ + switch( ability ) + { + case AbilityAnnounceButtons: + case AbilityButtonMenu: + case AbilityButtonOnAllDesktops: + case AbilityButtonSpacer: + case AbilityButtonHelp: + case AbilityButtonMinimize: + case AbilityButtonMaximize: + case AbilityButtonClose: + case AbilityButtonAboveOthers: + case AbilityButtonBelowOthers: + case AbilityButtonShade: + return true; + default: + return false; + }; +} + +// =========================================================================== + +DominoButton::DominoButton(ButtonType type, DominoClient *parent, const char *name) + : KCommonDecorationButton(type, parent, name) +{ + isMouseOver = false; + client = parent; +#ifdef ShapeInput + if(buttonInputShape && buttonShapeBitmap ) { + XShapeCombineMask (qt_xdisplay(), + winId(), + ShapeInput, + 0, + 0, + buttonShapeBitmap->handle(), + ShapeSet); + } +#endif +} + + +DominoButton::~DominoButton() +{ +} + + +void DominoButton::reset(unsigned long changed) +{ + if (changed&SizeChange || changed&ManualReset) { + setBackgroundOrigin(QWidget::WidgetOrigin); + setErasePixmap(showInactiveButtons ? *buttonPix : *buttonHidePix); + } + + + if (changed&DecorationReset || changed&ManualReset || changed&SizeChange || changed&StateChange) { + this->update(); + } + + +} + + +void DominoButton::drawButton(QPainter *p) +{ + if (!Domino_initialized) + return; + + bool down = isDown() || isOn(); + if(down || (( isMouseOver || showButtonIcons) && (showInactiveButtons || decoration()->isActive() || client->titleBarMouseOver)) ) { + switch (type()) { + case CloseButton: + p->drawPixmap(0, 0, down ? *pressedCloseButtonIcon : isMouseOver ? *mouseOverCloseButtonIcon : *closeButtonIcon); + break; + case HelpButton: + p->drawPixmap(0, 0, down ? *pressedHelpButtonIcon : isMouseOver ? *mouseOverHelpButtonIcon : *helpButtonIcon); + break; + case MinButton: + p->drawPixmap(0, 0, down ? *pressedMinButtonIcon : isMouseOver ? *mouseOverMinButtonIcon : *minButtonIcon); + break; + case MaxButton: + p->drawPixmap(0, 0, down ? *pressedMaxButtonIcon : isMouseOver ? *mouseOverMaxButtonIcon : *maxButtonIcon); + break; + case OnAllDesktopsButton: + p->drawPixmap(0, 0, down ? *pressedOnAllDesktopsButtonIcon : isMouseOver ? *mouseOverOnAllDesktopsButtonIcon : *onAllDesktopsButtonIcon); + break; + case ShadeButton: + p->drawPixmap(0, 0, down ? *pressedShadeButtonIcon : isMouseOver ? *mouseOverShadeButtonIcon : *shadeButtonIcon); + break; + case AboveButton: + p->drawPixmap(0, 0, down ? *pressedAboveButtonIcon : isMouseOver ? *mouseOverAboveButtonIcon : *aboveButtonIcon); + break; + case BelowButton: + p->drawPixmap(0, 0, down ? *pressedBelowButtonIcon : isMouseOver ? *mouseOverBelowButtonIcon : *belowButtonIcon); + break; + case MenuButton: + default: + break; + } + } + else { + if((client->titleBarMouseOver && type() != MenuButton) || (decoration()->isActive() && !showInactiveButtons && type() != MenuButton)) { + p->drawPixmap(0, 0, *buttonPix); + } + } +} + + + +void DominoButton::enterEvent(QEvent */*e*/) +{ + + if(!client->isActive() && !showInactiveButtons) + client->titleBarMouseOver = true; + + isMouseOver=true; + repaint(false); +} + + +void DominoButton::leaveEvent(QEvent */*e*/) +{ + isMouseOver=false; + repaint(false); + client->titleBarMouseOver = false; +} + + +// =========================================================================== + +DominoClient::DominoClient( KDecorationBridge* b, KDecorationFactory* f ) + : KCommonDecoration( b, f ) +{ +} + +DominoClient::~DominoClient() +{ + + delete titleBar; + delete borderTopLeft; + delete borderTopRight; + delete borderBottomLeft; + delete borderBottomRight; + delete borderLeft; + delete borderRight; + delete borderBottom; +} + +QString DominoClient::visibleName() const +{ + return "Domino"; +} + +QString DominoClient::defaultButtonsLeft() const +{ + return "MF"; +} + +QString DominoClient::defaultButtonsRight() const +{ + return "HIAX"; +} + +bool DominoClient::decorationBehaviour(DecorationBehaviour behaviour) const +{ + switch (behaviour) { + case DB_MenuClose: + return true; + case DB_WindowMask: + return true; + case DB_ButtonHide: + return true; + default: + return KCommonDecoration::decorationBehaviour(behaviour); + } +} + +int DominoClient::layoutMetric(LayoutMetric lm, bool respectWindowState, const KCommonDecorationButton *btn) const +{ + bool maximized = maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows(); + + switch (lm) { + case LM_BorderLeft: + case LM_BorderRight: + if(respectWindowState && maximized) + return 0; + return borderWidth; + + case LM_BorderBottom: { + if(respectWindowState && maximized) + return 0; + return bottomBorderHeight; // = 8 + } + + case LM_TitleEdgeLeft: + case LM_TitleEdgeRight: + return borderWidth + 3; + + case LM_TitleEdgeTop: + return titleEdgeTop; // = 3 + + case LM_TitleEdgeBottom: + return titleEdgeBottom; // = 1 + + case LM_TitleBorderLeft: + case LM_TitleBorderRight: + return 1; + + case LM_TitleHeight: { + return titleHeight; + } + + case LM_ButtonWidth: + return 16; // pixmap width + + case LM_ButtonHeight: + return titleHeight; + + case LM_ButtonSpacing: + return 3; + + case LM_ExplicitButtonSpacer: + return 2; + + default: + return KCommonDecoration::layoutMetric(lm, respectWindowState, btn); + } +} + +KCommonDecorationButton *DominoClient::createButton(ButtonType type) +{ + switch (type) { + case MenuButton: { + DominoButton* menu = new DominoButton(MenuButton, this, "menu"); + menuButton = menu; + connect(menu, SIGNAL(destroyed()), this, SLOT(menuButtonDestroyed())); + return menu; + break; + } + case OnAllDesktopsButton: { + return new DominoButton(OnAllDesktopsButton, this, "on_all_desktops"); + } + case HelpButton: { + return new DominoButton(HelpButton, this, "help"); + } + case MinButton: { + return new DominoButton(MinButton, this, "minimize"); + } + case MaxButton: { + return new DominoButton(MaxButton, this, "maximize"); + } + case CloseButton: { + return new DominoButton(CloseButton, this, "close"); + } + case AboveButton: { + return new DominoButton(AboveButton, this, "above"); + } + case BelowButton: { + return new DominoButton(BelowButton, this, "below"); + } + case ShadeButton: { + return new DominoButton(ShadeButton, this, "shade"); + } + default: + return 0; + } +} + + +void DominoClient::init() +{ + + menuButton = 0; + globalMouseTracking = false; + titleBarMouseOver = false; + QWidget* w = new QWidget(KDecoration::initialParentWidget(), "clientMainWidget", WNoAutoErase|WStaticContents); + setMainWidget(w); + + widget()->setBackgroundMode(NoBackground); + widget()->installEventFilter(this); + createLayout(); + + KCommonDecoration::reset(SettingButtons); + iconChange(); + connect(this, SIGNAL(keepAboveChanged(bool) ), SLOT(keepAboveChange(bool) ) ); + connect(this, SIGNAL(keepBelowChanged(bool) ), SLOT(keepBelowChange(bool) ) ); +} + +void DominoClient::createLayout() +{ + + int titleBarHeight = titleHeight+titleEdgeTop+titleEdgeBottom; + + mainlayout = new QGridLayout(widget(), 3, 3, 0); + titleBar = new TitleBar(widget(), "titlebar"); + titleBar->client = this; + titleBar->setMouseTracking(true); + + borderTopLeft = new QWidget(widget(), "borderTopLeft", Qt::WNoAutoErase); + borderTopLeft->setMouseTracking(true); + borderTopRight = new QWidget(widget(), "borderTopRight", Qt::WNoAutoErase); + borderTopRight->setMouseTracking(true); + borderBottomLeft = new QWidget(widget(), "borderBottomLeft", Qt::WNoAutoErase); + borderBottomLeft->setMouseTracking(true); + borderBottomRight = new QWidget(widget(), "borderBottomRight", Qt::WNoAutoErase); + borderBottomRight->setMouseTracking(true); + borderLeft = new QWidget(widget(), "borderLeft", Qt::WNoAutoErase); + borderLeft->setMouseTracking(true); + borderRight = new QWidget(widget(), "borderRight", Qt::WNoAutoErase); + borderRight->setMouseTracking(true); + borderBottom = new QWidget(widget(), "borderBottom", Qt::WNoAutoErase); + borderBottom->setMouseTracking(true); + + + titleBar->setFixedHeight(titleBarHeight); + titleBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + borderTopLeft->setFixedSize(borderWidth, titleBarHeight); + borderTopRight->setFixedSize(borderWidth, titleBarHeight); + + borderLeft->setFixedWidth(borderWidth); + borderLeft->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + borderRight->setFixedWidth(borderWidth); + borderRight->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + + borderBottomLeft->setFixedSize(borderWidth, bottomBorderHeight); + borderBottomRight->setFixedSize(borderWidth, bottomBorderHeight); + borderBottom->setFixedHeight(bottomBorderHeight); + borderBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + + mainlayout->addWidget(titleBar, 0,1); + mainlayout->addWidget(borderTopLeft, 0,0); + mainlayout->addWidget(borderTopRight, 0,2); + + mainlayout->addWidget(borderLeft, 1,0); + mainlayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding)); + mainlayout->addWidget(borderRight, 1,2); + + mainlayout->addWidget(borderBottomLeft, 2,0); + mainlayout->addWidget(borderBottom, 2,1); + mainlayout->addWidget(borderBottomRight, 2,2); + + setPixmaps(); + +} + +void DominoClient::setPixmaps() +{ + borderTopLeft->setErasePixmap(*borderTopLeftPix); + borderTopRight->setErasePixmap(*borderTopRightPix); + borderBottomLeft->setErasePixmap(*borderBottomLeftPix); + borderBottomRight->setErasePixmap(*borderBottomRightPix); + borderLeft->setErasePixmap(*borderLeftPix); + borderRight->setErasePixmap(*borderRightPix); + borderBottom->setErasePixmap(*borderBottomPix); + + borderTopLeft->erase(); + borderTopRight->erase(); + borderBottomLeft->erase(); + borderBottomRight->erase(); + borderLeft->erase(); + borderRight->erase(); + borderBottom->erase(); +} + +void DominoClient::reset( unsigned long changed) +{ + + widget()->repaint(); + KCommonDecoration::reset(changed); + KCommonDecoration::resetButtons(); + updateCaption(); + setPixmaps(); + iconChange(); +} + + +void DominoClient::updateMask() +{ + if(maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows()) { + clearMask(); + return; + } + QRect r(widget()->rect()); + + QRegion mask(r.x()+5, r.y(), r.width()-10, r.height()); + mask += QRect(r.x()+3, r.y()+1, r.width()-6, r.height()-2); + mask += QRect(r.x()+2, r.y()+2, r.width()-4, r.height()-4); + mask += QRect(r.x()+1, r.y()+3, r.width()-2, r.height()-6); + mask += QRect(r.x(), r.y()+5, r.width(), r.height()-10); + setMask(mask); + +} + +void DominoClient::updateCaption() +{ + QRect r(titleBar->rect()); + + QPixmap* titleBar_pix = new QPixmap(r.size()); + QPainter painter(titleBar_pix); + painter.drawTiledPixmap(0, 0, r.width(), r.height(), *titleBarPix); + + int lw = buttonsLeftWidth()+3; + int rw = buttonsRightWidth(); + + painter.setFont(options()->font(true,false)); + QFontMetrics fm = painter.fontMetrics(); + int captionWidth = fm.width(caption()); + int titleWidth = titleBar->width()-(lw+rw); + + + QRect re(titleWidth > captionWidth ? (titleWidth-captionWidth)/2+lw : lw, 0, titleWidth, r.height()); + painter.setClipRect(re); + painter.setPen(options()->color(KDecorationDefines::ColorFont, isActive())); + painter.drawText(QRect(lw, r.y(), r.width()-(rw+lw), r.height()), titleWidth > captionWidth ? Qt::AlignCenter : Qt::AlignLeft|Qt::AlignVCenter, caption()); + painter.end(); + + titleBar->setErasePixmap(*titleBar_pix); + titleBar->erase(); + delete titleBar_pix; +} + +void DominoClient::activeChange() +{ + updateButtons(); + updateCaption(); +} + +void DominoClient::iconChange() +{ + if(menuButton) { + QPixmap pix(*buttonHidePix); + QPixmap icon = KDecoration::icon().pixmap(QIconSet::Small, QIconSet::Normal); + if(!icon.isNull()) + bitBlt(&pix, 0, 0, &icon, 0, 0, -1, -1, Qt::CopyROP); + menuButton->setErasePixmap(pix); + } + +} + +void DominoClient::menuButtonDestroyed() +{ + menuButton = 0; +} + +void DominoClient::slotShade() +{ + setShade( !isSetShade() ); +} + + +void DominoClient::borders( int& left, int& right, int& top, int& bottom ) const +{ + + left = layoutMetric(LM_BorderLeft); + right = layoutMetric(LM_BorderRight); + bottom = layoutMetric(LM_BorderBottom); + top = layoutMetric(LM_TitleHeight) + + layoutMetric(LM_TitleEdgeTop) + + layoutMetric(LM_TitleEdgeBottom); + + widget()->layout()->activate(); + +} + +void DominoClient::shadeChange() +{ + if(isSetShade()) { + mainlayout->remove(borderLeft); + mainlayout->remove(borderRight); + borderLeft->resize(borderLeft->width(), 0); + borderRight->resize(borderLeft->width(), 0); + } + else { + mainlayout->addWidget(borderLeft,1,0); + mainlayout->addWidget(borderRight,1,2); + } + + widget()->layout()->activate(); + +} + +void DominoClient::resize( const QSize& s ) +{ + widget()->resize( s ); + if(maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows()) { + borderLeft->hide(); + borderRight->hide(); + borderTopLeft->hide(); + borderTopRight->hide(); + borderBottomLeft->hide(); + borderBottomRight->hide(); + } + else if(borderLeft->isHidden()) { + borderLeft->show(); + borderRight->show(); + borderTopLeft->show(); + borderTopRight->show(); + borderBottomLeft->show(); + borderBottomRight->show(); + } +} + + +void DominoClient::resizeEvent( QResizeEvent* ev ) +{ + + if (!Domino_initialized || ev->size() == ev->oldSize()) + return; + KCommonDecoration::resizeEvent(ev); // which calls calcHiddenButtons() + + updateMask(); + updateCaption(); +} +void DominoClient::updateWindowShape() +{ +} + +void DominoClient::showEvent(QShowEvent *) +{ +} + +void DominoClient::paintEvent( QPaintEvent* ) +{ +} + +bool DominoClient::eventFilter(QObject*, QEvent* e) +{ + switch(e->type()) { + case QEvent::Resize: + resizeEvent(static_cast(e)); + return true; + case QEvent::ApplicationPaletteChange: + return false; + case QEvent::Paint: + paintEvent(static_cast(e)); + return true; + case QEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast(e)); + return true; + case QEvent::Wheel: + if(titleBar->hasMouse() || isSetShade()) + wheelEvent(static_cast(e)); + return true; + case QEvent::MouseButtonPress: + processMousePressEvent(static_cast(e)); + return true; + case QEvent::Show: + return true; + case QEvent::Enter: + updateButtons(); + return true; + case QEvent::Leave: + if(globalMouseTracking && !showInactiveButtons) { + globalMouseTracking = false; + qApp->setGlobalMouseTracking( false ); + qApp->removeEventFilter(titleBar); + titleBarMouseOver = false; + } + updateButtons(); + return true; + default: + return false; + } + return false; +} + + +void TitleBar::enterEvent(QEvent*) +{ + if(!client->isActive() && !showInactiveButtons) { + if(!client->globalMouseTracking) { + client->globalMouseTracking = true; + qApp->setGlobalMouseTracking( true ); + qApp->installEventFilter(this); + client->titleBarMouseOver = true; + client->updateButtons(); + } + } +} + + +bool TitleBar::eventFilter(QObject*o, QEvent* e) { + + if(e->type() == QEvent::MouseMove && !showInactiveButtons && !client->isActive()) { + QPoint pos = ((QMouseEvent*)e)->pos(); + if((dynamic_cast(o) && geometry().contains(pos)) || dynamic_cast(o)) { + client->titleBarMouseOver = true; + } + else { + client->titleBarMouseOver = false; + client->updateButtons(); + } + } + return false; +} + + + +///////////// + +void renderGradient(QPainter *painter, QRect &rect, + QColor &c1, QColor &c2, const char* /*name*/) +{ + if((rect.width() <= 0)||(rect.height() <= 0)) + return; + + QPixmap *result; + + result = new QPixmap(10, rect.height()); + QPainter p(result); + + int r_h = result->rect().height(); + int r_x, r_y, r_x2, r_y2; + result->rect().coords(&r_x, &r_y, &r_x2, &r_y2); + + int rDiff, gDiff, bDiff; + int rc, gc, bc; + + register int y; + + rDiff = ( c2.red()) - (rc = c1.red()); + gDiff = ( c2.green()) - (gc = c1.green()); + bDiff = ( c2.blue()) - (bc = c1.blue()); + + register int rl = rc << 16; + register int gl = gc << 16; + register int bl = bc << 16; + + int rdelta = ((1<<16) / r_h) * rDiff; + int gdelta = ((1<<16) / r_h ) * gDiff; + int bdelta = ((1<<16) / r_h ) * bDiff; + + + for ( y = 0; y < r_h; y++ ) { + rl += rdelta; + gl += gdelta; + bl += bdelta; + p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.drawLine(r_x, r_y+y, r_x2, r_y+y); + } + p.end(); + + // draw the result... + painter->drawTiledPixmap(rect, *result); + +} + + +QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) +{ + + QRgb rgb = bgColor.rgb(); + QRgb rgb_b = fgColor.rgb(); + int alpha = a; + if(alpha>255) alpha = 255; + if(alpha<0) alpha = 0; + int inv_alpha = 255 - alpha; + + QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, + qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255, + qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) ); + + return result; +} + +QImage tintImage(const QImage &img, const QColor &tintColor) { + + QImage *result = new QImage(img.width(), img.height(), 32, 0, QImage::IgnoreEndian); + unsigned int *data = (unsigned int*) img.bits(); + unsigned int *resultData = (unsigned int*) result->bits(); + result->setAlphaBuffer( true ); + int alpha; + int total = img.width()*img.height(); + for ( int current = 0 ; current < total ; ++current ) { + alpha = qAlpha( data[ current ] ); + resultData[ current ] = qRgba( tintColor.red(), tintColor.green(), tintColor.blue(), alpha ); + } + return *result; +} + + + +} // namespace + +// Extended KWin plugin interface +extern "C" KDE_EXPORT KDecorationFactory* create_factory() +{ + return new Domino::DominoHandler(); +} + +#include "dominoclient.moc" + diff --git a/client/dominoclient.h b/client/dominoclient.h new file mode 100644 index 0000000..3c92495 --- /dev/null +++ b/client/dominoclient.h @@ -0,0 +1,156 @@ +/* + Copyright (C) 2006 Michael Lentner + + based on KDE2 Default KWin client: + Copyright (C) 1999, 2001 Daniel Duley + Matthias Ettrich + Karol Szwed + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +#ifndef _DOMINOCLIENT_H +#define _DOMINOCLIENT_H + +#include +#include +#include + +namespace Domino { + +class DominoClient; +class TitleBar; + +class DominoHandler: public QObject, public KDecorationFactory +{ + public: + DominoHandler(); + ~DominoHandler(); + KDecoration* createDecoration( KDecorationBridge* b ); + bool reset( unsigned long changed ); + virtual bool supports( Ability ability ); + + QColor buttonContourColor; + QColor buttonMouseOverContourColor; + QColor buttonPressedContourColor; + + bool customButtonColor; + QColor buttonColor; + bool customButtonIconColor; + QColor buttonIconColor; + bool customBorderColor; + QColor borderColor; + bool darkLines; + + private: + unsigned long readConfig( bool update ); + void createPixmaps(); + void freePixmaps(); + +}; + + +class DominoButton : public KCommonDecorationButton +{ + public: + DominoButton(ButtonType type, DominoClient *parent, const char *name); + ~DominoButton(); + + void reset(unsigned long changed); + + protected: + void enterEvent(QEvent *); + void leaveEvent(QEvent *); + void drawButton(QPainter *p); + void drawButtonLabel(QPainter*) {;} + + bool isMouseOver; + DominoClient* client; +}; + + +class DominoClient : public KCommonDecoration +{ + Q_OBJECT + public: + DominoClient( KDecorationBridge* b, KDecorationFactory* f ); + ~DominoClient(); + + virtual QString visibleName() const; + virtual QString defaultButtonsLeft() const; + virtual QString defaultButtonsRight() const; + virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; + virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; + virtual KCommonDecorationButton *createButton(ButtonType type); + void borders( int& left, int& right, int& top, int& bottom ) const; + + void init(); + void reset( unsigned long changed ); + void resize( const QSize& s ); + void updateMask(); + + void updateWindowShape(); + void updateCaption(); + void shadeChange(); + void activeChange(); + void iconChange(); + + TitleBar* titleBar; + QWidget* borderTopLeft; + QWidget* borderTopRight; + QWidget* borderBottomLeft; + QWidget* borderBottomRight; + QWidget* borderLeft; + QWidget* borderRight; + QWidget* borderBottom; + QGridLayout* mainlayout; + QButton* menuButton; + + void setPixmaps(); + bool titleBarMouseOver; + bool globalMouseTracking; + + public slots: + void slotShade(); + void menuButtonDestroyed(); + + protected: + bool eventFilter(QObject*, QEvent*); + void paintEvent(QPaintEvent*); + void resizeEvent(QResizeEvent*); + void showEvent(QShowEvent*); + + private: + + void createLayout(); +}; + +class TitleBar : public QWidget +{ + public: + TitleBar(QWidget* parent=0, const char* name=0) : QWidget(parent, name) {} + void enterEvent(QEvent * e); + bool eventFilter(QObject*, QEvent*); + DominoClient* client; +}; + + + +void renderGradient(QPainter *painter, QRect &rect, + QColor &c1, QColor &c2, const char* name = 0); +QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); +QImage tintImage(const QImage &img, const QColor &tintColor); +} + +#endif diff --git a/configure.in.in b/configure.in.in new file mode 100644 index 0000000..b3c83b1 --- /dev/null +++ b/configure.in.in @@ -0,0 +1 @@ +#MIN_CONFIG diff --git a/domino/Domino.kcsrc b/domino/Domino.kcsrc new file mode 100644 index 0000000..c689177 --- /dev/null +++ b/domino/Domino.kcsrc @@ -0,0 +1,27 @@ +[Color Scheme] +Name=Domino +activeBackground=149,155,162 +activeBlend=149,155,162 +activeForeground=40,40,40 +activeTitleBtnBg=154,161,168 +alternateBackground=230,230,230 +background=149,155,162 +buttonBackground=149,155,162 +buttonForeground=0,0,0 +contrast=0 +foreground=0,0,0 +frame=149,155,162 +handle=149,155,162 +inactiveBackground=149,155,162 +inactiveBlend=149,155,162 +inactiveForeground=40,40,40 +inactiveFrame=149,155,162 +inactiveHandle=149,155,162 +inactiveTitleBtnBg=123,128,134 +linkColor=10,95,137 +selectBackground=162,168,223 +selectForeground=0,0,0 +shadeSortColumn=false +visitedLinkColor=137,10,137 +windowBackground=237,237,237 +windowForeground=0,0,0 diff --git a/domino/Makefile.am b/domino/Makefile.am new file mode 100644 index 0000000..02f1095 --- /dev/null +++ b/domino/Makefile.am @@ -0,0 +1,20 @@ +AUTOMAKE_OPTIONS = foreign + +KDE_CXXFLAGS = -DQT_PLUGIN -I/usr/include/freetype2 + +INCLUDES = $(all_includes) + +stylercdir = $(kde_datadir)/kstyle/themes +stylerc_DATA = domino.themerc +schemedir = $(kde_datadir)/kdisplay/color-schemes +scheme_DATA = Domino.kcsrc + +noinst_HEADERS = domino.h misc.h data.h + +kde_style_LTLIBRARIES = domino.la +domino_la_SOURCES = domino.cpp misc.cpp +domino_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(KDE_RPATH) +domino_la_LIBADD = $(LIB_KDEUI) $(LIB_KUTILS) $(LIB_QT) -lkdefx -lXrender -lXft $(LIB_KDECORE) +domino_la_METASOURCES = AUTO + +DISTCLEANFILES = $(domino_la_METASOURCES) diff --git a/domino/data.h b/domino/data.h new file mode 100644 index 0000000..5ac0f48 --- /dev/null +++ b/domino/data.h @@ -0,0 +1,1306 @@ +/* + Copyright (C) 2006 Michael Lentner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + + +#ifndef _QEMBED_1804289383 +#define _QEMBED_1804289383 +#include +#include +static const QRgb arrow_down_small_data[] = { + 0x2d000000,0x96000000,0x96000000,0x96000000,0x2e000000,0x1000000,0x79000000,0x99000000,0x7a000000,0x1000000,0x0,0x29000000,0x99000000,0x2b000000, + 0x0,0x0,0x0,0x4f000000,0x0,0x0 +}; + +/* Generated by qembed */ +static const QRgb btn17H_data[] = { + 0x0,0x0,0x0,0x0,0xc6000000,0xc6000000,0xc6000000,0xc6000000,0x23000000,0x23000000,0x23000000,0x23000000,0x23000000,0x23000000, + 0x23000000,0x23000000,0xc6000000,0xc6000000,0xc6000000,0xc6000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb btn17HRaisedShadow_data[] = { + 0x1e000000,0x1e000000,0x1e000000,0x1e000000,0x15000000,0x15000000,0x15000000,0x15000000,0x1effffff,0x1effffff,0x1effffff,0x1effffff,0x18ffffff,0x18ffffff, + 0x18ffffff,0x18ffffff,0x2000000,0x2000000,0x2000000,0x2000000,0x2d000000,0x2d000000,0x2d000000,0x2d000000,0x11000000,0x11000000,0x11000000,0x11000000 +}; + +static const QRgb btn17HRaisedShadowPressed_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18ffffff,0x18ffffff,0x18ffffff,0x18ffffff,0x18ffffff,0x18ffffff, + 0x18ffffff,0x18ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb btn17HSunkenShadow_data[] = { + 0x1c000000,0x1c000000,0x1c000000,0x1c000000,0x15000000,0x15000000,0x15000000,0x15000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x4effffff,0x4effffff,0x4effffff,0x4effffff,0x1effffff,0x1effffff,0x1effffff,0x1effffff +}; + +static const QRgb btn17_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x2000000,0x2b000000,0x79000000,0xb3000000,0xb3000000,0x79000000,0x29000000,0x2000000,0x0,0x0,0x0,0x2000000,0x46000000,0xb9000000, + 0x76000000,0x33000000,0x33000000,0x77000000,0xb9000000,0x46000000,0x2000000,0x0,0x0,0x20000000,0xb5000000,0x49000000,0x4000000,0x1000000, + 0x1000000,0x4000000,0x49000000,0xb4000000,0x22000000,0x0,0x0,0x6d000000,0x84000000,0x5000000,0x0,0x0,0x0,0x0, + 0x5000000,0x82000000,0x6f000000,0x0,0x0,0xab000000,0x39000000,0x1000000,0x0,0x0,0x0,0x0,0x1000000,0x39000000, + 0xac000000,0x0,0x0,0xac000000,0x39000000,0x1000000,0x0,0x0,0x0,0x0,0x1000000,0x39000000,0xac000000,0x0, + 0x0,0x6f000000,0x84000000,0x5000000,0x0,0x0,0x0,0x0,0x5000000,0x84000000,0x6f000000,0x0,0x0,0x22000000, + 0xb4000000,0x49000000,0x7000000,0x2000000,0x1000000,0x4000000,0x49000000,0xb6000000,0x22000000,0x0,0x0,0x2000000,0x46000000,0xb9000000, + 0x77000000,0x33000000,0x33000000,0x77000000,0xba000000,0x46000000,0x2000000,0x0,0x0,0x0,0x2000000,0x29000000,0x79000000,0xb4000000, + 0xb6000000,0x79000000,0x29000000,0x2000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb btn17RaisedShadow3_data[] = { + 0x0,0x0,0x0,0x2000000,0x5000000,0xb000000,0xb000000,0x5000000,0x2000000,0x0,0x0,0x0,0x0,0x0, + 0x3000000,0xd000000,0x15000000,0x10000000,0x10000000,0x15000000,0xd000000,0x3000000,0x0,0x0,0x0,0x3000000,0xe000000,0xf000000, + 0x26f8f8f8,0x1dffffff,0x1effffff,0x26f8f8f8,0xf000000,0xe000000,0x3000000,0x0,0x0,0x8000000,0xe000000,0x1dffffff,0x17ffffff,0x8ffffff, + 0x8ffffff,0x17ffffff,0x1dffffff,0xe000000,0x9000000,0x0,0x3000000,0xe000000,0x1ef6f6f6,0x12ffffff,0x1ffffff,0x0,0x0,0x1ffffff, + 0x12ffffff,0x1ef6f6f6,0xe000000,0x3000000,0x7000000,0xb000000,0x17ffffff,0x7ffffff,0x0,0x0,0x0,0x0,0x6ffffff,0x18ffffff, + 0xb000000,0x7000000,0x9000000,0x8000000,0x18ffffff,0x7ffffff,0x0,0x0,0x0,0x0,0x6ffffff,0x18ffffff,0x8000000,0x9000000, + 0x8000000,0xe000000,0x20f7f7f7,0x12ffffff,0x1ffffff,0x0,0x0,0x1ffffff,0x12ffffff,0x1ff6f6f6,0xe000000,0x8000000,0x5000000,0x10000000, + 0x8000000,0x16ffffff,0x12ffffff,0x6ffffff,0x6ffffff,0x12ffffff,0x16ffffff,0x8000000,0x10000000,0x5000000,0x2000000,0x9000000,0x12000000,0x7000000, + 0x19ffffff,0x18ffffff,0x18ffffff,0x18ffffff,0x7000000,0x12000000,0x9000000,0x2000000,0x0,0x3000000,0xb000000,0x15000000,0xf000000,0x8000000, + 0x8000000,0xf000000,0x15000000,0xb000000,0x4000000,0x0,0x0,0x1000000,0x3000000,0x9000000,0x10000000,0x16000000,0x16000000,0x10000000, + 0x9000000,0x4000000,0x1000000,0x0,0x0,0x0,0x0,0x2000000,0x5000000,0x8000000,0x8000000,0x5000000,0x2000000,0x0, + 0x0,0x0 +}; + +static const QRgb btn17RaisedShadowPressed_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x25ffffff,0x1dffffff,0x1effffff,0x25ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1dffffff,0x17ffffff,0x8ffffff, + 0x8ffffff,0x17ffffff,0x1dffffff,0x0,0x0,0x0,0x0,0x0,0x1dffffff,0x12ffffff,0x1ffffff,0x0,0x0,0x1ffffff, + 0x12ffffff,0x1dffffff,0x0,0x0,0x0,0x0,0x17ffffff,0x7ffffff,0x0,0x0,0x0,0x0,0x6ffffff,0x18ffffff, + 0x0,0x0,0x0,0x0,0x18ffffff,0x7ffffff,0x0,0x0,0x0,0x0,0x6ffffff,0x18ffffff,0x0,0x0, + 0x0,0x0,0x1fffffff,0x12ffffff,0x1ffffff,0x0,0x0,0x1ffffff,0x12ffffff,0x1effffff,0x0,0x0,0x0,0x0, + 0x0,0x16ffffff,0x12ffffff,0x6ffffff,0x6ffffff,0x12ffffff,0x16ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x19ffffff,0x18ffffff,0x18ffffff,0x18ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb btn17SunkenShadow_data[] = { + 0x0,0x0,0x0,0x4000000,0xb000000,0x15000000,0x15000000,0xb000000,0x4000000,0x0,0x0,0x0,0x0,0x0, + 0x6000000,0x16000000,0x25000000,0x1c000000,0x1c000000,0x25000000,0x16000000,0x6000000,0x0,0x0,0x1ffffff,0x4000000,0x16000000,0x1b000000, + 0x3000000,0x0,0x0,0x3000000,0x1b000000,0x16000000,0x4000000,0x1ffffff,0x6d4d4d4,0xb000000,0x18000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x18000000,0xb000000,0x6d4d4d4,0x10cfcfcf,0x13000000,0x2000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x2000000,0x13000000,0x10cfcfcf,0x1ad7d7d7,0x10000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x10000000,0x1ad7d7d7,0x1ef6f6f6,0x7000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7000000,0x1ff6f6f6, + 0x1cffffff,0x17d2d2d2,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x17d2d2d2,0x1cffffff,0x16ffffff,0x29ffffff, + 0x3000000,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x29ffffff,0x16ffffff,0xdffffff,0x2cffffff,0x24ffffff,0x2000000, + 0x1000000,0x0,0x0,0x1000000,0x2000000,0x24ffffff,0x2cffffff,0xdffffff,0x5ffffff,0x16ffffff,0x34ffffff,0x34ffffff,0x19f4f4f4,0x2000000, + 0x2000000,0x19f4f4f4,0x34ffffff,0x34ffffff,0x16ffffff,0x5ffffff,0x1ffffff,0x6ffffff,0x16ffffff,0x2cffffff,0x3fffffff,0x4affffff,0x4affffff,0x3fffffff, + 0x2cffffff,0x16ffffff,0x6ffffff,0x1ffffff,0x0,0x1ffffff,0x5ffffff,0xdffffff,0x16ffffff,0x1bffffff,0x1bffffff,0x16ffffff,0xdffffff,0x5ffffff, + 0x1ffffff,0x0 +}; + +static const QRgb btn17V_data[] = { + 0x0,0xc6000000,0x23000000,0x23000000,0xc6000000,0x0,0x0,0xc6000000,0x23000000,0x23000000,0xc6000000,0x0,0x0,0xc6000000, + 0x23000000,0x23000000,0xc6000000,0x0,0x0,0xc6000000,0x23000000,0x23000000,0xc6000000,0x0 +}; + +static const QRgb btn17VRaisedShadow_data[] = { + 0x16000000,0x0,0x18ffffff,0x18ffffff,0x0,0x16000000,0x16000000,0x0,0x18ffffff,0x18ffffff,0x0,0x16000000,0x16000000,0x0, + 0x18ffffff,0x18ffffff,0x0,0x16000000,0x16000000,0x0,0x18ffffff,0x18ffffff,0x0,0x16000000 +}; + +static const QRgb btn17VRaisedShadowPressed_data[] = { + 0x0,0x0,0x18ffffff,0x18ffffff,0x0,0x0,0x0,0x0,0x18ffffff,0x18ffffff,0x0,0x0,0x0,0x0, + 0x18ffffff,0x18ffffff,0x0,0x0,0x0,0x0,0x18ffffff,0x18ffffff,0x0,0x0 +}; + +static const QRgb btn17VSunkenShadow_data[] = { + 0x22d9d9d9,0x0,0x0,0x0,0x0,0x22d9d9d9,0x22d9d9d9,0x0,0x0,0x0,0x0,0x22d9d9d9,0x22d9d9d9,0x0, + 0x0,0x0,0x0,0x22d9d9d9,0x22d9d9d9,0x0,0x0,0x0,0x0,0x22d9d9d9 +}; + +static const QRgb btnPressedShadowHLines_data[] = { + 0x81000000,0x81000000,0x81000000,0x81000000,0x4a000000,0x4a000000,0x4a000000,0x4a000000,0x1f000000,0x1f000000,0x1f000000,0x1f000000,0x8000000,0x8000000, + 0x8000000,0x8000000,0x1e000000,0x1e000000,0x1e000000,0x1e000000 +}; + +static const QRgb btnPressedShadowRectangular_data[] = { + 0x9c000000,0x8c000000,0x84000000,0x81000000,0x81000000,0x81000000,0x81000000,0x84000000,0x8c000000,0x9c000000,0x7a000000,0x5e000000,0x50000000,0x4b000000, + 0x4a000000,0x4a000000,0x4b000000,0x4f000000,0x5e000000,0x7a000000,0x5e000000,0x3a000000,0x26000000,0x20000000,0x1f000000,0x1f000000,0x20000000,0x26000000, + 0x39000000,0x5e000000,0x50000000,0x26000000,0x11000000,0x0,0x0,0x0,0x0,0x11000000,0x26000000,0x50000000,0x4b000000,0x20000000, + 0xa000000,0x0,0x0,0x0,0x0,0xa000000,0x20000000,0x4b000000,0x4a000000,0x1f000000,0x9000000,0x2000000,0x1000000,0x8000000, + 0x1e000000,0x4a000000,0x0,0x0,0x4b000000,0x20000000,0xa000000,0x2000000,0x2000000,0x9000000,0x1f000000,0x4a000000,0x0,0x0, + 0x4f000000,0x26000000,0x10000000,0xa000000,0x9000000,0x10000000,0x26000000,0x4f000000,0x0,0x0,0x5e000000,0x39000000,0x26000000,0x1f000000, + 0x1f000000,0x26000000,0x39000000,0x5e000000,0x0,0x0 +}; + +static const QRgb btnPressedShadowRound_data[] = { + 0x0,0x0,0x53000000,0x72000000,0x82000000,0x82000000,0x72000000,0x53000000,0x0,0x0,0x0,0x68000000,0x79000000,0x62000000, + 0x54000000,0x54000000,0x62000000,0x78000000,0x68000000,0x0,0x33000000,0x6e000000,0x4d000000,0x35000000,0x28000000,0x27000000,0x35000000,0x4d000000, + 0x6e000000,0x33000000,0x5a000000,0x4d000000,0x2b000000,0x17000000,0x7000000,0x7000000,0x17000000,0x2b000000,0x4d000000,0x5a000000,0x55000000,0x2e000000, + 0x14000000,0x4000000,0x2000000,0x2000000,0x4000000,0x14000000,0x2e000000,0x55000000,0x3f000000,0x27000000,0xe000000,0x3000000,0x3000000,0xd000000, + 0x27000000,0x3f000000,0x0,0x0,0x22000000,0x35000000,0x16000000,0x8000000,0x8000000,0x16000000,0x35000000,0x22000000,0x0,0x0, + 0x0,0x2a000000,0x2b000000,0x16000000,0x16000000,0x2a000000,0x2a000000,0x0,0x0,0x0,0x0,0x0,0x1b000000,0x27000000, + 0x27000000,0x1b000000,0x0,0x0,0x0,0x0 +}; + +static const QRgb btnPressedShadowVLines_data[] = { + 0x4a000000,0x1f000000,0x9000000,0x8000000,0x1e000000,0x4a000000,0x4a000000,0x1f000000,0x9000000,0x8000000,0x1e000000,0x4a000000,0x4a000000,0x1f000000, + 0x9000000,0x8000000,0x1e000000,0x4a000000,0x4a000000,0x1f000000,0x9000000,0x8000000,0x1e000000,0x4a000000 +}; + +static const QRgb checkbox2inside_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0xc7000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xc7000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0x0,0x0,0x0,0x0,0x0,0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0,0x0,0x0,0x0,0x0,0x0,0xff000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0x0,0x0,0x0,0x0,0x0,0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0,0x0,0x0,0x0,0x0,0x0,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0x0,0x0,0x0,0x0,0x0,0x0,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0,0x0,0x0,0x0,0x0,0x0,0xff000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0xc7000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xc7000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb checkbox2pressed_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x27000000,0x3b000000,0x2d000000,0x24000000,0x22000000,0x22000000,0x22000000,0x22000000,0x24000000,0x2c000000,0x3b000000,0x27000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x3b000000,0x16000000,0x8000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000, + 0x8000000,0x16000000,0x3b000000,0x0,0x0,0x0,0x0,0x0,0x0,0x2d000000,0x8000000,0x1000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0x8000000,0x2c000000,0x0,0x0,0x0,0x0,0x0,0x0,0x24000000, + 0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x23000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x22000000,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3000000, + 0x21000000,0x0,0x0,0x0,0x0,0x0,0x0,0x22000000,0x4000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x3000000,0x21000000,0x0,0x0,0x0,0x0,0x0,0x0,0x22000000,0x4000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3000000,0x21000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x22000000,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3000000,0x21000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x24000000,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x4000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x2c000000,0x8000000,0x1000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0x8000000,0x2c000000,0x0,0x0,0x0,0x0,0x0,0x0,0x3b000000, + 0x16000000,0x8000000,0x4000000,0x3000000,0x3000000,0x3000000,0x3000000,0x3000000,0x7000000,0x15000000,0x3a000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x27000000,0x3b000000,0x2c000000,0x23000000,0x21000000,0x21000000,0x21000000,0x21000000,0x23000000,0x2c000000,0x3a000000, + 0x27000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb checkbox2rect_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1a000000,0x6a000000,0xba000000,0xc8000000, + 0xc8000000,0xc8000000,0xc8000000,0xc8000000,0xc8000000,0xc8000000,0xc8000000,0xba000000,0x6a000000,0x18000000,0x0,0x0,0x0,0x0, + 0x6a000000,0x87000000,0x2a000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x2a000000,0x84000000,0x6a000000, + 0x0,0x0,0x0,0x0,0xba000000,0x2a000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x2a000000,0xba000000,0x0,0x0,0x0,0x0,0xc8000000,0x17000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0xc8000000,0x0,0x0,0x0,0x0,0xc8000000,0x17000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0xc8000000,0x0,0x0, + 0x0,0x0,0xc8000000,0x17000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x17000000,0xc8000000,0x0,0x0,0x0,0x0,0xc8000000,0x17000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x17000000,0xc8000000,0x0,0x0,0x0,0x0,0xc8000000,0x17000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0xc8000000,0x0,0x0,0x0,0x0, + 0xc8000000,0x17000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0xc8000000, + 0x0,0x0,0x0,0x0,0xc8000000,0x17000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x17000000,0xc8000000,0x0,0x0,0x0,0x0,0xc8000000,0x17000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0xc8000000,0x0,0x0,0x0,0x0,0xba000000,0x2a000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2a000000,0xba000000,0x0,0x0, + 0x0,0x0,0x6a000000,0x8a000000,0x2a000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x17000000,0x2a000000, + 0x87000000,0x6a000000,0x0,0x0,0x0,0x0,0x1a000000,0x6a000000,0xba000000,0xc8000000,0xc8000000,0xc8000000,0xc8000000,0xc8000000, + 0xc8000000,0xc8000000,0xc8000000,0xba000000,0x6a000000,0x1a000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb checkbox2shadow_data[] = { + 0x0,0x0,0x0,0x2000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000,0x4000000, + 0x2000000,0x0,0x0,0x0,0x0,0x0,0x4000000,0xf222222,0x17212121,0x191e1e1e,0x191e1e1e,0x1a272727,0x1a272727,0x1a272727, + 0x1a272727,0x1a272727,0x191e1e1e,0x17212121,0xf222222,0x4000000,0x0,0x0,0x0,0x3555555,0x13505050,0x106f6f6f,0xfefefe,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xfefefe,0x11696969,0x144c4c4c,0x3555555,0x0,0xffffff,0xa999999, + 0x13868686,0xffffff,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfcfcfc,0x14898989, + 0xa999999,0xffffff,0x2ffffff,0x15cecece,0xfcfcfc,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd, + 0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfcfcfc,0x16cacaca,0x2ffffff,0x3ffffff,0x1edcdcdc,0xffffff,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd, + 0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0x1fd9d9d9,0x3ffffff,0x4ffffff,0x22dddddd,0xfdfdfd,0xfdfdfd, + 0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd,0xfefefe,0xfdfdfd,0x22e1e1e1,0x4ffffff, + 0x4ffffff,0x22dddddd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd, + 0xfdfdfd,0xfdfdfd,0x22e1e1e1,0x4ffffff,0x4ffffff,0x22e1e1e1,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe, + 0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd,0x22e1e1e1,0x4ffffff,0x4ffffff,0x22e1e1e1,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe, + 0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd,0x22e1e1e1,0x4ffffff,0x4ffffff,0x22e1e1e1, + 0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd, + 0x22e1e1e1,0x4ffffff,0x4ffffff,0x22e1e1e1,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe, + 0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd,0x22e1e1e1,0x4ffffff,0x4ffffff,0x22e1e1e1,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe, + 0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd,0x22e1e1e1,0x4ffffff,0x4ffffff,0x20efefef,0xfdfdfd,0xfdfdfd, + 0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd,0xffffff,0x20efefef,0x4ffffff, + 0x3ffffff,0x1afefefe,0x20ededed,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfefefe,0xfdfdfd,0xfdfdfd, + 0xfdfdfd,0x20ededed,0x1bffffff,0x3ffffff,0x2ffffff,0x11ffffff,0x35fefefe,0x25f6f6f6,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd, + 0xfdfdfd,0xfdfdfd,0xfdfdfd,0xfdfdfd,0x25f8f8f8,0x35fefefe,0x12fefefe,0x2ffffff,0xffffff,0x6ffffff,0x19fafafa,0x35fcfcfc,0x48fdfdfd,0x4effffff, + 0x4ffdfdfd,0x4ffdfdfd,0x4ffdfdfd,0x4ffdfdfd,0x4ffdfdfd,0x4ffdfdfd,0x4ffdfdfd,0x48fdfdfd,0x35fefefe,0x19ffffff,0x7efefef,0xffffff,0x0,0x1ffffff, + 0x6ffffff,0x11ffffff,0x1afefefe,0x1dffffff,0x1effffff,0x1effffff,0x1effffff,0x1effffff,0x1effffff,0x1effffff,0x1effffff,0x1afefefe,0x11ffffff,0x6ffffff, + 0x1ffffff,0x0,0x0,0x0,0xffffff,0x2ffffff,0x3ffffff,0x3ffffff,0x3ffffff,0x4ffffff,0x4ffffff,0x4ffffff,0x4ffffff,0x4ffffff, + 0x3ffffff,0x3ffffff,0x2ffffff,0xffffff,0x0,0x0 +}; + +static const QRgb checkListExclusiveIndicator_data[] = { + 0x0,0x0,0x3000000,0x28000000,0x76000000,0x9c000000,0xa3000000,0x9c000000,0x76000000,0x28000000,0x3000000,0x0,0x0,0x0, + 0x4000000,0x61000000,0xad000000,0x71000000,0x42000000,0x31000000,0x42000000,0x71000000,0xad000000,0x61000000,0x4000000,0x0,0x3000000,0x65000000, + 0xaf000000,0x20000000,0x4000000,0x1000000,0x1000000,0x1000000,0x4000000,0x20000000,0xaf000000,0x65000000,0x3000000,0x29000000,0xb1000000,0x21000000, + 0x2000000,0x0,0x0,0x0,0x0,0x0,0x2000000,0x21000000,0xb1000000,0x29000000,0x79000000,0x82000000,0x4000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x82000000,0x79000000,0xa3000000,0x4a000000,0x1000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1000000,0x4a000000,0xa3000000,0xae000000,0x38000000,0x1000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0x38000000,0xae000000,0xa3000000,0x4a000000,0x1000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x1000000,0x4a000000,0xa3000000,0x79000000,0x82000000,0x4000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x4000000,0x82000000,0x79000000,0x29000000,0xb1000000,0x21000000,0x2000000,0x0,0x0,0x0,0x0,0x0, + 0x2000000,0x21000000,0xb1000000,0x29000000,0x3000000,0x65000000,0xaf000000,0x20000000,0x4000000,0x1000000,0x1000000,0x1000000,0x4000000,0x20000000, + 0xaf000000,0x65000000,0x3000000,0x0,0x4000000,0x61000000,0xad000000,0x6d000000,0x42000000,0x31000000,0x42000000,0x6d000000,0xad000000,0x61000000, + 0x4000000,0x0,0x0,0x0,0x3000000,0x28000000,0x76000000,0x9c000000,0xa3000000,0x9c000000,0x76000000,0x28000000,0x3000000,0x0, + 0x0 +}; + +static const QRgb checkmark_data[] = { + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0x37000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0x28000000,0xf1000000,0x46000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xf000000,0xd8000000,0xd7000000,0x9000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1000000,0xb7000000,0xfe000000,0x34000000,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0x3e000000,0x2000000,0xffffff,0xffffff,0x82000000,0xff000000,0x7f000000,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x48000000,0xfb000000,0xa3000000,0xffffff,0x50000000,0xff000000,0xd0000000,0x3000000,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x12000000,0xe1000000,0xff000000,0x91000000,0xf5000000,0xf5000000,0x27000000, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1f000000,0xee000000,0xff000000,0xff000000, + 0x6d000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x2f000000, + 0xf8000000,0xbb000000,0x1000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0x54000000,0x15000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff +}; + +static const QRgb dockBack_data[] = { + 0x0,0x0,0x1ffffff,0x360c0c0c,0x65030303,0x79010101,0x79010101,0x65030303,0x360c0c0c,0x1ffffff,0x0,0x0,0x0,0x1ffffff, + 0x4d070707,0x6f000000,0x60000000,0x59000000,0x59000000,0x60000000,0x6f000000,0x4d070707,0x1bfbfbf,0x0,0x1ffffff,0x36141414,0x68000000,0x55000000, + 0x4f000000,0x3d5a5a5a,0x3c5c5c5c,0x4f000000,0x55000000,0x68000000,0x36141414,0x1ffffff,0x4ffffff,0x5a0b0b0b,0x55000000,0x4d000000,0x4c000000,0x3c606060, + 0x3b626262,0x4c000000,0x4d000000,0x55000000,0x5a0b0b0b,0x4ffffff,0x9f6f6f6,0x5e020202,0x4f000000,0x4c000000,0x4c000000,0x39585858,0x385a5a5a,0x4c000000, + 0x4c000000,0x4f000000,0x5e020202,0x9ffffff,0xbffffff,0x57040404,0x4d000000,0x4c000000,0x4c000000,0x2e303030,0x2d323232,0x4c000000,0x4c000000,0x4d000000, + 0x57040404,0xbffffff,0xbffffff,0x4e242424,0x4d000000,0x3d000000,0x478a8a8a,0x31fdfdfd,0x32fdfdfd,0x478a8a8a,0x3d000000,0x4d000000,0x4e242424,0xbffffff, + 0x9ffffff,0x3f6b6b6b,0x4f000000,0x4c000000,0x45000000,0x4b838383,0x46858585,0x45000000,0x4c000000,0x4f000000,0x3f6c6c6c,0x9ffffff,0x4eeeeee,0x1dfcfcfc, + 0x46505050,0x4d000000,0x4c000000,0x4c000000,0x4c000000,0x4c000000,0x4d000000,0x46505050,0x1dfcfcfc,0x4ffffff,0x1ffffff,0x9ffffff,0x26fdfdfd,0x43858585, + 0x492e2e2e,0x4c050505,0x4c050505,0x492e2e2e,0x43858585,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff,0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd, + 0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff,0x9ffffff,0xbffffff,0xbffffff,0x9ffffff, + 0x4ffffff,0x1ffffff,0x0,0x0,0x0,0x0,0x1ffffff,0x41090909,0x7b010101,0x94010101,0x94010101,0x7b010101,0x41090909,0x1ffffff, + 0x0,0x0,0x0,0x1ffffff,0x5f060606,0x8e000000,0x83000000,0x7d000000,0x7d000000,0x83000000,0x8e000000,0x5f060606,0x1bfbfbf,0x0, + 0x1ffffff,0x42111111,0x89000000,0x7a000000,0x75000000,0x4e404040,0x4d414141,0x75000000,0x7a000000,0x89000000,0x42111111,0x1ffffff,0x4ffffff,0x73090909, + 0x7a000000,0x74000000,0x73000000,0x4d454545,0x4c454545,0x73000000,0x74000000,0x7a000000,0x73090909,0x4ffffff,0x9f6f6f6,0x7f010101,0x75000000,0x73000000, + 0x73000000,0x4a3d3d3d,0x493e3e3e,0x73000000,0x73000000,0x75000000,0x7f010101,0x9ffffff,0xbffffff,0x7a030303,0x74000000,0x73000000,0x73000000,0x41222222, + 0x40232323,0x73000000,0x73000000,0x74000000,0x7a030303,0xbffffff,0xbffffff,0x68161616,0x74000000,0x5c000000,0x556e6e6e,0x31fdfdfd,0x32fdfdfd,0x556e6e6e, + 0x5c000000,0x74000000,0x68161616,0xbffffff,0x9ffffff,0x49555555,0x75000000,0x73000000,0x68000000,0x5a626262,0x54666666,0x68000000,0x73000000,0x75000000, + 0x49565656,0x9ffffff,0x4eeeeee,0x1dfcfcfc,0x593a3a3a,0x74000000,0x73000000,0x73000000,0x73000000,0x73000000,0x74000000,0x593a3a3a,0x1dfcfcfc,0x4ffffff, + 0x1ffffff,0x9ffffff,0x26fdfdfd,0x4e6c6c6c,0x641d1d1d,0x71030303,0x71030303,0x641d1d1d,0x4e6c6c6c,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff, + 0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd,0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff, + 0x9ffffff,0xbffffff,0xbffffff,0x9ffffff,0x4ffffff,0x1ffffff,0x0,0x0 +}; + +static const QRgb dockClose_data[] = { + 0x0,0x0,0x1ffffff,0x360c0c0c,0x65030303,0x79010101,0x79010101,0x65030303,0x360c0c0c,0x1ffffff,0x0,0x0,0x0,0x1ffffff, + 0x4d070707,0x6f000000,0x60000000,0x59000000,0x59000000,0x60000000,0x6f000000,0x4d070707,0x1bfbfbf,0x0,0x1ffffff,0x36141414,0x68000000,0x3c7a7a7a, + 0x3f131313,0x4d000000,0x4d000000,0x3f131313,0x3e8a8a8a,0x68000000,0x36141414,0x1ffffff,0x4ffffff,0x5a0b0b0b,0x55000000,0x434a4a4a,0x23f4f4f4,0x32141414, + 0x2c161616,0x25f8f8f8,0x452f2f2f,0x55000000,0x5a0b0b0b,0x4ffffff,0x9f6f6f6,0x5e020202,0x4f000000,0x4c000000,0x36414141,0xbf8f8f8,0xcf8f8f8,0x39353535, + 0x4c000000,0x4f000000,0x5e020202,0x9ffffff,0xbffffff,0x57040404,0x4d000000,0x4c000000,0x352a2a2a,0x23fcfcfc,0x26fdfdfd,0x352a2a2a,0x4c000000,0x4d000000, + 0x57040404,0xbffffff,0xbffffff,0x4e242424,0x4d000000,0x431e1e1e,0x31f7f7f7,0x415d5d5d,0x434b4b4b,0x33f3f3f3,0x421e1e1e,0x4d000000,0x4e242424,0xbffffff, + 0x9ffffff,0x3f6b6b6b,0x4f000000,0x42a1a1a1,0x46363636,0x4c000000,0x4c000000,0x472e2e2e,0x428d8d8d,0x4f000000,0x3f6c6c6c,0x9ffffff,0x4eeeeee,0x1dfcfcfc, + 0x46505050,0x4d000000,0x4c000000,0x4c000000,0x4c000000,0x4c000000,0x4d000000,0x46505050,0x1dfcfcfc,0x4ffffff,0x1ffffff,0x9ffffff,0x26fdfdfd,0x43858585, + 0x492e2e2e,0x4c050505,0x4c050505,0x492e2e2e,0x43858585,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff,0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd, + 0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff,0x9ffffff,0xbffffff,0xbffffff,0x9ffffff, + 0x4ffffff,0x1ffffff,0x0,0x0,0x0,0x0,0x1ffffff,0x41090909,0x7b010101,0x94010101,0x94010101,0x7b010101,0x41090909,0x1ffffff, + 0x0,0x0,0x0,0x1ffffff,0x5f060606,0x8e000000,0x83000000,0x7d000000,0x7d000000,0x83000000,0x8e000000,0x5f060606,0x1bfbfbf,0x0, + 0x1ffffff,0x42111111,0x89000000,0x44656565,0x5b0d0d0d,0x74000000,0x74000000,0x5b0d0d0d,0x45757575,0x89000000,0x42111111,0x1ffffff,0x4ffffff,0x73090909, + 0x7a000000,0x58333333,0x23f4f4f4,0x4a0d0d0d,0x410f0f0f,0x25f8f8f8,0x601c1c1c,0x7a000000,0x73090909,0x4ffffff,0x9f6f6f6,0x7f010101,0x75000000,0x73000000, + 0x4a2c2c2c,0xbf8f8f8,0xcf8f8f8,0x4f232323,0x73000000,0x75000000,0x7f010101,0x9ffffff,0xbffffff,0x7a030303,0x74000000,0x73000000,0x4a1b1b1b,0x23fcfcfc, + 0x26fdfdfd,0x4b1a1a1a,0x73000000,0x74000000,0x7a030303,0xbffffff,0xbffffff,0x68161616,0x74000000,0x60121212,0x32f2f2f2,0x54424242,0x59303030,0x33eeeeee, + 0x5f121212,0x74000000,0x68161616,0xbffffff,0x9ffffff,0x49555555,0x75000000,0x4c858585,0x60222222,0x73000000,0x73000000,0x621c1c1c,0x4e717171,0x75000000, + 0x49565656,0x9ffffff,0x4eeeeee,0x1dfcfcfc,0x593a3a3a,0x74000000,0x73000000,0x73000000,0x73000000,0x73000000,0x74000000,0x593a3a3a,0x1dfcfcfc,0x4ffffff, + 0x1ffffff,0x9ffffff,0x26fdfdfd,0x4e6c6c6c,0x641d1d1d,0x71030303,0x71030303,0x641d1d1d,0x4e6c6c6c,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff, + 0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd,0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff, + 0x9ffffff,0xbffffff,0xbffffff,0x9ffffff,0x4ffffff,0x1ffffff,0x0,0x0 +}; + +static const QRgb dockStay_data[] = { + 0x0,0x0,0x1ffffff,0x360c0c0c,0x65030303,0x79010101,0x79010101,0x65030303,0x360c0c0c,0x1ffffff,0x0,0x0,0x0,0x1ffffff, + 0x4d070707,0x6f000000,0x60000000,0x59000000,0x59000000,0x60000000,0x6f000000,0x4d070707,0x1bfbfbf,0x0,0x1ffffff,0x36141414,0x68000000,0x403b3b3b, + 0x3fa2a2a2,0x44b3b3b3,0x44b2b2b2,0x3fa2a2a2,0x403b3b3b,0x68000000,0x36141414,0x1ffffff,0x4ffffff,0x5a0b0b0b,0x55000000,0x277b7b7b,0x3d000000,0x4c000000, + 0x4c000000,0x3d000000,0x277b7b7b,0x55000000,0x5a0b0b0b,0x4ffffff,0x9f6f6f6,0x5e020202,0x4f000000,0x267f7f7f,0x4c000000,0x4c000000,0x4c000000,0x4c000000, + 0x267f7f7f,0x4f000000,0x5e020202,0x9ffffff,0xbffffff,0x57040404,0x4d000000,0x257c7c7c,0x4c000000,0x4c000000,0x4c000000,0x4c000000,0x257c7c7c,0x4d000000, + 0x57040404,0xbffffff,0xbffffff,0x4e242424,0x4d000000,0x267d7d7d,0x3d000000,0x4c000000,0x4c000000,0x3d000000,0x267d7d7d,0x4d000000,0x4e242424,0xbffffff, + 0x9ffffff,0x3f6b6b6b,0x4f000000,0x50848484,0x43b5b5b5,0x43b5b5b5,0x43b5b5b5,0x43b5b5b5,0x50848484,0x4f000000,0x3f6c6c6c,0x9ffffff,0x4eeeeee,0x1dfcfcfc, + 0x46505050,0x4d000000,0x4c000000,0x4c000000,0x4c000000,0x4c000000,0x4d000000,0x46505050,0x1dfcfcfc,0x4ffffff,0x1ffffff,0x9ffffff,0x26fdfdfd,0x43858585, + 0x492e2e2e,0x4c050505,0x4c050505,0x492e2e2e,0x43858585,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff,0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd, + 0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff,0x9ffffff,0xbffffff,0xbffffff,0x9ffffff, + 0x4ffffff,0x1ffffff,0x0,0x0,0x0,0x0,0x1ffffff,0x41090909,0x7b010101,0x94010101,0x94010101,0x7b010101,0x41090909,0x1ffffff, + 0x0,0x0,0x0,0x1ffffff,0x5f060606,0x8e000000,0x83000000,0x7d000000,0x7d000000,0x83000000,0x8e000000,0x5f060606,0x1bfbfbf,0x0, + 0x1ffffff,0x42111111,0x89000000,0x522b2b2b,0x47898989,0x4c999999,0x4c989898,0x47898989,0x522b2b2b,0x89000000,0x42111111,0x1ffffff,0x4ffffff,0x73090909, + 0x7a000000,0x31616161,0x5c000000,0x73000000,0x73000000,0x5c000000,0x31616161,0x7a000000,0x73090909,0x4ffffff,0x9f6f6f6,0x7f010101,0x75000000,0x30646464, + 0x73000000,0x73000000,0x73000000,0x73000000,0x30646464,0x75000000,0x7f010101,0x9ffffff,0xbffffff,0x7a030303,0x74000000,0x2e5e5e5e,0x73000000,0x73000000, + 0x73000000,0x73000000,0x2e5e5e5e,0x74000000,0x7a030303,0xbffffff,0xbffffff,0x68161616,0x74000000,0x30636363,0x5c000000,0x73000000,0x73000000,0x5c000000, + 0x30636363,0x74000000,0x68161616,0xbffffff,0x9ffffff,0x49555555,0x75000000,0x60646464,0x4b9b9b9b,0x4b9b9b9b,0x4b9b9b9b,0x4b9b9b9b,0x60646464,0x75000000, + 0x49565656,0x9ffffff,0x4eeeeee,0x1dfcfcfc,0x593a3a3a,0x74000000,0x73000000,0x73000000,0x73000000,0x73000000,0x74000000,0x593a3a3a,0x1dfcfcfc,0x4ffffff, + 0x1ffffff,0x9ffffff,0x26fdfdfd,0x4e6c6c6c,0x641d1d1d,0x71030303,0x71030303,0x641d1d1d,0x4e6c6c6c,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff, + 0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd,0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff, + 0x9ffffff,0xbffffff,0xbffffff,0x9ffffff,0x4ffffff,0x1ffffff,0x0,0x0 +}; + +static const QRgb dockToDesktop2_data[] = { + 0x0,0x0,0x1ffffff,0x360c0c0c,0x64030303,0x79010101,0x79010101,0x64030303,0x360c0c0c,0x1ffffff,0x0,0x0,0x0,0x1ffffff, + 0x4d070707,0x6f000000,0x60000000,0x59000000,0x59000000,0x60000000,0x6f000000,0x4d070707,0x1bfbfbf,0x0,0x1ffffff,0x36151515,0x68000000,0x55000000, + 0x4f000000,0x32707070,0x2d8d8d8d,0x30868686,0x3b5c5c5c,0x68000000,0x36151515,0x1ffffff,0x4ffffff,0x5a0c0c0c,0x55000000,0x4d000000,0x4c000000,0x2a8b8b8b, + 0x4c000000,0x4c000000,0x2b888888,0x55000000,0x5a0c0c0c,0x4ffffff,0x9f6f6f6,0x5e030303,0x4f000000,0x33787878,0x2c909090,0x2c909090,0x31727272,0x4c000000, + 0x2a8b8b8b,0x4f000000,0x5e030303,0x9ffffff,0xbffffff,0x57050505,0x4d000000,0x2a8b8b8b,0x4c000000,0x4c000000,0x2a8b8b8b,0x3dafafaf,0x41959595,0x4d000000, + 0x57060606,0xbffffff,0xbffffff,0x4e232323,0x4d000000,0x2a8b8b8b,0x4c000000,0x4c000000,0x2a8b8b8b,0x4c000000,0x4c000000,0x4d000000,0x4e232323,0xbffffff, + 0x9ffffff,0x3f6c6c6c,0x4f000000,0x41959595,0x3dafafaf,0x3dafafaf,0x41959595,0x4c000000,0x4c000000,0x4f000000,0x3f6c6c6c,0x9ffffff,0x4eeeeee,0x1dfcfcfc, + 0x46505050,0x4d000000,0x4c000000,0x4c000000,0x4c000000,0x4c000000,0x4d000000,0x46505050,0x1dfcfcfc,0x4ffffff,0x1ffffff,0x9ffffff,0x26fdfdfd,0x42848484, + 0x492f2f2f,0x4c070707,0x4c070707,0x492f2f2f,0x42848484,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff,0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd, + 0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff,0x9ffffff,0xbffffff,0xbffffff,0x9ffffff, + 0x4ffffff,0x1ffffff,0x0,0x0,0x0,0x0,0x1ffffff,0x41090909,0x7b020202,0x94000000,0x94000000,0x7b020202,0x41090909,0x1ffffff, + 0x0,0x0,0x0,0x1ffffff,0x5f050505,0x8e000000,0x83000000,0x7d000000,0x7d000000,0x83000000,0x8e000000,0x5f050505,0x1bfbfbf,0x0, + 0x1ffffff,0x41101010,0x89000000,0x7a000000,0x75000000,0x3f555555,0x35737373,0x386f6f6f,0x46494949,0x89000000,0x41101010,0x1ffffff,0x4ffffff,0x72080808, + 0x7a000000,0x74000000,0x73000000,0x32707070,0x73000000,0x73000000,0x336e6e6e,0x7a000000,0x72080808,0x4ffffff,0x9f6f6f6,0x7f020202,0x75000000,0x405b5b5b, + 0x34757575,0x34757575,0x3e565656,0x73000000,0x32707070,0x75000000,0x7f020202,0x9ffffff,0xbffffff,0x79030303,0x74000000,0x32707070,0x73000000,0x73000000, + 0x32707070,0x44969696,0x4d777777,0x74000000,0x79030303,0xbffffff,0xbffffff,0x68161616,0x74000000,0x32707070,0x73000000,0x73000000,0x32707070,0x73000000, + 0x73000000,0x74000000,0x68161616,0xbffffff,0x9ffffff,0x4a565656,0x75000000,0x4d777777,0x44969696,0x44969696,0x4d777777,0x73000000,0x73000000,0x75000000, + 0x4a575757,0x9ffffff,0x4eeeeee,0x1dfcfcfc,0x593a3a3a,0x74000000,0x73000000,0x73000000,0x73000000,0x73000000,0x74000000,0x593a3a3a,0x1dfcfcfc,0x4ffffff, + 0x1ffffff,0x9ffffff,0x26fdfdfd,0x4d6b6b6b,0x641e1e1e,0x70030303,0x70030303,0x641e1e1e,0x4d6b6b6b,0x26fdfdfd,0xaf7f7f7,0x1ffffff,0x0,0x1ffffff, + 0x9ffffff,0x1dffffff,0x30fdfdfd,0x39fdfdfd,0x3afdfdfd,0x30fdfdfd,0x1dfcfcfc,0x9ffffff,0x1ffffff,0x0,0x0,0x0,0x1ffffff,0x4ffffff, + 0x9ffffff,0xbffffff,0xbffffff,0x9ffffff,0x4ffffff,0x1ffffff,0x0,0x0 +}; + +static const QRgb focusRectEdges_data[] = { + 0x0,0x3b000000,0xbb000000,0xbb000000,0x3b000000,0x0,0x33000000,0xc1000000,0x20000000,0x20000000,0xc1000000,0x33000000,0xbb000000,0x17000000, + 0x0,0x0,0x17000000,0xbb000000,0xbb000000,0x17000000,0x0,0x0,0x17000000,0xbb000000,0x33000000,0xc1000000,0x20000000,0x20000000, + 0xc1000000,0x33000000,0x0,0x3b000000,0xbb000000,0xbb000000,0x3b000000,0x0 +}; + +static const QRgb groupBoxMask_small_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x1bff0000,0x88ff0000,0xd1ff0000,0xffff0000,0xffff0000,0xd1ff0000,0x88ff0000,0x1bff0000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x64ff0000,0xf6ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xf6ff0000,0x64ff0000,0x0,0x0,0x0,0x0,0x0,0x64ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x64ff0000,0x0,0x0,0x0,0x1bff0000,0xf6ff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xf6ff0000,0x1bff0000,0x0,0x0,0x88ff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x88ff0000,0x0,0x0,0xd1ff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xd1ff0000,0x0, + 0x0,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0x0,0x0,0xd1ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xd1ff0000,0x0,0x0,0x88ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x88ff0000,0x0,0x0,0x1bff0000,0xf6ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xf6ff0000,0x1bff0000,0x0,0x0,0x0,0x64ff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x64ff0000,0x0,0x0,0x0,0x0,0x0,0x64ff0000, + 0xf6ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xf6ff0000,0x64ff0000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1bff0000,0x88ff0000,0xd1ff0000,0xffff0000,0xffff0000,0xd1ff0000,0x88ff0000,0x1bff0000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0 +}; + +static const QRgb groupBox_small_data[] = { + 0xffffff,0xffffff,0xffffff,0xffffff,0x3ffffff,0xbffffff,0x13ffffff,0x17ffffff,0x17ffffff,0x13ffffff,0xbffffff,0x3ffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0x1ffffff,0xbffffff,0x27b8b8b8,0x464d4d4d,0x4e212121,0x48000000,0x48000000,0x4e212121,0x464d4d4d,0x27b8b8b8, + 0xbffffff,0x1ffffff,0xffffff,0xffffff,0xffffff,0x1ffffff,0xfffffff,0x40707070,0x44080808,0x37000000,0x29000000,0x21000000,0x20000000,0x28000000, + 0x37000000,0x44080808,0x40707070,0xfffffff,0x2ffffff,0xffffff,0xffffff,0xcffffff,0x417a7a7a,0x39000000,0x23000000,0x12000000,0xa000000,0x5000000, + 0x5000000,0xa000000,0x12000000,0x22000000,0x39000000,0x417a7a7a,0xcffffff,0xffffff,0x6ffffff,0x2bc4c4c4,0x3d0d0d0d,0x1c000000,0x9000000,0x3000000, + 0x1000000,0xffffff,0xffffff,0x1000000,0x3000000,0x9000000,0x1c000000,0x3d0d0d0d,0x2bc4c4c4,0x6ffffff,0x12ffffff,0x3e5f5f5f,0x22000000,0x9000000, + 0x1000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1000000,0x9000000,0x22000000,0x3e5f5f5f,0x13ffffff,0x20ffffff,0x39363636, + 0x13000000,0x3000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x3000000,0x12000000,0x39363636,0x20ffffff, + 0x22ffffff,0x21000000,0xa000000,0x1000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1000000,0xa000000, + 0x21000000,0x22ffffff,0x22ffffff,0x2a4c4c4c,0x7000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0x6000000,0x2a4c4c4c,0x21ffffff,0x1dffffff,0x38878787,0xe000000,0x1000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0x1000000,0xe040404,0x38878787,0x1affffff,0x11ffffff,0x37dbdbdb,0x1c1b1b1b,0x4000000,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0x40d0d0d,0x1c1a1a1a,0x37dbdbdb,0x11ffffff,0x8ffffff,0x23ffffff,0x40aaaaaa,0x15010101,0x2000000,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x2000000,0x15040404,0x469c9c9c,0x23ffffff,0x9ffffff,0x3ffffff,0x11ffffff,0x30ffffff,0x47a9a9a9, + 0x1b1e1e1e,0x9000000,0x2000000,0xffffff,0xffffff,0x2000000,0x9000000,0x1a202020,0x47a9a9a9,0x30ffffff,0x11ffffff,0x3ffffff,0xffffff,0x5ffffff, + 0x15ffffff,0x30ffffff,0x49e4e4e4,0x439c9c9c,0x2a6d6d6d,0x1a050505,0x19050505,0x2a6d6d6d,0x429f9f9f,0x49e8e8e8,0x30ffffff,0x15ffffff,0x5ffffff,0xffffff, + 0xffffff,0x1ffffff,0x5ffffff,0x11ffffff,0x23ffffff,0x35ffffff,0x44ffffff,0x4cffffff,0x4cffffff,0x44ffffff,0x36ffffff,0x23ffffff,0x11ffffff,0x5ffffff, + 0x1ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x3ffffff,0x8ffffff,0x11ffffff,0x18ffffff,0x1cffffff,0x1cffffff,0x18ffffff,0x11ffffff,0x8ffffff, + 0x3ffffff,0xffffff,0xffffff,0xffffff +}; + +static const QRgb lineedit4edges_data[] = { + 0x0,0x1e121212,0x56141414,0x7a181818,0x7a181818,0x56141414,0x1e121212,0x0,0x1e000000,0x6c171717,0x51151515,0x3a131313,0x3a131313,0x51151515, + 0x6c171717,0x1e000000,0x4a000000,0x3f000000,0x1b111111,0xb111111,0xb111111,0x1b111111,0x3f000000,0x4a000000,0x4e000000,0x1d000000,0x5101010,0x20a0a0a, + 0x20a0a0a,0x5101010,0x1c000000,0x4e000000,0x4f000000,0xc000000,0x0,0x0,0x0,0x0,0xa000000,0x4f000000,0x36000000,0x14000000, + 0x2000000,0x0,0x0,0x0,0x12000000,0x36000000,0x16000000,0x34000000,0xe000000,0x3000000,0x0,0xd000000,0x34000000,0x16000000, + 0x0,0x11000000,0x1d000000,0x1f000000,0x1f000000,0x1d000000,0x11000000,0x0 +}; + +static const QRgb lineedit4inside_data[] = { + 0x0,0x0,0x59ffffff,0xbfffffff,0xbfffffff,0x59ffffff,0x0,0x0,0x0,0x8cffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0x8cffffff,0x0,0x59ffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x59ffffff,0xbfffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xbfffffff,0xbfffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xbfffffff,0x59ffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x59ffffff,0x0,0x8cffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x8cffffff,0x0, + 0x0,0x0,0x59ffffff,0xbfffffff,0xbfffffff,0x59ffffff,0x0,0x0 +}; + +static const QRgb lineEditBtnEdges_d_data[] = { + 0x0,0x66ededed,0xbeededed,0xbeededed,0x66ededed,0x0,0x66ededed,0xf1ededed,0xffededed,0xffededed,0xf1ededed,0x66ededed,0xbeededed,0xffededed, + 0xffededed,0xffededed,0xffededed,0xbeededed,0xbeededed,0xffededed,0xffededed,0xffededed,0xffededed,0xbeededed,0x66ededed,0xf1ededed,0xffededed,0xffededed, + 0xf1ededed,0x66ededed,0x0,0x66ededed,0xbeededed,0xbeededed,0x66ededed,0x0 +}; + +static const QRgb lineEditBtnEdges_data[] = { + 0x0,0x2fededed,0xafededed,0xafededed,0x2fededed,0x0,0x2fededed,0xefededed,0xffededed,0xffededed,0xefededed,0x2fededed,0xafededed,0xffededed, + 0xffededed,0xffededed,0xffededed,0xafededed,0xafededed,0xffededed,0xffededed,0xffededed,0xffededed,0xafededed,0x2fededed,0xefededed,0xffededed,0xffededed, + 0xefededed,0x2fededed,0x0,0x2fededed,0xafededed,0xafededed,0x2fededed,0x0 +}; + +static const QRgb lineEditBtnShadow_data[] = { + 0x0,0x1d000000,0x25000000,0x25000000,0x1d000000,0x0,0x1d000000,0x2b000000,0x1e000000,0x1e000000,0x2b000000,0x1d000000,0x18000000,0x16000000, + 0xc000000,0xc000000,0x16000000,0x18000000,0x13000000,0xa000000,0x2000000,0x2000000,0xa000000,0x13000000,0x1a000000,0xf000000,0x6000000,0x6000000, + 0xf000000,0x1a000000,0x0,0x19000000,0xb000000,0xb000000,0x19000000,0x0 +}; + +static const QRgb lveTriangular_data[] = { + 0x4c000000,0xb000000,0x0,0x0,0x0,0x0,0x0,0x7c000000,0x77000000,0x31000000,0x0,0x0,0x0,0x0, + 0x7c000000,0x7f000000,0x7f000000,0x60000000,0xd000000,0x0,0x0,0x7c000000,0x7f000000,0x7f000000,0x7f000000,0x7d000000,0x41000000,0x1000000, + 0x7c000000,0x7f000000,0x7f000000,0x7f000000,0x7f000000,0x7f000000,0x49000000,0x7c000000,0x7f000000,0x7f000000,0x7f000000,0x7d000000,0x41000000,0x1000000, + 0x7c000000,0x7f000000,0x7f000000,0x60000000,0xd000000,0x0,0x0,0x7c000000,0x77000000,0x31000000,0x0,0x0,0x0,0x0, + 0x4c000000,0xb000000,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb menuItem_data[] = { + 0x0,0x42000000,0xb3000000,0xc5000000,0x5c000000,0x3000000,0x36000000,0xff000000,0xff000000,0xff000000,0xff000000,0x62000000,0xa0000000,0xff000000, + 0xff000000,0xff000000,0xff000000,0xcc000000,0x92000000,0xff000000,0xff000000,0xff000000,0xff000000,0xbe000000,0x28000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0x52000000,0x0,0x24000000,0x92000000,0xa4000000,0x3b000000,0x0 +}; + +static const QRgb popup5_data[] = { + 0x0,0x0,0x3a575757,0xaf575757,0xfa575757,0xfa575757,0xaf575757,0x3a575757,0x0,0x0,0x0,0x5a575757,0xec575757,0x53575757, + 0x4575757,0x4575757,0x53575757,0xec575757,0x5a575757,0x0,0x22575757,0xeb575757,0x1c575757,0x0,0x0,0x0,0x0,0x1c575757, + 0xeb575757,0x22575757,0x9c575757,0x74575757,0x0,0x0,0x0,0x0,0x0,0x0,0x74575757,0x9c575757,0xd1575757,0x2c575757, + 0x0,0x0,0x0,0x0,0x0,0x0,0x2c575757,0xd1575757,0xd1575757,0x2c575757,0x0,0x0,0x0,0x0, + 0x0,0x0,0x2c575757,0xd1575757,0x9c575757,0x75575757,0x0,0x0,0x0,0x0,0x0,0x0,0x75575757,0x9c575757, + 0x22575757,0xeb575757,0x1c575757,0x0,0x0,0x0,0x0,0x1c575757,0xeb575757,0x22575757,0x0,0x5a575757,0xec575757,0x54575757, + 0x4575757,0x4575757,0x54575757,0xec575757,0x5a575757,0x0,0x0,0x0,0x3a575757,0xae575757,0xfa575757,0xfa575757,0xae575757,0x3a575757, + 0x0,0x0 +}; + +static const QRgb progressShadow2_data[] = { + 0xc6000000,0xb2000000,0xb2000000,0xc6000000,0x8d000000,0x65000000,0x65000000,0x8d000000,0x65000000,0x2f000000,0x2f000000,0x65000000,0x65000000,0x2e000000, + 0x2e000000,0x64000000 +}; + +static const QRgb progressTile_data[] = { + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000, + 0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000, + 0x12000000,0xc000000,0x7000000,0x3000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000, + 0x12000000,0xc000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x23000000,0x1f000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x25000000,0x27000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x25000000,0x27000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000, + 0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x1b000000,0x20000000, + 0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0x10000000,0x16000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000,0xa000000,0x10000000,0x10000000,0x16000000,0x1b000000,0x20000000, + 0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000,0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000, + 0x6000000,0xa000000,0xa000000,0x10000000,0x16000000,0x1b000000,0x20000000,0x23000000,0x25000000,0x27000000,0x27000000,0x27000000,0x23000000,0x1f000000, + 0x19000000,0x12000000,0xc000000,0x7000000,0x3000000,0x2000000,0x3000000,0x6000000 +}; + +static const QRgb radio3circle_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x8000000,0xd000000,0xd000000,0xd000000,0x8000000, + 0x2000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9000000,0x38000000,0xa4000000,0xb9000000, + 0xbd000000,0xb9000000,0xa4000000,0x38000000,0x9000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe000000,0x94000000, + 0xbe000000,0x53000000,0x10000000,0xd000000,0x10000000,0x53000000,0xbe000000,0x94000000,0xe000000,0x0,0x0,0x0,0x0,0x0, + 0xa000000,0x93000000,0x98000000,0x12000000,0x4000000,0x0,0x0,0x0,0x4000000,0x12000000,0x98000000,0x93000000,0xa000000,0x0, + 0x0,0x0,0x2000000,0x37000000,0xbb000000,0x13000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x13000000, + 0xbb000000,0x37000000,0x2000000,0x0,0x0,0x9000000,0x9e000000,0x53000000,0x4000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x4000000,0x53000000,0x9e000000,0x9000000,0x0,0x0,0xc000000,0xc5000000,0x10000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x10000000,0xc5000000,0xc000000,0x0,0x0,0xd000000,0xc6000000,0xd000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xd000000,0xc6000000,0xd000000,0x0,0x0, + 0xc000000,0xc5000000,0x10000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10000000,0xc5000000, + 0xc000000,0x0,0x0,0x9000000,0x9e000000,0x53000000,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x4000000,0x53000000,0x9e000000,0x9000000,0x0,0x0,0x2000000,0x37000000,0xbb000000,0x13000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x13000000,0xbb000000,0x37000000,0x2000000,0x0,0x0,0x0,0xa000000,0x93000000,0x98000000,0x12000000, + 0x4000000,0x0,0x0,0x0,0x4000000,0x12000000,0x98000000,0x93000000,0xa000000,0x0,0x0,0x0,0x0,0x0, + 0xe000000,0x94000000,0xbe000000,0x53000000,0x10000000,0xd000000,0x10000000,0x53000000,0xbe000000,0x94000000,0xe000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x9000000,0x38000000,0xa4000000,0xba000000,0xbe000000,0xba000000,0xa4000000,0x38000000,0x9000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x8000000,0xd000000,0xd000000,0xd000000,0x8000000, + 0x2000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb radio3inside_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffff,0xffffff,0xffffff,0xffffff,0x8ffffff,0x26ffffff, + 0x2affffff,0x26ffffff,0x8ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x0,0x0,0x0,0x0,0xffffff,0xffffff,0x4ffffff, + 0x5bffffff,0xe8ffffff,0xffffffff,0xffffffff,0xffffffff,0xe8ffffff,0x5bffffff,0x4ffffff,0xffffff,0xffffff,0x0,0x0,0x0,0x0, + 0xffffff,0x4ffffff,0x95ffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x95ffffff,0x4ffffff,0xffffff,0x0, + 0x0,0x0,0x0,0xffffff,0x5effffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0x5effffff,0xffffff,0x0,0x0,0x0,0x0,0x7ffffff,0xe8ffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xe8ffffff,0x7ffffff,0x0,0x0,0x0,0x0,0x27ffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x27ffffff,0x0,0x0,0x0,0x0,0x33ffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x33ffffff,0x0,0x0,0x0, + 0x0,0x2cffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x2cffffff, + 0x0,0x0,0x0,0x0,0x11ffffff,0xebffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xebffffff,0x11ffffff,0x0,0x0,0x0,0x0,0xffffff,0x7dffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x7dffffff,0xffffff,0x0,0x0,0x0,0x0,0xffffff,0x14ffffff,0xb9ffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xb9ffffff,0x14ffffff,0xffffff,0x0,0x0,0x0,0x0,0xffffff, + 0xffffff,0x1bffffff,0x8effffff,0xebffffff,0xffffffff,0xffffffff,0xffffffff,0xebffffff,0x8effffff,0x1bffffff,0xffffff,0xffffff,0x0,0x0, + 0x0,0x0,0xffffff,0xffffff,0xffffff,0xffffff,0x8ffffff,0x26ffffff,0x2affffff,0x26ffffff,0x8ffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb radio3pressed_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0xf000000,0x2e000000,0x32000000,0x32000000,0x32000000,0x2e000000,0xf000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1f000000,0x30000000,0x19000000,0xf000000,0xc000000,0xf000000,0x19000000,0x2f000000,0x1f000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0xf000000,0x30000000,0x11000000,0x5000000,0x2000000,0x1000000,0x1000000,0x5000000,0x11000000,0x30000000, + 0xf000000,0x0,0x0,0x0,0x0,0x0,0x0,0x2e000000,0x19000000,0x5000000,0x0,0x0,0x0,0x0, + 0x0,0x5000000,0x19000000,0x2d000000,0x0,0x0,0x0,0x0,0x0,0x0,0x32000000,0xf000000,0x2000000,0x0, + 0x0,0x0,0x0,0x0,0x2000000,0xf000000,0x32000000,0x0,0x0,0x0,0x0,0x0,0xb0b0b,0x32000000, + 0xd000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x1000000,0xc000000,0x31000000,0xb0b0b,0x0,0x0,0x0, + 0x0,0x242424,0x32000000,0xf000000,0x2000000,0x0,0x0,0x0,0x0,0x0,0x2000000,0xf000000,0x32000000,0x242424, + 0x0,0x0,0x0,0x0,0x666666,0x2d000000,0x19000000,0x5000000,0x0,0x0,0x0,0x0,0x0,0x5000000, + 0x19000000,0x2d000000,0x666666,0x0,0x0,0x0,0x0,0x7f7f7f,0xf141414,0x30000000,0x11000000,0x5000000,0x2000000,0x1000000, + 0x1000000,0x5000000,0x11000000,0x30000000,0xf141414,0x7f7f7f,0x0,0x0,0x0,0x0,0x0,0x757575,0x1f050505,0x30000000, + 0x19000000,0xf000000,0xc000000,0xf000000,0x19000000,0x30000000,0x1e080808,0x757575,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x777777,0xf1e1e1e,0x2d000000,0x31000000,0x31000000,0x31000000,0x2d000000,0xf1e1e1e,0x777777,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x7f7f7f,0x6d6d6d,0x4f4f4f,0x414141,0x4f4f4f,0x6d6d6d,0x7f7f7f,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb radio3shadow_data[] = { + 0x0,0x0,0x0,0x0,0x1000000,0x3000000,0x7000000,0xa000000,0xc000000,0xa000000,0x7000000,0x3000000,0x1000000,0x0, + 0x0,0x0,0x0,0xffffff,0xffffff,0xffffff,0x2000000,0x8000000,0x10000000,0x1b090909,0x24151515,0x26141414,0x24151515,0x1b090909, + 0x11000000,0x8000000,0x2000000,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x2000000,0xa000000,0x1b1c1c1c,0x2e2c2c2c,0xdffffff,0xbffffff, + 0xbffffff,0xbffffff,0xdffffff,0x2e2c2c2c,0x1b1c1c1c,0xa000000,0x2000000,0xffffff,0xffffff,0xffffff,0x1000000,0x91c1c1c,0x1d2b2b2b,0x10ffffff, + 0x6ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x6ffffff,0x10ffffff,0x1d2b2b2b,0x91c1c1c,0x1000000,0xffffff,0xffffff,0x3000000, + 0x17424242,0x14ffffff,0x2ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1ffffff,0x15ffffff,0x17424242,0x4000000, + 0xffffff,0x1000000,0xa4c4c4c,0x2b6a6a6a,0x8ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0x8ffffff,0x2b6a6a6a,0xa4c4c4c,0x1000000,0x27f7f7f,0x14727272,0x31919191,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0x1effffff,0x15797979,0x27f7f7f,0x3aaaaaa,0x1f9c9c9c,0x1dffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1dffffff,0x1f9c9c9c,0x47f7f7f,0x5cccccc,0x27b7b7b7,0x1dffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x1dffffff,0x27b7b7b7,0x5cccccc,0x5cccccc, + 0x26d0d0d0,0x27ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x27ffffff, + 0x27d1d1d1,0x5cccccc,0x4ffffff,0x20e7e7e7,0x44d5d5d5,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0x44d5d5d5,0x21e0e0e0,0x4ffffff,0x2ffffff,0x15f2f2f2,0x3fe2e2e2,0x14d8d8d8,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0x15dadada,0x40dfdfdf,0x15f2f2f2,0x2ffffff,0x1ffffff,0x9ffffff,0x30f4f4f4,0x59e8e8e8,0x5cccccc,0xffffff, + 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x6d4d4d4,0x59e8e8e8,0x30f4f4f4,0xaffffff,0x1ffffff,0xffffff,0x3ffffff,0x15ffffff, + 0x45f7f7f7,0x62efefef,0x16e7e7e7,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x16e7e7e7,0x62efefef,0x45f7f7f7,0x16ffffff,0x3ffffff,0xffffff, + 0xffffff,0xffffff,0x6ffffff,0x1bffffff,0x44fbfbfb,0x63f4f4f4,0x5df1f1f1,0x3feeeeee,0x34ebebeb,0x3feeeeee,0x5df1f1f1,0x63f4f4f4,0x44fbfbfb,0x1bffffff, + 0x6ffffff,0x1ffffff,0xffffff,0xffffff,0xffffff,0x1ffffff,0x6ffffff,0x15ffffff,0x2effffff,0x4afbfbfb,0x5dfcfcfc,0x63fcfcfc,0x5dfcfcfc,0x4afbfbfb, + 0x2effffff,0x15ffffff,0x6ffffff,0x1ffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0x3ffffff,0xaffffff,0x14ffffff,0x1dffffff, + 0x21ffffff,0x1dffffff,0x14ffffff,0xaffffff,0x3ffffff,0xffffff,0xffffff,0xffffff,0xffffff +}; + +static const QRgb rb_dot2_data[] = { + 0x221d1d1d,0x9f060606,0xcc010101,0x9f060606,0x221d1d1d,0xa2121212,0xd2010101,0xd2000000,0xd2010101,0xa2121212,0xd11f1f1f,0xd3060606,0xd2000000,0xd3060606, + 0xd11f1f1f,0xac393939,0xd71e1e1e,0xd5121212,0xd71e1e1e,0xac393939,0x27404040,0xaf424242,0xd8434343,0xaf424242,0x27404040 +}; + +static const QRgb rb_dot2_shadow_data[] = { + 0x4fefefe,0x4ffffff,0x1ffffff,0x4ffffff,0x4fcfcfc,0xcfafafa,0x1ffffff,0x0,0x1ffffff,0xcfafafa,0x1afcfcfc,0x5ffffff,0x1bfbfbf,0x5ffffff, + 0x1afcfcfc,0x27fdfdfd,0x1afcfcfc,0x10fafafa,0x1afcfcfc,0x27fdfdfd,0xafdfdfd,0x2efdfdfd,0x3afdfdfd,0x2efdfdfd,0xafdfdfd +}; + +static const QRgb scroll2BtnHContour2_data[] = { + 0xff000000,0xff000000,0xff000000,0xff000000,0xd5000000,0x78000000,0x40000000,0x11000000,0x0,0x0,0x11000000,0x40000000,0x78000000,0xd5000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0x23000000,0x23000000,0x331b1b1b,0x30000000,0x95000000,0x2c000000,0x1000000,0x0,0x0,0x0, + 0x0,0x1000000,0x2c000000,0x95000000,0x30000000,0x331b1b1b,0x23000000,0x23000000,0x0,0xe000000,0x36000000,0xaa000000,0x2f000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2f000000,0xaa000000,0x36000000,0xe000000,0x0,0x2000000,0x25000000, + 0xa1000000,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x34000000,0xa1000000, + 0x25000000,0x2000000,0x11000000,0x55000000,0x7c000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x7c000000,0x55000000,0x11000000,0x1d000000,0x8e000000,0x28000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x28000000,0x8e000000,0x1d000000,0x23000000,0xaf000000,0x1000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0xaf000000,0x23000000, + 0x28000000,0xb0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0xb0000000,0x28000000,0x23000000,0xaf000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1000000,0xaf000000,0x23000000,0x1d000000,0x8e000000,0x28000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x28000000,0x8e000000,0x1d000000,0x11000000,0x55000000, + 0x7c000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7c000000, + 0x55000000,0x11000000,0x2000000,0x25000000,0xa1000000,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x34000000,0xa1000000,0x25000000,0x2000000,0x0,0xe000000,0x36000000,0xaa000000,0x2f000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x2f000000,0xaa000000,0x36000000,0xe000000,0x0,0x23000000,0x23000000,0x331b1b1b,0x30000000, + 0x95000000,0x2c000000,0x1000000,0x0,0x0,0x0,0x0,0x1000000,0x2c000000,0x95000000,0x30000000,0x331b1b1b,0x23000000,0x23000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xd5000000,0x78000000,0x40000000,0x11000000,0x0,0x0,0x11000000,0x40000000,0x78000000,0xd5000000, + 0xff000000,0xff000000,0xff000000,0xff000000 +}; + +static const QRgb scroll2BtnHMask_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xb4ff0000,0x25ff0000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x25ff0000,0xb4ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x8dff0000,0x1ff0000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1ff0000,0x8dff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xb4ff0000,0x1ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1ff0000,0xb4ff0000, + 0xffff0000,0xffff0000,0xffff0000,0xfcff0000,0x24ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x24ff0000,0xfcff0000,0xffff0000,0xffff0000,0xbfff0000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbfff0000,0xffff0000,0xffff0000,0x88ff0000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x88ff0000,0xffff0000, + 0xffff0000,0x76ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x76ff0000,0xffff0000,0xffff0000,0x88ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x88ff0000,0xffff0000,0xffff0000,0xbfff0000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbfff0000,0xffff0000,0xffff0000,0xfcff0000, + 0x24ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24ff0000, + 0xfcff0000,0xffff0000,0xffff0000,0xffff0000,0xb4ff0000,0x1ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1ff0000,0xb4ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x8dff0000,0x1ff0000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1ff0000,0x8dff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xb4ff0000,0x25ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x25ff0000,0xb4ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0 +}; + +static const QRgb scroll2BtnHShadow2_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x13000000,0x12000000,0x7000000,0x7000000,0x12000000,0x13000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x17ffffff,0x17ffffff,0x12ffffff,0x19ffffff,0x16171717,0x24000000,0x17000000,0x7000000,0x2000000,0x2000000, + 0x7000000,0x17000000,0x24000000,0x16171717,0x19ffffff,0x12ffffff,0x17ffffff,0x17ffffff,0x0,0xcffffff,0x19ffffff,0x170b0b0b,0x21000000,0x11000000, + 0x8000000,0x2000000,0x0,0x0,0x2000000,0x8000000,0x11000000,0x21000000,0x170b0b0b,0x19ffffff,0xcffffff,0x0,0x5ffffff,0x1bffffff, + 0x112d2d2d,0x22000000,0xf000000,0x5000000,0x2000000,0x0,0x0,0x0,0x0,0x2000000,0x5000000,0xf000000,0x22000000,0x112d2d2d, + 0x1bffffff,0x5ffffff,0xeffffff,0x18ffffff,0x24000000,0x14000000,0x6000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1000000,0x6000000,0x14000000,0x24000000,0x18ffffff,0xeffffff,0x17ffffff,0x186a6a6a,0x20000000,0xb000000,0x2000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x2000000,0xb000000,0x20000000,0x186a6a6a,0x17ffffff,0x1bffffff,0x1a000000,0x19000000,0x7000000, + 0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x7000000,0x19000000,0x1a000000,0x1bffffff, + 0x1cffffff,0x1e000000,0x17000000,0x6000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x6000000,0x17000000,0x1e000000,0x1cffffff,0x1bffffff,0x1a000000,0x19000000,0x7000000,0x1000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x1000000,0x7000000,0x19000000,0x1a000000,0x1bffffff,0x17ffffff,0x19666666,0x20000000,0xa000000,0x2000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0xa000000,0x20000000,0x19666666,0x17ffffff,0xeffffff,0x18ffffff, + 0x24000000,0x13000000,0x6000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x6000000,0x13000000,0x24000000, + 0x18ffffff,0xeffffff,0x5ffffff,0x1bffffff,0x122a2a2a,0x22000000,0xf000000,0x5000000,0x1000000,0x0,0x0,0x0,0x0,0x1000000, + 0x5000000,0xf000000,0x22000000,0x122a2a2a,0x1bffffff,0x5ffffff,0x0,0xcffffff,0x19ffffff,0x180a0a0a,0x20000000,0x10000000,0x7000000,0x2000000, + 0x0,0x0,0x2000000,0x7000000,0x10000000,0x20000000,0x180a0a0a,0x19ffffff,0xcffffff,0x0,0x17ffffff,0x17ffffff,0x12ffffff,0x19ffffff, + 0x17161616,0x24000000,0x15000000,0x6000000,0x2000000,0x2000000,0x6000000,0x15000000,0x24000000,0x17161616,0x19ffffff,0x12ffffff,0x17ffffff,0x17ffffff, + 0x0,0x0,0x0,0x0,0x0,0x0,0x14000000,0xe000000,0x4000000,0x4000000,0xe000000,0x14000000,0x0,0x0, + 0x0,0x0,0x0,0x0 +}; + +static const QRgb scroll2BtnVContour2_data[] = { + 0xff000000,0x23000000,0x0,0x2000000,0x11000000,0x1d000000,0x23000000,0x28000000,0x23000000,0x1d000000,0x11000000,0x2000000,0x0,0x23000000, + 0xff000000,0xff000000,0x23000000,0xe000000,0x25000000,0x55000000,0x8e000000,0xaf000000,0xb0000000,0xaf000000,0x8e000000,0x55000000,0x25000000,0xe000000, + 0x23000000,0xff000000,0xff000000,0x331b1b1b,0x36000000,0xa1000000,0x7c000000,0x28000000,0x1000000,0x0,0x1000000,0x28000000,0x7c000000,0xa1000000, + 0x36000000,0x331b1b1b,0xff000000,0xff000000,0x30000000,0xaa000000,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x34000000,0xaa000000,0x30000000,0xff000000,0xd5000000,0x95000000,0x2f000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x2f000000,0x95000000,0xd5000000,0x78000000,0x2c000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x2c000000,0x78000000,0x40000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1000000,0x40000000,0x11000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x11000000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x11000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x11000000,0x40000000,0x1000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x40000000,0x78000000,0x2c000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2c000000,0x78000000,0xd5000000, + 0x95000000,0x2f000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2f000000,0x95000000,0xd5000000, + 0xff000000,0x30000000,0xaa000000,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x34000000,0xaa000000,0x30000000, + 0xff000000,0xff000000,0x331b1b1b,0x36000000,0xa1000000,0x7c000000,0x28000000,0x1000000,0x0,0x1000000,0x28000000,0x7c000000,0xa1000000,0x36000000, + 0x331b1b1b,0xff000000,0xff000000,0x23000000,0xe000000,0x25000000,0x55000000,0x8e000000,0xaf000000,0xb0000000,0xaf000000,0x8e000000,0x55000000,0x25000000, + 0xe000000,0x23000000,0xff000000,0xff000000,0x23000000,0x0,0x2000000,0x11000000,0x1d000000,0x23000000,0x28000000,0x23000000,0x1d000000,0x11000000, + 0x2000000,0x0,0x23000000,0xff000000 +}; + +static const QRgb scroll2BtnVMask_data[] = { + 0x0,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0x0,0x0,0xffff0000,0xffff0000,0xffff0000,0xfcff0000,0xbfff0000,0x88ff0000,0x76ff0000,0x88ff0000,0xbfff0000,0xfcff0000,0xffff0000,0xffff0000, + 0xffff0000,0x0,0x0,0xffff0000,0xffff0000,0xb4ff0000,0x24ff0000,0x0,0x0,0x0,0x0,0x0,0x24ff0000,0xb4ff0000, + 0xffff0000,0xffff0000,0x0,0x0,0xffff0000,0x8dff0000,0x1ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1ff0000,0x8dff0000,0xffff0000,0x0,0x0,0xb4ff0000,0x1ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1ff0000,0xb4ff0000,0x0,0x0,0x25ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x25ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x25ff0000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x25ff0000,0x0,0x0, + 0xb4ff0000,0x1ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1ff0000,0xb4ff0000,0x0, + 0x0,0xffff0000,0x8dff0000,0x1ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1ff0000,0x8dff0000,0xffff0000, + 0x0,0x0,0xffff0000,0xffff0000,0xb4ff0000,0x24ff0000,0x0,0x0,0x0,0x0,0x0,0x24ff0000,0xb4ff0000,0xffff0000, + 0xffff0000,0x0,0x0,0xffff0000,0xffff0000,0xffff0000,0xfcff0000,0xbfff0000,0x88ff0000,0x76ff0000,0x88ff0000,0xbfff0000,0xfcff0000,0xffff0000, + 0xffff0000,0xffff0000,0x0,0x0,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0x0 +}; + +static const QRgb scroll2BtnVShadow2_data[] = { + 0x0,0x17ffffff,0x0,0x5ffffff,0xeffffff,0x17ffffff,0x1bffffff,0x1cffffff,0x1bffffff,0x17ffffff,0xeffffff,0x5ffffff,0x0,0x17ffffff, + 0x0,0x0,0x17ffffff,0xcffffff,0x1bffffff,0x18ffffff,0x186a6a6a,0x1a000000,0x1e000000,0x1a000000,0x19666666,0x18ffffff,0x1bffffff,0xcffffff, + 0x17ffffff,0x0,0x0,0x12ffffff,0x19ffffff,0x112d2d2d,0x24000000,0x20000000,0x19000000,0x17000000,0x19000000,0x20000000,0x24000000,0x122a2a2a, + 0x19ffffff,0x12ffffff,0x0,0x0,0x19ffffff,0x170b0b0b,0x22000000,0x14000000,0xb000000,0x7000000,0x6000000,0x7000000,0xa000000,0x13000000, + 0x22000000,0x180a0a0a,0x19ffffff,0x0,0x0,0x16171717,0x21000000,0xf000000,0x6000000,0x2000000,0x1000000,0x0,0x1000000,0x2000000, + 0x6000000,0xf000000,0x20000000,0x17161616,0x0,0x0,0x24000000,0x11000000,0x5000000,0x1000000,0x0,0x0,0x0,0x0, + 0x0,0x1000000,0x5000000,0x10000000,0x24000000,0x0,0x13000000,0x17000000,0x8000000,0x2000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x1000000,0x7000000,0x15000000,0x14000000,0x12000000,0x7000000,0x2000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x2000000,0x6000000,0xe000000,0x7000000,0x2000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x4000000,0x7000000,0x2000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x4000000,0x12000000,0x7000000,0x2000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x6000000,0xe000000,0x13000000,0x17000000,0x8000000, + 0x2000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x7000000,0x15000000,0x14000000,0x0,0x24000000, + 0x11000000,0x5000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x1000000,0x5000000,0x10000000,0x24000000,0x0,0x0, + 0x16171717,0x21000000,0xf000000,0x6000000,0x2000000,0x1000000,0x0,0x1000000,0x2000000,0x6000000,0xf000000,0x20000000,0x17161616,0x0, + 0x0,0x19ffffff,0x170b0b0b,0x22000000,0x14000000,0xb000000,0x7000000,0x6000000,0x7000000,0xa000000,0x13000000,0x22000000,0x180a0a0a,0x19ffffff, + 0x0,0x0,0x12ffffff,0x19ffffff,0x112d2d2d,0x24000000,0x20000000,0x19000000,0x17000000,0x19000000,0x20000000,0x24000000,0x122a2a2a,0x19ffffff, + 0x12ffffff,0x0,0x0,0x17ffffff,0xcffffff,0x1bffffff,0x18ffffff,0x186a6a6a,0x1a000000,0x1e000000,0x1a000000,0x19666666,0x18ffffff,0x1bffffff, + 0xcffffff,0x17ffffff,0x0,0x0,0x17ffffff,0x0,0x5ffffff,0xeffffff,0x17ffffff,0x1bffffff,0x1cffffff,0x1bffffff,0x17ffffff,0xeffffff, + 0x5ffffff,0x0,0x17ffffff,0x0 +}; + +static const QRgb scroll2SliderHContour_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x64000000,0x8f000000,0x8f000000,0x64000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x18000000,0x9b000000,0x7c000000,0x3e000000,0x3e000000,0x7c000000,0x9b000000,0x18000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1c000000,0xb2000000,0x44000000,0x1c000000,0xa000000,0xa000000,0x1c000000, + 0x44000000,0xb2000000,0x1c000000,0x0,0x0,0x0,0x0,0x0,0x2000000,0xa8000000,0x48000000,0x17000000,0x0,0x0, + 0x0,0x0,0x17000000,0x48000000,0xa8000000,0x2000000,0x0,0x0,0x0,0x0,0x56000000,0x87000000,0x1e000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1e000000,0x87000000,0x56000000,0x0,0x0,0x0,0x0,0x91000000,0x40000000, + 0xb000000,0x0,0x0,0x0,0x0,0x0,0x0,0xb000000,0x40000000,0x91000000,0x0,0x0,0x0,0x0, + 0xb8000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x23000000,0xb8000000,0x0,0x0, + 0x0,0x0,0xb9000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x23000000,0xb9000000, + 0x0,0x0,0x0,0x0,0xb8000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x23000000,0xb8000000,0x0,0x0,0x0,0x0,0x98000000,0x40000000,0xb000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0xb000000,0x40000000,0x91000000,0x0,0x0,0x0,0x0,0x4a000000,0x87000000,0x1e000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x1e000000,0x87000000,0x56000000,0x0,0x0,0x0,0x0,0x2000000,0xa8000000,0x48000000,0x17000000, + 0x0,0x0,0x0,0x0,0x17000000,0x48000000,0xa8000000,0x2000000,0x0,0x0,0x0,0x0,0x0,0x1c000000, + 0xb2000000,0x44000000,0x1c000000,0xa000000,0xa000000,0x1c000000,0x44000000,0xb2000000,0x1c000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x18000000,0x9b000000,0x7c000000,0x3e000000,0x3e000000,0x7c000000,0x9b000000,0x18000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x64000000,0x8f000000,0x8f000000,0x64000000,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb scroll2SliderHDockedContour_data[] = { + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000,0x23000000,0x23000000,0x23000000,0x2b000000,0x44121212,0x9c000000,0x7c000000,0x3e000000,0x3e000000,0x7c000000,0x9c000000,0x44121212, + 0x2b000000,0x23000000,0x23000000,0x23000000,0x0,0x0,0xe000000,0x2f000000,0xb2000000,0x71000000,0x1c000000,0xa000000,0xa000000,0x1c000000, + 0x71000000,0xb2000000,0x2f000000,0xe000000,0x0,0x0,0x0,0x2000000,0x25000000,0xa9000000,0x48000000,0x17000000,0x0,0x0, + 0x0,0x0,0x17000000,0x48000000,0xa9000000,0x25000000,0x2000000,0x0,0x0,0x11000000,0x63000000,0x87000000,0x1e000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1e000000,0x87000000,0x63000000,0x11000000,0x0,0x0,0x1d000000,0x94000000,0x40000000, + 0xb000000,0x0,0x0,0x0,0x0,0x0,0x0,0xb000000,0x40000000,0x94000000,0x1d000000,0x0,0x0,0x23000000, + 0xb8000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x23000000,0xb8000000,0x23000000,0x0, + 0x0,0x23000000,0xb9000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x23000000,0xb9000000, + 0x23000000,0x0,0x0,0x23000000,0xb8000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x23000000,0xb8000000,0x23000000,0x0,0x0,0x1d000000,0x94000000,0x40000000,0xb000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0xb000000,0x40000000,0x94000000,0x1d000000,0x0,0x0,0x11000000,0x63000000,0x87000000,0x1e000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x1e000000,0x87000000,0x63000000,0x11000000,0x0,0x0,0x2000000,0x25000000,0xa9000000,0x48000000,0x17000000, + 0x0,0x0,0x0,0x0,0x17000000,0x48000000,0xa9000000,0x25000000,0x2000000,0x0,0x0,0x0,0xe000000,0x2f000000, + 0xb2000000,0x71000000,0x1c000000,0xa000000,0xa000000,0x1c000000,0x71000000,0xb2000000,0x2f000000,0xe000000,0x0,0x0,0x23000000,0x23000000, + 0x23000000,0x2b000000,0x44121212,0x9c000000,0x7c000000,0x3e000000,0x3e000000,0x7c000000,0x9c000000,0x44121212,0x2b000000,0x23000000,0x23000000,0x23000000, + 0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000,0xff000000, + 0xff000000,0xff000000 +}; + +static const QRgb scroll2SliderHDockedShadow_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x17ffffff,0x17ffffff,0x17ffffff,0x17ffffff,0x11ffffff,0x16ffffff,0xbffffff,0x13ffffff,0x13ffffff,0xbffffff,0x16ffffff,0x11ffffff, + 0x17ffffff,0x17ffffff,0x17ffffff,0x17ffffff,0x0,0x0,0xaffffff,0x19ffffff,0x18ffffff,0x17ffffff,0x15ffffff,0x7ffffff,0x7ffffff,0x15ffffff, + 0x17ffffff,0x18ffffff,0x19ffffff,0xaffffff,0x0,0x0,0x0,0x5ffffff,0x19ffffff,0x13ffffff,0x11ffffff,0x11ffffff,0x0,0x0, + 0x0,0x0,0x11ffffff,0x11ffffff,0x13ffffff,0x19ffffff,0x5ffffff,0x0,0x0,0xdffffff,0x1effffff,0x7ffffff,0x16ffffff,0x0, + 0x0,0x0,0x0,0x0,0x0,0x16ffffff,0x7ffffff,0x1effffff,0xdffffff,0x0,0x0,0x16ffffff,0x9ffffff,0x13ffffff, + 0x8ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x8ffffff,0x13ffffff,0x9ffffff,0x16ffffff,0x0,0x0,0x1effffff, + 0x0,0x19ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x19ffffff,0x0,0x1effffff,0x0, + 0x0,0x1effffff,0x0,0x1affffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1affffff,0x0, + 0x1effffff,0x0,0x0,0x1effffff,0x0,0x19ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x19ffffff,0x0,0x1effffff,0x0,0x0,0x16ffffff,0x9ffffff,0x13ffffff,0x8ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x8ffffff,0x13ffffff,0x9ffffff,0x16ffffff,0x0,0x0,0xdffffff,0x1effffff,0x7ffffff,0x16ffffff,0x0,0x0,0x0, + 0x0,0x0,0x0,0x16ffffff,0x7ffffff,0x1effffff,0xdffffff,0x0,0x0,0x5ffffff,0x19ffffff,0x13ffffff,0x11ffffff,0x11ffffff, + 0x0,0x0,0x0,0x0,0x11ffffff,0x11ffffff,0x13ffffff,0x19ffffff,0x5ffffff,0x0,0x0,0x0,0xaffffff,0x19ffffff, + 0x18ffffff,0x17ffffff,0x15ffffff,0x7ffffff,0x7ffffff,0x15ffffff,0x17ffffff,0x18ffffff,0x19ffffff,0xaffffff,0x0,0x0,0x17ffffff,0x17ffffff, + 0x17ffffff,0x17ffffff,0x11ffffff,0x16ffffff,0xbffffff,0x13ffffff,0x13ffffff,0xbffffff,0x16ffffff,0x11ffffff,0x17ffffff,0x17ffffff,0x17ffffff,0x17ffffff, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb scroll2SliderHMask_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4bff0000,0xdaff0000,0xffff0000,0xffff0000,0xdaff0000,0x4bff0000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x72ff0000,0xfeff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xfeff0000,0x72ff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4bff0000,0xfeff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xfeff0000,0x4bff0000,0x0,0x0,0x0,0x0,0x0,0x3ff0000,0xdbff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xdbff0000,0x3ff0000,0x0,0x0,0x0,0x0,0x40ff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x40ff0000,0x0,0x0,0x0,0x0, + 0x77ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x77ff0000,0x0,0x0, + 0x0,0x0,0x89ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x89ff0000, + 0x0,0x0,0x0,0x0,0x77ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0x77ff0000,0x0,0x0,0x0,0x0,0x40ff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0x40ff0000,0x0,0x0,0x0,0x0,0x3ff0000,0xdbff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xdbff0000,0x3ff0000,0x0,0x0,0x0,0x0,0x0,0x4bff0000,0xfeff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xfeff0000,0x4bff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x72ff0000,0xfeff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xfeff0000,0x72ff0000,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x4bff0000,0xdaff0000,0xffff0000,0xffff0000,0xdaff0000,0x4bff0000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb scroll2SliderHShadow2_data[] = { + 0x0,0x0,0x0,0x3000000,0xa000000,0x15000000,0x1f000000,0x17000000,0x17000000,0x1f000000,0x15000000,0xa000000,0x3000000,0x0, + 0x0,0x0,0x0,0x0,0x3000000,0xb000000,0x1a000000,0x1a000000,0xce9e9e9,0x13ffffff,0x13ffffff,0xce9e9e9,0x1a000000,0x1a000000, + 0xb000000,0x3000000,0x0,0x0,0x0,0x2000000,0xa000000,0x1a000000,0x1b000000,0x10ffffff,0x15ffffff,0x7ffffff,0x7ffffff,0x15ffffff, + 0x10ffffff,0x1b000000,0x1a000000,0xa000000,0x2000000,0x0,0x1000000,0x6000000,0x16000000,0x18000000,0x11ffffff,0x11ffffff,0x0,0x0, + 0x0,0x0,0x11ffffff,0x11ffffff,0x18000000,0x16000000,0x6000000,0x1000000,0x2000000,0xc000000,0x20000000,0x7ffffff,0x16ffffff,0x0, + 0x0,0x0,0x0,0x0,0x0,0x16ffffff,0x7ffffff,0x20000000,0xc000000,0x2000000,0x4000000,0x12000000,0x15000000,0x13ffffff, + 0x8ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x8ffffff,0x13ffffff,0x15000000,0x12000000,0x4000000,0x5000000,0x16000000, + 0x16000000,0x19ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x19ffffff,0x16000000,0x16000000,0x5000000, + 0x6000000,0x16000000,0x16000000,0x1affffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1affffff,0x16000000, + 0x16000000,0x6000000,0x5000000,0x16000000,0x16000000,0x19ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x19ffffff,0x16000000,0x16000000,0x5000000,0x4000000,0x12000000,0x15000000,0x13ffffff,0x8ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x8ffffff,0x13ffffff,0x15000000,0x12000000,0x4000000,0x2000000,0xc000000,0x20000000,0x7ffffff,0x16ffffff,0x0,0x0,0x0, + 0x0,0x0,0x0,0x16ffffff,0x7ffffff,0x20000000,0xc000000,0x2000000,0x1000000,0x6000000,0x16000000,0x18000000,0x11ffffff,0x11ffffff, + 0x0,0x0,0x0,0x0,0x11ffffff,0x11ffffff,0x18000000,0x16000000,0x6000000,0x1000000,0x0,0x2000000,0xa000000,0x1a000000, + 0x1b000000,0x10ffffff,0x15ffffff,0x7ffffff,0x7ffffff,0x15ffffff,0x10ffffff,0x1b000000,0x1a000000,0xa000000,0x2000000,0x0,0x0,0x0, + 0x3000000,0xb000000,0x1a000000,0x1a000000,0xce9e9e9,0x13ffffff,0x13ffffff,0xce9e9e9,0x1a000000,0x1a000000,0xb000000,0x3000000,0x0,0x0, + 0x0,0x0,0x1000000,0x3000000,0xa000000,0x16000000,0x1f000000,0x17000000,0x17000000,0x1f000000,0x16000000,0xa000000,0x3000000,0x1000000, + 0x0,0x0 +}; + +static const QRgb scroll2SliderVContour_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x2000000,0x4a000000,0x98000000,0xb8000000,0xb9000000,0xb8000000,0x91000000,0x56000000,0x2000000, + 0x0,0x0,0x0,0x0,0x0,0x1c000000,0xa8000000,0x87000000,0x40000000,0x23000000,0x23000000,0x23000000,0x40000000,0x87000000, + 0xa8000000,0x1c000000,0x0,0x0,0x0,0x18000000,0xb2000000,0x48000000,0x1e000000,0xb000000,0x0,0x0,0x0,0xb000000, + 0x1e000000,0x48000000,0xb2000000,0x18000000,0x0,0x0,0x9b000000,0x44000000,0x17000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x17000000,0x44000000,0x9b000000,0x0,0x64000000,0x7c000000,0x1c000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1c000000,0x7c000000,0x64000000,0x8f000000,0x3e000000,0xa000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0xa000000,0x3e000000,0x8f000000,0x8f000000,0x3e000000,0xa000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0xa000000,0x3e000000,0x8f000000,0x64000000,0x7c000000,0x1c000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1c000000,0x7c000000,0x64000000,0x0,0x9b000000,0x44000000,0x17000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0x44000000,0x9b000000,0x0,0x0,0x18000000,0xb2000000, + 0x48000000,0x1e000000,0xb000000,0x0,0x0,0x0,0xb000000,0x1e000000,0x48000000,0xb2000000,0x18000000,0x0,0x0,0x0, + 0x1c000000,0xa8000000,0x87000000,0x40000000,0x23000000,0x23000000,0x23000000,0x40000000,0x87000000,0xa8000000,0x1c000000,0x0,0x0,0x0, + 0x0,0x0,0x2000000,0x56000000,0x91000000,0xb8000000,0xb9000000,0xb8000000,0x91000000,0x56000000,0x2000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb scroll2SliderVDockedContour_data[] = { + 0xff000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x23000000, + 0xff000000,0xff000000,0x23000000,0x0,0x2000000,0x11000000,0x1d000000,0x23000000,0x23000000,0x23000000,0x1d000000,0x11000000,0x2000000,0x0, + 0x23000000,0xff000000,0xff000000,0x23000000,0xe000000,0x25000000,0x63000000,0x94000000,0xb8000000,0xb9000000,0xb8000000,0x94000000,0x63000000,0x25000000, + 0xe000000,0x23000000,0xff000000,0xff000000,0x2b000000,0x2f000000,0xa9000000,0x87000000,0x40000000,0x23000000,0x23000000,0x23000000,0x40000000,0x87000000, + 0xa9000000,0x2f000000,0x2b000000,0xff000000,0xff000000,0x44121212,0xb2000000,0x48000000,0x1e000000,0xb000000,0x0,0x0,0x0,0xb000000, + 0x1e000000,0x48000000,0xb2000000,0x44121212,0xff000000,0xff000000,0x9c000000,0x71000000,0x17000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x17000000,0x71000000,0x9c000000,0xff000000,0xff000000,0x7c000000,0x1c000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1c000000,0x7c000000,0xff000000,0xff000000,0x3e000000,0xa000000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0xa000000,0x3e000000,0xff000000,0xff000000,0x3e000000,0xa000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0xa000000,0x3e000000,0xff000000,0xff000000,0x7c000000,0x1c000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1c000000,0x7c000000,0xff000000,0xff000000,0x9c000000,0x71000000,0x17000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x17000000,0x71000000,0x9c000000,0xff000000,0xff000000,0x44121212,0xb2000000, + 0x48000000,0x1e000000,0xb000000,0x0,0x0,0x0,0xb000000,0x1e000000,0x48000000,0xb2000000,0x44121212,0xff000000,0xff000000,0x2b000000, + 0x2f000000,0xa9000000,0x87000000,0x40000000,0x23000000,0x23000000,0x23000000,0x40000000,0x87000000,0xa9000000,0x2f000000,0x2b000000,0xff000000,0xff000000, + 0x23000000,0xe000000,0x25000000,0x63000000,0x94000000,0xb8000000,0xb9000000,0xb8000000,0x94000000,0x63000000,0x25000000,0xe000000,0x23000000,0xff000000, + 0xff000000,0x23000000,0x0,0x2000000,0x11000000,0x1d000000,0x23000000,0x23000000,0x23000000,0x1d000000,0x11000000,0x2000000,0x0,0x23000000, + 0xff000000,0xff000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x23000000,0xff000000 +}; + +static const QRgb scroll2SliderVDockedShadow_data[] = { + 0x0,0x17ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x17ffffff, + 0x0,0x0,0x17ffffff,0x0,0x5ffffff,0xdffffff,0x16ffffff,0x1effffff,0x1effffff,0x1effffff,0x16ffffff,0xdffffff,0x5ffffff,0x0, + 0x17ffffff,0x0,0x0,0x17ffffff,0xaffffff,0x19ffffff,0x1effffff,0x9ffffff,0x0,0x0,0x0,0x9ffffff,0x1effffff,0x19ffffff, + 0xaffffff,0x17ffffff,0x0,0x0,0x17ffffff,0x19ffffff,0x13ffffff,0x7ffffff,0x13ffffff,0x19ffffff,0x1affffff,0x19ffffff,0x13ffffff,0x7ffffff, + 0x13ffffff,0x19ffffff,0x17ffffff,0x0,0x0,0x11ffffff,0x18ffffff,0x11ffffff,0x16ffffff,0x8ffffff,0x0,0x0,0x0,0x8ffffff, + 0x16ffffff,0x11ffffff,0x18ffffff,0x11ffffff,0x0,0x0,0x16ffffff,0x17ffffff,0x11ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x11ffffff,0x17ffffff,0x16ffffff,0x0,0x0,0xbffffff,0x15ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x15ffffff,0xbffffff,0x0,0x0,0x13ffffff,0x7ffffff,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x7ffffff,0x13ffffff,0x0,0x0,0x13ffffff,0x7ffffff,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x7ffffff,0x13ffffff,0x0,0x0,0xbffffff,0x15ffffff,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x15ffffff,0xbffffff,0x0,0x0,0x16ffffff,0x17ffffff,0x11ffffff, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x11ffffff,0x17ffffff,0x16ffffff,0x0,0x0,0x11ffffff,0x18ffffff, + 0x11ffffff,0x16ffffff,0x8ffffff,0x0,0x0,0x0,0x8ffffff,0x16ffffff,0x11ffffff,0x18ffffff,0x11ffffff,0x0,0x0,0x17ffffff, + 0x19ffffff,0x13ffffff,0x7ffffff,0x13ffffff,0x19ffffff,0x1affffff,0x19ffffff,0x13ffffff,0x7ffffff,0x13ffffff,0x19ffffff,0x17ffffff,0x0,0x0, + 0x17ffffff,0xaffffff,0x19ffffff,0x1effffff,0x9ffffff,0x0,0x0,0x0,0x9ffffff,0x1effffff,0x19ffffff,0xaffffff,0x17ffffff,0x0, + 0x0,0x17ffffff,0x0,0x5ffffff,0xdffffff,0x16ffffff,0x1effffff,0x1effffff,0x1effffff,0x16ffffff,0xdffffff,0x5ffffff,0x0,0x17ffffff, + 0x0,0x0,0x17ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x17ffffff,0x0 +}; + +static const QRgb scroll2SliderVMask_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x3ff0000,0x40ff0000,0x77ff0000,0x89ff0000,0x77ff0000,0x40ff0000,0x3ff0000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x4bff0000,0xdbff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xdbff0000, + 0x4bff0000,0x0,0x0,0x0,0x0,0x0,0x72ff0000,0xfeff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xfeff0000,0x72ff0000,0x0,0x0,0x0,0x4bff0000,0xfeff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xfeff0000,0x4bff0000,0x0,0x0,0xdaff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xdaff0000,0x0,0x0,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x0,0x0,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0x0,0x0,0xdaff0000,0xffff0000,0xffff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xdaff0000,0x0,0x0,0x4bff0000,0xfeff0000,0xffff0000, + 0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xfeff0000,0x4bff0000,0x0,0x0,0x0,0x72ff0000, + 0xfeff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xfeff0000,0x72ff0000,0x0,0x0,0x0,0x0, + 0x0,0x4bff0000,0xdbff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xffff0000,0xdbff0000,0x4bff0000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x3ff0000,0x40ff0000,0x77ff0000,0x89ff0000,0x77ff0000,0x40ff0000,0x3ff0000,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0 +}; + +static const QRgb scroll2SliderVShadow2_data[] = { + 0x0,0x0,0x0,0x1000000,0x2000000,0x4000000,0x5000000,0x6000000,0x5000000,0x4000000,0x2000000,0x1000000,0x0,0x0, + 0x0,0x0,0x0,0x2000000,0x6000000,0xc000000,0x12000000,0x16000000,0x16000000,0x16000000,0x12000000,0xc000000,0x6000000,0x2000000, + 0x0,0x0,0x0,0x3000000,0xa000000,0x16000000,0x20000000,0x15000000,0x16000000,0x16000000,0x16000000,0x15000000,0x20000000,0x16000000, + 0xa000000,0x3000000,0x1000000,0x3000000,0xb000000,0x1a000000,0x18000000,0x7ffffff,0x13ffffff,0x19ffffff,0x1affffff,0x19ffffff,0x13ffffff,0x7ffffff, + 0x18000000,0x1a000000,0xb000000,0x3000000,0xa000000,0x1a000000,0x1b000000,0x11ffffff,0x16ffffff,0x8ffffff,0x0,0x0,0x0,0x8ffffff, + 0x16ffffff,0x11ffffff,0x1b000000,0x1a000000,0xa000000,0x15000000,0x1a000000,0x10ffffff,0x11ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x11ffffff,0x10ffffff,0x1a000000,0x16000000,0x1f000000,0xce9e9e9,0x15ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x15ffffff,0xce9e9e9,0x1f000000,0x17000000,0x13ffffff,0x7ffffff,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x7ffffff,0x13ffffff,0x17000000,0x17000000,0x13ffffff,0x7ffffff,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x7ffffff,0x13ffffff,0x17000000,0x1f000000,0xce9e9e9,0x15ffffff,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x15ffffff,0xce9e9e9,0x1f000000,0x15000000,0x1a000000,0x10ffffff,0x11ffffff, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x11ffffff,0x10ffffff,0x1a000000,0x16000000,0xa000000,0x1a000000,0x1b000000, + 0x11ffffff,0x16ffffff,0x8ffffff,0x0,0x0,0x0,0x8ffffff,0x16ffffff,0x11ffffff,0x1b000000,0x1a000000,0xa000000,0x3000000,0xb000000, + 0x1a000000,0x18000000,0x7ffffff,0x13ffffff,0x19ffffff,0x1affffff,0x19ffffff,0x13ffffff,0x7ffffff,0x18000000,0x1a000000,0xb000000,0x3000000,0x0, + 0x3000000,0xa000000,0x16000000,0x20000000,0x15000000,0x16000000,0x16000000,0x16000000,0x15000000,0x20000000,0x16000000,0xa000000,0x3000000,0x1000000, + 0x0,0x0,0x2000000,0x6000000,0xc000000,0x12000000,0x16000000,0x16000000,0x16000000,0x12000000,0xc000000,0x6000000,0x2000000,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0x2000000,0x4000000,0x5000000,0x6000000,0x5000000,0x4000000,0x2000000,0x1000000,0x0, + 0x0,0x0 +}; + +static const QRgb scrollBarArrows_data[] = { + 0x0,0x0,0x0,0x23000000,0xa2000000,0xa2000000,0x23000000,0x0,0x0,0x0,0x0,0x0,0x4000000,0x77000000, + 0x4000000,0x0,0x0,0xa2000000,0xe5000000,0xeb000000,0xef000000,0xeb000000,0xe5000000,0xa2000000,0x0,0x0,0x42000000,0xbb000000, + 0xe5000000,0xe5000000,0xbb000000,0x42000000,0x0,0x0,0x0,0x0,0x7b000000,0xf5000000,0x7b000000,0x0,0x0,0x2a000000, + 0xbb000000,0xff000000,0xff000000,0xff000000,0xbb000000,0x23000000,0x4000000,0x7b000000,0xe4000000,0xff000000,0xeb000000,0xeb000000,0xff000000,0xe4000000, + 0x7b000000,0x4000000,0x0,0x42000000,0xe4000000,0xff000000,0xe4000000,0x42000000,0x0,0x0,0x42000000,0xe4000000,0xff000000,0xe4000000, + 0x42000000,0x0,0x77000000,0xf5000000,0xff000000,0xff000000,0xef000000,0xef000000,0xff000000,0xff000000,0xf5000000,0x77000000,0x2a000000,0xbb000000, + 0xff000000,0xff000000,0xff000000,0xbb000000,0x23000000,0x0,0x0,0x7b000000,0xf5000000,0x7b000000,0x0,0x0,0x4000000,0x7b000000, + 0xe4000000,0xff000000,0xeb000000,0xeb000000,0xff000000,0xe4000000,0x7b000000,0x4000000,0xa2000000,0xe5000000,0xeb000000,0xef000000,0xeb000000,0xe5000000, + 0xa2000000,0x0,0x0,0x4000000,0x77000000,0x4000000,0x0,0x0,0x0,0x0,0x42000000,0xbb000000,0xe5000000,0xe5000000, + 0xbb000000,0x42000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2a000000,0xa2000000,0xa2000000,0x2a000000,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb sizeGrip_data[] = { + 0x33bebebe,0x78bbbbbb,0x6bababab,0x278f8f8f,0x5e9d9d9d,0x6e9b9b9b,0x678a8a8a,0x4e6b6b6b,0x4b6c6c6c,0x576c6c6c,0x53595959,0x41363636,0x19282828,0x3a1e1e1e, + 0x390d0d0d,0x18000000 +}; + +static const QRgb sliderGrooveHBody_data[] = { + 0xb000000,0xb000000,0xb000000,0xb000000,0x9b353535,0x9b353535,0x9b353535,0x9b353535,0x92434343,0x92434343,0x92434343,0x92434343,0x8c535353,0x8c535353, + 0x8c535353,0x8c535353,0x86656565,0x86656565,0x86656565,0x86656565,0x2bfefefe,0x2bfefefe,0x2bfefefe,0x2bfefefe,0x9ffffff,0x9ffffff,0x9ffffff,0x9ffffff +}; + +static const QRgb sliderGroove_h_data[] = { + 0x1000000,0x5000000,0x9000000,0x9000000,0x5000000,0x1000000,0x2000000,0x41353535,0x89353535,0x89353535,0x41353535,0x2000000,0x5999999,0x83444444, + 0x92434343,0x92434343,0x83444444,0x5999999,0x8dfdfdf,0x7f575757,0x8c535353,0x8c535353,0x7f575757,0x8dfdfdf,0x7ffffff,0x488e8e8e,0x7c6c6c6c,0x7c6c6c6c, + 0x488e8e8e,0x7ffffff,0x3ffffff,0x14fcfcfc,0x25ffffff,0x25ffffff,0x14fcfcfc,0x3ffffff,0x0,0x3ffffff,0x7ffffff,0x7ffffff,0x3ffffff,0x0 +}; + +static const QRgb sliderGroove_v_data[] = { + 0x1000000,0x2000000,0x5999999,0x8dfdfdf,0x7ffffff,0x3ffffff,0x0,0x5000000,0x41353535,0x83444444,0x7f575757,0x488e8e8e,0x14fcfcfc,0x3ffffff, + 0x9000000,0x89353535,0x92434343,0x8c535353,0x7c6c6c6c,0x25ffffff,0x7ffffff,0x9000000,0x89353535,0x92434343,0x8c535353,0x7c6c6c6c,0x25ffffff,0x7ffffff, + 0x5000000,0x41353535,0x83444444,0x7f575757,0x488e8e8e,0x14fcfcfc,0x3ffffff,0x1000000,0x2000000,0x5999999,0x8dfdfdf,0x7ffffff,0x3ffffff,0x0 +}; + +static const QRgb sliderHandle2inside2_data[] = { + 0x0,0x0,0x0,0x0,0x0,0xfffffff,0x39ffffff,0x51ffffff,0x39ffffff,0xfffffff,0x0,0x0,0x0,0x0, + 0x0,0x0,0xffffff,0xffffff,0x4ffffff,0x71ffffff,0xf4ffffff,0xffffffff,0xffffffff,0xffffffff,0xf3ffffff,0x6fffffff,0x3ffffff,0xffffff, + 0x0,0x0,0x0,0xffffff,0x4ffffff,0xabffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xabffffff, + 0x3ffffff,0x0,0x0,0x0,0xffffff,0x71ffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0x71ffffff,0x0,0x0,0x0,0xbffffff,0xf6ffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xf2ffffff,0xbffffff,0x0,0x0,0x3affffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x3affffff,0x0,0x0,0x4affffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x4affffff,0x0,0x0,0x3cffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x3cffffff,0x0,0x0,0x10ffffff,0xf6ffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xf6ffffff,0x10ffffff,0x0,0x0,0xffffff,0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x0,0x0,0x0,0xffffff,0x6ffffff,0xb8ffffff, + 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xb0ffffff,0x6ffffff,0x0,0x0,0x0,0xffffff,0xffffff, + 0x7ffffff,0x7dffffff,0xf7ffffff,0xffffffff,0xffffffff,0xffffffff,0xf7ffffff,0x7affffff,0x6ffffff,0xffffff,0x0,0x0,0x0,0xffffff, + 0xffffff,0xffffff,0xffffff,0xfffffff,0x39ffffff,0x51ffffff,0x39ffffff,0xfffffff,0xffffff,0xffffff,0xffffff,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0 +}; + +static const QRgb sliderHandle2circle_data[] = { + 0x0,0x0,0x0,0x0,0x1e8b8b8b,0x815e5e5e,0x95595959,0x995d5d5d,0x95595959,0x815e5e5e,0x1e8b8b8b,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x6c5e5e5e,0x92585858,0x336e6e6e,0x0,0x0,0x0,0x336e6e6e,0x92585858,0x6c5e5e5e,0x0, + 0x0,0x0,0x0,0x0,0x6f595959,0x75595959,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x75595959, + 0x6f595959,0x0,0x0,0x0,0x1e6b6b6b,0xa8525252,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0xa8525252,0x1e6b6b6b,0x0,0x0,0x874f4f4f,0x30545454,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x30545454,0x874f4f4f,0x0,0x0,0xab4c4c4c,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0xab4c4c4c,0x0,0x0,0xae4c4c4c,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0xb14c4c4c,0x0,0x0,0xab4c4c4c,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0xab4c4c4c,0x0,0x0,0x7b4d4d4d,0x304a4a4a,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x304a4a4a,0x784d4d4d,0x0,0x0,0x1b4c4c4c,0xa84c4c4c,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xa84c4c4c,0x1b4c4c4c,0x0,0x0,0x0,0x6f4c4c4c,0x784d4d4d, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x784d4d4d,0x6c4c4c4c,0x0,0x0,0x0,0x0,0x0, + 0x6c4c4c4c,0x864c4c4c,0x334b4b4b,0x0,0x0,0x0,0x334b4b4b,0x864c4c4c,0x6c4c4c4c,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1e4d4d4d,0x814b4b4b,0x954b4b4b,0x994d4d4d,0x954b4b4b,0x7e4d4d4d,0x1e4d4d4d,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0 +}; + +static const QRgb sliderHandle2shadow_data[] = { + 0x0,0x0,0x1000000,0x3000000,0x5000000,0x4000000,0x2000000,0x5d5d5d,0x2000000,0x4000000,0x5000000,0x3000000,0x1000000,0x0, + 0x0,0x0,0x1000000,0x4000000,0x5000000,0xefefefe,0x32fefefe,0x45fefefe,0x4cfefefe,0x45fefefe,0x32fefefe,0xefefefe,0x5000000,0x4000000, + 0x1000000,0x0,0x1000000,0x4000000,0x6000000,0x17fefefe,0x3bfefefe,0x35fefefe,0x30fefefe,0x2efefefe,0x30fefefe,0x35fefefe,0x3bfefefe,0x17fefefe, + 0x6000000,0x4000000,0x1000000,0x3000000,0x9000000,0x8fefefe,0x29fefefe,0x20fefefe,0x1cffffff,0x1bffffff,0x1affffff,0x1bfdfdfd,0x1cfdfdfd,0x20fefefe, + 0x29fefefe,0x8fefefe,0x9000000,0x3000000,0x7000000,0x8000000,0x14fdfdfd,0x12fdfdfd,0xcffffff,0xbffffff,0xbffffff,0xbffffff,0xbffffff,0xbffffff, + 0xcffffff,0x12fefefe,0x14fdfdfd,0x8000000,0x7000000,0xc000000,0x3000000,0xcfcfcfc,0x2ffffff,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x2f0f0f0,0xcffffff,0x3000000,0xc000000,0xf000000,0x1000000,0x8fbfbfb,0x1ffffff,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x1ffffff,0x8fbfbfb,0x1000000,0x10000000,0x11000000,0x4000000,0x89c9c9c,0x1010101,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0x98b8b8b,0x4000000,0x11000000,0xf000000,0xe000000,0xa7e7e7e,0x91f1f1f,0x2000000,0x0, + 0x0,0x0,0x0,0x0,0x2000000,0xa1c1c1c,0xa7e7e7e,0xe000000,0x10000000,0xc000000,0x19000000,0x2fcfcfc,0xe242424,0xc030303, + 0x4010101,0x2000000,0x1000000,0x2000000,0x4000000,0xc000000,0xf232323,0x2fcfcfc,0x19000000,0xc000000,0x7000000,0x19000000,0x13000000,0x2fefefe, + 0xf121212,0x12020202,0xb030303,0x8040404,0xb030303,0x12020202,0xf121212,0x2fefefe,0x13000000,0x19000000,0x7000000,0x3000000,0xd000000,0x21000000, + 0x15000000,0x1fefefe,0x91e1e1e,0x11020202,0x16020202,0x11020202,0x91e1e1e,0x1fafafa,0x15000000,0x21000000,0xd000000,0x3000000,0x1000000,0x4000000, + 0x10000000,0x21000000,0x22000000,0x12000000,0x6000000,0x1000000,0x6000000,0x12000000,0x22000000,0x21000000,0x10000000,0x4000000,0x1000000,0x0, + 0x1000000,0x4000000,0xd000000,0x19000000,0x24000000,0x2a000000,0x2d000000,0x2a000000,0x24000000,0x19000000,0xd000000,0x4000000,0x1000000,0x0, + 0x0,0x0,0x1000000,0x3000000,0x7000000,0xc000000,0x10000000,0x11000000,0x10000000,0xc000000,0x7000000,0x3000000,0x1000000,0x0, + 0x0 +}; + +static const QRgb spinBoxArrows_data[] = { + 0x0,0x0,0x0,0xd000000,0x0,0x0,0x0,0x0,0x0,0x24000000,0xa5000000,0x24000000,0x0,0x0, + 0x0,0x19000000,0xb5000000,0xff000000,0xb5000000,0x19000000,0x0,0x18000000,0x99000000,0xff000000,0xff000000,0xff000000,0x99000000,0x12000000, + 0x79000000,0xca000000,0xcc000000,0xd7000000,0xcc000000,0xca000000,0x78000000,0x79000000,0xca000000,0xcc000000,0xd7000000,0xcc000000,0xca000000,0x78000000, + 0x18000000,0x99000000,0xff000000,0xff000000,0xff000000,0x99000000,0x12000000,0x0,0x19000000,0xb5000000,0xff000000,0xb5000000,0x19000000,0x0, + 0x0,0x0,0x24000000,0xa5000000,0x24000000,0x0,0x0,0x0,0x0,0x0,0xd000000,0x0,0x0,0x0 +}; + +static const QRgb tabHLines_data[] = { + 0x4effffff,0x4effffff,0x4effffff,0x4effffff,0x1effffff,0x1effffff,0x1effffff,0x1effffff,0x19f9f9f9,0x19f9f9f9,0x19f9f9f9,0x19f9f9f9 +}; + +static const QRgb tabInsideWhiteLines_data[] = { + 0x19ffffff,0x19ffffff,0x19ffffff,0x19ffffff,0x19ffffff,0x0,0x0,0x0,0x19ffffff,0x0,0x0,0x0,0x19ffffff,0x0, + 0x0,0x0 +}; + +static const QRgb tabInsideWhite_data[] = { + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0xaffffff,0x13ffffff,0x18ffffff,0x18ffffff,0x13ffffff,0xaffffff,0x0,0x0,0x0,0x0, + 0x0,0x0,0x3ffffff,0x17ffffff,0x14ffffff,0x9ffffff,0x3ffffff,0x3ffffff,0x9ffffff,0x14ffffff,0x17ffffff,0x3ffffff,0x0,0x0, + 0x0,0x1ffffff,0x18ffffff,0xbffffff,0x0,0x0,0x0,0x0,0x0,0x0,0xbffffff,0x18ffffff,0x1ffffff,0x0, + 0x0,0xcffffff,0x13ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x13ffffff,0xcffffff,0x0, + 0x0,0x19ffffff,0x9ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9ffffff,0x19ffffff,0x0, + 0x0,0x19ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x19ffffff,0x0, + 0x0,0x19ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x19ffffff,0x0, + 0x0,0x13ffffff,0x8ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8ffffff,0x13ffffff,0x0, + 0x0,0x7ffffff,0xbffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbffffff,0x7ffffff,0x0, + 0x0,0x0,0x8ffffff,0x4ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x4ffffff,0x8ffffff,0x0,0x0, + 0x0,0x0,0x0,0x2ffffff,0x2ffffff,0x1ffffff,0x0,0x0,0x1ffffff,0x2ffffff,0x2ffffff,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +static const QRgb tabVlines_data[] = { + 0x1effffff,0x1effffff,0x1effffff,0x1effffff +}; + +static const QRgb tabWidget_data[] = { + 0x0,0x0,0x0,0x0,0x3000000,0xb000000,0x13000000,0x17000000,0x17000000,0x13000000,0xb000000,0x3000000,0x0,0x0, + 0x0,0x0,0x0,0x0,0x1000000,0xb000000,0x27474747,0x46b2b2b2,0x4ededede,0x48ffffff,0x48ffffff,0x4ededede,0x46b2b2b2,0x27474747, + 0xb000000,0x1000000,0x0,0x0,0x0,0x1000000,0xf000000,0x408f8f8f,0x44f7f7f7,0x37ffffff,0x29ffffff,0x21ffffff,0x20ffffff,0x28ffffff, + 0x37ffffff,0x44f7f7f7,0x408f8f8f,0xf000000,0x2000000,0x0,0x0,0xc000000,0x41858585,0x39ffffff,0x23ffffff,0x12ffffff,0xaffffff,0x5ffffff, + 0x5ffffff,0xaffffff,0x12ffffff,0x22ffffff,0x39ffffff,0x41858585,0xc000000,0x0,0x6000000,0x2b3b3b3b,0x3df2f2f2,0x1cffffff,0x9ffffff,0x3ffffff, + 0x1ffffff,0x0,0x0,0x1ffffff,0x3ffffff,0x9ffffff,0x1cffffff,0x3df2f2f2,0x2b3b3b3b,0x6000000,0x12000000,0x3ea0a0a0,0x22ffffff,0x9ffffff, + 0x1ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x1ffffff,0x9ffffff,0x22ffffff,0x3ea0a0a0,0x13000000,0x20000000,0x39c9c9c9, + 0x13ffffff,0x3ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3ffffff,0x12ffffff,0x39c9c9c9,0x20000000, + 0x22000000,0x21ffffff,0xaffffff,0x1ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1ffffff,0xaffffff, + 0x21ffffff,0x22000000,0x22000000,0x2ab3b3b3,0x7ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x6ffffff,0x2ab3b3b3,0x21000000,0x1d000000,0x38787878,0xeffffff,0x1ffffff,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x1ffffff,0xefbfbfb,0x38787878,0x1a000000,0x11000000,0x37242424,0x1ce4e4e4,0x4ffffff,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x4f2f2f2,0x1ce5e5e5,0x37242424,0x11000000,0x8000000,0x23000000,0x40555555,0x15fefefe,0x2ffffff,0x0, + 0x0,0x0,0x0,0x0,0x0,0x2ffffff,0x15fbfbfb,0x46636363,0x23000000,0x9000000,0x3000000,0x11000000,0x30000000,0x47565656, + 0x1be1e1e1,0x9ffffff,0x2ffffff,0x0,0x0,0x2ffffff,0x9ffffff,0x1adfdfdf,0x47565656,0x30000000,0x11000000,0x3000000,0x0,0x5000000, + 0x15000000,0x30000000,0x491b1b1b,0x43636363,0x2a929292,0x1afafafa,0x19fafafa,0x2a929292,0x42606060,0x49171717,0x30000000,0x15000000,0x5000000,0x0, + 0x0,0x1000000,0x5000000,0x11000000,0x23000000,0x35000000,0x44000000,0x4c000000,0x4c000000,0x44000000,0x36000000,0x23000000,0x11000000,0x5000000, + 0x1000000,0x0,0x0,0x0,0x0,0x3000000,0x8000000,0x11000000,0x18000000,0x1c000000,0x1c000000,0x18000000,0x11000000,0x8000000, + 0x3000000,0x0,0x0,0x0 +}; + +static const QRgb tooltipframe2_data[] = { + 0x0,0x0,0x0,0xa575757,0x50575757,0x98575757,0xcc575757,0xcc575757,0x98575757,0x50575757,0xa575757,0x0,0x0,0x0, + 0x0,0x0,0x27575757,0xd3575757,0x99575757,0x56575757,0x1c575757,0x1c575757,0x56575757,0x99575757,0xd3575757,0x27575757,0x0,0x0, + 0x0,0x2d575757,0xe9575757,0x47575757,0x0,0x0,0x0,0x0,0x0,0x0,0x47575757,0xe9575757,0x2d575757,0x0, + 0x0,0xbf575757,0x4c575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4c575757,0xbf575757,0x0, + 0x51575757,0xb7575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xb7575757,0x51575757, + 0x99575757,0x52575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x52575757,0x99575757, + 0xc5575757,0x26575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x26575757,0xc5575757, + 0xc8575757,0x24575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24575757,0xc8575757, + 0x9b575757,0x50575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x50575757,0x9b575757, + 0x57575757,0xb0575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xb0575757,0x57575757, + 0x1575757,0xc6575757,0x45575757,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x45575757,0xc6575757,0x1575757, + 0x0,0x33575757,0xe6575757,0x3a575757,0x0,0x0,0x0,0x0,0x0,0x0,0x3a575757,0xe6575757,0x33575757,0x0, + 0x0,0x0,0x2f575757,0xda575757,0x8d575757,0x49575757,0x10575757,0x10575757,0x49575757,0x8d575757,0xda575757,0x2f575757,0x0,0x0, + 0x0,0x0,0x0,0xf575757,0x5d575757,0xa5575757,0xd9575757,0xd9575757,0xa5575757,0x5d575757,0xf575757,0x0,0x0,0x0 +}; + +static const QRgb toolBtnFrameThin_data[] = { + 0x0,0x12000000,0x4e000000,0x9d000000,0x9d000000,0x4e000000,0x12000000,0x0,0xd000000,0x81000000,0x6d000000,0x19000000,0x19000000,0x6d000000, + 0x81000000,0xd000000,0x4a000000,0x66000000,0x0,0x0,0x0,0x0,0x66000000,0x4a000000,0x9c000000,0x19000000,0x0,0x0, + 0x0,0x0,0x19000000,0x9c000000,0x9c000000,0x19000000,0x0,0x0,0x0,0x0,0x19000000,0x9c000000,0x4a000000,0x66000000, + 0x0,0x0,0x0,0x0,0x66000000,0x4a000000,0xd000000,0x81000000,0x6d000000,0x19000000,0x19000000,0x6d000000,0x81000000,0xd000000, + 0x0,0x12000000,0x4e000000,0x9d000000,0x9d000000,0x4e000000,0x12000000,0x0 +}; + + +static struct EmbedImage { + int width, height, depth; + const unsigned char *data; + int numColors; + const QRgb *colorTable; + bool alpha; + const char *name; + } embed_image_vec[] = { + { 5, 4, 32, (const unsigned char*)arrow_down_small_data, 0, 0, TRUE, "arrow_down" }, + { 4, 7, 32, (const unsigned char*)btn17H_data, 0, 0, TRUE, "btnH" }, + { 4, 7, 32, (const unsigned char*)btn17HRaisedShadow_data, 0, 0, TRUE, "btnHRSh" }, + { 4, 7, 32, (const unsigned char*)btn17HRaisedShadowPressed_data, 0, 0, TRUE, "btnHRSPr" }, + { 4, 7, 32, (const unsigned char*)btn17HSunkenShadow_data, 0, 0, TRUE, "btnHSSh" }, + { 12, 13, 32, (const unsigned char*)btn17_data, 0, 0, TRUE, "btn" }, + { 12, 13, 32, (const unsigned char*)btn17RaisedShadow3_data, 0, 0, TRUE, "btn17RaisedShadow3" }, + { 12, 13, 32, (const unsigned char*)btn17RaisedShadowPressed_data, 0, 0, TRUE, "btnRSPr" }, + { 12, 13, 32, (const unsigned char*)btn17SunkenShadow_data, 0, 0, TRUE, "btnSSh" }, + { 6, 4, 32, (const unsigned char*)btn17V_data, 0, 0, TRUE, "btnV" }, + { 6, 4, 32, (const unsigned char*)btn17VRaisedShadow_data, 0, 0, TRUE, "btnVRSh" }, + { 6, 4, 32, (const unsigned char*)btn17VRaisedShadowPressed_data, 0, 0, TRUE, "btnVRSPr" }, + { 6, 4, 32, (const unsigned char*)btn17VSunkenShadow_data, 0, 0, TRUE, "btnVSSh" }, + { 4, 5, 32, (const unsigned char*)btnPressedShadowHLines_data, 0, 0, TRUE, "btnPressedShadowHLines" }, + { 10, 9, 32, (const unsigned char*)btnPressedShadowRectangular_data, 0, 0, TRUE, "btnPressedShadowRectangular" }, + { 10, 9, 32, (const unsigned char*)btnPressedShadowRound_data, 0, 0, TRUE, "btnPressedShadowRound" }, + { 6, 4, 32, (const unsigned char*)btnPressedShadowVLines_data, 0, 0, TRUE, "btnPressedShadowVLines" }, + { 18, 19, 32, (const unsigned char*)checkbox2inside_data, 0, 0, TRUE, "checkbox2inside" }, + { 18, 19, 32, (const unsigned char*)checkbox2pressed_data, 0, 0, TRUE, "checkbox2pressed" }, + { 18, 19, 32, (const unsigned char*)checkbox2rect_data, 0, 0, TRUE, "checkbox2rect" }, + { 18, 19, 32, (const unsigned char*)checkbox2shadow_data, 0, 0, TRUE, "checkbox2shadow" }, + { 13, 13, 32, (const unsigned char*)checkListExclusiveIndicator_data, 0, 0, TRUE, "checkListExclusiveIndicator" }, + { 16, 17, 32, (const unsigned char*)checkmark_data, 0, 0, TRUE, "checkmark" }, + { 12, 24, 32, (const unsigned char*)dockBack_data, 0, 0, TRUE, "DockbackButton" }, + { 12, 24, 32, (const unsigned char*)dockClose_data, 0, 0, TRUE, "DockCloseButton" }, + { 12, 24, 32, (const unsigned char*)dockStay_data, 0, 0, TRUE, "OverlapButton" }, + { 12, 24, 32, (const unsigned char*)dockToDesktop2_data, 0, 0, TRUE, "ToDesktopButton" }, + { 6, 6, 32, (const unsigned char*)focusRectEdges_data, 0, 0, TRUE, "focusRectEdges" }, + { 16, 16, 32, (const unsigned char*)groupBoxMask_small_data, 0, 0, TRUE, "groupBoxMask" }, + { 16, 16, 32, (const unsigned char*)groupBox_small_data, 0, 0, TRUE, "groupBox" }, + { 8, 8, 32, (const unsigned char*)lineedit4edges_data, 0, 0, TRUE, "lineedit4edges" }, + { 8, 8, 32, (const unsigned char*)lineedit4inside_data, 0, 0, TRUE, "lineedit4inside" }, + { 6, 6, 32, (const unsigned char*)lineEditBtnEdges_d_data, 0, 0, TRUE, "lineEditBtnEdges-d" }, + { 6, 6, 32, (const unsigned char*)lineEditBtnEdges_data, 0, 0, TRUE, "lineEditBtnEdges" }, + { 6, 6, 32, (const unsigned char*)lineEditBtnShadow_data, 0, 0, TRUE, "lineEditBtnShadow" }, + { 7, 9, 32, (const unsigned char*)lveTriangular_data, 0, 0, TRUE, "lveTriangular" }, + { 6, 6, 32, (const unsigned char*)menuItem_data, 0, 0, TRUE, "menuItem" }, + { 10, 10, 32, (const unsigned char*)popup5_data, 0, 0, TRUE, "popup5" }, + { 4, 4, 32, (const unsigned char*)progressShadow2_data, 0, 0, TRUE, "progressShadow2" }, + { 20, 20, 32, (const unsigned char*)progressTile_data, 0, 0, TRUE, "progressTile" }, + { 17, 17, 32, (const unsigned char*)radio3circle_data, 0, 0, TRUE, "radio3circle" }, + { 17, 17, 32, (const unsigned char*)radio3inside_data, 0, 0, TRUE, "radio3inside" }, + { 17, 17, 32, (const unsigned char*)radio3pressed_data, 0, 0, TRUE, "radio3pressed" }, + { 17, 17, 32, (const unsigned char*)radio3shadow_data, 0, 0, TRUE, "radio3shadow" }, + { 5, 5, 32, (const unsigned char*)rb_dot2_data, 0, 0, TRUE, "rb-dot" }, + { 5, 5, 32, (const unsigned char*)rb_dot2_shadow_data, 0, 0, TRUE, "rb-dot-shadow" }, + { 18, 15, 32, (const unsigned char*)scroll2BtnHContour2_data, 0, 0, TRUE, "scrollBtnHContour" }, + { 18, 15, 32, (const unsigned char*)scroll2BtnHMask_data, 0, 0, TRUE, "scrollBtnHMask" }, + { 18, 15, 32, (const unsigned char*)scroll2BtnHShadow2_data, 0, 0, TRUE, "scrollBtnHShadow" }, + { 15, 18, 32, (const unsigned char*)scroll2BtnVContour2_data, 0, 0, TRUE, "scrollBtnVContour" }, + { 15, 18, 32, (const unsigned char*)scroll2BtnVMask_data, 0, 0, TRUE, "scrollBtnVMask" }, + { 15, 18, 32, (const unsigned char*)scroll2BtnVShadow2_data, 0, 0, TRUE, "scrollBtnVShadow" }, + { 16, 15, 32, (const unsigned char*)scroll2SliderHContour_data, 0, 0, TRUE, "scrollSliderHContour" }, + { 16, 15, 32, (const unsigned char*)scroll2SliderHDockedContour_data, 0, 0, TRUE, "scrollSliderHDockedContour" }, + { 16, 15, 32, (const unsigned char*)scroll2SliderHDockedShadow_data, 0, 0, TRUE, "scrollSliderHDockedShadow" }, + { 16, 15, 32, (const unsigned char*)scroll2SliderHMask_data, 0, 0, TRUE, "scrollSliderHMask" }, + { 16, 15, 32, (const unsigned char*)scroll2SliderHShadow2_data, 0, 0, TRUE, "scrollSliderHShadow" }, + { 15, 16, 32, (const unsigned char*)scroll2SliderVContour_data, 0, 0, TRUE, "scrollSliderVContour" }, + { 15, 16, 32, (const unsigned char*)scroll2SliderVDockedContour_data, 0, 0, TRUE, "scrollSliderVDockedContour" }, + { 15, 16, 32, (const unsigned char*)scroll2SliderVDockedShadow_data, 0, 0, TRUE, "scrollSliderVDockedShadow" }, + { 15, 16, 32, (const unsigned char*)scroll2SliderVMask_data, 0, 0, TRUE, "scrollSliderVMask" }, + { 15, 16, 32, (const unsigned char*)scroll2SliderVShadow2_data, 0, 0, TRUE, "scrollSliderVShadow" }, + { 24, 7, 32, (const unsigned char*)scrollBarArrows_data, 0, 0, TRUE, "scrollBarArrows" }, + { 4, 4, 32, (const unsigned char*)sizeGrip_data, 0, 0, TRUE, "sizeGrip" }, + { 4, 7, 32, (const unsigned char*)sliderGrooveHBody_data, 0, 0, TRUE, "slGHBody" }, + { 6, 7, 32, (const unsigned char*)sliderGroove_h_data, 0, 0, TRUE, "slGh" }, + { 7, 6, 32, (const unsigned char*)sliderGroove_v_data, 0, 0, TRUE, "slGv" }, + { 15, 15, 32, (const unsigned char*)sliderHandle2inside2_data, 0, 0, TRUE, "sliderHandle2inside" }, + { 15, 15, 32, (const unsigned char*)sliderHandle2circle_data, 0, 0, TRUE, "sliderHandle2circle" }, + { 15, 15, 32, (const unsigned char*)sliderHandle2shadow_data, 0, 0, TRUE, "sliderHandle2shadow" }, + { 7, 10, 32, (const unsigned char*)spinBoxArrows_data, 0, 0, TRUE, "spinBoxArrows" }, + { 4, 3, 32, (const unsigned char*)tabHLines_data, 0, 0, TRUE, "tabHLines" }, + { 4, 4, 32, (const unsigned char*)tabInsideWhiteLines_data, 0, 0, TRUE, "tabInsideWhiteLines" }, + { 14, 14, 32, (const unsigned char*)tabInsideWhite_data, 0, 0, TRUE, "tabInsideWhite" }, + { 1, 4, 32, (const unsigned char*)tabVlines_data, 0, 0, TRUE, "tabVLines" }, + { 16, 16, 32, (const unsigned char*)tabWidget_data, 0, 0, TRUE, "tabWidget" }, + { 14, 14, 32, (const unsigned char*)tooltipframe2_data, 0, 0, TRUE, "border1" }, + { 8, 8, 32, (const unsigned char*)toolBtnFrameThin_data, 0, 0, TRUE, "toolBtnFrameThin" }, + { 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const QImage& qembed_findImage( const QString& name ) +{ + static QDict dict; + QImage* img = dict.find( name ); + if ( !img ) { + for ( int i = 0; embed_image_vec[i].data; i++ ) { + if ( strcmp(embed_image_vec[i].name, name.latin1()) == 0 ) { + img = new QImage((uchar*)embed_image_vec[i].data, + embed_image_vec[i].width, + embed_image_vec[i].height, + embed_image_vec[i].depth, + (QRgb*)embed_image_vec[i].colorTable, + embed_image_vec[i].numColors, + QImage::BigEndian ); + if ( embed_image_vec[i].alpha ) + img->setAlphaBuffer( TRUE ); + dict.insert( name, img ); + break; + } + } + if ( !img ) { + static QImage dummy; + return dummy; + } + } + return *img; +} + +#endif diff --git a/domino/domino.cpp b/domino/domino.cpp new file mode 100644 index 0000000..837d0af --- /dev/null +++ b/domino/domino.cpp @@ -0,0 +1,8139 @@ +/* Domino widget style for KDE 3 + Copyright (C) 2006 Michael Lentner + + based on the KDE style "Plastik": + Copyright (C) 2003 Sandro Giessl + + based on the KDE style "dotNET": + Copyright (C) 2001-2002, Chris Lee + Carsten Pfeiffer + Karol Szwed + Drawing routines completely reimplemented from KDE3 HighColor, which was + originally based on some stuff from the KDE2 HighColor. + + based on drawing routines of the style "Keramik": + Copyright (c) 2002 Malte Starostik + (c) 2002,2003 Maksim Orlovich + based on the KDE3 HighColor Style + Copyright (C) 2001-2002 Karol Szwed + (C) 2001-2002 Fredrik Höglund + Drawing routines adapted from the KDE2 HCStyle, + Copyright (C) 2000 Daniel M. Duley + (C) 2000 Dirk Mueller + (C) 2001 Martijn Klingens + Progressbar code based on KStyle, + Copyright (C) 2001-2002 Karol Szwed + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include FT_FREETYPE_H + +#include "domino.h" + +#include +// #include +#include + + + +// popupmenu item constants... +static const int itemHMargin = 6; +static const int itemFrame = 7; +static const int arrowHMargin = 6; + +ButtonContour::ButtonContour() +{ + + state = Contour_Default; + alpha_mode = false; + + for(int t = 0; t < num_types; t++) + for(int s = 0; s < num_states; s++) + created[t][s] = 0; + + for(int s = 0; s < num_states; s++) + shadowCreated[s] = 0; + + ContourType ty; + ty = Contour_Sunken; + for(int s = 0; s < num_states; s++) { + c1[ty][s] = qRgba(31, 31, 31, 32); // top first shadow line + c4[ty][s] = qRgba(255, 255, 255, 78); // bottom first shadow line + c5[ty][s] = qRgba(255, 255, 255, 30); // bottom second shadow line + c6[ty][s] = qRgba(217, 217, 217, 34); // first left shadow line + } + ty = Contour_Raised; + for(int s = 0; s < num_states; s++) { + c1[ty][s] = qRgba(0, 0, 0, 14); // top first shadow line + c4[ty][s] = qRgba(0, 0, 0, 26); // bottom first shadow line + c5[ty][s] = qRgba(0, 0, 0, 10); // bottom second shadow line + c6[ty][s] = qRgba(0, 0, 0, 12); // first left shadow line + } + ty = Contour_Simple; + for(int s = 0; s < num_states; s++) { + c1[ty][s] = qRgba(0, 0, 0, 0); // top first shadow line + c4[ty][s] = qRgba(0, 0, 0, 0); // bottom first shadow line + c5[ty][s] = qRgba(0, 0, 0, 0); // bottom second shadow line + c6[ty][s] = qRgba(0, 0, 0, 0); // first left shadow line + } + drawButtonSunkenShadow = true; +} + + +ButtonContour::~ButtonContour() +{ + + for(int t = 0; t < num_types; t++) { + for(int s = 0; s < num_states; s++) { + if(created[t][s]) { + delete btnEdges[t][s]; + delete btnVLines[t][s]; + delete btnHLines[t][s]; + } + } + } + for(int s = 0; s < num_states; s++) { + if(shadowCreated[s]) + delete buttonShadowRectangular[s]; + } +} + +RubberWidget::RubberWidget(Window window ) + : QWidget() +{ + setWState(WState_Disabled|WState_Polished); + QWidget::create( window, true, true); +} + +RubberWidget::~RubberWidget() +{ +} + + + +Rubber::Rubber(uint col) +{ + + rubber = 0; + parent = 0; + window = 0; + mask = QRegion(); + Display *dpy = qt_xdisplay(); + int screen = qt_xscreen(); + visual = 0; + colormap = 0; + int event_base, error_base; + + if ( XRenderQueryExtension( dpy, &event_base, &error_base ) ) + { + int nvi; + XVisualInfo templ; + templ.screen = screen; + templ.depth = 32; + templ.c_class = TrueColor; + XVisualInfo *xvi = XGetVisualInfo( dpy, VisualScreenMask | VisualDepthMask + | VisualClassMask, &templ, &nvi ); + + for ( int i = 0; i < nvi; i++ ) { + XRenderPictFormat *format = XRenderFindVisualFormat( dpy, xvi[i].visual ); + if ( format->type == PictTypeDirect && format->direct.alphaMask ) { + visual = xvi[i].visual; + colormap = XCreateColormap( dpy, RootWindow( dpy, screen ), visual, AllocNone ); + break; + } + } + } + + wsa.border_pixel = 0; + wsa.colormap = colormap; + wsa.background_pixel = 0x00000000; + wsa.override_redirect = true; + + color = col; +} + +void Rubber::create(QRect& r, QRegion& m) { + if(parent) + return; + + mask = m; + + wsa.background_pixel = 0x00000000; + Window parentwin = XCreateWindow(qt_xdisplay(), qApp->desktop()->winId(), r.x(), r.y(), r.width(), r.height(), 0, 32, InputOutput, visual, CWBackPixel|CWColormap|CWBorderPixel|CWOverrideRedirect, &wsa); + parent = new RubberWidget(parentwin); + + wsa.background_pixel = color; + window = XCreateWindow(qt_xdisplay(), parentwin, 0, 0, r.width(), r.height(), 0, 32, InputOutput, visual, CWBackPixel|CWColormap|CWBorderPixel|CWOverrideRedirect, &wsa); + rubber = new RubberWidget(window); + +#ifdef ShapeInput + QBitmap bm(r.width(), r.height(), true); + XShapeCombineMask(qt_xdisplay(), rubber->winId(), ShapeInput, 0, 0, bm.handle(), ShapeSet); +#endif + XShapeCombineRegion( qt_xdisplay(), rubber->winId(), ShapeBounding, 0, 0, mask.handle(), ShapeSet ); + + rubber->show(); + parent->show(); + + XFlush(qt_xdisplay()); +} + +Rubber::~Rubber() +{ +} + +void Rubber::updateMask(QRegion& m) { + if(mask != m) + XShapeCombineRegion( qt_xdisplay(), rubber->winId(), ShapeBounding, 0, 0, m.handle(), ShapeSet ); +} + + +// -- Style Plugin Interface ------------------------- +class DominoStylePlugin : public QStylePlugin +{ + public: + DominoStylePlugin() {} + ~DominoStylePlugin() {} + + QStringList keys() const { + return QStringList() << "Domino"; + } + + QStyle* create( const QString& key ) { + if (key.lower() == "domino") + return new DominoStyle; + return 0; + } +}; + +KDE_Q_EXPORT_PLUGIN( DominoStylePlugin ) +// -- end -- + + DominoStyle::DominoStyle() : KStyle( KStyle::Default /*AllowMenuTransparency*/, ThreeButtonScrollBar ) +{ + konsoleMode = false; + kickerMode = false; + konquerorMode = false; + flatMode = false; + viewPortPressed = false; + oldRubberRect = QRect(); + rubber = 0; + ignoreNextFocusRect = false; +#if KDE_VERSION < 0x30506 + compositeManagerRunning = true; +#endif + configMode = "0"; // temporaly to avoid cache problems between the configs previewStyle and this style + spinWidgetDown = false; + + popupTimer = new QTimer(this); + + QColor background = qApp->palette().active().background(); + QColor buttonColor = qApp->palette().active().button(); + QColor highlight = qApp->palette().active().highlight(); + QSettings settings; +// _contrast = settings.readNumEntry("/Qt/KDE/contrast", 0); + + settings.beginGroup("/domino/Settings"); + + //konqTabBarContrast = 150; + konqTabBarContrast = settings.readNumEntry("/konqTabBarContrast", 15)+100; + + _animateProgressBar = settings.readBoolEntry("/animateProgressBar", true); + _centerTabs = settings.readBoolEntry("/centerTabs", false); + _drawTriangularExpander = settings.readBoolEntry("/drawTriangularExpander", true); + _customCheckMarkColor = settings.readBoolEntry("/customCheckMarkColor", false); + _checkMarkColor.setNamedColor( settings.readEntry("/checkMarkColor", "black") ); + groupBoxSettings.tintBackground = settings.readBoolEntry("/tintGroupBoxBackground", true); + groupBoxSettings.customColor = settings.readBoolEntry("/customGroupBoxBackgroundColor", false); + groupBoxSettings.brightness = settings.readNumEntry("/groupBoxBrightness", 10); + groupBoxSettings.color = settings.readEntry("/groupBoxBackgroundColor", darkenColor(background, 10).name()); + bool customToolTipColor = settings.readBoolEntry("/customToolTipColor", false); + _toolTipColor = customToolTipColor? settings.readEntry("/toolTipColor", QColor(218,218,179).name()) : QColor(218,218,179); + //_toolTipColor = QColor(255,255,220); // yellow + _smoothScrolling = settings.readBoolEntry("/smoothScrolling", true); + _buttonHeightAdjustment = settings.readNumEntry("/buttonHeightAdjustment", 0); + _customPopupMenuColor = settings.readBoolEntry("/customPopupMenuColor", false); + _popupMenuColor = _customPopupMenuColor ? settings.readEntry("/popupMenuColor", background.name()) : background.name(); + _customSelMenuItemColor = settings.readBoolEntry("/customSelMenuItemColor", false); + _selMenuItemColor = _customSelMenuItemColor ? settings.readEntry("/selMenuItemColor", highlight.name()) : highlight.name(); + _drawPopupMenuGradient = settings.readBoolEntry("/drawPopupMenuGradient", true); + _indentPopupMenuItems = settings.readBoolEntry("/indentPopupMenuItems", true); + _toolBtnAsBtn = settings.readBoolEntry("/drawToolButtonAsButton", true); + _highlightToolBtnIcon = settings.readBoolEntry("/highlightToolBtnIcon", false); + + rubberBandType = (RubberType) settings.readNumEntry("/rubberBandType", DistRubber); + if(rubberBandType == ArgbRubber) { + int dummy; + if(XQueryExtension(qt_xdisplay(), "Composite", &dummy, &dummy, &dummy)) { + QColor c = settings.readEntry("/rubberBandColor", highlight.name()); + int a = settings.readNumEntry("/rubberBandOpacity", 30)*255/100; + _argbRubberBandColor = qRgba(c.red(), c.green(), c.blue(), a); + + rubber = new Rubber(preMultiplyColor(_argbRubberBandColor)); + } + else + rubberBandType = DistRubber; + } + + + focusIndicatorSettings.indicateFocus = settings.readBoolEntry("/indicateFocus", true); + if(focusIndicatorSettings.indicateFocus) { + focusIndicatorSettings.color = settings.readEntry("/indicatorColor", highlight.name()); + focusIndicatorSettings.opacity = settings.readNumEntry("/indicatorColorOpacity", 60)*255/100; + focusIndicatorSettings.buttonColor = settings.readEntry("/indicatorButtonColor", highlight.name()); + focusIndicatorSettings.buttonOpacity = settings.readNumEntry("/indicatorColorButtonOpacity", 60)*255/100; + } + focusIndicatorSettings.drawUnderline = settings.readBoolEntry("/drawFocusUnderline", true); + + buttonContour = new ButtonContour(); + buttonContour->setDefaultType((ContourType)settings.readNumEntry("/buttonContourType", Contour_Raised), false); // we need to know the ContourType to adjust the contour colors + buttonContour->setColor(Contour_Default, settings.readEntry("/buttonContourColor", background.dark(250).name())); + buttonContour->setColor(Contour_DefaultButton, settings.readEntry("/buttonDefaultContourColor", highlight.name())); + buttonContour->setColor(Contour_MouseOver, settings.readEntry("/buttonMouseOverContourColor", background.dark(250).name())); + buttonContour->setColor(Contour_Pressed, settings.readEntry("/buttonPressedContourColor", background.dark(250).name())); + buttonContour->drawButtonSunkenShadow = settings.readBoolEntry("/drawButtonSunkenShadow", true); + buttonContour->setDefaultType(buttonContour->defaultType); // create this time the tinted pixmaps + + if(buttonContour->defaultType == Contour_Raised) + buttonContour->drawButtonSunkenShadow = false; + + _customSliderHandleContourColor = settings.readBoolEntry("/customSliderHandleContourColor", false); + + bool drawTextEffect = settings.readBoolEntry("/drawTextEffect", true); + if(drawTextEffect) { + + textEffectSettings.mode = settings.readNumEntry("/textEffectMode", 0) ? TextEffect_Everywhere : TextEffect_OnlyButton; + textEffectSettings.color = settings.readEntry("/textEffectColor", Qt::white.name()); + textEffectSettings.opacity = settings.readNumEntry("/textEffectOpacity", 60)*255/100; + textEffectSettings.buttonColor = settings.readEntry("/textEffectButtonColor", Qt::white.name()); + textEffectSettings.buttonOpacity = settings.readNumEntry("/textEffectButtonOpacity", 60)*255/100; + int textEffectPos = settings.readNumEntry("/textEffectPos", 5); + switch(textEffectPos) { + case 0: + textEffectSettings.pos = QPoint(-1,-1); + break; + case 1: + textEffectSettings.pos = QPoint(0,-1); + break; + case 2: + textEffectSettings.pos = QPoint(1,-1); + break; + case 3: + textEffectSettings.pos = QPoint(1,0); + break; + case 4: + textEffectSettings.pos = QPoint(1,1); + break; + case 5: + textEffectSettings.pos = QPoint(0,1); + break; + case 6: + textEffectSettings.pos = QPoint(-1,1); + break; + case 7: + textEffectSettings.pos = QPoint(-1,0); + break; + default: + textEffectSettings.pos = QPoint(0,1); + } + + int textEffectButtonPos = settings.readNumEntry("/textEffectButtonPos", 5); + switch(textEffectButtonPos) { + case 0: + textEffectSettings.buttonPos = QPoint(-1,-1); + break; + case 1: + textEffectSettings.buttonPos = QPoint(0,-1); + break; + case 2: + textEffectSettings.buttonPos = QPoint(1,-1); + break; + case 3: + textEffectSettings.buttonPos = QPoint(1,0); + break; + case 4: + textEffectSettings.buttonPos = QPoint(1,1); + break; + case 5: + textEffectSettings.buttonPos = QPoint(0,1); + break; + case 6: + textEffectSettings.buttonPos = QPoint(-1,1); + break; + case 7: + textEffectSettings.buttonPos = QPoint(-1,0); + break; + default: + textEffectSettings.buttonPos = QPoint(0,1); + } + } + else + textEffectSettings.mode = TextEffect_None; + + btnSurface.numGradients = settings.readNumEntry("/btnSurface_numGradients", 2); + btnSurface.g1Color1 = settings.readEntry("/btnSurface_g1Color1", buttonColor.name()); + btnSurface.g1Color2 = settings.readEntry("/btnSurface_g1Color2", buttonColor.dark(120).name()); + btnSurface.g2Color1 = settings.readEntry("/btnSurface_g2Color1", buttonColor.dark(120).name()); + btnSurface.g2Color2 = settings.readEntry("/btnSurface_g2Color2", buttonColor.dark(110).name()); + btnSurface.background = settings.readEntry("/btnSurface_background", buttonColor.name()); + btnSurface.g1Top = settings.readNumEntry("/btnSurface_g1Top", 0); + btnSurface.g1Bottom = settings.readNumEntry("/btnSurface_g1Bottom", 50); + btnSurface.g2Top = settings.readNumEntry("/btnSurface_g2Top", 50); + btnSurface.g2Bottom = settings.readNumEntry("/btnSurface_g2Bottom", 100); + + activeTabTopSurface.numGradients = settings.readNumEntry("/activeTabTopSurface_numGradients", 2); + activeTabTopSurface.g1Color1 = settings.readEntry("/activeTabTopSurface_g1Color1", background.light(110).name()); + activeTabTopSurface.g1Color2 = settings.readEntry("/activeTabTopSurface_g1Color2", background.name()); + activeTabTopSurface.g2Color1 = settings.readEntry("/activeTabTopSurface_g2Color1", background.name()); + activeTabTopSurface.g2Color2 = settings.readEntry("/activeTabTopSurface_g2Color2", background.name()); + activeTabTopSurface.background = settings.readEntry("/activeTabTopSurface_background", background.name()); + activeTabTopSurface.g1Top = settings.readNumEntry("/activeTabTopSurface_g1Top", 0); + activeTabTopSurface.g1Bottom = settings.readNumEntry("/activeTabTopSurface_g1Bottom", 50); + activeTabTopSurface.g2Top = settings.readNumEntry("/activeTabTopSurface_g2Top", 50); + activeTabTopSurface.g2Bottom = settings.readNumEntry("/activeTabTopSurface_g2Bottom", 100); + + tabTopSurface.numGradients = settings.readNumEntry("/tabTopSurface_numGradients", 2); + tabTopSurface.g1Color1 = settings.readEntry("/tabTopSurface_g1Color1", background.light(110).name()); + tabTopSurface.g1Color2 = settings.readEntry("/tabTopSurface_g1Color2", background.dark(110).name()); + tabTopSurface.g2Color1 = settings.readEntry("/tabTopSurface_g2Color1", background.dark(110).name()); + tabTopSurface.g2Color2 = settings.readEntry("/tabTopSurface_g2Color2", background.dark(110).name()); + tabTopSurface.background = settings.readEntry("/tabTopSurface_background", background.dark(110).name()); + tabTopSurface.g1Top = settings.readNumEntry("/tabTopSurface_g1Top", 0); + tabTopSurface.g1Bottom = settings.readNumEntry("/tabTopSurface_g1Bottom", 50); + tabTopSurface.g2Top = settings.readNumEntry("/tabTopSurface_g2Top", 50); + tabTopSurface.g2Bottom = settings.readNumEntry("/tabTopSurface_g2Bottom", 100); + + activeTabBottomSurface.numGradients = settings.readNumEntry("/activeTabBottomSurface_numGradients", 2); + activeTabBottomSurface.g1Color1 = settings.readEntry("/activeTabBottomSurface_g1Color1", background.name()); + activeTabBottomSurface.g1Color2 = settings.readEntry("/activeTabBottomSurface_g1Color2", background.name()); + activeTabBottomSurface.g2Color1 = settings.readEntry("/activeTabBottomSurface_g2Color1", background.name()); + activeTabBottomSurface.g2Color2 = settings.readEntry("/activeTabBottomSurface_g2Color2", background.dark(120).name()); + activeTabBottomSurface.background = settings.readEntry("/activeTabBottomSurface_background", background.name()); + activeTabBottomSurface.g1Top = settings.readNumEntry("/activeTabBottomSurface_g1Top", 0); + activeTabBottomSurface.g1Bottom = settings.readNumEntry("/activeTabBottomSurface_g1Bottom", 50); + activeTabBottomSurface.g2Top = settings.readNumEntry("/activeTabBottomSurface_g2Top", 50); + activeTabBottomSurface.g2Bottom = settings.readNumEntry("/activeTabBottomSurface_g2Bottom", 100); + + tabBottomSurface.numGradients = settings.readNumEntry("/tabBottomSurface_numGradients", 2); + tabBottomSurface.g1Color1 = settings.readEntry("/tabBottomSurface_g1Color1", background.dark(110).name()); + tabBottomSurface.g1Color2 = settings.readEntry("/tabBottomSurface_g1Color2", background.dark(110).name()); + tabBottomSurface.g2Color1 = settings.readEntry("/tabBottomSurface_g2Color1", background.dark(110).name()); + tabBottomSurface.g2Color2 = settings.readEntry("/tabBottomSurface_g2Color2", background.dark(120).name()); + tabBottomSurface.background = settings.readEntry("/tabBottomSurface_background", background.dark(110).name()); + tabBottomSurface.g1Top = settings.readNumEntry("/tabBottomSurface_g1Top", 0); + tabBottomSurface.g1Bottom = settings.readNumEntry("/tabBottomSurface_g1Bottom", 50); + tabBottomSurface.g2Top = settings.readNumEntry("/tabBottomSurface_g2Top", 50); + tabBottomSurface.g2Bottom = settings.readNumEntry("/tabBottomSurface_g2Bottom", 100); + + scrollBarSurface.numGradients = settings.readNumEntry("/scrollBarSurface_numGradients", 2); + scrollBarSurface.g1Color1 = settings.readEntry("/scrollBarSurface_g1Color1", buttonColor.name()); + scrollBarSurface.g1Color2 = settings.readEntry("/scrollBarSurface_g1Color2", buttonColor.dark(120).name()); + scrollBarSurface.g2Color1 = settings.readEntry("/scrollBarSurface_g2Color1", buttonColor.dark(120).name()); + scrollBarSurface.g2Color2 = settings.readEntry("/scrollBarSurface_g2Color2", buttonColor.dark(110).name()); + scrollBarSurface.background = settings.readEntry("/scrollBarSurface_background", buttonColor.name()); + scrollBarSurface.g1Top = settings.readNumEntry("/scrollBarSurface_g1Top", 0); + scrollBarSurface.g1Bottom = settings.readNumEntry("/scrollBarSurface_g1Bottom", 50); + scrollBarSurface.g2Top = settings.readNumEntry("/scrollBarSurface_g2Top", 50); + scrollBarSurface.g2Bottom = settings.readNumEntry("/scrollBarSurface_g2Bottom", 100); + + scrollBarGrooveSurface.numGradients = settings.readNumEntry("/scrollBarGrooveSurface_numGradients", 0); + scrollBarGrooveSurface.g1Color1 = settings.readEntry("/scrollBarGrooveSurface_g1Color1", background.name()); + scrollBarGrooveSurface.g1Color2 = settings.readEntry("/scrollBarGrooveSurface_g1Color2", background.dark(120).name()); + scrollBarGrooveSurface.g2Color1 = settings.readEntry("/scrollBarGrooveSurface_g2Color1", background.dark(120).name()); + scrollBarGrooveSurface.g2Color2 = settings.readEntry("/scrollBarGrooveSurface_g2Color2", background.dark(110).name()); + scrollBarGrooveSurface.background = settings.readEntry("/scrollBarGrooveSurface_background", background.dark(150).name()); + scrollBarGrooveSurface.g1Top = settings.readNumEntry("/scrollBarGrooveSurface_g1Top", 0); + scrollBarGrooveSurface.g1Bottom = settings.readNumEntry("/scrollBarGrooveSurface_g1Bottom", 50); + scrollBarGrooveSurface.g2Top = settings.readNumEntry("/scrollBarGrooveSurface_g2Top", 50); + scrollBarGrooveSurface.g2Bottom = settings.readNumEntry("/scrollBarGrooveSurface_g2Bottom", 100); + + headerSurface.numGradients = settings.readNumEntry("/headerSurface_numGradients", 2); + headerSurface.g1Color1 = settings.readEntry("/headerSurface_g1Color1", background.name()); + headerSurface.g1Color2 = settings.readEntry("/headerSurface_g1Color2", background.dark(120).name()); + headerSurface.g2Color1 = settings.readEntry("/headerSurface_g2Color1", background.dark(120).name()); + headerSurface.g2Color2 = settings.readEntry("/headerSurface_g2Color2", background.dark(110).name()); + headerSurface.background = settings.readEntry("/headerSurface_background", background.name()); + headerSurface.g1Top = settings.readNumEntry("/headerSurface_g1Top", 0); + headerSurface.g1Bottom = settings.readNumEntry("/headerSurface_g1Bottom", 50); + headerSurface.g2Top = settings.readNumEntry("/headerSurface_g2Top", 50); + headerSurface.g2Bottom = settings.readNumEntry("/headerSurface_g2Bottom", 100); + + // checkBoxes + radioButtons + checkItemSurface.numGradients = settings.readNumEntry("/checkItemSurface_numGradients", 2); + checkItemSurface.g1Color1 = settings.readEntry("/checkItemSurface_g1Color1", buttonColor.name()); + checkItemSurface.g1Color2 = settings.readEntry("/checkItemSurface_g1Color2", buttonColor.dark(120).name()); + checkItemSurface.g2Color1 = settings.readEntry("/checkItemSurface_g2Color1", buttonColor.dark(120).name()); + checkItemSurface.g2Color2 = settings.readEntry("/checkItemSurface_g2Color2", buttonColor.dark(110).name()); + checkItemSurface.background = settings.readEntry("/checkItemSurface_background", buttonColor.name()); + checkItemSurface.g1Top = settings.readNumEntry("/checkItemSurface_g1Top", 0); + checkItemSurface.g1Bottom = settings.readNumEntry("/checkItemSurface_g1Bottom", 50); + checkItemSurface.g2Top = settings.readNumEntry("/checkItemSurface_g2Top", 50); + checkItemSurface.g2Bottom = settings.readNumEntry("/checkItemSurface_g2Bottom", 100); + + settings.endGroup(); + + if(!strcmp(qApp->argv()[0], "konqueror")) { + KGlobal::config()->setGroup("General"); + minTabLength = KGlobal::config()->readNumEntry("MinimumTabLength", 3); + } + else + minTabLength = 0; + + if(!strcmp(qApp->className(), "KApplication")) { + QString oldgroup = KGlobal::config()->group(); + KGlobal::config()->setGroup("KDE"); + macStyleBar = KGlobal::config()->readBoolEntry("macStyle", false); + KGlobal::config()->setGroup(oldgroup); // reset the group, do not interfere with the application + KApplicationMode = true; + } + else { + macStyleBar = false; + KApplicationMode = false; + } + + + hoverWidget = 0; + horizontalLine = 0; + verticalLine = 0; + sideRepaint = 0; + hoveredToolBoxTab = 0; + + checkMark = createCheckMark(_customCheckMarkColor? _checkMarkColor : qApp->palette().active().foreground()); + radioIndicator = createRadioIndicator(_customCheckMarkColor? _checkMarkColor : qApp->palette().active().foreground()); + + popupFrame = new QPixmap(tintImage(qembed_findImage("popup5"), _popupMenuColor.dark(150) )); + + // setup pixmap cache... + pixmapCache = new QIntCache(150000, 499); + pixmapCache->setAutoDelete(true); + + if ( _animateProgressBar ) + { + animationTimer = new QTimer( this ); + connect( animationTimer, SIGNAL(timeout()), this, SLOT(updateProgressPos()) ); + } + + scrollDistance = 0; + scrollWidget = 0; + scrollTimer = new QTimer(this); + connect( scrollTimer, SIGNAL(timeout()), this, SLOT(updateScrollPos()) ); + + QColor tabContour2 = qApp->palette().active().background().dark(150); + border1= new QPixmap(tintImage(qembed_findImage("border1"), tabContour2)); +} + +void DominoStyle::updateProgressPos() +{ + + QProgressBar* pb; + //Update the registered progressbars. + QMap::iterator iter; + bool visible = false; + for (iter = progAnimWidgets.begin(); iter != progAnimWidgets.end(); iter++) + { + if ( !dynamic_cast(iter.key()) ) + continue; + + pb = dynamic_cast(iter.key()); + if ( iter.key() -> isEnabled() && + pb->progress() != pb->totalSteps() && pb->progress()) + { + // update animation Offset of the current Widget + iter.data() = (iter.data() + 1) % 20; + iter.key()->update(); + } + if (iter.key()->isVisible()) + visible = true; + } + if (!visible) + animationTimer->stop(); +} + +void DominoStyle::updateScrollPos() +{ + if(dynamic_cast(scrollWidget) && scrollDistance != 0) { + int scroll; + if(scrollDistance < 0) { + if(scrollDistance < -200) + scroll = +45; + else if(scrollDistance < -100) + scroll = +30; + else + scroll = +15; + + scrollDistance += scroll; + scrollDistance = QMIN(scrollDistance, 0); + } + else { + if(scrollDistance > 200) + scroll = -45; + else if(scrollDistance > 100) + scroll = -30; + else + scroll = -15; + + scrollDistance += scroll; + scrollDistance = QMAX(scrollDistance, 0); + } + + if(scrollVertical) + scrollWidget->scrollBy(0, scroll); + else + scrollWidget->scrollBy(scroll, 0); + } + else if(scrollTimer->isActive()) { + scrollTimer->stop(); + } +} + + +DominoStyle::~DominoStyle() +{ + delete pixmapCache; + delete horizontalLine; + delete verticalLine; + + delete checkMark; + delete radioIndicator; + delete border1; + delete popupFrame; + + delete buttonContour; +} + +void DominoStyle::polish(QApplication* app) +{ + if(!qstrcmp(app->name(), "konsole")) + konsoleMode = true; + else if(!qstrcmp(app->name(), "konqueror")) + konquerorMode = true; + else if(!qstrcmp(app->name(), "kicker")) + kickerMode = true; + + QPixmapCache::clear(); +} + +void DominoStyle::polish(QPalette &p) { + + p.setBrush(QColorGroup::Button, p.active().background()); + + if(!_customPopupMenuColor) + _popupMenuColor = qApp->palette().active().background(); + if(!_customSelMenuItemColor) + _selMenuItemColor = qApp->palette().active().highlight(); + + QColor tabContour2 = qApp->palette().active().background().dark(150); + delete border1; + border1= new QPixmap(tintImage(qembed_findImage("border1"), tabContour2)); + delete popupFrame; + popupFrame = new QPixmap(tintImage(qembed_findImage("popup5"), _popupMenuColor.dark(150))); + if(!_customCheckMarkColor) { + delete checkMark; + checkMark = createCheckMark(qApp->palette().active().foreground()); + delete radioIndicator; + radioIndicator = createRadioIndicator(qApp->palette().active().foreground()); + } +} + +void DominoStyle::polish(QWidget* widget) +{ + + if(!strcmp(widget->name(), "__khtml")) { // is it a khtml widget...? + khtmlWidgets[widget] = true; + connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(khtmlWidgetDestroyed(QObject*))); + } + else if((!strcmp(widget->name(), "kfile button") || (widget->isA("KLineEdit") && widget->parentWidget())) && !strcmp(widget->parentWidget()->name(), "__khtml")) { + widget->setBackgroundMode(Qt::NoBackground); + widget->parentWidget()->setBackgroundMode(Qt::NoBackground); + khtmlWidgets[widget] = true; + connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(khtmlWidgetDestroyed(QObject*))); + } + + if(dynamic_cast(widget)) { + + setDominoButtonPalette(widget, Palette_Widget); + + if (widget->isA("KDockButton_Private")) + widget->setFixedSize(13, 13); // 12x12 pixmap + 1px top and right spacing + else { + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + if(widget->parentWidget() && widget->parentWidget()->paletteBackgroundPixmap() && !khtmlWidgets.contains(widget)) { + widget->setBackgroundMode(Qt::PaletteButton); + widget->setBackgroundPixmap(*widget->parentWidget()->paletteBackgroundPixmap()); + widget->setBackgroundOrigin(setPixmapOrigin(widget->parentWidget()->backgroundOrigin())); + } + } + + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + KToolBarButton* tb = static_cast(widget); + //setDominoButtonPalette(widget); // ### changing the palette breaks them! + + if(tb->popupDelay() < 1) + tb->setPopupDelay(5); // now we have time to draw a pressed button + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + QToolButton* tb = static_cast(widget); + tb->setBackgroundMode(Qt::PaletteBackground); + tb->setPaletteForegroundColor(tb->palette().active().buttonText()); + setDominoButtonPalette(widget, Palette_Widget); + + if(tb->popupDelay() < 1) { + disconnect(tb, SIGNAL(pressed()), tb, SLOT(popupPressed())); + connect(tb, SIGNAL(pressed()), this, SLOT(toolPopupPressed())); + connect(tb, SIGNAL(released()), this, SLOT(toolPopupReleased())); + } + + if(tb->popupDelay() < 1) + tb->setPopupDelay(5); + + if(tb->parentWidget() && tb->parentWidget()->paletteBackgroundPixmap()) { + tb->setPaletteBackgroundPixmap(*tb->parentWidget()->paletteBackgroundPixmap()); + tb->setBackgroundOrigin(setPixmapOrigin(tb->parentWidget()->backgroundOrigin())); + } + +// if(widget->isA("TaskContainer")) +// ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); +// else + widget->installEventFilter(this); + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + } + else if(dynamic_cast(widget)) { + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + QComboBox* cb = static_cast(widget); + + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + if(widget->parentWidget() && widget->parentWidget()->paletteBackgroundPixmap() && !khtmlWidgets.contains(widget)) { + widget->setBackgroundMode(Qt::PaletteButton); + widget->setBackgroundOrigin(setPixmapOrigin(widget->parentWidget()->backgroundOrigin())); + } + + setDominoButtonPalette(widget, Palette_Widget); + if(cb->listBox()) + cb->listBox()->setFrameStyle(QFrame::Panel|QFrame::Sunken); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + QGroupBox* gb = dynamic_cast(widget); + gb->setAlignment(Qt::AlignHCenter); + + if(!gb->isFlat() && !gb->lineWidth() <= 0) { + if(gb->layout() && gb->layout()->margin() < 7) + gb->layout()->setMargin(7); + bool groupBoxFrame = gb->frameShape() == QFrame::GroupBoxPanel; + if(groupBoxFrame) + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + + if(groupBoxSettings.tintBackground && groupBoxFrame) { + QColor color = getGroupBoxColor(gb); + QPalette pal(widget->palette()); + int h, s, v; + pal.active().foreground().hsv(&h, &s, &v); + pal.setColor(QPalette::Active, QColorGroup::Background, color); + pal.setColor(QPalette::Inactive, QColorGroup::Background, color); + pal.setColor(QPalette::Disabled, QColorGroup::Background, color); + pal.setColor(QPalette::Disabled, QColorGroup::Text, alphaBlendColors(pal.active().foreground(), color, 40)); + gb->setPalette(pal); + + if(gb->isCheckable()) { + ((QCheckBox*)gb->child("qt_groupbox_checkbox", 0, false))->setPaletteBackgroundColor(gb->parentWidget()->paletteBackgroundColor()); + } + } + connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(groupBoxDestroyed(QObject*))); + } + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + // Don't like this widget... too much private stuff and the spinBox/spinWidget mess. + // We check here if the spinBox has a backgroundPixmap. If it's a spinWidget without a spinBox, well, maybe we should fill the widget black then >:) + if(widget->parentWidget() && widget->parentWidget()->parentWidget() && widget->parentWidget()->parentWidget()->paletteBackgroundPixmap()) { + QWidget::BackgroundOrigin origin = widget->parentWidget()->backgroundOrigin(); + if(origin == QWidget::WidgetOrigin) { + widget->parentWidget()->setBackgroundOrigin(QWidget::ParentOrigin); + widget->setBackgroundOrigin(QWidget::AncestorOrigin); + } + else + widget->setBackgroundOrigin(setPixmapOrigin(origin)); + } + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + setDominoButtonPalette(widget, Palette_Widget); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + connect(dynamic_cast(widget), SIGNAL(valueChanged(int)), this, SLOT(spinBoxValueChanged(int))); + } + else if(dynamic_cast(widget)) { + QLineEdit* le = dynamic_cast(widget); + QRect r = le->rect(); + le->setFrameRect(QRect(r.x()+1, r.y(), r.width()-1, r.height())); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + setDominoButtonPalette(widget, Palette_Widget); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + + if(widget->isA("PanelKMenu")) + widget->setPaletteForegroundColor(alphaBlendColors(_popupMenuColor, qApp->palette().active().foreground(), 150)); + + widget->setBackgroundMode( NoBackground ); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + QTabBar* tb = dynamic_cast(widget); + if(widget->parentWidget() && widget->parentWidget()->isA("KonqFrameTabs")) { + tb->setShape(QTabBar::RoundedBelow); + widget->setEraseColor(widget->paletteBackgroundColor().dark(konqTabBarContrast)); + } + connect(tb, SIGNAL(layoutChanged()), this, SLOT(updateTabWidgetFrame())); + connect(tb, SIGNAL(selected(int)), this, SLOT(updateTabWidgetFrame())); + setDominoButtonPalette(widget, Palette_Widget); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + ((DominoQWidget*)dynamic_cast(widget)->viewport())->setWFlags(Qt::WNoAutoErase); + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + dynamic_cast(widget)->viewport()->installEventFilter(this); // rubberband + if(strcmp(widget->className(), "KDIconView")) + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + dynamic_cast(widget)->viewport()->installEventFilter(this); // rubberband + if(widget->isA("KonqTreeViewWidget")) { // konqi frames + QFrame* f = dynamic_cast(widget); + f->setFrameStyle(QFrame::Box|QFrame::Plain); + f->setLineWidth(1); + } + + if(!widget->isA("KopeteContactListView") && !widget->isA("ViewTree")) // they have their own mousewheel handling + widget->installEventFilter(this); + } + else if(widget->isA("KActiveLabel")) { // before QScrollView + if(dynamic_cast(widget->parentWidget())) + widget->setPaletteBackgroundColor(widget->parentWidget()->paletteBackgroundColor()); + } + else if(dynamic_cast(widget)) { + dynamic_cast(widget)->viewport()->installEventFilter(this); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + QFrame* f = dynamic_cast(widget); + if((konquerorMode && widget->isA("KHTMLView")) || f->parentWidget() && !strcmp(f->parentWidget()->name(), "KonqFrame")) { // konqi frames + f->setFrameStyle(QFrame::Box|QFrame::Plain); + f->setLineWidth(1); + widget->installEventFilter(this); + } + else if(_smoothScrolling && !widget->isA("TaskBar") && !widget->isA("Gwenview::ImageView")) + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + } + else if(dynamic_cast(widget)) { + widget->installEventFilter(this); + } + else if(dynamic_cast(widget) || dynamic_cast(widget)) { + widget->setBackgroundMode(Qt::PaletteBackground); + } + + else if(widget->isA("KonqCheckBox")) { + widget->installEventFilter(this); + } + else if(widget->isA("QTipLabel")) { + widget->installEventFilter(this); + } + else if(widget->isA("QWhatsThat")) { + widget->installEventFilter(this); + } + else if(widget->isA("KonqFileTip")) { + widget->installEventFilter(this); + } + + else if(dynamic_cast(widget) && widget->parentWidget() && widget->parentWidget()->isA("QToolBox")) { + widget->installEventFilter(this); + } + else if( dynamic_cast(widget) && _animateProgressBar) + { + setDominoButtonPalette(widget, Palette_Widget); + + progAnimWidgets[widget] = 0; + connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(progressBarDestroyed(QObject*))); +// if (!animationTimer->isActive()) +// animationTimer->start( 50, false ); + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + widget->installEventFilter(this); + } + else if(dynamic_cast(widget)) { + QFrame* f = dynamic_cast(widget); + + switch (f->frameShape()) { + case QFrame::Box: + f->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); + f->setLineWidth(2); + break; + case QFrame::Panel: + if(kickerMode && f->parentWidget() && f->parentWidget()->isA("ClockApplet")) { + f->setLineWidth(0); + break; + } + case QFrame::WinPanel: + f->setLineWidth(1); + widget->installEventFilter(this); + break; + case QFrame::LineEditPanel: { + widget->installEventFilter(this); + break; + } + case QFrame::TabWidgetPanel: + if(dynamic_cast(widget)) { + if(f->parentWidget() && f->parentWidget()->isA("KonqFrameTabs")) + break; + + f->setLineWidth(4); + f->setFrameRect(QRect(0, 0, f->width(), f->height()-1)); + f->setMargin(0); + + QWidget* w = widget->parentWidget(); + for(int i=0; i<3; i++) { // the third parentcheck is for the tabWidget on kcm khtml_plugins + if(!w) break; + if(dynamic_cast(w)) { + widget->setPaletteBackgroundColor(qApp->palette().active().background()); + break; + } + w = w->parentWidget(); + } + + if(dynamic_cast(widget)->widget(0)) // only if it has contents + ((DominoQWidget*)widget)->setWFlags(Qt::WNoAutoErase); + } + case QFrame::HLine: + case QFrame::VLine: { + widget->installEventFilter(this); + break; + } + case QFrame::StyledPanel: + if(dynamic_cast(widget)) { + widget->installEventFilter(this); + } + else if(widget->isA("QWorkspaceChild")) { + f->setFrameStyle(QFrame::Panel|QFrame::Sunken); + f->setLineWidth(1); + widget->installEventFilter(this); + } + else if(widget->isA("KAnimWidget")) + f->setLineWidth(0); + + default: + break; + } + } +// else if (dynamic_cast(widget)) { +// widget->installEventFilter(this); +// } else if (dynamic_cast(widget)) { +// widget->installEventFilter(this); + else if(widget->isA("QDateTimeEditor")) { + widget->installEventFilter(this); + } + else if(widget->inherits("QDockWindowHandle") || widget->isA("QDockWindowResizeHandle") || + widget->isA("AppletHandleDrag")) { // !qstrcmp(widget->name(), "qt_dockwidget_internal") + widget->installEventFilter(this); + } + else if(widget->isA("KDockWidget") && widget->parentWidget() && widget->parentWidget()->parentWidget() + && widget->parentWidget()->parentWidget()->isA("Sidebar_Widget")) { + widget->setEraseColor(widget->palette().active().base()); + } + +// widget->installEventFilter(this); + //qDebug("className %s, name: %s", widget->className(), widget->name()); + +} + +void DominoStyle::unPolish(QWidget* widget) +{ + + if( !strcmp(widget->name(), "__khtml") || (!strcmp(widget->name(), "kfile button") && !strcmp(widget->parentWidget()->name(), "__khtml"))) { // is it a khtml widget...? + khtmlWidgets.remove(widget); + } + + if (dynamic_cast(widget) || + dynamic_cast(widget) || dynamic_cast(widget) || + dynamic_cast(widget) || + dynamic_cast(widget) || dynamic_cast(widget) || + dynamic_cast(widget) || widget->isA("AppletHandleDrag") || + widget->isA("QDockWindowHandle")) + { + ((DominoQWidget*)widget)->clearWFlags(Qt::WNoAutoErase); + widget->removeEventFilter(this); + } + else if(widget->isA("KonqCheckBox") || widget->isA("QWhatsThat") || widget->isA("QTipLabel")) { + widget->removeEventFilter(this); + widget->setPaletteBackgroundColor(qApp->palette().active().background()); + widget->setBackgroundMode(Qt::PaletteBackground); + } + else if(dynamic_cast(widget) || dynamic_cast(widget)) { + widget->removeEventFilter(this); + widget->setBackgroundMode(Qt::PaletteBackground); + } + else if(dynamic_cast(widget)) { + ((DominoQWidget*)widget)->clearWFlags(Qt::WNoAutoErase); + widget->removeEventFilter(this); + } + else if(dynamic_cast(widget)) { // after KonqCheckBox + ((DominoQWidget*)widget)->clearWFlags(Qt::WNoAutoErase); + widget->removeEventFilter(this); + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + widget->setBackgroundMode(Qt::PaletteButton); + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + widget->setBackgroundMode(Qt::PaletteBackground); + static_cast(widget)->setLineWidth(2); + widget->clearMask(); + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + widget->setBackgroundMode(Qt::PaletteBackground); + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + ((DominoQWidget*)widget)->clearWFlags(Qt::WNoAutoErase); + QGroupBox* gb = dynamic_cast(widget); + gb->setBackgroundMode(Qt::PaletteBackground); + gb->setPalette(qApp->palette()); + gb->setAlignment(Qt::AlignLeft|Qt::AlignBottom); + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + widget->setBackgroundMode(Qt::PaletteBase); + QLineEdit* le = dynamic_cast(widget); + QRect r = le->rect(); + le->setFrameRect(QRect(r.x()-1, r.y(), r.width()+1, r.height())); + widget->clearMask(); + } + else if(dynamic_cast(widget) ) { + progAnimWidgets.remove(widget); + } + else if(dynamic_cast(widget) || dynamic_cast(widget) ) { + widget->removeEventFilter(this); + widget->setBackgroundMode(Qt::PaletteButton); + } + if(widget->isA("KonqFileTip")) { + widget->removeEventFilter(this); + widget->setPaletteBackgroundColor(widget->palette().active().background()); + QFrame* f = dynamic_cast(widget); + f->setMargin(1); + f->setFrameStyle(QFrame::Plain|QFrame::Box); + + QObjectList *list = const_cast(widget->children()); + QObjectListIt it( *list ); + QObject * o; + while ( (o = it.current()) != 0 ) { + ++it; + if(dynamic_cast(o)) { + QLabel* l = dynamic_cast(o); + l->setBackgroundOrigin(QWidget::WidgetOrigin); + l->setBackgroundMode(Qt::PaletteBackground); + l->setPaletteBackgroundColor(l->palette().active().background()); + } + } + } + else if(dynamic_cast(widget)) { + QFrame* f = dynamic_cast(widget); + if((konquerorMode && widget->isA("KHTMLView")) || f->parentWidget() && !strcmp(f->parentWidget()->name(), "KonqFrame")) { // konqi frames + widget->removeEventFilter(this); + f->setFrameStyle(QFrame::NoFrame|QFrame::Plain); + f->setLineWidth(0); + } + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + } + else if(dynamic_cast(widget)) { + widget->removeEventFilter(this); + QFrame* f = dynamic_cast(widget); + switch(f->frameShape()) { + case QFrame::Panel: + if(widget->isA("QWorkspaceChild")) { + f->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); + f->setLineWidth(2); + } + break; + case QFrame::WinPanel: + f->setLineWidth(2); + break; + case QFrame::TabWidgetPanel: + f->setLineWidth(2); + f->setMargin(2); + f->setFrameRect(QRect(0, 0, 0, 0)); + break; + case QFrame::StyledPanel: + if(widget->isA("KAnimWidget")) + f->setLineWidth(2); + break; + default: + break; + } + } + + + KStyle::unPolish(widget); +} + +void DominoStyle::khtmlWidgetDestroyed(QObject* obj) +{ + khtmlWidgets.remove(static_cast(obj)); +} + +void DominoStyle::groupBoxDestroyed(QObject* obj) +{ + groupBoxPixmaps.remove(static_cast(obj)); +} + +void DominoStyle::progressBarDestroyed(QObject* obj) +{ + progAnimWidgets.remove(static_cast(obj)); +} + + +void DominoStyle::renderContour(QPainter *p, const QRect &r, const QColor &backgroundColor, const QColor &contour, const uint flags) const { + + if((r.width() <= 0)||(r.height() <= 0)) + return; + + const bool drawLeft = flags&Draw_Left; + const bool drawRight = flags&Draw_Right; + const bool drawTop = flags&Draw_Top; + const bool drawBottom = flags&Draw_Bottom; +// const bool disabled = flags&Is_Disabled; + const bool alphaBlend = flags&Draw_AlphaBlend; + + const bool roundUpperLeft = flags&Round_UpperLeft; + const bool roundUpperRight = flags&Round_UpperRight; + const bool roundBottomLeft = flags&Round_BottomLeft; + const bool roundBottomRight = flags&Round_BottomRight; + const bool isButton = flags&Is_Button; + const bool isHorizontal = flags&Is_Horizontal; + const bool isScrollBarBtn = flags&Is_ScrollBarBtn; + + QColor appButtonColor = qApp->palette().active().button(); + + if(isButton) { + + QRect sr = QRect(r.x(), r.y()+2, r.width(), r.height()-5); // surface rect + int top = sr.y()+sr.height()*btnSurface.g1Top/100; + int bottom = sr.height()*btnSurface.g1Bottom/100; + int top2 = sr.y()+sr.height()*btnSurface.g2Top/100; + int bottom2 = sr.y()+sr.height()*btnSurface.g2Bottom/100-top2; + + int left = sr.x()+sr.width()*btnSurface.g1Top/100; + int width = sr.width()*btnSurface.g1Bottom/100; + int left2 = sr.x()+sr.width()*btnSurface.g2Top/100; + int width2 = sr.width()*btnSurface.g2Bottom/100-left2; + + // darker surface colors for the inner part of the contour + QColor insideBackground; + QColor gr1TopColor; + QColor gr1BottomColor; + QColor gr2TopColor; + QColor gr2BottomColor; + + const int alphaInside = qAlpha(buttonContour->color3()); + + insideBackground = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.background, 127) : btnSurface.background), alphaInside); + + switch (btnSurface.numGradients) { + case 2:{ + + gr1TopColor = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.g1Color1, 127) : btnSurface.g1Color1), alphaInside); + + gr1BottomColor = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.g1Color2, 127) : btnSurface.g1Color2), alphaInside); + + gr2TopColor = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.g2Color1, 127) : btnSurface.g2Color1), alphaInside); + + gr2BottomColor = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.g2Color2, 127) : btnSurface.g2Color2), alphaInside); + + break; + } + case 1: { + gr1TopColor = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.g1Color1, 127) : btnSurface.g1Color1), alphaInside); + + gr1BottomColor = alphaBlendColors(buttonContour->color3(), + ((contour != appButtonColor) ? alphaBlendColors(contour, btnSurface.g1Color2, 127) : btnSurface.g1Color2), alphaInside); + break; + } + default: { + insideBackground = insideBackground; + gr1TopColor = insideBackground; + gr1BottomColor = insideBackground; + gr2TopColor = insideBackground; + gr2BottomColor = insideBackground; + break; + } + } + + if(flags & Is_Down) { + gr1TopColor = darkenColor(gr1TopColor, 15); + gr1BottomColor = darkenColor(gr1BottomColor, 15); + gr2TopColor = darkenColor(gr2TopColor, 15); + gr2BottomColor = darkenColor(gr2BottomColor, 15); + insideBackground = darkenColor(insideBackground, 15); + } + + + + QRegion clip; + if(drawTop) + clip += QRegion(r.left()+6, r.top()+2, r.width()-12, 1); + if(drawBottom) + clip += QRegion(r.left()+6, r.bottom()-3, r.width()-12, 1); + if(drawLeft) + clip += QRegion(r.left()+2, r.top()+6, 1, r.height()-13); + if(drawRight) + clip += QRegion(r.right()-2, r.top()+6, 1, r.height()-13); + p->setClipRegion(clip); + + + p->fillRect(sr, insideBackground); + switch(btnSurface.numGradients) { + case 1: + if(isHorizontal) + renderGradient(p, QRect(sr.x(), top, sr.width(), bottom), gr1TopColor, gr1BottomColor, true); + else + renderGradient(p, QRect(left, sr.y(), width, sr.height()), gr1TopColor, gr1BottomColor, false); + break; + case 2: + if(isHorizontal) { + renderGradient(p, QRect(r.x(), top, r.width(), bottom), gr1TopColor, gr1BottomColor, true); + renderGradient(p, QRect(r.x(), top2, r.width(), bottom2), gr2TopColor, gr2BottomColor, true); + } + else { + renderGradient(p, QRect(left, sr.y(), width, sr.height()), gr1TopColor,gr1BottomColor, false); + renderGradient(p, QRect(left2, sr.y(), width2, sr.height()), gr2TopColor,gr2BottomColor, false); + } + default: + break; + } + p->setClipping(false); + + + const QColor color1 = alphaBlendColors(buttonContour->color1(), backgroundColor, qAlpha(buttonContour->color1())); // 1.top + const QColor color4 = alphaBlendColors(buttonContour->color4(), backgroundColor, qAlpha(buttonContour->color4())); // 3.bottom + const QColor color5 = alphaBlendColors(buttonContour->color5(), backgroundColor, qAlpha(buttonContour->color5())); // 4.bottom + const QColor color2 = alphaBlendColors(buttonContour->color2(), backgroundColor, qAlpha(buttonContour->color2())); // 2.top 2.left 2.bottom + const QColor color6 = alphaBlendColors(buttonContour->color6(), backgroundColor, qAlpha(buttonContour->color6())); // 1.left + + + if(roundUpperLeft) + p->drawPixmap(r.left(), r.top(), *buttonContour->buttonEdges(), 0, 0, 6, 6); + + if(roundUpperRight) + p->drawPixmap(r.right()-5, r.top(), *buttonContour->buttonEdges(), 6, 0, 6, 6); + + if(roundBottomLeft) + p->drawPixmap(r.left(), r.bottom()-6, *buttonContour->buttonEdges(), 0, 6, 6, 7); + + if(roundBottomRight) + p->drawPixmap(r.right()-5, r.bottom()-6, *buttonContour->buttonEdges(), 6, 6, 6, 7); + + if(drawTop) { + if(!alphaBlend) { + p->setPen(color1); + p->drawLine(r.left()+6, r.top(), r.right()-6, r.top()); + p->setPen(color2); + p->drawLine(r.left()+6, r.top()+1, r.right()-6, r.top()+1); + } + else { + p->drawTiledPixmap(r.left()+6, r.top(), r.width()-12, 2, *buttonContour->buttonHLines(), 0, 0); + } + } + + if(drawBottom) { + if(!alphaBlend) { + p->setPen(color2); + p->drawLine(r.left()+6, r.bottom()-2, r.right()-6, r.bottom()-2); + p->setPen(color4); + p->drawLine(r.left()+6, r.bottom()-1, r.right()-6, r.bottom()-1); + p->setPen(color5); + p->drawLine(r.left()+6, r.bottom(), r.right()-6, r.bottom()); + } + else { + p->drawTiledPixmap(r.left()+6, r.bottom()-2, r.width()-12, 3, *buttonContour->buttonHLines(), 0, 4); + } + } + + if(drawLeft) { + if(!alphaBlend) { + p->setPen(color6); + p->drawLine(r.left(), r.top()+6, r.left(), r.bottom()-7); + p->setPen(color2); + p->drawLine(r.left()+1, r.top()+6, r.left()+1, r.bottom()-7); + } + else { + p->drawTiledPixmap(r.left(), r.top()+6, 2, r.height()-13, *buttonContour->buttonVLines(), 0, 0); + } + } + + if(drawRight) { + if(!alphaBlend) { + p->setPen(color2); + p->drawLine(r.right()-1, r.top()+6, r.right()-1, r.bottom()-7); + p->setPen(color6); + p->drawLine(r.right(), r.top()+6, r.right(), r.bottom()-7); + } + else { + p->drawTiledPixmap(r.right()-1, r.top()+6, 2, r.height()-13, *buttonContour->buttonVLines(), 4, 0); + } + } + + + + + } + else if(isScrollBarBtn) { + + QColor background; + QColor gr1TopColor; + QColor gr1BottomColor; + QColor gr2TopColor; + QColor gr2BottomColor; + + + if(contour != appButtonColor) { + gr1TopColor = alphaBlendColors(contour, scrollBarSurface.g1Color1, 127); + gr1BottomColor = alphaBlendColors(contour, scrollBarSurface.g1Color2, 127); + gr2TopColor = alphaBlendColors(contour, scrollBarSurface.g2Color1, 127); + gr2BottomColor = alphaBlendColors(contour, scrollBarSurface.g2Color2, 127); + background = alphaBlendColors(contour, scrollBarSurface.background, 127); + } + else { + gr1TopColor = scrollBarSurface.g1Color1; + gr1BottomColor = scrollBarSurface.g1Color2; + gr2TopColor = scrollBarSurface.g2Color1; + gr2BottomColor = scrollBarSurface.g2Color2; + background = scrollBarSurface.background; + } + + QColor btnContour = buttonContour->contourColor(Contour_Default); + QColor whiteColor( qRgba(Qt::white.red(), Qt::white.green(), Qt::white.blue(), 23)); // first white layer + QColor blackColor( qRgba(btnContour.red(), btnContour.green(), btnContour.blue(), 35)); // second contour layer + + + gr1TopColor = blendColors(gr1TopColor, whiteColor); + gr1TopColor = blendColors(gr1TopColor, blackColor); + + gr1BottomColor = blendColors(gr1BottomColor, whiteColor); + gr1BottomColor = blendColors(gr1BottomColor, blackColor); + + gr2TopColor = blendColors(gr2TopColor, whiteColor); + gr2TopColor = blendColors(gr2TopColor, blackColor); + + gr2BottomColor = blendColors(gr2BottomColor, whiteColor); + gr2BottomColor = blendColors(gr2BottomColor, blackColor); + + background = blendColors(background, whiteColor); + background = blendColors(background, blackColor); + + + + + QRegion clip; + if(drawTop) + clip += QRegion(r.left(), r.top()+1, r.width(), 1); + if(drawBottom) + clip += QRegion(r.left(), r.bottom()-1, r.width(), 1); + if(drawLeft) + clip += QRegion(r.left()+1, r.top(), 1, r.height()); + if(drawRight) + clip += QRegion(r.right()-1, r.top(), 1, r.height()); + + p->setClipRegion(clip); + + + QRect sr = r; + int top = sr.y()+sr.height()*scrollBarSurface.g1Top/100; + int bottom = sr.height()*scrollBarSurface.g1Bottom/100; + int top2 = sr.y()+sr.height()*scrollBarSurface.g2Top/100; + int bottom2 = sr.height()*scrollBarSurface.g2Bottom/100-top2; + int left = sr.x()+sr.width()*scrollBarSurface.g1Top/100; + int width = sr.width()*scrollBarSurface.g1Bottom/100; + int left2 = sr.x()+sr.width()*scrollBarSurface.g2Top/100; + int width2 = sr.width()*scrollBarSurface.g2Bottom/100-left2; + + p->fillRect(sr, background); + switch(scrollBarSurface.numGradients) { + case 1: + if(isHorizontal) + renderGradient(p, QRect(sr.x(), top, sr.width(), bottom), gr1TopColor, gr1BottomColor, true); + else + renderGradient(p, QRect(left, sr.y(), width, sr.height()), gr1TopColor, gr1BottomColor, false); + break; + case 2: + if(isHorizontal) { + renderGradient(p, QRect(r.x(), top, r.width(), bottom), gr1TopColor, gr1BottomColor, true); + renderGradient(p, QRect(r.x(), top2, r.width(), bottom2), gr2TopColor, gr2BottomColor, true); + } + else { + renderGradient(p, QRect(left, sr.y(), width, sr.height()), gr1TopColor,gr1BottomColor, false); + renderGradient(p, QRect(left2, sr.y(), width2, sr.height()), gr2TopColor,gr2BottomColor, false); + } + default: + break; + } + p->setClipping(false); + + + + QColor color1 = alphaBlendColors(buttonContour->contourColor(Contour_Default), backgroundColor, 203); // like btn contour + QColor color2 = alphaBlendColors(QColor(255, 255, 255), color1, 25); + + p->setPen(color1); + if(drawTop) { + p->drawLine(r.left(), r.top(), r.right(), r.top()); // top + } + if(drawBottom) { + p->drawLine(r.left(), r.bottom(), r.right(), r.bottom()); // bottom + } + if(drawLeft) { + p->drawLine(r.left(), r.top(), r.left(), r.bottom()); // left + } + if(drawRight) { + p->drawLine(r.right(), r.top(), r.right(), r.bottom()); // right + } + + + color1 = blendColors(color1, whiteColor); + p->setPen(color2); + if(roundUpperLeft) { + renderPixel(p, QPoint(r.x()+1, r.y()+1), 127, color1, color1, true); + p->drawPoint(r.x(), r.y()); + } + if(roundUpperRight) { + renderPixel(p, QPoint(r.right()-1, r.top()+1), 127, color1, color1, true); + p->drawPoint(r.right(), r.y()); + + } + if(roundBottomLeft) { + renderPixel(p, QPoint(r.x()+1, r.bottom()-1), 127, color1, color1, true); + p->drawPoint(r.x(), r.bottom()); + } + if(roundBottomRight) { + renderPixel(p, QPoint(r.right()-1, r.bottom()-1), 127, color1, color1, true); + p->drawPoint(r.right(), r.bottom()); + } + } + return; +} + + +void DominoStyle::renderSurface(QPainter *p, + const QRect &r, + const QColor &backgroundColor, + const QColor &buttonColor, + const QColor &/*highlightColor*/, + const uint flags) const +{ + + if((r.width() <= 0)||(r.height() <= 0)) + return; + + const DSurface* ds = 0; + const bool isButton = flags&Is_Button; + const bool isScrollBarBtn = flags&Is_ScrollBarBtn; + const bool isScrollBarGroove = flags&Is_ScrollBarGroove; + const bool isCheckItem = flags&Is_CheckItem; + const bool isHeader = flags&Is_Header; + const bool isTabTop = flags&Is_TabTop; + const bool isActiveTabTop = flags&Is_ActiveTabTop; + const bool isTabBottom = flags&Is_TabBottom; + const bool isActiveTabBottom = flags&Is_ActiveTabBottom; + const bool horizontal = flags&Is_Horizontal; + const bool isDown = flags&Is_Down; + + if(isButton) + ds = &btnSurface; + else if(isCheckItem) + ds = &checkItemSurface; + else if(isScrollBarBtn) + ds = &scrollBarSurface; + else if(isScrollBarGroove) + ds = &scrollBarGrooveSurface; + else if(isHeader) + ds = &headerSurface; + else if(isTabTop) + ds = &tabTopSurface; + else if(isActiveTabTop) + ds = &activeTabTopSurface; + else if(isTabBottom) + ds = &tabBottomSurface; + else if(isActiveTabBottom) + ds = &activeTabBottomSurface; + + + + + + QColor g1Color1; + QColor g1Color2; + QColor g2Color1; + QColor g2Color2; + QColor background; + + if(buttonColor != qApp->palette().active().button()) { + g2Color1 = alphaBlendColors(buttonColor, ds->g2Color1, 127); + g2Color2 = alphaBlendColors(buttonColor, ds->g2Color2, 127); + g1Color1 = alphaBlendColors(buttonColor, ds->g1Color1, 127); + g1Color2 = alphaBlendColors(buttonColor, ds->g1Color2, 127); + background = alphaBlendColors(buttonColor, ds->background, 127); + } + else { + g1Color1 = ds->g1Color1; + g1Color2 = ds->g1Color2; + g2Color1 = ds->g2Color1; + g2Color2 = ds->g2Color2; + background = ds->background; + } + if(isDown) { + g1Color1 = darkenColor(g1Color1, 15); + g1Color2 = darkenColor(g1Color2, 15); + g2Color1 = darkenColor(g2Color1, 15); + g2Color2 = darkenColor(g2Color2, 15); + background = darkenColor(background, 15); + } + + if(isButton) { // button / toolButton / comboBox / spinWidget / slider / progressBar + + if(!flatMode) { + QRegion mask(r.x()+2, r.y(), r.width()-4, r.height()); + mask += QRegion(r.x()+1, r.y()+1, r.width()-2, r.height()-2); + mask += QRegion(r.x(), r.y()+2, r.width(), r.height()-4); + p->setClipRegion(mask, QPainter::CoordPainter); + } + + + QRect re = r; + if(re.x() < 0 ) { + re.setWidth(re.width()+QABS(re.x())); + re.setX(0); + } + else if(re.y() < 0 ) { + re.setHeight(re.height()+QABS(re.y())); + re.setY(0); + } + + QPixmap pix(re.width(), re.height()); + pix.fill(background); + QPainter painter(&pix); + + int top = re.height()*btnSurface.g1Top/100; + int bottom = re.height()*btnSurface.g1Bottom/100; + int top2 = re.height()*btnSurface.g2Top/100; + int bottom2 = re.height()*btnSurface.g2Bottom/100-top2; + + int left = re.width()*btnSurface.g1Top/100; + int width = re.width()*btnSurface.g1Bottom/100; + int left2 = re.width()*btnSurface.g2Top/100; + int width2 = re.width()*btnSurface.g2Bottom/100-left2; + + switch (btnSurface.numGradients) { + case 1:{ + if(horizontal) { + renderGradient(&painter, QRect(0, top, re.width(), bottom), g1Color1, g1Color2, true); + } + else { + renderGradient(&painter, QRect(left, 0, width, re.height()), g1Color1, g1Color2, false); + } + break; + } + case 2: { + if(horizontal) { + renderGradient(&painter, QRect(0, top, re.width(), bottom), g1Color1, g1Color2, true); + renderGradient(&painter, QRect(0, top2, re.width(), bottom2), g2Color1, g2Color2, true); + } + else { + renderGradient(&painter, QRect(left, 0, width, re.height()), g1Color1, g1Color2, false); + renderGradient(&painter, QRect(left2, 0, width2, re.height()), g2Color1, g2Color2, false); + } + } + default: break; + } + + p->drawPixmap(r.x(), r.y(), pix); + p->setClipping(false); + + } + else if(isTabTop || isActiveTabTop || isTabBottom || isActiveTabBottom) { + + int top = r.y()+r.height()*ds->g1Top/100; + int bottom = r.height()*ds->g1Bottom/100; + int top2 = r.y()+r.height()*ds->g2Top/100; + int bottom2 = r.height()*ds->g2Bottom/100-top2; + + p->fillRect(r, background); + switch (ds->numGradients) { + case 1:{ + renderGradient(p, QRect(r.x(), top, r.width(), bottom), g1Color1, g1Color2, true); + break; + } + case 2: { + renderGradient(p, QRect(r.x(), top, r.width(), bottom), g1Color1, g1Color2, true); + renderGradient(p, QRect(r.x(), top2, r.width(), bottom2), g2Color1, g2Color2, true); + } + default: break; + } + } + else if(isScrollBarBtn) { + + int top = r.height()*scrollBarSurface.g1Top/100; + int bottom = r.height()*scrollBarSurface.g1Bottom/100; + int top2 = r.height()*scrollBarSurface.g2Top/100; + int bottom2 = r.height()*scrollBarSurface.g2Bottom/100-top2; + int left = r.width()*scrollBarSurface.g1Top/100; + int width = r.width()*scrollBarSurface.g1Bottom/100; + int left2 = r.width()*scrollBarSurface.g2Top/100; + int width2 = r.width()*scrollBarSurface.g2Bottom/100-left2; + + p->fillRect(r, background); + switch (scrollBarSurface.numGradients) { + case 1: { + if(horizontal) { + renderGradient(p, QRect(r.left(), top, r.width(), bottom), g1Color1, g1Color2, true); + } + else { + renderGradient(p, QRect(left, r.top(), width, r.height()), g1Color1, g1Color2, false); + } + break; + } + case 2: { + if(horizontal) { + renderGradient(p, QRect(r.left(), top, r.width(), bottom), g1Color1, g1Color2, true); + renderGradient(p, QRect(r.left(), top2, r.width(), bottom2), g2Color1, g2Color2, true); + } + else { + renderGradient(p, QRect(left, r.top(), width, r.height()), g1Color1, g1Color2, false); + renderGradient(p, QRect(left2, r.top(), width2, r.height()), g2Color1, g2Color2, false); + } + } + default: + break; + } + + + } + else if(isScrollBarGroove) { + + int top = r.height()*scrollBarGrooveSurface.g1Top/100; + int bottom = r.height()*scrollBarGrooveSurface.g1Bottom/100; + int top2 = r.height()*scrollBarGrooveSurface.g2Top/100; + int bottom2 = r.height()*scrollBarGrooveSurface.g2Bottom/100-top2; + int left = r.width()*scrollBarGrooveSurface.g1Top/100; + int width = r.width()*scrollBarGrooveSurface.g1Bottom/100; + int left2 = r.width()*scrollBarGrooveSurface.g2Top/100; + int width2 = r.width()*scrollBarGrooveSurface.g2Bottom/100-left2; + + p->fillRect(r, background); + switch (scrollBarGrooveSurface.numGradients) { + case 1: { + if(horizontal) { + renderGradient(p, QRect(r.left(), top, r.width(), bottom), g1Color1, g1Color2, true); + } + else { + renderGradient(p, QRect(left, r.top(), width, r.height()), g1Color1, g1Color2, false); + } + break; + } + case 2: { + if(horizontal) { + renderGradient(p, QRect(r.left(), top, r.width(), bottom), g1Color1, g1Color2, true); + renderGradient(p, QRect(r.left(), top2, r.width(), bottom2), g2Color1, g2Color2, true); + } + else { + renderGradient(p, QRect(left, r.top(), width, r.height()), g1Color1, g1Color2, false); + renderGradient(p, QRect(left2, r.top(), width2, r.height()), g2Color1, g2Color2, false); + } + } + default: + break; + } + + } + else if(isCheckItem) { + + QPixmap pix(r.width(), r.height()); + pix.fill(background); + QPainter painter(&pix); + + int top = r.height()*checkItemSurface.g1Top/100; + int bottom = r.height()*checkItemSurface.g1Bottom/100; + int top2 = r.height()*checkItemSurface.g2Top/100; + int bottom2 = r.height()*checkItemSurface.g2Bottom/100-top2; + + switch(checkItemSurface.numGradients) { + case 1:{ + renderGradient(&painter, QRect(0, top, r.width(), bottom), g1Color1, g1Color2, true); + break; + } + case 2: { + renderGradient(&painter, QRect(0, top, r.width(), bottom), g1Color1, g1Color2, true); + renderGradient(&painter, QRect(0, top2, r.width(), bottom2), g2Color1, g2Color2, true); + break; + } + default: break; + } + painter.end(); + p->drawPixmap(QRect(r.x(), r.y()+3, r.width(), r.height()-7), pix); + + } + else if(isHeader) { + QHeader* hdr = dynamic_cast(p->device()); + bool needErasePixmap = false; + QRect re = r; + bool horizontal = false; + bool drawTop = false; + + if(hdr) { + if(hdr->orientation() == Qt::Horizontal) { + horizontal = true; + bool hasErasePixmap = hdr->erasePixmap(); + if(hasErasePixmap && !isDown) { + hdr->erase(r); + return; + } + else if(!hasErasePixmap && !isDown) { + needErasePixmap = true; + re = QRect(0, 0, 10, r.height()); + } + } + else if(hdr->sectionAt(r.top()+hdr->offset()) == 0 && r.y() == 0) + drawTop = true; + } + + QPixmap pix(re.width(), re.height()); + pix.fill(background); + QPainter painter(&pix); + + int top = re.height()*headerSurface.g1Top/100; + int bottom = re.height()*headerSurface.g1Bottom/100; + int top2 = re.height()*headerSurface.g2Top/100; + int bottom2 = re.height()*headerSurface.g2Bottom/100-top2; + + switch (headerSurface.numGradients) { + case 1:{ + renderGradient(&painter, QRect(0, top, re.width(), bottom), g1Color1, g1Color2, true); + break; + } + case 2: { + renderGradient(&painter, QRect(0, top, re.width(), bottom), g1Color1, g1Color2, true); + renderGradient(&painter, QRect(0, top2, re.width(), bottom2), g2Color1, g2Color2, true); + break; + } + default: break; + } + + painter.setPen(alphaBlendColors(buttonContour->contourColor(Contour_Default), backgroundColor, 179)); + if(horizontal || drawTop) + painter.drawLine(0, re.y(), re.width(), re.y()); + painter.drawLine(0, re.height()-1, re.width(), re.height()-1); + + if(needErasePixmap) { + hdr->setUpdatesEnabled(false); + hdr->setErasePixmap(pix); + hdr->setUpdatesEnabled(true); + hdr->erase(r); + } + else { + // same problem as with the scrollbars, if we don't clip, the text above will be randomly erased. + p->setClipRect(re); + p->drawPixmap(r.x(), r.y(), pix); + p->setClipping(false); + } + } +} + + +void DominoStyle::renderPixel(QPainter *p, + const QPoint &pos, + const int alpha, + const QColor &color, + const QColor &background, + bool fullAlphaBlend) const +{ + if(fullAlphaBlend) + // full alpha blend: paint into an image with alpha buffer and convert to a pixmap ... + { + QRgb rgb = color.rgb(); + // generate a quite unique key -- use the unused width field to store the alpha value. + CacheEntry search(cAlphaDot, alpha, 0, rgb); + int key = search.key(); + + CacheEntry *cacheEntry; + if( (cacheEntry = pixmapCache->find(key)) ) { + if( search == *cacheEntry ) { // match! we can draw now... + if(cacheEntry->pixmap) + p->drawPixmap(pos, *(cacheEntry->pixmap) ); + return; + } else { //Remove old entry in case of a conflict! + pixmapCache->remove( key ); + } + } + + + QImage aImg(1,1,32); // 1x1 + aImg.setAlphaBuffer(true); + aImg.setPixel(0,0,qRgba(qRed(rgb),qGreen(rgb),qBlue(rgb),alpha)); + QPixmap *result = new QPixmap(aImg); + + p->drawPixmap(pos, *result); + + // add to the cache... + CacheEntry *toAdd = new CacheEntry(search); + toAdd->pixmap = result; + bool insertOk = pixmapCache->insert( key, toAdd, result->depth()/8); + if(!insertOk) + delete result; + } else + // don't use an alpha buffer: calculate the resulting color from the alpha value, the fg- and the bg-color. + { + QRgb rgb_a = color.rgb(); + QRgb rgb_b = background.rgb(); + int a = alpha; + if(a>255) a = 255; + if(a<0) a = 0; + int a_inv = 255 - a; + + QColor res = QColor( qRgb(qRed(rgb_b)*a_inv/255 + qRed(rgb_a)*a/255, + qGreen(rgb_b)*a_inv/255 + qGreen(rgb_a)*a/255, + qBlue(rgb_b)*a_inv/255 + qBlue(rgb_a)*a/255) ); + p->setPen(res); + p->drawPoint(pos); + } +} + +void DominoStyle::renderButtonShadow(QPainter *p, const QRect &r, const uint flags) const { + + if((!buttonContour->drawButtonSunkenShadow && buttonContour->defaultType == Contour_Sunken) || (buttonContour->defaultType != Contour_Sunken && !flatMode)) + return; + + + if(flags&Round_UpperLeft) { + bitBlt(p->device(), r.left(), r.top(), buttonContour->shadowRound(), 0, 0, 5, 5, Qt::CopyROP); + } + else if(flags&Rectangular_UpperLeft){ + bitBlt(p->device(), r.left(), r.top(), buttonContour->shadowRectangular(), 0, 0, 5, 5, Qt::CopyROP); + } + if(flags&Round_UpperRight) { + bitBlt(p->device(), r.right()-6, r.top(), buttonContour->shadowRound(), 5, 0, 5, 5, Qt::CopyROP); + } + else if(flags&Rectangular_UpperRight){ + bitBlt(p->device(), r.right()-6, r.top(), buttonContour->shadowRectangular(), 5, 0, 5, 5, Qt::CopyROP); + } + if(flags&Round_BottomLeft) { + bitBlt(p->device(), r.left(), r.bottom()-5, buttonContour->shadowRound(), 0, 5, 4, 4, Qt::CopyROP); + } + else if(flags&Rectangular_BottomLeft) + bitBlt(p->device(), r.left(), r.bottom()-5, buttonContour->shadowRectangular(), 0, 5, 4, 4, Qt::CopyROP); + if(flags&Round_BottomRight) { + bitBlt(p->device(), r.right()-5, r.bottom()-5, buttonContour->shadowRound(), 4, 5, 4, 4, Qt::CopyROP); + } + else if(flags&Rectangular_BottomRight) + bitBlt(p->device(), r.right()-5, r.bottom()-5, buttonContour->shadowRectangular(), 4, 5, 4, 4, Qt::CopyROP); + + if(flags&Draw_Top) + p->drawTiledPixmap(r.left()+5, r.top(), r.width()-12, 3, *buttonContour->shadowHLines(), 0, 0); + if(flags&Draw_Left) + p->drawTiledPixmap(r.left(), r.top()+5, 3, r.height()-11, *buttonContour->shadowVLines(), 0, 0); + if(flags&Draw_Right) + p->drawTiledPixmap(r.right()-4, r.top()+5, 3, r.height()-11, *buttonContour->shadowVLines(), 3, 0); + if(flags&Draw_Bottom) + p->drawTiledPixmap(r.left()+4, r.bottom()-3, r.width()-10, 2, *buttonContour->shadowHLines(), 0, 3); + +} + +void DominoStyle::renderButton(QPainter *p, + const QRect &r, + const QColorGroup &g, + bool sunken, + bool /*mouseOver*/, + bool horizontal, + bool enabled, + bool khtmlMode) const +{ + + uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; + + if(!enabled) contourFlags|=Is_Disabled; + + if(khtmlMode || buttonContour->alphaMode() /* || kickerMode*/) { + contourFlags|=Draw_AlphaBlend; + } + + uint surfaceFlags = Is_Button; + if(horizontal) { + surfaceFlags|=Is_Horizontal; + contourFlags|=Is_Horizontal; + } + if(!enabled) + surfaceFlags|=Is_Disabled; + else { + if(sunken) { + surfaceFlags|=Is_Down; + contourFlags|=Is_Down; + } + } + +// QColor buttonColor = khtmlMode ? g.button() : qApp->palette().active().background(); + + if (!flatMode) { + contourFlags |= Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight|Is_Button; + renderSurface(p, QRect(r.x()+2, r.y()+2, r.width()-4, r.height()-5), g.background(), g.button(), g.button(), surfaceFlags); + renderContour(p, r, g.background(), g.button(), contourFlags); + if(sunken) { + renderButtonShadow(p, QRect(r.x()+2, r.y()+2, r.width()-2, r.height()-3), contourFlags); + } + } + else { + renderSurface(p, QRect(r.x()-3, r.y()-1, r.width()+6, r.height()+2), g.background(), g.button(), g.button(), surfaceFlags); + + if(sunken) { + contourFlags |= Rectangular_UpperLeft|Rectangular_UpperRight|Rectangular_BottomLeft|Rectangular_BottomRight; + renderButtonShadow(p, QRect(r.x()-2, r.y()-2, r.width()+4, r.height()+4), contourFlags); + } + } +} + +void DominoStyle::renderHeader(QPainter *p, + const QRect &r, + const QColorGroup &g, + bool sunken, + bool /*mouseOver*/, + bool /*horizontal*/, + bool /*enabled*/) const +{ + p->save(); + bool drawLeft = true; + QHeader* hd = dynamic_cast(p->device()); + if(hd && hd->orientation() == Qt::Horizontal) + drawLeft = r.x() == 0 && hd->sectionAt(r.left()+hd->offset()) == 0; + + uint surfaceFlags = Is_Header|Is_Horizontal; + if(sunken) + surfaceFlags |= Is_Down; + renderSurface(p, QRect(r.left(), r.top(), r.width(), r.height()), g.button(), g.button(), g.button(), surfaceFlags); + +// p->setPen(buttonContour->contourColor(Contour_Default)); + p->setPen(alphaBlendColors(buttonContour->contourColor(Contour_Default), g.background(), 179)); + if(drawLeft) + p->drawLine(r.left(), r.top(), r.left(), r.bottom()); + if(!hd) + p->drawLine(r.right(), r.top(), r.left(), r.top()); + p->drawLine(r.right(), r.top(), r.right(), r.bottom()); + p->restore(); +} + + +void DominoStyle::renderGradient(QPainter *painter, + const QRect &rect, + const QColor &c1, + const QColor &c2, + bool horizontal) const +{ + if((rect.width() <= 0)||(rect.height() <= 0)) + return; + + // generate a quite unique key for this surface. + CacheEntry search(cGradientTile, + horizontal ? 0 : rect.width(), + horizontal ? rect.height() : 0, + c1.rgb(), c2.rgb(), horizontal ); + int key = search.key(); + + CacheEntry *cacheEntry; + if( (cacheEntry = pixmapCache->find(key)) ) { + if( search == *cacheEntry ) { // match! we can draw now... + if(cacheEntry->pixmap) { + painter->drawTiledPixmap(rect, *(cacheEntry->pixmap) ); + } + return; + } else { + // Remove old entry in case of a conflict! + // This shouldn't happen very often, see comment in CacheEntry. + pixmapCache->remove(key); + } + } + + // there wasn't anything matching in the cache, create the pixmap now... + QPixmap *result = new QPixmap(horizontal ? 10 : rect.width(), + horizontal ? rect.height() : 10); + QPainter p(result); + + int r_w = result->rect().width(); + int r_h = result->rect().height(); + int r_x, r_y, r_x2, r_y2; + result->rect().coords(&r_x, &r_y, &r_x2, &r_y2); + + int rDiff, gDiff, bDiff; + int rc, gc, bc; + + register int x, y; + + rDiff = ( c2.red()) - (rc = c1.red()); + gDiff = ( c2.green()) - (gc = c1.green()); + bDiff = ( c2.blue()) - (bc = c1.blue()); + + register int rl = rc << 16; + register int gl = gc << 16; + register int bl = bc << 16; + + int rdelta = ((1<<16) / (horizontal ? r_h : r_w)) * rDiff; + int gdelta = ((1<<16) / (horizontal ? r_h : r_w)) * gDiff; + int bdelta = ((1<<16) / (horizontal ? r_h : r_w)) * bDiff; + + // these for-loops could be merged, but the if's in the inner loop + // would make it slow + if(horizontal) { + for ( y = 0; y < r_h; y++ ) { + rl += rdelta; + gl += gdelta; + bl += bdelta; + + p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.drawLine(r_x, r_y+y, r_x2, r_y+y); + } + } else { + for( x = 0; x < r_w; x++) { + rl += rdelta; + gl += gdelta; + bl += bdelta; + + p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.drawLine(r_x+x, r_y, r_x+x, r_y2); + } + } + + p.end(); + + // draw the result... + painter->drawTiledPixmap(rect, *result); + + // insert into cache using the previously created key. + CacheEntry *toAdd = new CacheEntry(search); + toAdd->pixmap = result; + bool insertOk = pixmapCache->insert( key, toAdd, result->width()*result->height()*result->depth()/8 ); + + if(!insertOk) + delete result; +} + +void DominoStyle::renderTab(QPainter *p, + const QRect &r, + const QColorGroup &g, + bool /*mouseOver*/, + const bool selected, + const bool bottom, + const TabPosition pos, + const bool /*triangular*/, + const bool /*cornerWidget*/, + const bool konqTab) const +{ + + const bool isFirst = (pos == First); + const bool isLast = (pos == Last); + const bool isSingle = (pos == Single); + + QPixmap buffer(r.width(), r.height()); + QPainter painter(&buffer); + + QColor tabContour2 = g.background().dark(150); + QPixmap* tabEdges; + if(!(tabEdges = QPixmapCache::find(QString::number(tabContour2.pixel(), 16)+"tabEdges"))) { + QImage img1 = tintImage(qembed_findImage("border1"), tabContour2); + QImage img2 = qembed_findImage("tabInsideWhite"); + blend(img1, img2, img2); + tabEdges = new QPixmap(img2); + QPixmapCache::insert(QString::number(tabContour2.pixel(), 16)+"tabEdges", tabEdges); + } + + QPixmap* tabHLines; + if(!(tabHLines = QPixmapCache::find("tabHLines"))) { + tabHLines = new QPixmap(qembed_findImage("tabHLines")); + QPixmapCache::insert("tabHLines", tabHLines); + } + + QPixmap* tabVLines; + if(!(tabVLines = QPixmapCache::find("tabVLines"))) { + tabVLines = new QPixmap(qembed_findImage("tabVLines")); + QPixmapCache::insert("tabVLines", tabVLines); + } + + + if(konqTab) { + + const QColor background = g.background().dark(konqTabBarContrast); + + if (selected) { + + ///painter.fillRect(0, r.height()-9, r.width(), 9, background); // rect below gradient + ///painter.fillRect(0, 0, r.width(), r.height()-9, g.background()); // rect above gradient + painter.fillRect(0, 0, r.width(), 2, g.background()); // rect above gradient + + painter.translate(0, 2); + renderSurface(&painter, QRect(1, 0, r.width()-2, r.height()-3), g.background(), g.button(), g.button(), Is_ActiveTabBottom); + painter.translate(0, -2); + + + QPixmap* tabEdges2; + QString position = isFirst ? "first" : isLast ? "last" : isSingle ? "single" : "middle"; + if(!(tabEdges2 = QPixmapCache::find(position+"tabEdges2-k-sel"+QString::number(g.background().pixel(), 16)+QString::number(r.height())))) { + tabEdges2 = new QPixmap(16, 8); + tabEdges2->fill(background); + QPainter painter2(tabEdges2); + + // parts of the unselected tabs under the rounded edges + if(!isSingle) { + if(!isFirst) { + painter2.translate(0, -r.height()+12); + renderSurface(&painter2, QRect(0, 0, 3, r.height()-5-3), g.background(), g.button(), g.button(), Is_TabBottom); + painter2.resetXForm(); + painter2.drawTiledPixmap(0, 3, 3, 1, *tabHLines, 0, 2); // left + painter2.setPen(alphaBlendColors(QColor(0,0,0), background, 79)); // bottomShadow1 + painter2.drawLine(0, 4, 1, 4); + painter2.setPen(alphaBlendColors(QColor(0,0,0), background, 30)); // bottomShadow2 + painter2.drawPoint(2,4); // last point from bottomShadow1 a tad lighter (will be overpainted by the circle) + painter2.drawLine(0, 5, 3, 5); + } + if(!isLast) { + painter2.translate(0, -r.height()+12); + renderSurface(&painter2, QRect(13, 0, 3, r.height()-5-3), g.background(), g.button(), g.button(), Is_TabBottom); + painter2.resetXForm(); + painter2.drawTiledPixmap(13, 3, 3, 1, *tabHLines, 0, 2); // right + painter2.setPen(alphaBlendColors(QColor(0,0,0), background, 79)); // bottomShadow1 + painter2.drawLine(14, 4, 15, 4); + painter2.setPen(alphaBlendColors(QColor(0,0,0), background, 30)); // bottomShadow2 + painter2.drawPoint(13,4); + painter2.drawLine(12, 5, 15, 5); + } + } + // fill the rect under the gradients (faster as clipping the gradients) + painter2.fillRect(QRect(0, 6, 16, 2), background); + painter2.end(); + + QPixmap tabEdgesMask = qembed_findImage("groupBoxMask"); // this fits because the tab frame is just an inverted groupbox frame, but pssst ;) + painter2.begin(&tabEdgesMask); + painter2.translate(0, -r.height()+19); + renderSurface(&painter2, QRect(0, 0, 16, r.height()-3), g.background(), g.button(), g.button(), Is_ActiveTabBottom); + painter2.end(); + bitBlt(tabEdges2, 0, 0, &tabEdgesMask, 0, 8); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabEdges2, 0, 0, &circle, 0, 8); + + QPixmapCache::insert(position+"tabEdges2-k-sel"+QString::number(g.background().pixel(), 16)+QString::number(r.height()), tabEdges2); + } + + + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 79)); // bottomShadow1 + painter.drawLine(8, r.height()-3, r.width()-9, r.height()-3); + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 30)); // bottomShadow2 + painter.drawLine(8, r.height()-2, r.width()-9, r.height()-2); + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 35)); + painter.translate(0,3); + if(isFirst || isSingle) + painter.drawLine(0, -1, 0, r.height()-13); // left + else + renderTabSeparator(&painter, QRect(0, 0, 1, r.height()-5-3), g.button(), false); + if(isLast || isSingle) + painter.drawLine(r.width()-1, -1, r.width()-1, r.height()-13); // right + else + renderTabSeparator(&painter, QRect(r.width()-1, 0, 1, r.height()-5-3), g.button(), false); + painter.translate(0,-3); + + bitBlt(&buffer, 0, r.height()-9, tabEdges2, 0, 0, 8, 8); + bitBlt(&buffer, r.width()-8, r.height()-9, tabEdges2, 8, 0, 8, 8); + + painter.drawTiledPixmap(8, r.height()-4, r.width()-16, 1, *tabHLines, 0, 2); + painter.drawTiledPixmap(1, 2, 1, r.height()-11, *tabVLines); // left + painter.drawTiledPixmap(r.width()-2, 2, 1, r.height()-11, *tabVLines); // right + + + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 20)); + painter.drawPoint(0,1); + painter.drawPoint(r.width()-1,1); + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 50)); + painter.drawPoint(0,2); + painter.drawPoint(r.width()-1,2); + //QColor tmp = alphaBlendColors(QColor(255,255,255), g.background(), 14); + QColor tmp = g.background(); + painter.setPen(alphaBlendColors(tmp, activeTabBottomSurface.g1Top == 0 ? activeTabBottomSurface.g1Color1 : activeTabBottomSurface.background, 127)); +// painter.drawPoint(1,2); +// painter.drawPoint(r.width()-2,2); + painter.drawLine(1,2, r.width()-2, 2); + + // under the tab + painter.setPen(background); + painter.drawLine(0, r.height()-1, r.width(), r.height()-1); + + } + else { // unselected + + painter.setPen(g.background());// 0. tabbarline + painter.drawLine(0, 0, r.width(), 0); + painter.setPen(g.background().dark(120));//QColor(110,110,110) // 1. tabbarline + painter.drawLine(0, 1, r.width(), 1); + painter.setPen(g.background().dark(konqTabBarContrast+20)); //QColor(110,110,110) + + + // topline +// painter.setPen(g.background().dark(150-15)); + painter.setPen(g.background().dark(150-15)); + painter.drawLine(0, 2, r.width(), 2); + + + if(isFirst || isLast) { + + painter.translate(0, 3); + renderSurface(&painter, QRect(1, 0, r.width()-2, r.height()-5-3), g.background(), g.button(), g.button(), Is_TabBottom); + painter.translate(0, -3); + + + QPixmap* tabEdges2; + if(!(tabEdges2 = QPixmapCache::find("tabEdges2-k"+QString::number(g.background().pixel(), 16)+QString::number(r.height())))) { + tabEdges2 = new QPixmap(16, 8); + tabEdges2->fill(background); + + QPixmap tabEdgesMask = qembed_findImage("groupBoxMask"); + QPainter painter2(&tabEdgesMask); + painter2.translate(0, -r.height()+19+3); + renderSurface(&painter2, QRect(1, 0, 14, r.height()-5-3), g.background(), g.button(), g.button(), Is_TabBottom); + painter2.end(); + bitBlt(tabEdges2, 0, 0, &tabEdgesMask, 0, 8); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabEdges2, 0, 0, &circle, 0, 8); + + QPixmapCache::insert("tabEdges2-k"+QString::number(g.background().pixel(), 16)+QString::number(r.height()), tabEdges2); + } + + + if(isFirst) { + + painter.translate(0,3); + renderTabSeparator(&painter, QRect(r.width()-1, 0, 1, r.height()-5-3), g.button(), false);// right + painter.translate(0,-3); + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 79)); // bottomShadow1 + painter.drawLine(8, r.height()-5, r.width()-1, r.height()-5); + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 30)); // bottomShadow2 + painter.drawLine(8, r.height()-4, r.width()-1, r.height()-4); + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 35)); + painter.drawLine(0, 2, 0, r.height()-11); // left + + + bitBlt(&buffer, 0, r.height()-11, tabEdges2, 0, 0, 8, 8); + + painter.drawTiledPixmap(8, r.height()-6, r.width()-8, 1, *tabHLines, 0, 2); // bottom + painter.drawTiledPixmap(1, 3, 1, r.height()-14, *tabVLines); // left + + } + else { + + painter.translate(0,3); + renderTabSeparator(&painter, QRect(0, 0, 1, r.height()-5-3), g.button(), false); // left + painter.translate(0,-3); + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 79)); // bottomShadow1 + painter.drawLine(0, r.height()-5, r.width()-8, r.height()-5); + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 30)); // bottomShadow2 + painter.drawLine(0, r.height()-4, r.width()-8, r.height()-4); + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 35)); + painter.drawLine(r.width()-1, 2, r.width()-1, r.height()-11); // right + + + bitBlt(&buffer, r.width()-8, r.height()-11, tabEdges2, 8, 0, 8, 8); + + painter.drawTiledPixmap(0, r.height()-6, r.width()-8, 1, *tabHLines, 0, 2); // bottom + painter.drawTiledPixmap(r.width()-2, 3, 1, r.height()-14, *tabVLines); // right + } + } + else { // middle + + painter.translate(0,3); + renderTabSeparator(&painter, QRect(0, 0, 1, r.height()-5-3), g.button(), false); // left + renderTabSeparator(&painter, QRect(r.width()-1, 0, 1, r.height()-5-3), g.button(), false);// right + painter.translate(0,-3); + + painter.translate(0, 3); + renderSurface(&painter, QRect(1, 0, r.width()-2, r.height()-5-3), g.background(), g.button(), g.button(), Is_TabBottom); + painter.translate(0, -3); + + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 79)); // bottomShadow1 + painter.drawLine(0, r.height()-5, r.width()-1, r.height()-5); + painter.setPen(alphaBlendColors(QColor(0,0,0), background, 30)); // bottomShadow2 + painter.drawLine(0, r.height()-4, r.width()-1, r.height()-4); + + painter.drawTiledPixmap(0, r.height()-6, r.width(), 1, *tabHLines, 0, 2); // bottom + + } + painter.fillRect(QRect(0, r.height()-3, r.width(), 3), background); + } + p->drawPixmap(r.left(), r.top(), buffer); + } + else { // standard tabs + + if(bottom) { + if (selected) { + + renderSurface(&painter, QRect(1, 0, r.width()-2, r.height()-2), g.background(), g.button(), g.button(), Is_ActiveTabBottom); + + + QPixmap* tabEdges2; + QString position = isFirst ? "first" : isLast ? "last" : isSingle ? "single" : "middle"; + if(!(tabEdges2 = QPixmapCache::find(position+"tabEdges2-bottom-sel"+QString::number(g.background().pixel(), 16)+QString::number(r.height())))) { + tabEdges2 = new QPixmap(16, 8); + tabEdges2->fill(g.background()); + QPainter painter2(tabEdges2); + + if(!isSingle) { + if(!isFirst) { + painter2.translate(0, -r.height()+8); + renderSurface(&painter2, QRect(0, 0, 2, r.height()-5), g.background(), g.button(), g.button(), Is_TabBottom); + painter2.resetXForm(); + painter2.drawTiledPixmap(0, 2, 2, 1, *tabHLines, 0, 2); // left + painter2.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 79)); + painter2.drawLine(0, 3, 1,3); + painter2.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 30)); + painter2.drawLine(0, 4, 3, 4); + } + if(!isLast) { + + painter2.translate(0, -r.height()+8); + renderSurface(&painter2, QRect(14, 0, 2, r.height()-5), g.background(), g.button(), g.button(), Is_TabBottom); + painter2.resetXForm(); + painter2.drawTiledPixmap(14, 2, 2, 1, *tabHLines, 0, 2); // right + painter2.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 79)); + painter2.drawLine(14, 3, 15, 3); + painter2.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 30)); + painter2.drawLine(12, 4, 15, 4); + } + } + painter2.fillRect(QRect(0, 5, 16, 3), g.background()); + painter2.end(); + + + QPixmap tabEdgesMask = qembed_findImage("groupBoxMask"); + painter2.begin(&tabEdgesMask); + painter2.translate(0, -r.height()+16); + renderSurface(&painter2, QRect(1, 0, 14, r.height()-2), g.background(), g.button(), g.button(), Is_ActiveTabBottom); + painter2.end(); + bitBlt(tabEdges2, 0, 0, &tabEdgesMask, 0, 8); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabEdges2, 0, 0, &circle, 0, 8); + + QPixmapCache::insert(position+"tabEdges2-bottom-sel"+QString::number(g.background().pixel(), 16)+QString::number(r.height()), tabEdges2); + } + + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 79)); // bottomShadow1 + painter.drawLine(8, r.height()-2, r.width()-9, r.height()-2); + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 30)); // bottomShadow2 + painter.drawLine(8, r.height()-1, r.width()-9, r.height()-1); + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + if(isFirst || isSingle) + painter.drawLine(0, 0, 0, r.height()-8); // left + else + renderTabSeparator(&painter, QRect(0, 0, 1, r.height()-5), g.button(), false); + if(isLast || isSingle) + painter.drawLine(r.width()-1, 0, r.width()-1, r.height()-8); // right + else + renderTabSeparator(&painter, QRect(r.width()-1, 0, 1, r.height()-5), g.button(), false); + + bitBlt(&buffer, 0, r.bottom()-7, tabEdges2, 0, 0, 8, 8); + bitBlt(&buffer, r.width()-8, r.bottom()-7, tabEdges2, 8, 0, 8, 8); + + + painter.drawTiledPixmap(8, r.height()-3, r.width()-16, 1, *tabHLines, 0, 2); // bottom + painter.drawTiledPixmap(1, 0, 1, r.height()-8, *tabVLines); // left + painter.drawTiledPixmap(r.width()-2, 0, 1, r.height()-8, *tabVLines); // right + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); // clip the first pixels of the separators + painter.drawPoint(0, 0); + painter.drawPoint(r.width()-1, 0); + + } + else { // unselected + + renderSurface(&painter, QRect(1, 0, r.width()-2, r.height()-5), g.background(), g.button(), g.button(), Is_TabBottom); + + + if(isFirst || isLast) { + + QPixmap* tabEdges2; + if(!(tabEdges2 = QPixmapCache::find("tabEdges2-bottom"+QString::number(g.background().pixel(), 16)+QString::number(r.height())))) { + tabEdges2 = new QPixmap(16, 8); + tabEdges2->fill(g.background()); + + QPixmap tabEdgesMask = qembed_findImage("groupBoxMask"); + QPainter painter2(&tabEdgesMask); + painter2.translate(0, -r.height()+19); + renderSurface(&painter2, QRect(1, 0, 14, r.height()-5), g.background(), g.button(), g.button(), Is_TabBottom); + painter2.end(); + bitBlt(tabEdges2, 0, 0, &tabEdgesMask, 0, 8); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabEdges2, 0, 0, &circle, 0, 8); + + QPixmapCache::insert("tabEdges2-bottom"+QString::number(g.background().pixel(), 16)+QString::number(r.height()), tabEdges2); + } + + + if(isFirst) { + renderTabSeparator(&painter, QRect(r.width()-1, 0, 1, r.height()-5), g.button(), false);// right + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 79)); // bottomShadow1 + painter.drawLine(8, r.height()-5, r.width()-1, r.height()-5); + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 30)); // bottomShadow2 + painter.drawLine(8, r.height()-4, r.width()-1, r.height()-4); + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + painter.drawLine(0, 1, 0, r.height()-12); // left + + bitBlt(&buffer, 0, r.height()-11, tabEdges2, 0, 0, 8, 8); + + painter.drawTiledPixmap(1, 1, 1, r.height()-12, *tabVLines); // left + painter.drawTiledPixmap(8, r.height()-6, r.width()-8, 1, *tabHLines, 0, 2); // bottom + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 55)); + painter.drawLine(0, 0, r.width()-1, 0); // top + + } + else { + renderTabSeparator(&painter, QRect(0, 0, 1, r.height()-5), g.button(), false); // left + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 79)); // bottomShadow1 + painter.drawLine(0, r.height()-5, r.width()-8, r.height()-5); + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 30)); // bottomShadow2 + painter.drawLine(0, r.height()-4, r.width()-8, r.height()-4); + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + painter.drawLine(r.width()-1, 1, r.width()-1, r.height()-12); // right + + bitBlt(&buffer, r.width()-8, r.height()-11, tabEdges2, 8, 0, 8, 8); + + painter.drawTiledPixmap(r.width()-2, 1, 1, r.height()-12, *tabVLines); // right + painter.drawTiledPixmap(0, r.height()-6, r.width()-8, 1, *tabHLines, 0, 2); // bottom + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 55)); + painter.drawLine(0, 0, r.width()-1, 0); // top + } + } + else { // middle + renderTabSeparator(&painter, QRect(0, 0, 1, r.height()-5), g.button(), false); // left + renderTabSeparator(&painter, QRect(r.width()-1, 0, 1, r.height()-5), g.button(), false);// right + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 79)); // bottomShadow1 + painter.drawLine(0, r.height()-5, r.width()-1, r.height()-5); + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 30)); // bottomShadow2 + painter.drawLine(0, r.height()-4, r.width()-1, r.height()-4); + painter.drawTiledPixmap(0, r.height()-6, r.width(), 1, *tabHLines, 0, 2); // bottom + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 55)); + painter.drawLine(0, 0, r.width()-1, 0); // top + } + + painter.fillRect(QRect(0, r.height()-3, r.width(), 3), g.background()); // rect under the tab, clips also the tabSeperator + + } + } + else { // above + if (selected) { + + renderSurface(&painter, QRect(1, 1, r.width()-2, r.height()), g.background(), g.button(), g.button(), Is_ActiveTabTop); + + QPixmap* tabEdges2; + QString position = isFirst ? "first" : isLast ? "last" : isSingle ? "single" : "middle"; + if(!(tabEdges2 = QPixmapCache::find(position+"tabEdges2-top-sel"+QString::number(g.background().pixel(), 16)+QString::number(r.height())))) { + tabEdges2 = new QPixmap(16,8); + tabEdges2->fill(g.background()); + QPainter painter2(tabEdges2); + + if(!isSingle) { + painter2.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 25)); + if(!isFirst) { + renderSurface(&painter2, QRect(0, 4, 2, r.height()), g.background(), g.button(), g.button(), Is_TabTop); + painter2.drawLine(0, 3, 1, 3); // topLine + painter2.drawTiledPixmap(0, 4, 2, 2, *tabHLines); + } + if(!isLast) { + renderSurface(&painter2, QRect(14, 4, 2, r.height()), g.background(), g.button(), g.button(), Is_TabTop); + painter2.drawLine(14, 3, 15, 3); // topLine + painter2.drawTiledPixmap(14, 4, 2, 2, *tabHLines); + } + } + painter2.end(); + + QPixmap tabEdgesMask = qembed_findImage("groupBoxMask"); + painter2.begin(&tabEdgesMask); + renderSurface(&painter2, QRect(1, 1, 14, r.height()), g.background(), g.button(), g.button(), Is_ActiveTabTop); + painter2.end(); + bitBlt(tabEdges2, 0, 0, &tabEdgesMask); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabEdges2, 0, 0, &circle); + + QPixmapCache::insert(position+"tabEdges2-top-sel"+QString::number(g.background().pixel(), 16)+QString::number(r.height()), tabEdges2); + } + + /////////////////////////////////////////////// + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + ///painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 40)); + if(isFirst || isSingle) + painter.drawLine(0, 8, 0, r.height()-1); // left + else + renderTabSeparator(&painter, QRect(0, 4, 1, r.height()), g.button(), true); + if(isLast || isSingle) + painter.drawLine(r.width()-1, 8, r.width()-1, r.height()-1); // right + else + renderTabSeparator(&painter, QRect(r.width()-1, 4, 1, r.height()), g.button(), true); + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 25)); + painter.drawLine(8, 0, r.width()-9, 0); // top + + + bitBlt(&buffer, 0, 0, tabEdges2, 0, 0, 8, 8, Qt::CopyROP); + bitBlt(&buffer, r.width()-8, 0, tabEdges2, 8, 0, 8, 8, Qt::CopyROP); + + painter.drawTiledPixmap(8, 1, r.width()-16, 2, *tabHLines); // top + painter.drawTiledPixmap(1, 8, 1, r.height()-1, *tabVLines); // left + painter.drawTiledPixmap(r.width()-2, 8, 1, r.height()-1, *tabVLines); // right + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); // clip the last pixels of the separators + painter.drawPoint(0, r.height()-1); + painter.drawPoint(r.width()-1, r.height()-1); + + + } + else { // unselected + + painter.fillRect(0, 0, r.width(), 10, g.background()); + painter.setPen(g.background().dark(150)); + + renderSurface(&painter, QRect(1, 4, r.width()-2, r.height()), g.background(), g.button(), g.button(), Is_TabTop); + + if(isFirst || isLast) { + + QPixmap* tabEdges2; + if(!(tabEdges2 = QPixmapCache::find("tabEdges2-top"+QString::number(g.background().pixel(), 16)+QString::number(r.height())))) { + tabEdges2 = new QPixmap(16, 8); + tabEdges2->fill(g.background()); + + QPixmap tabEdgesMask = qembed_findImage("groupBoxMask"); + QPainter painter2(&tabEdgesMask); + renderSurface(&painter2, QRect(1, 1, r.width()-2, r.height()), g.background(), g.button(), g.button(), Is_TabTop); + painter2.end(); + bitBlt(tabEdges2, 0, 0, &tabEdgesMask); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabEdges2, 0, 0, &circle); + + QPixmapCache::insert("tabEdges2-top"+QString::number(g.background().pixel(), 16)+QString::number(r.height()), tabEdges2); + } + + + + if(isFirst) { + // darker separator + renderTabSeparator(&painter, QRect(r.width()-1, 4, 1, r.height()), g.button(), true); // left + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 25)); + painter.drawLine(8, 3, r.width()-1, 3); // topLine + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + painter.drawLine(0, 10, 0, r.height()-1); // left + painter.drawLine(1, r.height()-1, r.width()-1, r.height()-1); // bottom + + painter.drawTiledPixmap(8, 4, r.width()-1, 2, *tabHLines); // top + painter.drawTiledPixmap(1, 11, 1, r.height()-12, *tabVLines); // left + + bitBlt(&buffer, 0, 3, tabEdges2, 0, 0, 8, 8); + + } + else { + // darker separator + renderTabSeparator(&painter, QRect(0, 4, 1, r.height()), g.button(), true); // right + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 25)); + painter.drawLine(0, 3, r.width()-9, 3); // topLine + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + painter.drawLine(r.width()-1, 10, r.width()-1, r.height()-1); // right + painter.drawLine(0, r.height()-1, r.width()-2, r.height()-1); // bottom + + painter.drawTiledPixmap(0, 4, r.width()-8, 2, *tabHLines); // top + painter.drawTiledPixmap(r.width()-2, 11, 1, r.height()-12, *tabVLines); // right + + bitBlt(&buffer, r.width()-8, 3, tabEdges2, 8, 0, 8, 8); + } + + } + else { // middle + + renderTabSeparator(&painter, QRect(r.width()-1, 4, 1, r.height()), g.button(), true); // left + renderTabSeparator(&painter, QRect(0, 4, 1, r.height()), g.button(), true); // right + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 25)); + painter.drawLine(0, 3, r.width()-1, 3); // top + painter.drawTiledPixmap(0, 4, r.width(), 2, *tabHLines); + + painter.setPen(alphaBlendColors(QColor(0,0,0), g.background(), 35)); + painter.drawLine(0, r.height()-1, r.width()-1, r.height()-1); // bottom + + } + } + } + p->drawPixmap(r.left(), r.top(), buffer); + } +} + +void DominoStyle::drawKStylePrimitive(KStylePrimitive kpe, + QPainter *p, + const QWidget* widget, + const QRect &r, + const QColorGroup &cg, + SFlags flags, + const QStyleOption& opt) const +{ + //return KStyle::drawKStylePrimitive(kpe, p, widget, r, cg, flags, opt); + +// SLIDER +// ------ + switch( kpe ) { + case KPE_SliderGroove: { + + bool horizontal = ((const QSlider*)widget)->orientation() == Horizontal; + + QRect re; + if(horizontal) + re.setRect(r.left(), r.y()+r.height()/2-3, r.width(), 4); + else + re.setRect(r.x()+r.width()/2-3, r.top(), 4, r.height()); + + bool parentBgPix = widget->parentWidget() ? widget->parentWidget()->paletteBackgroundPixmap() : 0; + QString hori = horizontal ? "1" : "0"; + QString trans = parentBgPix ? "1" : "0"; + QPixmap* sliderGroove; + if(!(sliderGroove = QPixmapCache::find(QString::number(cg.background().pixel(), 16)+"sliderGroove"+hori+trans))) { + + if(parentBgPix) { // ### the pix are transparent! + if(!horizontal) { + QWMatrix m; + m.rotate(-90); + sliderGroove = new QPixmap(qembed_findImage("slGHBody").xForm(m)); + } + else + sliderGroove = new QPixmap(qembed_findImage("slGHBody")); + } + else { + const QColor c1 = alphaBlendColors(QColor(0,0,0), cg.background(), 11); + const QColor c2 = alphaBlendColors(QColor(53,53,53), cg.background(), 155); + const QColor c3 = alphaBlendColors(QColor(67,67,67), cg.background(), 146); + const QColor c4 = alphaBlendColors(QColor(83,83,83), cg.background(), 140); + const QColor c5 = alphaBlendColors(QColor(101,101,101), cg.background(), 134); + const QColor c6 = alphaBlendColors(QColor(254,254,254), cg.background(), 43); + const QColor c7 = alphaBlendColors(QColor(255,255,255), cg.background(), 9); + + sliderGroove = new QPixmap(7, 7); + QPainter painter(sliderGroove); + QRect rr = sliderGroove->rect(); + + if (horizontal) { + painter.setPen(c1); + painter.drawLine(0, 0, 7, 0); + painter.setPen(c2); + painter.drawLine(0, 1, 7, 1); + painter.setPen(c3); + painter.drawLine(0, 2, 7, 2); + painter.setPen(c4); + painter.drawLine(0, 3, 7, 3); + painter.setPen(c5); + painter.drawLine(0, 4, 7, 4); + painter.setPen(c6); + painter.drawLine(0, 5, 7, 5); + painter.setPen(c7); + painter.drawLine(0, 6, 7, 6); + } + else { + painter.setPen(c1); + painter.drawLine(0, 0, 0, 7); + painter.setPen(c2); + painter.drawLine(1, 0, 1 , 7); + painter.setPen(c3); + painter.drawLine(2, 0, 2 , 7); + painter.setPen(c4); + painter.drawLine(3, 0, 3, 7); + painter.setPen(c5); + painter.drawLine(4, 0, 4, 7); + painter.setPen(c6); + painter.drawLine(5, 0, 5, 7); + painter.setPen(c7); + painter.drawLine(6, 0, 6, 7); + } + } + QPixmapCache::insert(QString::number(cg.background().pixel(), 16)+"sliderGroove"+hori+trans, sliderGroove); + } + + if (horizontal) { + QPixmap* slGh; + if(parentBgPix || !(slGh = QPixmapCache::find(QString::number(cg.background().pixel(), 16)+"slGh"))) { // rounded edges + + if(parentBgPix) + slGh = new QPixmap(qembed_findImage("slGh")); + else { + slGh = new QPixmap(6, 7); + slGh->fill(cg.background()); + QPixmap pix = qembed_findImage("slGh"); + bitBlt(slGh, 0, 0, &pix, 0, 0, -1, -1, Qt::CopyROP); + } + QPixmapCache::insert(QString::number(cg.background().pixel(), 16)+"slGh",slGh ); + } + + bitBlt(p->device(), re.x(), re.y(), slGh, 0, 0, 3, 7, Qt::CopyROP); + bitBlt(p->device(), r.width()-3, re.y(), slGh, 3, 0, 3, 7, Qt::CopyROP); + p->drawTiledPixmap(re.x()+3, re.y(), r.width()-6, 7, *sliderGroove); + } + else { + QPixmap* slGv; + if(parentBgPix || !(slGv = QPixmapCache::find(QString::number(cg.background().pixel(), 16)+"slGv"))) { + if(parentBgPix) + slGv = new QPixmap(qembed_findImage("slGv")); + else { + slGv = new QPixmap(7, 6); + slGv->fill(cg.background()); + QPixmap pix = qembed_findImage("slGv"); + bitBlt(slGv, 0, 0, &pix, 0, 0, -1, -1, Qt::CopyROP); + } + QPixmapCache::insert(QString::number(cg.background().pixel(), 16)+"slGv",slGv ); + } + bitBlt(p->device(), re.x(), re.y(), slGv, 0, 0, 7, 3, Qt::CopyROP); + bitBlt(p->device(), re.x(), re.height()-3, slGv, 0, 3, 7, 3, Qt::CopyROP); + p->drawTiledPixmap(re.x(), re.y()+3, 7, r.height()-6, *sliderGroove); + } + + break; + } + + case KPE_SliderHandle: { + const QSlider* slider = (const QSlider*)widget; + + int y, x; + if(slider->orientation() == Horizontal) { + x = r.x(); + y =r.y()+r.height()/2-8+1; + } + else { + y = r.y()+1; + x = r.x()+r.width()/2-8; + } + + QPixmap* handle; + if(!(handle = QPixmapCache::find("sliderHandle"+QString::number(cg.button().pixel(), 16)))) { + QPixmap insidePix = qembed_findImage("sliderHandle2inside"); // a filled antialiased circle to draw the gradients on + QPainter painter(&insidePix); + flatMode=true; + renderSurface(&painter, QRect(1, 0, 13, 15), cg.background(), cg.button(), cg.button(), Is_Button|Is_Horizontal); + flatMode=false; + QImage inside = insidePix.convertToImage(); + + QImage circle = tintImage(qembed_findImage("sliderHandle2circle"), + _customSliderHandleContourColor ? buttonContour->contourColor(Contour_Default) : alphaBlendColors(black, cg.button(), 110)); + + QImage shadow = qembed_findImage("sliderHandle2shadow"); + blend(shadow, inside, inside); + blend(circle, inside, inside); + handle = new QPixmap(inside); + QPixmapCache::insert("sliderHandle"+QString::number(cg.button().pixel(), 16), handle ); + } + bitBlt(p->device(), x, y, handle, 0, 0, -1, -1, Qt::CopyROP); + + break; + } + + case KPE_ListViewExpander: { + + QWidget* w = dynamic_cast(p->device()); + p->setPen( cg.text() ); + QColor bg = w ? w->paletteBackgroundColor() : cg.background(); + QString hasBgPix = w && w->paletteBackgroundPixmap() ? "1" : "0"; + QString expanded = flags & Style_Off ? "1" : "0"; + QPixmap* lve; + + if(_drawTriangularExpander) { + + if(!(lve = QPixmapCache::find(QString::number(bg.pixel(), 16)+QString::number(cg.text().pixel(), 16)+"lveT"+hasBgPix+expanded))) { + QWMatrix m; + m.rotate(90); + if(w && !w->paletteBackgroundPixmap()) { + QImage img = tintImage(qembed_findImage("lveTriangular"), cg.text()); + int w=7, h=9; + if(flags & Style_Off) { + w=9, h=7; + img = img.xForm(m); + } + QImage imgBG(w,h,32); + imgBG.fill(bg.rgb()); + bitBlt(&imgBG, 0, 0, &img); + lve = new QPixmap(imgBG); + } + else { + if(flags & Style_Off) + lve = new QPixmap(tintImage(qembed_findImage("lveTriangular").xForm(m), cg.text())); + else + lve = new QPixmap(tintImage(qembed_findImage("lveTriangular"), cg.text())); + } + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(cg.text().pixel(), 16)+"lveT"+hasBgPix+expanded, lve); + } + + p->drawPixmap(r.x(), r.y(), *lve); + + } + else { + + if(!(lve = QPixmapCache::find(QString::number(bg.pixel(), 16)+QString::number(cg.text().pixel(), 16)+"lveC"+hasBgPix+expanded))) { + if(w && !w->paletteBackgroundPixmap()) { + lve = new QPixmap(11,11); + lve->fill(bg); + QPainter painter(lve); + painter.drawPixmap(0, 0, tintImage(qembed_findImage("lve"), cg.text())); + + // plus or minus + painter.drawLine( 3, 5, 7, 5 ); + if ( flags & Style_On ) // Collapsed = On + painter.drawLine( 5, 3, 5, 7 ); + + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(cg.text().pixel(), 16)+"lveC"+hasBgPix+expanded, lve); + } + else { + QImage img = QImage(11, 11, 32); + img.setAlphaBuffer(true); + for(int x=0; x < img.width(); ++x) { + for(int y=0; y < img.height(); ++y) { + img.setPixel(x, y, qRgba(0, 0, 0, 0)); + } + } + + + QImage img2 = tintImage(qembed_findImage("lve"), cg.text()); + bitBlt(&img, 0, 0, &img2); + + int r, b, g; + int a = 255; + cg.text().getRgb(&r, &g, &b); + + // minus + img.setPixel(3, 5, qRgba(r, b, g, a)); + img.setPixel(4, 5, qRgba(r, b, g, a)); + img.setPixel(5, 5, qRgba(r, b, g, a)); + img.setPixel(6, 5, qRgba(r, b, g, a)); + img.setPixel(7, 5, qRgba(r, b, g, a)); + + + if ( flags & Style_Off ) + lve = new QPixmap(img); + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(cg.text().pixel(), 16)+"lveC"+hasBgPix+"1", new QPixmap(img)); + + // plus + img.setPixel(5, 3, qRgba(r, b, g, a)); + img.setPixel(5, 4, qRgba(r, b, g, a)); + img.setPixel(5, 6, qRgba(r, b, g, a)); + img.setPixel(5, 7, qRgba(r, b, g, a)); + + if ( flags & Style_On ) + lve = new QPixmap(img); + + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(cg.text().pixel(), 16)+"lveC"+hasBgPix+"0", new QPixmap(img)); + } + } + p->drawPixmap(r.x()-1,r.y()-1, *lve); + } + break; + } + + // copied and slightly modified from KStyle. + case KPE_ListViewBranch: { + if(_drawTriangularExpander) break; + // Typical Windows style listview branch element (dotted line). + + // Create the dotline pixmaps if not already created + if ( !verticalLine ) + { + // make 128*1 and 1*128 bitmaps that can be used for + // drawing the right sort of lines. + verticalLine = new QBitmap( 1, 129, true ); + horizontalLine = new QBitmap( 128, 1, true ); + QPointArray a( 64 ); + QPainter p2; + p2.begin( verticalLine ); + + int i; + for( i=0; i < 64; i++ ) + a.setPoint( i, 0, i*2+1 ); + p2.setPen( color1 ); + p2.drawPoints( a ); + p2.end(); + QApplication::flushX(); + verticalLine->setMask( *verticalLine ); + + p2.begin( horizontalLine ); + for( i=0; i < 64; i++ ) + a.setPoint( i, i*2+1, 0 ); + p2.setPen( color1 ); + p2.drawPoints( a ); + p2.end(); + QApplication::flushX(); + horizontalLine->setMask( *horizontalLine ); + } + + p->setPen( cg.mid() ); + + if (flags & Style_Horizontal) + { + int point = r.x(); + int other = r.y(); + int end = r.x()+r.width(); + int thickness = r.height(); + + while( point < end ) + { + int i = 128; + if ( i+point > end ) + i = end-point; + p->drawPixmap( point, other, *horizontalLine, 0, 0, i, thickness ); + point += i; + } + + } else { + int point = r.y(); + int other = r.x(); + int end = r.y()+r.height(); + int thickness = r.width(); + int pixmapoffset = (flags & Style_NoChange) ? 0 : 1; // ### Hackish + + while( point < end ) + { + int i = 128; + if ( i+point > end ) + i = end-point; + p->drawPixmap( other, point, *verticalLine, 0, pixmapoffset, thickness, i ); + point += i; + } + } + break; + } + + default: + KStyle::drawKStylePrimitive(kpe, p, widget, r, cg, flags, opt); + } +} + + +void DominoStyle::drawPrimitive(PrimitiveElement pe, + QPainter *p, + const QRect &r, + const QColorGroup &cg, + SFlags flags, + const QStyleOption &opt ) const +{ + bool down = flags & Style_Down; + bool on = flags & Style_On; + bool sunken = flags & Style_Sunken; + bool horiz = flags & Style_Horizontal; + const bool enabled = flags & Style_Enabled; + const bool mouseOver = flags & Style_MouseOver; + +// bool hasFocus = flags & Style_HasFocus; + + int x = r.x(); + int y = r.y(); + int w = r.width(); + int h = r.height(); + + + + //return KStyle::drawPrimitive(pe, p, r, cg, flags, opt); + + switch(pe) { + + case PE_FocusRect: { + + if(rubberBandType == DistRubber || (rubberBandType == ArgbRubber && !compositeManagerRunning)) { + p->drawWinFocusRect( r ); + break; + } + + QWidget* w = dynamic_cast(p->device()); + if(rubberBandType == ArgbRubber && compositeManagerRunning && viewPortPressed && dynamic_cast(w->parentWidget())) { + QListView* lv = dynamic_cast(w->parentWidget()); + if(!lv->currentItem()) + break; + QRect sr = lv->itemRect(lv->currentItem()); + QRect rr = r.normalize(); + int step = lv->rootIsDecorated() ? (lv->currentItem()->depth()+1)*lv->treeStepSize() : lv->currentItem()->depth()*lv->treeStepSize(); + if(dynamic_cast(lv->currentItem())) + step += 16+lv->itemMargin()+4; + + // why is the focusrect misused as a rubberband!? + if((lv->selectionMode() == QListView::Multi || lv->selectionMode() == QListView::Extended) && + !((sr.y() == rr.y()) && (sr.height() == rr.height()) && (sr.x()+step == rr.x()))) { + + QScrollView* sv = static_cast(w); + + QPoint po = w->mapFrom(sv, r.topLeft()); + QRect re = QRect(po.x(), po.y(), r.width(), r.height()); + + drawPrimitive(PE_RubberBand, p, r, cg, flags, opt); + break; + } + } + if(ignoreNextFocusRect) { + ignoreNextFocusRect= false; + break; + } + + QColor color = alphaBlendColors(cg.highlight(), cg.foreground(), 160); + + if(w && (w->isA("QViewportWidget") || dynamic_cast(p->device())->isA("RegionGrabber"))) { // QListView, QListBox, KSnapshot... + // we can't be sure if the pixamp edges will be erased, so only a simple rect. + p->setPen(QPen(color, 1, Qt::SolidLine)); + p->drawRect(r); + break; + } + + QPixmap* edges; + if(!(edges = QPixmapCache::find("fre"+QString::number(color.pixel(), 16)))) { + edges = new QPixmap(tintImage(qembed_findImage("focusRectEdges"), color)); + QPixmapCache::insert("fre"+QString::number(color.pixel(), 16), edges); + } + + p->drawPixmap(r.left(), r.top(), *edges, 0, 0, 3, 3); + p->drawPixmap(r.left(), r.bottom()-2, *edges, 0, 3, 3, 3); + p->drawPixmap(r.right()-2, r.top(), *edges, 3, 0, 3, 3); + p->drawPixmap(r.right()-2, r.bottom()-2, *edges, 3, 3, 3, 3); + + p->setPen(color); + p->drawLine(r.left()+3, r.top(), r.right()-2, r.y()); + p->drawLine(r.left()+3, r.bottom(), r.right()-2, r.bottom()); + p->drawLine(r.left(), r.top()+3, r.left(), r.bottom()-2); + p->drawLine(r.right(), r.top()+3, r.right(), r.bottom()-2); + + break; + } + + case PE_HeaderSection: { // also taskbar buttons + if(dynamic_cast(p->device()) && dynamic_cast(p->device())->isA("PanelKMenu")) { + QWidget* w = dynamic_cast(p->device()); + + if(w->parentWidget() && w->parentWidget()->paletteBackgroundPixmap()) { + + QPixmap pix(w->width(), w->height()); + QPainter painter(&pix); + QPoint point = QPoint(w->geometry().x(), w->geometry().y()); + painter.drawTiledPixmap( 0, 0, w->width(), w->height(), + *w->parentWidget()->backgroundPixmap(), + point.x(), point.y() ); + // if the PopupTitle is hovered by the mouse, we don't have access to the parent background pixmap, + // so it must have have its own one. + w->setUpdatesEnabled(false); + w->setErasePixmap(pix); + w->setUpdatesEnabled(true); + w->erase(); + } + else + w->erase(r); + break; + } + + renderHeader(p, r, cg, (on||down||sunken), mouseOver, true, enabled ); + break; + } + + + // BUTTONS + // ------- + + case PE_ButtonTool: + case PE_ButtonDropDown: + case PE_ButtonBevel: + case PE_ButtonCommand: { + + // the above promitives are not called from within the style + if(dynamic_cast(p->device())) // more likely a backgroundPixmap than a doublebuffer + buttonContour->setAlphaMode(); + + renderButton(p, r, cg, (on||down), mouseOver, true, enabled, khtmlWidgets.contains(opt.widget()) ); + buttonContour->reset(); + break; + } + + case PE_ButtonDefault: { + break; + } + + case PE_SpinWidgetPlus: + case PE_SpinWidgetMinus: { + p->setPen( cg.buttonText() ); + + int l = QMIN( w-2, h-2 ); + // make the length even so that we get a nice symmetric plus... + if(l%2 != 0) + --l; + QPoint c = r.center(); + + p->drawLine( c.x()-l/2, c.y(), c.x()+l/2, c.y() ); + if ( pe == PE_SpinWidgetPlus ) { + p->drawLine( c.x(), c.y()-l/2, c.x(), c.y()+l/2 ); + } + break; + } + + case PE_ScrollBarSlider: { + + QColor buttonColor = cg.button(); + + QPixmap buffer; + if(horiz) + buffer.resize(r.width()-14, r.height()); + else + buffer.resize(r.width(), r.height()-14); + if(buffer.isNull()) break; + + QRect br = buffer.rect(); + QPainter painter(&buffer); + + if(horiz) { + uint surfaceFlags = Is_ScrollBarBtn|Is_Horizontal; + renderSurface(&painter, br, cg.button(), cg.button(), buttonColor, surfaceFlags); + + uint contourFlags = Is_ScrollBarBtn|Is_Horizontal|Draw_Top|Draw_Bottom; + renderContour(&painter, QRect(-2, 0, br.width()+4, br.height()), cg.button(), buttonColor, contourFlags); + + p->drawPixmap(r.left()+7, r.y(), buffer); + } + else { + uint surfaceFlags = Is_ScrollBarBtn; + renderSurface(&painter, br, cg.button(), cg.button(), buttonColor, surfaceFlags); + + uint contourFlags = Is_ScrollBarBtn|Draw_Left|Draw_Right; + renderContour(&painter, QRect(0, -2, br.width(), br.height()+4), cg.button(), buttonColor, contourFlags); + + bitBlt(p->device(), r.x(), r.y()+7, &buffer, 0, 0, -1, -1, Qt::CopyROP); + } + break; + } + + case PE_ScrollBarAddPage: { // bottom / right + + QColor buttonColor = cg.button(); + QColor contourColor = alphaBlendColors(buttonContour->contourColor(Contour_Default), buttonColor, 203); + QPixmap* addPageBtn; + QPixmap buffer; + + uint surfaceFlags = Is_ScrollBarBtn; + if(horiz) + surfaceFlags |= Is_Horizontal; + + int sl = 6; + if(sliderlen < 14) + sl = sliderlen/2-1; + + //// button part + if(horiz) { + buffer.resize(r.width()+sl, r.height()); + if(buffer.isNull()) break; + + if(!(addPageBtn = QPixmapCache::find(QString::number(buttonColor.pixel(), 16)+"ah"+configMode ))) { + + QPixmap gradientPix = qembed_findImage("scrollBtnHMask"); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollBtnHShadow"); + QImage img3 = tintImage(qembed_findImage("scrollBtnHContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + addPageBtn = new QPixmap(img1); + + QPixmapCache::insert(QString::number(buttonColor.pixel(), 16)+"ah"+configMode, addPageBtn); + } + } + else { + buffer.resize(r.width(), r.height()+sl); + if(buffer.isNull()) break; + if(!(addPageBtn = QPixmapCache::find(QString::number(buttonColor.pixel(), 16)+"av"+configMode ))) { + + QPixmap gradientPix = qembed_findImage("scrollBtnVMask"); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollBtnVShadow"); + QImage img3 = tintImage(qembed_findImage("scrollBtnVContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + addPageBtn = new QPixmap(img1); + + QPixmapCache::insert(QString::number(buttonColor.pixel(), 16)+"av"+configMode, addPageBtn); + } + } + + QRect br(buffer.rect() ); + QPainter bp(&buffer); + + //// groove + if(sliderlen >= 10) { + surfaceFlags = Is_ScrollBarGroove; + if(horiz) + surfaceFlags |= Is_Horizontal; + + QColor grooveLine = alphaBlendColors(black, buttonColor, 80); + renderSurface(&bp, QRect(0, 0, br.width(), br.height()), grooveLine, grooveLine, grooveLine, surfaceFlags); + bp.setClipRegion(horiz ? QRect(0, 1, br.width(), br.height()-2) : QRect(1, 0, br.width()-2, br.height())); + renderSurface(&bp, QRect(0, 0, br.width(), br.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + bp.setClipping(false); + } + else { + renderSurface(&bp, QRect(0, 0, br.width(), br.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + uint contourFlags = Is_ScrollBarBtn; + contourFlags |= (horiz)? Draw_Top|Draw_Bottom : Draw_Left|Draw_Right; + renderContour(&bp, horiz?QRect(-2, 0, br.width()+4, br.height()):QRect(0, -2, br.width(), br.height()+4), buttonColor, buttonColor, contourFlags); + } + + + + QString docked = (!horiz && r.height() == 1) || (horiz && r.width() == 1) ? "1" : "0"; + QPixmap* sliderCap; + if(horiz) { + if(!(sliderCap = QPixmapCache::find("sHCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode))) { + if(r.width() == 1) { + QPixmap gradientPix(16, 15); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn|Is_Horizontal); + QImage img1 = gradientPix.convertToImage(); + + QImage img2 = qembed_findImage("scrollSliderHDockedShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderHDockedContour"), contourColor); + + bitBlt(&img1, 0, 0, &img2); + bitBlt(&img1, 0, 0, &img3); + + sliderCap = new QPixmap(img1); + } + else { + QPixmap gradientPix = qembed_findImage("scrollSliderHMask"); + QPainter painter(&gradientPix); + + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn|Is_Horizontal); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollSliderHShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderHContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + sliderCap = new QPixmap(img1); + } + QPixmapCache::insert("sHCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode, sliderCap); + } + } + else { + if(!(sliderCap = QPixmapCache::find("sVCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode))) { + if(r.height() == 1) { + QPixmap gradientPix(15, 16); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn); + QImage img1 = gradientPix.convertToImage(); + + QImage img2 = qembed_findImage("scrollSliderVDockedShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderVDockedContour"), contourColor); + + bitBlt(&img1, 0, 0, &img2); + bitBlt(&img1, 0, 0, &img3); + + sliderCap = new QPixmap(img1); + } + else { + QPixmap gradientPix = qembed_findImage("scrollSliderVMask"); + QPainter painter(&gradientPix); + + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollSliderVShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderVContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + sliderCap = new QPixmap(img1); + } + QPixmapCache::insert("sVCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode, sliderCap); + } + } + + + //////////// + + if(horiz) { + if(sliderlen >= 10) { + bp.drawPixmap(br.right()-8, 0, *addPageBtn, 9, 0, 9, 15); + bp.drawPixmap(-6+sl, 0, *sliderCap, 8, 0, 8, 15); + } + bitBlt(p->device(), r.x()-sl, r.y(), &buffer, 0, 0, br.width(), br.height(), Qt::CopyROP); + } + else { + if(sliderlen >= 10) { + bp.drawPixmap(0, br.bottom()-8, *addPageBtn, 0, 9, 15, 9); + bp.drawPixmap(0, (br.height() <= 6)? br.bottom()-6 :br.top(), *sliderCap, 0, 8, 15, 8); + } + bitBlt(p->device(), r.x(), r.y()-sl, &buffer, 0, 0, br.width(), br.height(), Qt::CopyROP); + } + break; + } + + case PE_ScrollBarSubPage: { // top / left + + QColor buttonColor = cg.button(); + QColor contourColor = alphaBlendColors(buttonContour->contourColor(Contour_Default), buttonColor, 203); + QPixmap* subPageBtn; + QPixmap buffer; + + uint surfaceFlags = Is_ScrollBarBtn; + + if(horiz) + surfaceFlags |= Is_Horizontal; + + + int sl = 6; + if(sliderlen < 14) + sl = sliderlen/2; + + + //// button part + if(horiz) { + buffer.resize(r.width()+sl, r.height()); + if(buffer.isNull()) break; + + if(!(subPageBtn = QPixmapCache::find(QString::number(buttonColor.pixel(), 16)+"sh"+configMode ))) { + + QPixmap gradientPix = qembed_findImage("scrollBtnHMask"); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollBtnHShadow"); + QImage img3 = tintImage(qembed_findImage("scrollBtnHContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + subPageBtn = new QPixmap(img1); + + QPixmapCache::insert(QString::number(buttonColor.pixel(), 16)+"sh"+configMode, subPageBtn); + } + } + else { + buffer.resize(r.width(), r.height()+sl); + if(buffer.isNull()) break; + + if(!(subPageBtn = QPixmapCache::find(QString::number(buttonColor.pixel(), 16)+"sv"+configMode ))) { + + QPixmap gradientPix = qembed_findImage("scrollBtnVMask"); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollBtnVShadow"); + QImage img3 = tintImage(qembed_findImage("scrollBtnVContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + subPageBtn = new QPixmap(img1); + + QPixmapCache::insert(QString::number(buttonColor.pixel(), 16)+"sv"+configMode, subPageBtn); + } + } + + QRect br(buffer.rect()); + QPainter bp(&buffer); + + //// groove + if(sliderlen >= 10) { + surfaceFlags = Is_ScrollBarGroove; + if(horiz) + surfaceFlags |= Is_Horizontal; + + QColor grooveLine = alphaBlendColors(black, buttonColor, 80); + renderSurface(&bp, QRect(0, 0, br.width(), br.height()), grooveLine, grooveLine, grooveLine, surfaceFlags); + bp.setClipRegion(horiz ? QRect(0, 1, br.width(), br.height()-2) : QRect(1, 0, br.width()-2, br.height())); + renderSurface(&bp, QRect(0, 0, br.width(), br.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + bp.setClipping(false); + } + else { + renderSurface(&bp, QRect(0, 0, br.width(), br.height()), buttonColor, buttonColor, buttonColor, surfaceFlags); + uint contourFlags = Is_ScrollBarBtn; + contourFlags |= (horiz)? Draw_Top|Draw_Bottom : Draw_Left|Draw_Right; + renderContour(&bp, horiz?QRect(-2, 0, br.width()+4, br.height()):QRect(0, -2, br.width(), br.height()+4), buttonColor, buttonColor, contourFlags); + } + + + QString docked = (!horiz && r.bottom() == 15) || (horiz && r.right() == 15) ? "1" : "0"; + QPixmap* sliderCap; + if(horiz) { + if(!(sliderCap = QPixmapCache::find("sHCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode))) { + + if(r.right() == 15) { + QPixmap gradientPix(16, 15); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn|Is_Horizontal); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollSliderHDockedShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderHDockedContour"), contourColor); + + bitBlt(&img1, 0, 0, &img2); + bitBlt(&img1, 0, 0, &img3); + + sliderCap = new QPixmap(img1); + } + else { + QPixmap gradientPix = qembed_findImage("scrollSliderHMask"); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn|Is_Horizontal); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollSliderHShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderHContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + sliderCap = new QPixmap(img1); + } + + QPixmapCache::insert("sHCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode, sliderCap); + } + } + else { + if(!(sliderCap = QPixmapCache::find("sVCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode))) { + + if(r.bottom() == 15) { + QPixmap gradientPix(15, 16); + QPainter painter(&gradientPix); + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn); + QImage img1 = gradientPix.convertToImage(); + + QImage img2 = qembed_findImage("scrollSliderVDockedShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderVDockedContour"), contourColor); + + bitBlt(&img1, 0, 0, &img2); + bitBlt(&img1, 0, 0, &img3); + + sliderCap = new QPixmap(img1); + } + else { + QPixmap gradientPix = qembed_findImage("scrollSliderVMask"); + QPainter painter(&gradientPix); + + renderSurface(&painter, QRect(0, 0, gradientPix.width(), gradientPix.height()), cg.button(), cg.button(), buttonColor, Is_ScrollBarBtn); + QImage img1 = gradientPix.convertToImage(); + QImage img2 = qembed_findImage("scrollSliderVShadow"); + QImage img3 = tintImage(qembed_findImage("scrollSliderVContour"), contourColor); + + blend(img2, img1, img1); + blend(img3, img1, img1); + + sliderCap = new QPixmap(img1); + } + + + QPixmapCache::insert("sVCap"+QString::number(buttonColor.pixel(), 16)+docked+configMode, sliderCap); + } + } + + if(horiz) { + if(sliderlen >= 10) { + bp.drawPixmap(0, 0, *subPageBtn, 0, 0, 9, 15); + bp.drawPixmap((br.width() <= 6)? -2 : br.width()-8, 0, *sliderCap, 0, 0, 8, 15); + } + } + else { + if(sliderlen >= 10) { + bp.drawPixmap(0, 0, *subPageBtn, 0, 0, 15, 9); + bp.drawPixmap(0, br.bottom()-sl-2+1, *sliderCap, 0, 0, 15, 8); + } + } + + bitBlt(p->device(), r.x(), r.y(), &buffer, 0, 0, br.width(), br.height(), Qt::CopyROP); + break; + } + + // SCROLLBAR BUTTONS + // ----------------- + + case PE_ScrollBarSubLine: { // top / left button + + uint contourFlags = Is_ScrollBarBtn; + + QRect cr = r; + QRect ar = r; + QRect sr = r; + + if(horiz) { + contourFlags |= Is_Horizontal|Draw_Top|Draw_Bottom; + if(r.x() == 0) { // = single Button + sr.setX(2); + sr.setWidth(13); + ar.setX(3); + contourFlags |= Draw_Left|Round_BottomLeft|Round_UpperLeft; + } + else { + cr.setWidth(17); + cr.setX(cr.x()-2); + } + } + else { + ar.setX(1); + contourFlags |= Draw_Left|Draw_Right; + if(r.y() == 0) { + sr.setY(2); + sr.setHeight(13); + ar.setY(3); + contourFlags |= Draw_Top|Round_UpperLeft|Round_UpperRight; + } + else { + cr.setHeight(17); + cr.setY(cr.y()-2); + } + } + + if(horiz) { + renderSurface(p, QRect(sr.x(), sr.y(), sr.width(), sr.height()), cg.button(), cg.button(), cg.button(), Is_ScrollBarBtn|Is_Horizontal); + renderContour(p, QRect(cr.x(), cr.y(), cr.width(), cr.height()), cg.button(), cg.button(), contourFlags); + } + else { + p->setClipRegion(QRect(sr.x()+2, sr.y(), sr.width()-4, sr.height())); + renderSurface(p, QRect(sr.x(), sr.y(), sr.width(), sr.height()), cg.button(), cg.button(), cg.button(), Is_ScrollBarBtn); + p->setClipping(false); + renderContour(p, QRect(cr.x(), cr.y(), cr.width(), cr.height()), cg.button(), cg.button(), contourFlags); + } + + QColor color = dynamic_cast(p->device()) ? dynamic_cast(p->device())->palette().active().buttonText() : cg.buttonText(); + p->setPen(color); + drawPrimitive((horiz ? PE_ArrowLeft : PE_ArrowUp), p, ar, cg, flags); + + break; + } + + case PE_ScrollBarAddLine: { // bottom / right button + + QRect cr = r; + QRect ar = r; + QRect sr = r; + if(horiz) { + sr.setWidth(13); + ar.setX(r.x()-4); + } + else { + sr.setHeight(13); + ar.setY(r.y()-2); + ar.setX(r.x()+1); + } + + if(horiz) { + uint contourFlags = Is_ScrollBarBtn|Is_Horizontal|Draw_Top|Draw_Bottom|Draw_Right|Round_UpperRight|Round_BottomRight; + renderSurface(p, QRect(sr.x(), sr.y(), sr.width(), sr.height()), cg.button(), cg.button(), cg.button(), Is_ScrollBarBtn|Is_Horizontal); + renderContour(p, QRect(cr.x(), cr.y(), cr.width(), cr.height()), cg.button(), cg.button(), contourFlags); + } + else { + p->setClipRegion(QRect(sr.x()+2, sr.y(), sr.width()-4, sr.height())); + renderSurface(p, QRect(sr.x(), sr.y(), sr.width(), sr.height()), cg.button(), cg.button(), cg.button(), Is_ScrollBarBtn); + p->setClipping(false); + uint contourFlags = Is_ScrollBarBtn|Draw_Bottom|Draw_Left|Draw_Right|Round_BottomLeft|Round_BottomRight; + renderContour(p, QRect(cr.x(), cr.y(), cr.width(), cr.height()), cg.button(), cg.button(), contourFlags); + } + + QColor color = dynamic_cast(p->device()) ? dynamic_cast(p->device())->palette().active().buttonText() : cg.buttonText(); + p->setPen(color); + drawPrimitive((horiz ? PE_ArrowRight : PE_ArrowDown), p, ar, cg, flags); + + + break; + } + + case PE_ScrollBarSubLine2: { // second top / left button // ### remove + + uint contourFlags = Is_ScrollBarBtn; + + QRect cr = r; + QRect ar = r; + QRect sr = r; + + if(horiz) { + contourFlags |= Is_Horizontal|Draw_Top|Draw_Bottom; + } + else { + ar.setX(1); + contourFlags |= Draw_Left|Draw_Right; + } + + if(horiz) { + renderSurface(p, QRect(sr.x(), sr.y(), sr.width(), sr.height()), cg.button(), cg.button(), cg.button(), Is_ScrollBarBtn|Is_Horizontal); + renderContour(p, QRect(cr.x(), cr.y(), cr.width(), cr.height()), cg.button(), cg.button(), contourFlags); + } + else { + p->setClipRegion(QRect(sr.x()+2, sr.y(), sr.width()-4, sr.height())); + renderSurface(p, QRect(sr.x(), sr.y(), sr.width(), sr.height()), cg.button(), cg.button(), cg.button(), Is_ScrollBarBtn); + p->setClipping(false); + renderContour(p, QRect(cr.x(), cr.y(), cr.width(), cr.height()), cg.button(), cg.button(), contourFlags); + } + + QColor color = dynamic_cast(p->device()) ? dynamic_cast(p->device())->palette().active().buttonText() : cg.buttonText(); + p->setPen(color); + drawPrimitive((horiz ? PE_ArrowLeft : PE_ArrowUp), p, ar, cg, flags); + + break; + } + + // CHECKBOXES + // ---------- + case PE_Indicator: { + break; + } + + case PE_IndicatorMask: { + p->fillRect (r.x()+3, r.y()+3, r.width()-6, r.height()-7, color1); + break; + } + + // RADIOBUTTONS + // ------------ + case PE_ExclusiveIndicator: { + break; + } + + case PE_ExclusiveIndicatorMask: { + + QPointArray pa(8); + pa.setPoint(0, 3,6); + pa.setPoint(1, 6,3); + pa.setPoint(2, 10,3); + pa.setPoint(3, 13,6); + pa.setPoint(4, 13,10); + pa.setPoint(5, 10,13); + pa.setPoint(6, 6,13); + pa.setPoint(7, 3,10); + + p->setBrush(color1); + p->setPen(color1); + p->drawPolygon(pa); + break; + } + + // GENERAL PANELS + // -------------- + case PE_Splitter: { + + p->fillRect(r, cg.background()); + int ch, cs, cv; + cg.background().getHsv(ch, cs, cv); + if(cv < 100) + p->setPen(alphaBlendColors(cg.background(), white, 120)); + else + p->setPen(alphaBlendColors(cg.background(), black, 180)); + + p->setPen(dGetColor(cg.background(), 55)); + if (w > h) { + int ycenter = r.height()/2; + for(int k =r.width()/2-5; k < r.width()/2+5; k+=3) { + p->drawRect(k, ycenter-1, 2,2); + } + } + else { + int xcenter = r.width()/2; + for(int k =r.height()/2-5; k < r.height()/2+5; k+=3) { + p->drawRect( xcenter-1, k, 2,2); + } + } + + break; + } + + case PE_GroupBoxFrame: + case PE_PanelGroupBox: { // QFrame::GroupBoxPanel + break; + } + + case PE_WindowFrame: { + if ( opt.isDefault() || opt.lineWidth() <= 0 ) + break; + + p->setPen(cg.background().dark(120)); + p->drawRect(r); + p->setPen(cg.background().light(110)); + p->drawRect(QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); + + break; + } + + case PE_Panel: { // QFrame::StyledPanel + if(kickerMode) + break; + + p->save(); + // inside rect + p->setPen(cg.background().dark(120)); + p->drawLine(r.x()+1, r.y()+1, r.right()-1, r.y()+1); //top + p->drawLine(r.x()+1, r.bottom()-1, r.right()-1, r.bottom()-1); + p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.bottom()-1); + p->drawLine(r.right()-1, r.y()+1, r.right()-1, r.bottom()-1); + + // outside rect + p->setPen(cg.background()); + p->drawLine(r.x(), r.y(), r.right(), r.y()); //top + p->setPen(alphaBlendColors(white, cg.background(), 30)); + p->drawLine(r.x(), r.y()+1, r.x(), r.bottom()); + p->drawLine(r.right(), r.y()+1, r.right(), r.bottom()); + p->setPen(alphaBlendColors(white, cg.background(), 50)); + p->drawLine(r.x()+1, r.bottom(), r.right()-1, r.bottom()); + + p->restore(); // maybe we are a KArrowButton and need to draw the arrow + break; + } + + case PE_PanelLineEdit: { // QFrame::LineEditPanel + break; + } + + case PE_PanelTabWidget: { // QFrame::TabWidgetPanel + + // we get a wrong clip rect + p->setClipping(false); + + bool roundTopLeft = true; + bool roundTopRight = true; + bool roundBottomLeft = true; + bool roundBottomRight = true; + bool tabsAbove = true; + +// p->fillRect(QRect(r.x()-10, r.y()-10, r.width()+20, r.height()+20), yellow); + + QRect tr; + QWidget* w = dynamic_cast(p->device()); + QTabWidget* tw = w ? dynamic_cast(w->parentWidget()) : 0; + bool tabBarHidden = tw && !((DominoQTabWidget*)tw)->tabBar()->isVisible(); + if(tw && !tabBarHidden) { + + tabsAbove = tw->tabPosition() == QTabWidget::Top; + + if(tw->count() != 0) { + + QTabBar* tb = ((DominoQTabWidget*)tw)->tabBar(); + QRect gr = tb->geometry(); + + if(tb->isVisible()) { + tr = tb->tabAt(tw->currentPageIndex())->rect(); + tr.setHeight(3); + tr.moveBy(gr.x(), tabsAbove ? 0 : r.height()-2); + } + + if(!tw->cornerWidget(Qt::TopLeft) && gr.x() < 7) { + if(tabsAbove) + roundTopLeft = false; + else + roundBottomLeft = false; + } + if(!tw->cornerWidget(Qt::TopRight) && gr.x()+gr.width() > tw->width()-7) { + if(tabsAbove) + roundTopRight = false; + else + roundBottomRight = false; + } + } + } + QBrush background = tw ? tw->colorGroup().brush(QColorGroup::Background) : cg.brush(QColorGroup::Background); + QColor bottomGradient = alphaBlendColors(QColor(0,0,0), cg.background(), 11); + QColor topGradient = alphaBlendColors(QColor(255,255,255), cg.background(), 15); + QColor tabContour2 = cg.background().dark(150); + + + QString tabPos = tabsAbove ? "1" : "0"; + QPixmap* tabWEdges; + if(!(tabWEdges = QPixmapCache::find("tabWEdges"+tabPos+QString::number(background.color().pixel(), 16)+QString::number(cg.background().pixel(), 16)))) { + tabWEdges = new QPixmap(16,16); + QPainter painter(tabWEdges); + painter.fillRect(tabWEdges->rect(), background); + painter.end(); + + QPixmap tabWEdgesMask = qembed_findImage("groupBoxMask"); + painter.begin(&tabWEdgesMask); + painter.fillRect(tabWEdgesMask.rect(), cg.brush(QColorGroup::Background)); + painter.end(); + bitBlt(tabWEdges, 0, 0, &tabWEdgesMask); + + QPixmap circle = qembed_findImage("tabWidget"); + bitBlt(tabWEdges, 0, 0, &circle); + + QPixmapCache::insert("tabWEdges"+tabPos+QString::number(background.color().pixel(), 16)+QString::number(cg.background().pixel(), 16), tabWEdges); + } + + + QRect re = QRect(r.x(), r.y(), r.width(), r.height()+1); + QColor bg = cg.background(); + QColor bg2 = background.color(); // parent color + + // top + QColor c1 = alphaBlendColors(QColor(0,0,0), bg2, 25); + QColor c2 = alphaBlendColors(QColor(255,255,255), bg, 70); + QColor c3 = alphaBlendColors(QColor(255,255,255), bg, 30); + + // left + right + QColor c4 = alphaBlendColors(QColor(0,0,0), bg2, 40); +// QColor c5 = alphaBlendColors(QColor(255,255,255), bg, 30); + QColor c6 = alphaBlendColors(QColor(255,255,255), bg, 4); + + // bottom + QColor c7 = alphaBlendColors(QColor(249,249,249), bg, 25); + QColor c8 = alphaBlendColors(QColor(0,0,0), bg2, 79); + QColor c9 = alphaBlendColors(QColor(0,0,0), bg2, 30); + + // top + p->setPen(c1); + p->drawLine(re.left(), re.y(), re.right(), re.y()); + p->setPen(c2); + p->drawLine(re.left(), re.y()+1, re.right(), re.y()+1); + p->setPen(c3); + p->drawLine(re.left(), re.y()+2, re.right(), re.y()+2); + // bottom + p->setPen(c7); + p->drawLine(re.left()+1, re.bottom()-2, re.right(), re.bottom()-2); + p->setPen(c8); + p->drawLine(re.left()+1, re.bottom()-1, re.right(), re.bottom()-1); + p->setPen(c9); + p->drawLine(re.left(), re.bottom(), re.right(), re.bottom()); + // left + p->setPen(c4); + p->drawLine(re.left(), re.y()+1, re.left(), re.bottom()-1); + p->setPen(c3); + p->drawLine(re.left()+1, re.y()+2, re.left()+1, re.bottom()-2); + p->setPen(c6); + p->drawLine(re.left()+2, re.y()+3, re.left()+2, re.bottom()-3); + // right + p->drawLine(re.right()-2, re.y()+3, re.right()-2, re.bottom()-3); + p->setPen(c3); + p->drawLine(re.right()-1, re.y()+2, re.right()-1, re.bottom()-2); + p->setPen(c4); + p->drawLine(re.right(), re.y()+1, re.right(), re.bottom()-1); + + + // unpainted area + p->setPen(bg); + p->drawLine(re.left()+3, re.y()+3, re.right()-3, re.y()+3); + p->drawLine(re.left()+3, re.bottom()-4, re.right()-3, re.bottom()-4); + p->drawLine(re.left()+3, re.bottom()-3, re.right()-3, re.bottom()-3); + p->drawLine(re.left()+3, re.y()+3, re.left()+3, re.bottom()-4); + p->drawLine(re.right()-3, re.y()+3, re.right()-3, re.bottom()-4); + + + if(roundTopLeft) { + bitBlt(p->device(), re.x(), re.y(), tabWEdges, 0, 0, 8, 8, Qt::CopyROP); + } + if(roundTopRight) { + bitBlt(p->device(), re.width()-8, re.y(), tabWEdges, 8, 0, 8, 8, Qt::CopyROP); + } + if(roundBottomLeft) { + bitBlt(p->device(), re.x(), re.height()-8, tabWEdges, 0, 8, 8, 8, Qt::CopyROP); + } + if(roundBottomRight) { + bitBlt(p->device(), re.width()-8, re.height()-8, tabWEdges, 8, 8, 8, 8, Qt::CopyROP); + } + + + // paint over the frame to not disturb the transition from the tabWidget to the current tab + if(tr.isValid()) { + p->fillRect(tr, cg.background()); // ### shrink + + if(tabsAbove) { + QColor p1 = alphaBlendColors(QColor(255,255,255), bg, 50); + QColor p2 = alphaBlendColors(QColor(255,255,255), bg, 25); + QColor p3 = alphaBlendColors(QColor(255,255,255), bg, 10); + + p->setPen(p1); + p->drawPoint(tr.left(), tr.top()+1); + p->drawPoint(tr.right(), tr.top()+1); + p->setPen(p2); + p->drawPoint(tr.left()+1, tr.top()+1); + p->drawPoint(tr.left(), tr.top()+2); + p->drawPoint(tr.right()-1, tr.top()+1); + p->drawPoint(tr.right(), tr.top()+2); + p->setPen(p3); + p->drawPoint(tr.left()+1, tr.top()+2); + p->drawPoint(tr.right()-1, tr.top()+2); + } + else { + QColor p1 = alphaBlendColors(QColor(255,255,255), bg, 17); + QColor p2 = alphaBlendColors(QColor(255,255,255), bg, 10); + + p->setPen(p1); + p->drawPoint(tr.left(), tr.top()); + p->drawPoint(tr.right(), tr.top()); + + p->setPen(p2); + p->drawPoint(tr.left()+1, tr.top()); + p->drawPoint(tr.right()-1, tr.top()); + + } + + } + + break; + } + + case PE_PanelPopup: { // QFrame::PopupPanel + + QPopupMenu* pm = dynamic_cast(p->device()); + QColor background = dynamic_cast(p->device()) ? cg.base() : _customPopupMenuColor ? _popupMenuColor : cg.background(); + + QRegion mask(x, y+5, w, h-10); + mask += QRegion(x+5, y, w-10, h); + mask += QRegion(x+1, y+2, w-2, h-4); + mask += QRegion(x+2, y+1, w-4, h-2); + + if(_drawPopupMenuGradient) { + QPixmap buffer(r.width(), r.height()); + QPainter bp(&buffer); + renderGradient(&bp, r, lightenColor(background, 18), darkenColor(background, 12), true); + + if(pm) { + pm->setUpdatesEnabled(false); + pm->setPaletteBackgroundPixmap(buffer); + pm->setUpdatesEnabled(true); + } + else { + p->setClipRegion(mask); + p->drawPixmap(r, buffer); + p->setClipping(false); + } + } + else { + if(pm) { + pm->setUpdatesEnabled(false); + pm->setPaletteBackgroundColor(background); + pm->setUpdatesEnabled(true); + } + } + + if(pm) { + if(pm->isA("PrettyPopupMenu") || pm->isA("Amarok::Menu") || pm->isA("Digikam::DPopupMenu")) { + // these popups have a side pixmap and are drawing the frame after the contents + QRect cr = pm->contentsRect(); + if(QApplication::reverseLayout()) + pm->erase(mask-QRegion(cr.width()+3, cr.y(), r.width()-cr.width()-6, cr.height()-1)); + else + pm->erase(mask-QRegion(r.x()+3, cr.y(), r.width()-cr.width()-6, cr.height()-1)); + ((DominoQFrame*)pm)->drawContents(p ); + } + else + pm->erase(mask); + } + + + bitBlt(p->device(), r.x(), r.y(), popupFrame, 0, 0, 5, 5, Qt::CopyROP); + bitBlt(p->device(), r.width()-5, r.y(), popupFrame, 5, 0, 5, 5, Qt::CopyROP); + bitBlt(p->device(), r.x(), r.bottom()-4, popupFrame, 0, 5, 5, 5, Qt::CopyROP); + bitBlt(p->device(), r.width()-5, r.bottom()-4, popupFrame, 5, 5, 5, 5, Qt::CopyROP); + + p->setPen(background.dark(150)); + p->drawLine(r.x()+5, r.y(), r.width()-6, r.y()); + p->drawLine(r.x()+5, r.bottom(), r.width()-6, r.bottom()); + p->drawLine(r.x(), r.y()+5, r.x(), r.bottom()-5); + p->drawLine(r.width()-1, r.y()+5, r.width()-1, r.bottom()-5); + + break; + } + + // MENU / TOOLBAR PANEL + // -------------------- + case PE_PanelMenuBar: // QFrame::MenuBarPanel + case PE_PanelDockWindow: { // QFrame::ToolBarPanel + + p->setPen(cg.background()); + // overpainting the menus leads to flicker so we draw only the frame here. + if(dynamic_cast(p->device())) + p->drawRect(r); + else + p->fillRect(r, cg.brush(QColorGroup::Background)); // colorpreview in kcontrol + break; + } + + case PE_StatusBarSection: { + break; + } + + case PE_TabBarBase: { + break; + } + + // TOOLBAR/DOCK WINDOW HANDLE + // -------------------------- + case PE_DockWindowResizeHandle: { + QWidget* w = dynamic_cast(p->device()); // QDockWindowResizeHandle + + if(w && !w->erasePixmap()) { + QPixmap pix(r.size()); + QPainter painter(&pix); + renderGradient(&painter, r, lightenColor(cg.background(), 40), darkenColor(cg.background(), 30), horiz); + w->setErasePixmap(pix); + } + break; + } + + case PE_DockWindowHandle: { + QWidget* widget = dynamic_cast(p->device()); // qt_dockwidget_internal - QDockWindowHandle + + int ch, cs, cv; + cg.background().getHsv(ch, cs, cv); + if(cv < 100) + p->setPen(alphaBlendColors(cg.background(), white, 120)); + else + p->setPen(alphaBlendColors(cg.background(), black, 180)); + + if(widget && widget == hoverWidget) { + if (w > h) { + int ycenter = r.height()/2; + for(int k = r.width()/2-5; k < r.width()/2+5; k+=3) { + p->drawRect(k, ycenter-1, 2, 2); + } + } + else { + int xcenter = r.width()/2; + for(int k = r.height()/2-5; k < r.height()/2+5; k+=3) { + p->drawRect(xcenter-1, k, 2, 2); + } + } + } + break; + } + + // TOOLBAR SEPARATOR + // ----------------- + case PE_DockWindowSeparator: { + if(!_toolBtnAsBtn) { + int ch, cs, cv; + cg.background().getHsv(ch, cs, cv); + if(cv < 100) + p->setPen(alphaBlendColors(cg.background(), white, 150)); + else + p->setPen(alphaBlendColors(cg.background(), black, 150)); + + if(horiz) { + int x = r.width()/2; + for(int i = 2; i < r.height()-4; i += 3) + p->drawPoint(x, i); + } + else { + int y = r.height()/2; + for(int i = 2; i < r.width()-4; i += 3) + p->drawPoint(i, y); + } + } + break; + } + case PE_CheckMark: { + if( flags & Style_On ) { + if(flags & Style_Enabled) + p->drawPixmap(r.x()+1, r.y()+1, *checkMark, 0, 0, 16, 17); + else + p->drawPixmap(r.x()+1, r.y()+1, *checkMark, 16, 0, 16, 17); + } + else if ( flags & Style_Off ) { + } + else {// tristate + p->setPen(_customCheckMarkColor ? _checkMarkColor : qApp->palette().active().foreground()); + p->drawLine(6,6,11,6); + p->drawLine(6,8,11,8); + p->drawLine(6,10,11,10); + } + + break; + } + + case PE_SpinWidgetUp: + case PE_SpinWidgetDown: { + QPixmap* arrow; + bool isEnabled = (flags & Style_Enabled); + QString enabled = isEnabled ? "1" : "0"; + QColor color = p->pen().color(); + + if(!(arrow = QPixmapCache::find(QString::number(color.pixel(), 16)+"spinArrows"+enabled))) { + QImage ar = tintImage(qembed_findImage("spinBoxArrows"), color); + if(!isEnabled) { // make it transparent + ar = setImageOpacity(ar, 25); + } + arrow = new QPixmap(ar); + QPixmapCache::insert(QString::number(color.pixel(), 16)+"spinArrows"+enabled, arrow); + } + + if(textEffectSettings.mode) { + QPixmap* effectArrow; + if(!(effectArrow = QPixmapCache::find(QString::number(textEffectSettings.buttonColor.pixel(), 16)+"spinEArrows"+enabled))) { + QImage img = tintImage(qembed_findImage("spinBoxArrows"), textEffectSettings.buttonColor); + int opacity = textEffectSettings.buttonOpacity*100/255; + effectArrow = new QPixmap(setImageOpacity(img, !isEnabled ? opacity*25/100 : opacity)); + QPixmapCache::insert(QString::number(textEffectSettings.buttonColor.pixel(), 16)+"spinEArrows"+enabled, effectArrow); + } + bitBlt(p->device(), r.x()+7/2+1+textEffectSettings.buttonPos.x(), r.y()+r.height()/2-3+textEffectSettings.buttonPos.y(), effectArrow, 0, pe == PE_SpinWidgetDown ? 5 : 0, 7, 5); + + } + + bitBlt(p->device(), r.x()+7/2+1, r.y()+r.height()/2-3, arrow, 0, pe == PE_SpinWidgetDown ? 5 : 0, 7, 5); + break; + } + case PE_HeaderArrow: + case PE_ArrowUp: + case PE_ArrowDown: + case PE_ArrowLeft: + case PE_ArrowRight: { + + QRect re = r; + int x2, w2, h2; + int x = -4; + switch (pe) { + case PE_ArrowUp: { + + x2 = 10; + w2 = 7; + h2 = 5; + break; + } + case PE_ArrowDown: { + x2 = 17; + w2 = 7; + h2 = 5; + break; + } + case PE_ArrowLeft: { + x += 1; + x2 = 0; + w2 = 5; + h2 = 7; + break; + } + case PE_ArrowRight: { + x += 2; + x2 = 5; + w2 = 5; + h2 = 7; + break; + } + default: { + if(flags & Style_Up) { + x2 = 10; + w2 = 7; + h2 = 5; + } + else { + x2 = 17; + w2 = 7; + h2 = 5; + } + break; + } + } + + + QPixmap* arrow; + bool isEnabled = (flags & Style_Enabled); + QString enabled = isEnabled ? "1" : "0"; + QColor color = p->pen().color(); + + if(!(arrow = QPixmapCache::find(QString::number(color.pixel(), 16)+"scrollBarArrows"+enabled))) { + QImage ar = tintImage(qembed_findImage("scrollBarArrows"), color); + if(!isEnabled) { + ar = setImageOpacity(ar, 25); + } + arrow = new QPixmap(ar); + QPixmapCache::insert(QString::number(color.pixel(), 16)+"scrollBarArrows"+enabled, arrow); + } + + if(/*pe == PE_HeaderArrow &&*/ textEffectSettings.mode) { + QPixmap* effectArrow; + if(!(effectArrow = QPixmapCache::find(QString::number(textEffectSettings.buttonColor.pixel(), 16)+"scrollBarEArrows"+enabled))) { + QImage img = tintImage(qembed_findImage("scrollBarArrows"), textEffectSettings.buttonColor); + int opacity = textEffectSettings.buttonOpacity*100/255; + effectArrow = new QPixmap(setImageOpacity(img, !isEnabled ? opacity*25/100 : opacity)); + QPixmapCache::insert(QString::number(textEffectSettings.buttonColor.pixel(), 16)+"scrollBarEArrows"+enabled, effectArrow); + } + p->drawPixmap(re.x()+re.width()/2+x+textEffectSettings.buttonPos.x(), re.y()+re.height()/2-3+textEffectSettings.buttonPos.y(), *effectArrow, x2, 0, w2, h2); + } + + p->drawPixmap(re.x()+re.width()/2+x, re.y()+re.height()/2-3, *arrow, x2, 0, w2, h2); + break; + } + + case PE_CheckListIndicator: { + // the rect in not correctly calculated in Qt, so the controller rect is 2px above the drawn rect. + + QCheckListItem *item = opt.checkListItem(); + QListView *lv = item->listView(); + if(!item) + return; + + QString state = flags& Style_On ? "1" : "0"; + state += flags& Style_Selected ? "1" : "0"; + state += flags& Style_NoChange ? "1" : "0"; + + QColor background = flags& Style_Selected ? cg.highlight() : cg.base(); + QColor foreground = cg.text(); + + QPixmap* pix; + if(!(pix = QPixmapCache::find(QString::number(background.pixel(), 16)+QString::number(foreground.pixel(), 16)+"checkListIndicator"+state))) { + pix = new QPixmap(r.x()+lv->itemMargin()+r.width()+4, item->height()); + pix->fill(background); + QPainter painter(pix); + + painter.setPen(alphaBlendColors(foreground, background, 127)); + painter.drawLine(r.x()+1, r.y()+1, r.x()+12, r.y()+1); // t + painter.drawLine(r.x()+1, r.y()+14, r.x()+12, r.y()+14); // b + painter.drawLine(r.x(), r.y()+2, r.x(), r.y()+13); // l + painter.drawLine(r.x()+13, r.y()+2, r.x()+13, r.y()+13); // r + + painter.setPen(alphaBlendColors(foreground, background, 80)); + painter.drawPoint(r.x(), r.y()+1); + painter.drawPoint(r.x()+13, r.y()+1); + painter.drawPoint(r.x(), r.y()+14); + painter.drawPoint(r.x()+13, r.y()+14); + + + if(flags& Style_NoChange) { + painter.fillRect(r.x()+1, r.y()+2, 12, 12, dGetColor(background, 30)); + painter.drawPixmap(r.x()-1, r.y(), tintImage(qembed_findImage("checkmark"), foreground)); + } + if(flags& Style_On) + painter.drawPixmap(r.x()-1, r.y(), tintImage(qembed_findImage("checkmark"), foreground)); + + QPixmapCache::insert(QString::number(background.pixel(), 16)+QString::number(foreground.pixel(), 16)+"checkListIndicator"+state, pix); + } + + p->drawPixmap(0, 0, *pix); + break; + } + + case PE_CheckListExclusiveIndicator: { + QColor background = flags& Style_Selected ? cg.highlight() : cg.base(); + p->drawPixmap(r.left()+3, r.top()+1, tintImage(qembed_findImage("checkListExclusiveIndicator"), alphaBlendColors(cg.text(), background, 127))); + + if(flags&Style_On) + p->drawPixmap(r.x()+7, r.y()+5, tintImage(qembed_findImage("rb-dot"),cg.text())); + break; + } + + case PE_SizeGrip: { + + bool parentBgPix = cg.brush(QColorGroup::Background).pixmap(); + QString trans = parentBgPix ? "1" : "0"; + QPixmap* grip; + if(!(grip = QPixmapCache::find(QString::number(cg.background().pixel(), 16)+"sizeGrip"+trans))) { + if(parentBgPix) + grip = new QPixmap(qembed_findImage("sizeGrip")); + else { + grip = new QPixmap(4, 4); + grip->fill(cg.background()); + QPixmap tmpPix = qembed_findImage("sizeGrip"); + bitBlt(grip, 0, 0, &tmpPix, 0, 0, -1, -1, Qt::CopyROP); + } + QPixmapCache::insert(QString::number(cg.background().pixel(), 16)+"sizeGrip"+trans, grip); + } + + bitBlt(p->device(), r.width()-(QApplication::reverseLayout() ? 12 : 6), r.height()-12, grip, 0, 0, -1, -1, Qt::CopyROP); + bitBlt(p->device(), r.width()-6, r.height()-6, grip, 0, 0, -1, -1, Qt::CopyROP); + bitBlt(p->device(), r.width()-12, r.height()-6, grip, 0, 0, -1, -1, Qt::CopyROP); + break; + } + + + + + case PE_RubberBand: { + +#if KDE_VERSION >= 0x30506 + if(rubberBandType != ArgbRubber || !compositeManagerRunning) { +#else + if(rubberBandType != ArgbRubber) { +#endif + if(rubberBandType == LineRubber) { + p->save(); + p->setPen(QPen(black, 1, Qt::SolidLine)); + p->drawRect(r); + p->restore(); + } + else { + KStyle::drawPrimitive(pe, p, r, cg, flags, opt); + } + break; + } + + + + bool normalized = r.width() < 0 || r.height() < 0; + QRect re = normalized? r.normalize(): r; + + if(re.y() < 0) + re.setY(-3); + if(re.x() < 0) + re.setX(-3); + + + if(!viewPortPressed || re == oldRubberRect || re.width() == 0 || re.height() == 0) { + break; + } + + QColor fg = alphaBlendColors(_argbRubberBandColor, black, 127); + const QWidget* w = dynamic_cast(p->device()); + if(!w) + w = rubberViewPort; + + QPoint po = w->mapToGlobal(QPoint(0,0)); + QRect gr = QRect(po.x(), po.y(), w->width(), w->height()); + + QRegion mask(re.x()+1, re.y(), re.width()-2, re.height()); + mask += QRegion(re.x(), re.y()+1, re.width(), re.height()-2); + + rubber->create(gr, mask); + + + GC gc2 = XCreateGC(qt_xdisplay(), rubber->window, 0, 0); + + /////// erasing + XRectangle xrect; + XRectangle outline[4]; + int num = 0; + if(re.y() < oldRubberRect.y()) {// ^ top + outline[num].x = oldRubberRect.x(); + outline[num].y = oldRubberRect.y(); + outline[num].width = oldRubberRect.width(); + outline[num].height = 1; + num += 1; + + } + if(oldRubberRect.y()+oldRubberRect.height() < re.y()+re.height()) {// v bottom + outline[num].x = oldRubberRect.x(); + outline[num].y = oldRubberRect.y()+oldRubberRect.height()-1; + outline[num].width = oldRubberRect.width(); + outline[num].height = 1; + num += 1; + } + if(re.x() < oldRubberRect.x()) {// < left + outline[num].x = oldRubberRect.x(); + outline[num].y = oldRubberRect.y(); + outline[num].width = 1; + outline[num].height = oldRubberRect.height()-1; + num += 1; + } + + if(oldRubberRect.x()+oldRubberRect.width() < re.x()+re.width()) {// > right + outline[num].x = oldRubberRect.x()+oldRubberRect.width()-1; + outline[num].y = oldRubberRect.y(); + outline[num].width = 1; + outline[num].height = oldRubberRect.height()-1; + num += 1; + } + + for(int i = 0; iwindow, outline[i].x, outline[i].y, outline[i].width, outline[i].height, false); + + xrect.x = oldRubberRect.x()+1; + xrect.y = oldRubberRect.y()+1; + xrect.width = 2; + xrect.height = 2; + XClearArea(qt_xdisplay(), rubber->window, xrect.x, xrect.y, xrect.width, xrect.height, false); + + xrect.x = oldRubberRect.x()+1; + xrect.y = oldRubberRect.y()+oldRubberRect.height()-3; + xrect.width = 2; + xrect.height = 2; + XClearArea(qt_xdisplay(), rubber->window, xrect.x, xrect.y, xrect.width, xrect.height, false); + + xrect.x = oldRubberRect.x()+oldRubberRect.width()-3; + xrect.y = oldRubberRect.y()+1; + xrect.width = 2; + xrect.height = 2; + XClearArea(qt_xdisplay(), rubber->window, xrect.x, xrect.y, xrect.width, xrect.height, false); + + xrect.x = oldRubberRect.x()+oldRubberRect.width()-3; + xrect.y = oldRubberRect.y()+oldRubberRect.height()-3; + xrect.width = 2; + xrect.height = 2; + XClearArea(qt_xdisplay(), rubber->window, xrect.x, xrect.y, xrect.width, xrect.height, false); + + + rubber->updateMask(mask); + + ///////////// painting + + XSetForeground(qt_xdisplay(), gc2, preMultiplyColor(qRgba(fg.red(), fg.green(), fg.blue(),153))); + XDrawRectangle(qt_xdisplay(), rubber->window, gc2, re.x(), re.y(), re.width()-1, re.height()-1); + + // inside + XRectangle xrects[8]; + // top left + xrects[0].x = re.x()+2; + xrects[0].y = re.y()+1; + xrects[0].width = 1; + xrects[0].height = 1; + + xrects[1].x = re.x()+1; + xrects[1].y = re.y()+2; + xrects[1].width = 1; + xrects[1].height = 1; + // top right + xrects[2].x = re.x()+re.width()-3; + xrects[2].y = re.y()+1; + xrects[2].width = 1; + xrects[2].height = 1; + + xrects[3].x = re.x()+re.width()-2; + xrects[3].y = re.y()+2; + xrects[3].width = 1; + xrects[3].height = 1; + // bottom left + xrects[4].x = re.x()+1; + xrects[4].y = re.y()+re.height()-3; + xrects[4].width = 1; + xrects[4].height = 1; + + xrects[5].x = re.x()+2; + xrects[5].y = re.y()+re.height()-2; + xrects[5].width = 1; + xrects[5].height = 1; + // bottom right + xrects[6].x = re.x()+re.width()-2; + xrects[6].y = re.y()+re.height()-3; + xrects[6].width = 1; + xrects[6].height = 1; + + xrects[7].x = re.x()+re.width()-3; + xrects[7].y = re.y()+re.height()-2; + xrects[7].width = 1; + xrects[7].height = 1; + + QColor blendc = qRgba(fg.red(), fg.green(), fg.blue(), 36); + XSetForeground(qt_xdisplay(), gc2, preMultiplyColor(blendColors(_argbRubberBandColor, blendc).rgb())); + XSetClipRectangles(qt_xdisplay(), gc2, 0, 0, xrects, 8, Unsorted); + XDrawRectangle(qt_xdisplay(), rubber->window, gc2, re.x()+1, re.y()+1, re.width()-3, re.height()-3); + + XRectangle xrects2[8]; + // top left + xrects2[0].x = re.x()+2; + xrects2[0].y = re.y(); + xrects2[0].width = 1; + xrects2[0].height = 1; + + xrects2[1].x = re.x()+1; + xrects2[1].y = re.y()+1; + xrects2[1].width = 1; + xrects2[1].height = 1; + + xrects2[2].x = re.x(); + xrects2[2].y = re.y()+2; + xrects2[2].width = 1; + xrects2[2].height = 1; + // top right + xrects2[3].x = re.x()+re.width()-3; + xrects2[3].y = re.y(); + xrects2[3].width = 1; + xrects2[3].height = 1; + + xrects2[4].x = re.x()+re.width()-2; + xrects2[4].y = re.y()+1; + xrects2[4].width = 1; + xrects2[4].height = 1; + + xrects2[5].x = re.x()+re.width()-1; + xrects2[5].y = re.y()+2; + xrects2[5].width = 1; + xrects2[5].height = 1; + // bottom left + xrects2[6].x = re.x()+2; + xrects2[6].y = re.y()+re.height()-1; + xrects2[6].width = 1; + xrects2[6].height = 1; + + xrects2[7].x = re.x()+1; + xrects2[7].y = re.y()+re.height()-2; + xrects2[7].width = 1; + xrects2[7].height = 1; + + xrects2[8].x = re.x(); + xrects2[8].y = re.y()+re.height()-3; + xrects2[8].width = 1; + xrects2[8].height = 1; + // bottom right + xrects2[9].x = re.x()+re.width()-3; + xrects2[9].y = re.y()+re.height()-1; + xrects2[9].width = 1; + xrects2[9].height = 1; + + xrects2[10].x = re.x()+re.width()-2; + xrects2[10].y = re.y()+re.height()-2; + xrects2[10].width = 1; + xrects2[10].height = 1; + + xrects2[11].x = re.x()+re.width()-1; + xrects2[11].y = re.y()+re.height()-3; + xrects2[11].width = 1; + xrects2[11].height = 1; + + + XSetForeground(qt_xdisplay(), gc2, preMultiplyColor(qRgba(fg.red(), fg.green(), fg.blue(), 121))); + XSetClipRectangles(qt_xdisplay(), gc2, 0, 0, xrects2, 12, Unsorted); + XDrawRectangle(qt_xdisplay(), rubber->window, gc2, re.x()+1, re.y()+1, re.width()-3, re.height()-3); + XDrawRectangle(qt_xdisplay(), rubber->window, gc2, re.x(), re.y(), re.width()-1, re.height()-1); + + // outermost pixels + XRectangle xrects3[8]; + // top left + xrects3[0].x = re.x()+1; + xrects3[0].y = re.y(); + xrects3[0].width = 1; + xrects3[0].height = 1; + + xrects3[1].x = re.x(); + xrects3[1].y = re.y()+1; + xrects3[1].width = 1; + xrects3[1].height = 1; + // top right + xrects3[2].x = re.x()+re.width()-2; + xrects3[2].y = re.y(); + xrects3[2].width = 1; + xrects3[2].height = 1; + + xrects3[3].x = re.x()+re.width()-1; + xrects3[3].y = re.y()+1; + xrects3[3].width = 1; + xrects3[3].height = 1; + // bottom left + xrects3[4].x = re.x()+1; + xrects3[4].y = re.y()+re.height()-1; + xrects3[4].width = 1; + xrects3[4].height = 1; + + xrects3[5].x = re.x(); + xrects3[5].y = re.y()+re.height()-2; + xrects3[5].width = 1; + xrects3[5].height = 1; + // bottom right + xrects3[6].x = re.x()+re.width()-2; + xrects3[6].y = re.y()+re.height()-1; + xrects3[6].width = 1; + xrects3[6].height = 1; + + xrects3[7].x = re.x()+re.width()-1; + xrects3[7].y = re.y()+re.height()-2; + xrects3[7].width = 1; + xrects3[7].height = 1; + + XSetForeground(qt_xdisplay(), gc2, preMultiplyColor(qRgba(fg.red(), fg.green(), fg.blue(), 37))); + XSetClipRectangles(qt_xdisplay(), gc2, 0, 0, xrects3, 8, Unsorted); + XDrawRectangle(qt_xdisplay(), rubber->window, gc2, re.x(), re.y(), re.width()-1, re.height()-1); + + XFlush(qt_xdisplay()); + XFreeGC(qt_xdisplay(),gc2); + oldRubberRect = re; + + break; + } + + default: { + return KStyle::drawPrimitive(pe, p, r, cg, flags, opt); + } + } +} + +void DominoStyle::drawControl(ControlElement element, + QPainter *p, + const QWidget *widget, + const QRect &r, + const QColorGroup &cg, + SFlags flags, + const QStyleOption& opt) const +{ + + const bool enabled = (flags & Style_Enabled); + + //return KStyle::drawControl(element, p, widget, r, cg, flags, opt); + + switch (element) { + + case CE_ToolButtonLabel: { + + if(widget->isA("KToolBarButton")) { + DominoKToolBarButton* tb= (DominoKToolBarButton *) widget; + + QStyle::SFlags flags = QStyle::Style_Default; + QStyle::SCFlags active = QStyle::SC_None; + + if (tb->isDown()) { + flags |= QStyle::Style_Down; + active |= QStyle::SC_ToolButton; + } + if (tb->isEnabled()) flags |= QStyle::Style_Enabled; + if (tb->isOn()) flags |= QStyle::Style_On; + if (tb->isEnabled() && tb->hasMouse()) flags |= QStyle::Style_Raised; + if (tb->hasFocus()) flags |= QStyle::Style_HasFocus; + + int dx, dy; + QFont tmp_font(KGlobalSettings::toolBarFont()); + QFontMetrics fm(tmp_font); + QRect textRect; + int textFlags = 0; + + + QPixmap pixmap; + if (tb->iconTextMode() != KToolBar::TextOnly) { + pixmap =tb->iconSet().pixmap( QIconSet::Automatic, + tb->isEnabled() ? (tb->isActive() ? QIconSet::Active : QIconSet::Normal) : + QIconSet::Disabled, + tb->isOn() ? QIconSet::On : QIconSet::Off ); + + QImage img = pixmap.convertToImage(); + if((_toolBtnAsBtn || tb->isToggleButton()) && (tb->isDown() || tb->isOn())) + pixmap = KImageEffect::fade(img, 0.10, black); + else if(tb->isDown() || tb->isOn()) + pixmap = KImageEffect::fade(img, 0.15, black); + else if(_highlightToolBtnIcon && tb->hasMouse() && tb->isEnabled()) + pixmap = KImageEffect::fade(img, 0.25, white); + + } + + QPixmap outlinePixmap = 0; + bool drawOutlinePixmap = false; + if(flags &QStyle::Style_HasFocus && focusIndicatorSettings.indicateFocus && !pixmap.isNull()) { + outlinePixmap = renderOutlineIcon(&pixmap); + drawOutlinePixmap = true; + } + + if (tb->iconTextMode() == KToolBar::IconOnly) // icon only + { + if( !pixmap.isNull()) + { + + dx = ( tb->width() - pixmap.width() ) / 2; + dy = ( tb->height()-1 - pixmap.height() ) / 2; + + if(drawOutlinePixmap) { + p->drawPixmap( dx-1, dy-1, outlinePixmap ); + } + + p->drawPixmap( dx, dy, pixmap ); + } + } + + else if (tb->iconTextMode() == KToolBar::IconTextRight) // icon and text (if any) + { + if( !pixmap.isNull()) + { + dx = 4; + dy = ( tb->height()-1 - pixmap.height() ) / 2; + + if(drawOutlinePixmap) { + p->drawPixmap( dx-1, dy-1, outlinePixmap ); + } + + p->drawPixmap( dx, dy, pixmap ); + } + if (!tb->textLabel().isNull()) + { + textFlags = AlignVCenter|AlignLeft; + if (!pixmap.isNull()) + dx = 4 + pixmap.width() + 2; + else + dx = 4; + dy = 0; + + textRect = QRect(dx, dy, tb->width()-dx, tb->height()-1); + } + } + else if (tb->iconTextMode() == KToolBar::TextOnly) + { + if (!tb->textLabel().isNull()) + { + textFlags = AlignVCenter|AlignLeft; + dx = (tb->width() - fm.width(tb->textLabel())) / 2; + dy = (tb->height()-1 - fm.lineSpacing()) / 2; + + textRect = QRect( dx, dy, fm.width(tb->textLabel()), fm.lineSpacing() ); + } + } + else if (tb->iconTextMode() == KToolBar::IconTextBottom) + { + if( !pixmap.isNull()) + { + dx = (tb->width() - pixmap.width()) / 2; + dy = (tb->height()-1 - fm.lineSpacing() - pixmap.height()) / 2; + + if(drawOutlinePixmap) { + p->drawPixmap( dx-1, dy-1, outlinePixmap ); + } + + p->drawPixmap( dx, dy, pixmap ); + } + + if (!tb->textLabel().isNull()) + { + textFlags = AlignBottom|AlignHCenter; + dx = (tb->width() - fm.width(tb->textLabel())) / 2; + dy = tb->height()-1 - fm.lineSpacing() - 4; + + textRect = QRect( dx, dy, fm.width(tb->textLabel()), fm.lineSpacing() ); + } + } + if (!tb->textLabel().isNull() && !textRect.isNull()) + { + p->setFont(KGlobalSettings::toolBarFont()); + QColor pencolor; + if (!tb->isEnabled()) + pencolor = tb->palette().disabled().dark(); + // replaced through icon highlights +// else if(tb->isRaised()) +// pencolor = KGlobalSettings::toolBarHighlightColor(); + else + pencolor = tb->colorGroup().buttonText(); + + dominoDrawItem( p, textRect, textFlags, cg, enabled, 0, tb->textLabel(), -1, &pencolor, textEffectSettings.mode > 0 ? 1 : 0); + } + } + else { // QToolButton - bye bye win95 iconset mode :) + + const QToolButton *toolbutton = (const QToolButton *) widget; + QRect rect = r; + Qt::ArrowType arrowType = opt.isDefault() ? Qt::DownArrow : opt.arrowType(); + + if (!opt.isDefault()) { + PrimitiveElement pe; + switch (arrowType) { + case Qt::LeftArrow: pe = PE_ArrowLeft; break; + case Qt::RightArrow: pe = PE_ArrowRight; break; + case Qt::UpArrow: pe = PE_ArrowUp; break; + default: + case Qt::DownArrow: pe = PE_ArrowDown; break; + } + + drawPrimitive(pe, p, rect, cg, flags, opt); + } + else { + + QColor btext = toolbutton->paletteForegroundColor(); + + if (toolbutton->iconSet().isNull() && ! toolbutton->text().isNull() && ! toolbutton->usesTextLabel()) { + int alignment = AlignCenter | ShowPrefix; + if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0)) + alignment |= NoAccel; + dominoDrawItem( p, rect, alignment, cg, enabled, 0, toolbutton->text(), toolbutton->text().length(), &btext, textEffectSettings.mode > 0 ? 1 : 0); + } + else { + QPixmap pm; + QIconSet::Size size = toolbutton->usesBigPixmap() ? QIconSet::Large : QIconSet::Small; + QIconSet::State state = toolbutton->isOn() ? QIconSet::On : QIconSet::Off; + QIconSet::Mode mode; +/* if (!toolbutton->isEnabled()) + mode = QIconSet::Disabled; + else*/ if (flags & (Style_Down | Style_On) || (flags & Style_Raised) && (flags & Style_AutoRaise)) + mode = QIconSet::Active; + else + mode = QIconSet::Normal; + + pm = toolbutton->iconSet().pixmap( size, mode, state ); + + if(!toolbutton->isEnabled()) + pm = disableIcon(&pm); + + QImage img = pm.convertToImage(); + if((_toolBtnAsBtn || toolbutton->isToggleButton()) && (toolbutton->isDown() || toolbutton->isOn())) + pm = KImageEffect::fade(img, 0.10, black); + else if(toolbutton->isDown() || toolbutton->isOn()) + pm = KImageEffect::fade(img, 0.15, black); + else if(_highlightToolBtnIcon && toolbutton->hasMouse() && toolbutton->isEnabled()) + pm = KImageEffect::fade(img, 0.25, white); + + QPixmap outlinePixmap = 0; + bool drawOutlinePixmap = false; + if(flags &QStyle::Style_HasFocus && focusIndicatorSettings.indicateFocus) { + outlinePixmap = renderOutlineIcon(&pm); + drawOutlinePixmap = true; + } + + if ( toolbutton->usesTextLabel() ) { + p->setFont( toolbutton->font() ); + QRect pr = rect, tr = rect; + int alignment = ShowPrefix; + if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0)) + alignment |= NoAccel; + + if ( toolbutton->textPosition() == QToolButton::Under ) { + int fh = p->fontMetrics().height(); + pr.addCoords( 0, 1, 0, -fh-3 ); + tr.addCoords( 0, pr.bottom(), 0, -3 ); + + if(drawOutlinePixmap) + drawItem( p, pr, AlignCenter, cg, TRUE, &outlinePixmap, QString::null ); + + drawItem( p, pr, AlignCenter, cg, TRUE, &pm, QString::null ); + alignment |= AlignCenter; + } else { + pr.setWidth( pm.width() + 8 ); + tr.addCoords( pr.right(), 0, 0, 0 ); + + if(drawOutlinePixmap) + drawItem( p, pr, AlignCenter, cg, TRUE, &outlinePixmap, QString::null ); + + drawItem( p, pr, AlignCenter, cg, TRUE, &pm, QString::null ); + alignment |= AlignLeft | AlignVCenter; + } + dominoDrawItem( p, tr, alignment, cg, enabled, 0, toolbutton->textLabel(), toolbutton->textLabel().length(), &btext, textEffectSettings.mode > 0 ? 1 : 0); + } + else { + if(drawOutlinePixmap) + drawItem( p, rect, AlignCenter, cg, TRUE, &outlinePixmap, QString::null ); + + drawItem( p, rect, AlignCenter, cg, TRUE, &pm, QString::null ); + } + } + } + } + break; + } + + // PROGRESSBAR + // ----------- + case CE_ProgressBarGroove: { + drawPrimitive(PE_Panel, p, r, cg, flags, opt); + break; + } + + case CE_ProgressBarContents: { + + const QProgressBar *pb = dynamic_cast(widget); + int steps = pb->totalSteps(); + + const QColor bg = enabled? cg.base(): cg.background(); // background + const QColor fg = cg.background(); + bool reverseLayout = QApplication::reverseLayout(); + + QPixmap* prBgShadow; + + int h, s, v, bv; + bg.getHsv(&h, &s, &v); + cg.background().getHsv(&h, &s, &bv); + int diff = KMAX(v-bv, 0); + + // if we don't adjust the shadow to the background, it will look strange + QColor tintColor = alphaBlendColors(Qt::black, bg, diff+30); + + if(!(prBgShadow = QPixmapCache::find(QString::number(bg.pixel(), 16)+QString::number(cg.background().pixel(), 16)+"prBgShadow"))) { + prBgShadow = new QPixmap(4,4); + prBgShadow->fill(bg); + QPainter painter(prBgShadow); + painter.drawPixmap(0, 0, tintImage(qembed_findImage("progressShadow2"), tintColor)); + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(cg.background().pixel(), 16)+"prBgShadow", prBgShadow); + } + + QRect surface; + QRect rightBg; + QRect leftBg; + p->setClipRegion(r); + + + if( steps == 0 ) { // Busy indicator + static const int barWidth = 10; + int progress = pb->progress() % (2*(r.width()-barWidth)); + if( progress < 0) + progress = 0; + if( progress > r.width()-barWidth ) + progress = (r.width()-barWidth)-(progress-(r.width()-barWidth)); + + surface = QRect(reverseLayout? r.right()-progress+1: r.x()+progress+1, r.top(), barWidth-2, r.height()); + rightBg = reverseLayout ? QRect(r.x(), r.y(), r.width()-(progress-1), r.height()) : + QRect(r.x()+progress+barWidth-1, r.y(), r.width()-(progress+barWidth-1), r.height()); + + if(rightBg.width()+surface.width() < r.width()) { + leftBg = reverseLayout ? QRect(rightBg.width()+surface.width(), r.y(), r.width()-(rightBg.width()+surface.width()-2), r.height()) : + QRect(r.x(), r.y(), r.x()+progress+1, r.height()); + } + } + else { + double percent = static_cast(pb->progress()) / static_cast(steps); + int w = static_cast(r.width() * percent); + if(w < 0) + w = 0; + int w2 = r.width()-(r.width()-w); + rightBg = QRect(reverseLayout? r.left(): r.left()+w, r.top(), r.width()-w, r.height()); + surface = QRect(reverseLayout? r.right()-w2+1: r.left(), r.top(), w2, r.height()); + } + + + + QPixmap* surfaceTile; + if(!(surfaceTile = QPixmapCache::find("prTile"+QString::number(surface.height())+QString::number(bg.pixel(), 16)))) { + surfaceTile = new QPixmap(20, surface.height()); + QPainter tilePainter(surfaceTile); + + flatMode=true; + renderSurface(&tilePainter, QRect(0, 0, 20, surface.height()), fg, cg.background(), fg , Is_Button|Is_Horizontal); + flatMode=false; + + QPixmap pix = qembed_findImage("progressTile"); + tilePainter.drawTiledPixmap(0,0, 20, surface.height(), pix); + + QPixmapCache::insert("prTile"+QString::number(surface.height())+QString::number(bg.pixel(), 16), surfaceTile); + } + + + int staticShift = 0; + int animShift = 0; + + // find the animation Offset for the current Widget + QWidget* nonConstWidget = const_cast(widget); + QMapConstIterator iter = progAnimWidgets.find(nonConstWidget); + if (iter != progAnimWidgets.end()) + animShift = iter.data(); + + int counter = 0; + while(counter < (surface.width()+20)) { + counter += 20; + if (reverseLayout) { + p->drawPixmap(surface.right()-counter+animShift+staticShift+1, r.top(), *surfaceTile); + } + else { + p->drawPixmap(surface.left()+counter-20-animShift+staticShift, r.top(), *surfaceTile); + } + } + + + // empty area + + QColor color_d = alphaBlendColors(tintColor, bg, 170); + QColor color_m = alphaBlendColors(tintColor, bg, 85); + QColor color_l = alphaBlendColors(tintColor, bg, 25); + + if(leftBg.isValid()) { + p->setClipRegion(leftBg); + p->fillRect(leftBg, bg); + + p->setPen(color_d); + p->drawLine(leftBg.x()+2, leftBg.y(), leftBg.right()-2, leftBg.y()); + p->setPen(color_m); + p->drawLine(leftBg.x()+2, leftBg.y()+1, leftBg.right()-2, leftBg.y()+1); + p->setPen(color_l); + p->drawLine(leftBg.x()+2, leftBg.y()+2, leftBg.right()-2, leftBg.y()+2); + p->drawLine(leftBg.x()+2, leftBg.bottom(), leftBg.right()-2, leftBg.bottom()); + + //p->setPen(color_l); + p->drawLine(leftBg.x()+1, leftBg.y()+3, leftBg.x()+1, leftBg.bottom()-1); // l + p->drawLine(leftBg.right()-1, leftBg.y()+3, leftBg.right()-1, leftBg.bottom()-1); // r + + p->setPen(color_m); + p->drawLine(leftBg.x(), leftBg.y()+3, leftBg.x(), leftBg.bottom()-1); // l + p->drawLine(leftBg.right(), leftBg.y()+3, leftBg.right(), leftBg.bottom()-1); // r + + p->drawPixmap(leftBg.right()-1, leftBg.y(), *prBgShadow, 2, 0, 2, 3); // tr + p->drawPixmap(leftBg.x(), leftBg.y(), *prBgShadow, 0, 0, 2, 3); + p->drawPixmap(leftBg.right()-1, leftBg.bottom(), *prBgShadow, 2, 3, 2, 1); // br + p->drawPixmap(leftBg.x(), leftBg.bottom(), *prBgShadow, 0, 3, 2, 1); + } + + p->setClipRegion(rightBg); + p->fillRect(rightBg, bg); + + p->setPen(color_d); + p->drawLine(rightBg.x()+2, rightBg.y(), rightBg.right()-2, rightBg.y()); + p->setPen(color_m); + p->drawLine(rightBg.x()+2, rightBg.y()+1, rightBg.right()-2, rightBg.y()+1); + p->setPen(color_l); + p->drawLine(rightBg.x()+2, rightBg.y()+2, rightBg.right()-2, rightBg.y()+2); + p->drawLine(rightBg.x()+2, rightBg.bottom(), rightBg.right()-2, rightBg.bottom()); + + //p->setPen(color_l); + p->drawLine(rightBg.x()+1, rightBg.y()+3, rightBg.x()+1, rightBg.bottom()-1); // l + p->drawLine(rightBg.right()-1, rightBg.y()+3, rightBg.right()-1, rightBg.bottom()-1); // r + + p->setPen(color_m); + p->drawLine(rightBg.x(), rightBg.y()+3, rightBg.x(), rightBg.bottom()-1); // l + p->drawLine(rightBg.right(), rightBg.y()+3, rightBg.right(), rightBg.bottom()-1); // r + + + p->drawPixmap(rightBg.right()-1, rightBg.y(), *prBgShadow, 2, 0, 2, 3); // tr + p->drawPixmap(rightBg.x(), rightBg.y(), *prBgShadow, 0, 0, 2, 3); + p->drawPixmap(rightBg.right()-1, rightBg.bottom(), *prBgShadow, 2, 3, 2, 1); // br + p->drawPixmap(rightBg.x(), rightBg.bottom(), *prBgShadow, 0, 3, 2, 1); + + if(rightBg.width() == 2) { // must overpaint two lighter pixel + p->drawPixmap(rightBg.right(), rightBg.y()+2, *prBgShadow, 0, 3, 1, 1); // br + p->drawPixmap(rightBg.right(), rightBg.bottom(), *prBgShadow, 0, 3, 1, 1); // br + } + + p->setClipping(false); + + break; + } + case CE_ProgressBarLabel: { + const QProgressBar *progressbar = (const QProgressBar *) widget; + QFont font = p->font(); + font.setBold(false); + p->setFont(font); + p->setPen(cg.buttonText()); + //p->drawText(r, AlignCenter | SingleLine, progressbar->progressString()); + dominoDrawItem( p, r, AlignCenter | SingleLine, cg, false, 0, progressbar->progressString(), -1,&cg.buttonText(), false); + break; + } + + case CE_CheckBox: { + + QColorGroup g = cg; + if(!khtmlWidgets.contains(widget)) + g.setColor(QColorGroup::Button, qApp->palette().active().background()); + + QPixmap insidePix = qembed_findImage("checkbox2inside"); + QPainter painter(&insidePix); + renderSurface(&painter, QRect(3, 0, 14, 19), g.background(), g.button(), g.button(), Is_CheckItem); + painter.end(); + QImage inside = insidePix.convertToImage(); + + QImage checkbox; + QImage shadow = qembed_findImage("checkbox2shadow"); + QImage circle = tintImage(qembed_findImage("checkbox2rect"), buttonContour->contourColor(Contour_Default)); + blend(shadow, inside, checkbox); + blend(circle, checkbox, checkbox); + + if(flags&Style_Down) { + QImage pressed = tintImage(qembed_findImage("checkbox2pressed"), buttonContour->contourColor(Contour_Pressed)); + blend(pressed, checkbox, checkbox); + } + + QPixmap pix = QPixmap(checkbox); + if(flags&Style_On || flags&Style_NoChange) { + painter.begin(&pix); + drawPrimitive(PE_CheckMark, &painter, r, cg, flags); + painter.end(); + } + + p->drawPixmap(r.left(), r.top(), pix); + break; + } + + case CE_CheckBoxLabel: { + const QCheckBox *cb = (const QCheckBox *) widget; + + int alignment = QApplication::reverseLayout() ? AlignRight : AlignLeft; + if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0)) + alignment |= NoAccel; + + QRect re = focusIndicatorSettings.drawUnderline ? subRect(SR_CheckBoxFocusRect, cb) : r; + + if (flags& Style_HasFocus && focusIndicatorSettings.indicateFocus) + drawFocusIndicator(p, re, alignment | AlignVCenter |ShowPrefix, cg, flags & Style_Enabled, cb->pixmap(), cb->text(), -1, focusIndicatorSettings.color, focusIndicatorSettings.drawUnderline); + + drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, + flags & Style_Enabled, cb->pixmap(), cb->text()); + break; + } + + // RADIOBUTTONS + // ------------ + case CE_RadioButton: { + QColorGroup g = cg; + if(!khtmlWidgets.contains(widget)) + g.setColor(QColorGroup::Button, qApp->palette().active().background()); + + QString down = flags& Style_Down ? "1" : "0"; + + QPixmap* radio; + if((flags & Domino_noCache) || !(radio = QPixmapCache::find("tabEdges"+down))) { + QImage radioImg; + + QPixmap insidePix = qembed_findImage("radio3inside"); + QPainter painter(&insidePix); + renderSurface(&painter, QRect(r.left(), r.top(), r.width(), r.height()+1), g.background(), g.button(), g.background(), Is_CheckItem); + QImage inside = insidePix.convertToImage(); + + QImage shadow = qembed_findImage("radio3shadow"); + QImage circle = tintImage(qembed_findImage("radio3circle"), buttonContour->contourColor(Contour_Default)); + blend(shadow, inside, inside); + blend(circle, inside, radioImg); + + if(flags&Style_Down) { + QImage pressed = tintImage(qembed_findImage("radio3pressed"), buttonContour->contourColor(Contour_Default)); + blend(pressed, radioImg, radioImg); + } + + radio = new QPixmap(radioImg); + if(!(flags & Domino_noCache)) + QPixmapCache::insert("radio"+down, radio); + + } + + if(flags & Style_On) { + if(flags & Style_Enabled) + bitBlt(radio, 6, 6, radioIndicator, 0, 0, 5, 5); + else + bitBlt(radio, 6, 6, radioIndicator, 5, 0, 5, 5); + } + + bitBlt(p->device(), r.x(), r.y(), radio); + break; + } + + case CE_RadioButtonLabel: { + const QRadioButton *radiobutton = (const QRadioButton *) widget; + + int alignment = QApplication::reverseLayout() ? AlignRight : AlignLeft; + if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0)) + alignment |= NoAccel; + + QRect re = focusIndicatorSettings.drawUnderline ? subRect(SR_RadioButtonFocusRect, radiobutton) : r; + + if (flags& Style_HasFocus && focusIndicatorSettings.indicateFocus) + drawFocusIndicator(p, re, alignment | AlignVCenter |ShowPrefix, cg, flags & Style_Enabled, radiobutton->pixmap(), radiobutton->text(), -1, focusIndicatorSettings.color, focusIndicatorSettings.drawUnderline); + + drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, + flags & Style_Enabled, radiobutton->pixmap(), radiobutton->text()); + + break; + } + + // TABS + // ---- + case CE_TabBarTab: { + + QTabBar * tb = (QTabBar *) widget; + + bool konqTab = false; + bool kickoffTab = false; + if(tb->parentWidget()) { + const QWidget* w = tb->parentWidget(); + if(w->isA("KonqFrameTabs")) + konqTab = true; + else if(!strcmp(w->name(), "SUSE::Kickoff::KMenu")) + kickoffTab = true; + } + + QTabBar::Shape tbs = tb->shape(); + bool selected = false; + bool reverseLayout = QApplication::reverseLayout(); + if (flags & Style_Selected) selected = true; + TabPosition pos; + if (tb->count() == 1) { + pos = Single; + } else if ((tb->indexOf(opt.tab()->identifier()) == 0)) { + pos = reverseLayout?Last:First; + } else if (tb->indexOf(opt.tab()->identifier()) == tb->count() - 1) { + pos = reverseLayout?First:Last; + } else { + pos = Middle; + } + + switch (tbs) { + case QTabBar::TriangularAbove: + renderTab(p, r, cg, (flags & Style_MouseOver), selected, false, pos, true, false, konqTab); + break; + case QTabBar::RoundedAbove: + renderTab(p, r, cg, (flags & Style_MouseOver), selected, false, pos, false, false, konqTab); + break; + case QTabBar::TriangularBelow: + renderTab(p, r, cg, (flags & Style_MouseOver), selected, true, pos, true, false, konqTab); + break; + case QTabBar::RoundedBelow: + renderTab(p, r, cg, (flags & Style_MouseOver), selected, true, pos, false, false, konqTab); + break; + default: + KStyle::drawControl(element, p, widget, r, cg, flags, opt); + } + + // Qt3 uses this painter to draw the iconSet between CE_TabBarTab and CE_TabBarLabel. If we clip the painter here + // we will have a clean area to draw the icon at the right position in CE_TabBarLabel. + if(!kickoffTab) + p->setClipRect(QRect()); + break; + } + + case CE_PushButton: { + + QPushButton *button = (QPushButton *)widget; + bool khtmlMode = khtmlWidgets.contains(button); + bool isDefault = enabled && button->isDefault(); + bool isHoverWidget = enabled && button == hoverWidget; + bool isSunken = flags & Style_On || flags & Style_Down; + + uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; + uint surfaceFlags = Is_Button|Is_Horizontal; + flatMode = button->isFlat(); + + QColor bg; + if(!khtmlMode && !button->paletteBackgroundPixmap()) { + + if(dynamic_cast(button->parentWidget())) { + bg = button->parentWidget()->paletteBackgroundColor(); + } + else { + bg = cg.background(); + } + + p->fillRect(QRect(r.x(), r.y(), 6, 6), bg); + p->fillRect(QRect(r.width()-6, r.y(), 6, 6), bg); + p->fillRect(QRect(r.width()-6, r.height()-7, 6,7), bg); + p->fillRect(QRect(r.x(), r.height()-7, 6, 7), bg); + } + else { + buttonContour->setAlphaMode(); + contourFlags|=Draw_AlphaBlend; + } + if(khtmlMode) contourFlags|=Draw_AlphaBlend; + if(!enabled) { + contourFlags|=Is_Disabled; + surfaceFlags|=Is_Disabled; + } + if(isSunken) { + surfaceFlags|=Is_Down; + contourFlags|=Is_Down; + } + + if(button->isDown()) + buttonContour->setState(Contour_Pressed); + else if(isHoverWidget) + buttonContour->setState(Contour_MouseOver); + else if(isDefault) + buttonContour->setState(Contour_DefaultButton); + + if(!flatMode) { + renderSurface(p, QRect(r.x()+2, r.y()+2, r.width()-4, r.height()-5), cg.background(), cg.button(), cg.button(), surfaceFlags); + + contourFlags |= Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight|Is_Button|Is_Horizontal; + renderContour(p, r, bg, cg.button(), contourFlags); + + if(isSunken) { + renderButtonShadow(p, QRect(r.x()+2, r.y()+2, r.width()-2, r.height()-3), contourFlags); + } + } + else { + renderSurface(p, QRect(r.x()-3, r.y()-1, r.width()+6, r.height()+2), cg.background(), cg.button(), cg.button(), surfaceFlags); + + QColor contourColor = alphaBlendColors(buttonContour->contourColor(buttonContour->state), cg.background(), 179); + p->setPen(contourColor); + if(dynamic_cast(button)) { + + const QWidget* parent = button->parentWidget(); + bool horizontal = parent->width() >= parent->height(); + + KMultiTabBar* tabBar = static_cast(widget->parentWidget()->parentWidget()->parentWidget()->parentWidget()); + + KMultiTabBarTab* tab; + QPtrList* list = tabBar->tabs(); + for(tab = list->first(); tab; tab = list->next()) { + if(horizontal && tab->x()+tab->width() == widget->x()) + break; + else if(tab->y()+tab->height() == widget->y()) + break; + } + + if(tab) { + QPainter painter(tab); + painter.setPen(contourColor); + QRect re = tab->rect(); + if(horizontal) + painter.drawLine(re.right(), re.y(), re.right(), re.bottom()); // right lines + else + painter.drawLine(re.x(), re.bottom(), re.right(), re.bottom()); + } + + if(horizontal) { + if(button->x() == parent->x()) + p->drawLine(r.x(), r.y(), r.x(), r.bottom()); // first left line + p->drawLine(r.right(), r.y(), r.right(), r.bottom()); // right lines + } + else { + if(button->y() == parent->y()) + p->drawLine(r.right(), r.y(), r.right(), r.bottom()); + p->drawLine(r.x(), r.y(), r.x(), r.bottom()); + } + // middle lines + p->drawLine(r.x(), r.y(), r.right(), r.y()); + p->drawLine(r.x(), r.bottom(), r.right(), r.bottom()); + +// if(isSunken) { +// contourFlags = Draw_Top|Draw_Left|Draw_Right|Draw_Bottom|Rectangular_UpperLeft|Rectangular_UpperRight|Rectangular_BottomLeft|Rectangular_BottomRight; +// renderButtonShadow(p, QRect(r.x()-1, r.y()-1, r.width()+5, r.height()+2), contourFlags); +// renderButtonShadow(p, re), contourFlags); +// } + + + } + else { + p->drawRect(r); + } + flatMode = false; + } + + buttonContour->reset(); + break; + } + + case CE_PushButtonLabel: + { + + int x, y, w, h; + r.rect( &x, &y, &w, &h ); + + const QPushButton* button = static_cast( widget ); + bool cornArrow = false; + bool hasFocus = button->hasFocus(); + + p->setPen(button->colorGroup().buttonText()); + + // Does the button have a popup menu? + if ( button->popup() ) + { + int dx = pixelMetric( PM_MenuButtonIndicator, widget ); + if ( button->iconSet() && !button->iconSet()->isNull() && + (dx + button->iconSet()->pixmap (QIconSet::Small, QIconSet::Normal, QIconSet::Off ).width()) >= w ) + { + cornArrow = true; //To little room. Draw the arrow in the corner, don't adjust the widget + } + else + { + drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - dx - 8, y + 3, dx, h - 3), r ), cg, flags, opt ); + w -= dx; + } + } + + + // Draw the icon if there is one + if ( button->iconSet() && !button->iconSet()->isNull() ) + { + QIconSet::Mode mode = QIconSet::Disabled; + QIconSet::State state = QIconSet::Off; + + if (button->isEnabled()) + mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + if (button->isToggleButton() && button->isOn()) + state = QIconSet::On; + + QPixmap pixmap = button->iconSet()->pixmap( QIconSet::Small, mode, state ); + bool focusIcon = hasFocus && focusIndicatorSettings.indicateFocus && !focusIndicatorSettings.drawUnderline; + int pw = pixmap.width(); + + if(button->text().isEmpty()) { + int bpw = button->pixmap() ? button->pixmap()->width() : 0; + if(focusIcon) { + QPixmap outlinePixmap = renderOutlineIcon(&pixmap); + p->drawPixmap( x + (w - bpw -outlinePixmap.width())/2, y + (h - outlinePixmap.height())/ 2, outlinePixmap ); + } + p->drawPixmap( x + (w - bpw - pw)/2, y + (h- pixmap.height()) / 2, pixmap ); + } + else { + int cw = p->fontMetrics().size(Qt::ShowPrefix, button->text()).width()+pw; + if(focusIcon) { + QPixmap outlinePixmap = renderOutlineIcon(&pixmap); + p->drawPixmap( x + (w - cw)/2 - 1 , y + (h - outlinePixmap.height())/ 2, outlinePixmap ); + } + p->drawPixmap( x + (w - cw)/2 , y + (h - pixmap.height())/ 2, pixmap ); + + } + + if (cornArrow) //Draw over the icon + drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - 6, x + h - 6, 7, 7), r ), cg, flags, opt ); + + x += pw + 4; + w -= pw + 4; + } + + QRect re = focusIndicatorSettings.drawUnderline ? subRect(SR_PushButtonFocusRect, button) : QRect(x, y, w, h); + + if(hasFocus && focusIndicatorSettings.indicateFocus && !button->text().isNull()) + drawFocusIndicator(p, re, AlignCenter|ShowPrefix, cg, button->isEnabled(), 0, button->text(), -1, focusIndicatorSettings.buttonColor, focusIndicatorSettings.drawUnderline, true); + + QPixmap buttonPixmap; + if(button->pixmap()) { + if(!enabled) + buttonPixmap = disableIcon(button->pixmap()); + else + buttonPixmap = *button->pixmap(); + } + dominoDrawItem( p, QRect(x, y, w, h), AlignCenter|ShowPrefix, button->colorGroup(), + enabled, button->pixmap() ? &buttonPixmap : 0, button->text(), -1, &button->colorGroup().buttonText(), textEffectSettings.mode > 0 ? 1 : 0 ); + + break; + } + case CE_TabBarLabel: { + p->setClipping(false); // was set in CE_TabBarTab to clip the icon drawing + + if ( opt.isDefault() ) + break; + const QTabBar * tb = (const QTabBar *) widget; + QTab * t = opt.tab(); + bool konqTab = false; + bool kickoffTab = false; + int shift, cshift; + + switch (tb->shape()) { + case QTabBar::RoundedAbove: + shift = 4; + cshift = 3; + break; + case QTabBar::RoundedBelow: + if((konqTab = tb->parentWidget() && tb->parentWidget()->isA("KonqFrameTabs")) || + (kickoffTab = tb->parentWidget() && !strcmp(tb->parentWidget()->name(), "SUSE::Kickoff::KMenu"))) { + shift = 0; + cshift = 0; + } + else { + shift = -3; + cshift = -1; + } + break; + case QTabBar::TriangularAbove: + shift = 4; + cshift = 3; + break; + case QTabBar::TriangularBelow: + shift = -5; + cshift = -3; + break; + default: + shift = 0; + cshift = 0; + } + + QRect tr = r; + bool currentTab = t->identifier() == tb->currentTab(); + if (!currentTab) + tr.setTop( tr.top() +shift ); + else + tr.setTop( tr.top() +cshift ); + + int alignment = AlignCenter | ShowPrefix; + + if (flags& Style_HasFocus && focusIndicatorSettings.indicateFocus && !t->text().isEmpty()) + drawFocusIndicator(p, QRect(tr.x(), tr.y(), tr.width(), tr.height()), alignment, cg, flags & Style_Enabled, 0, t->text(), -1, focusIndicatorSettings.buttonColor, focusIndicatorSettings.drawUnderline, true); + + if(t->iconSet() && !tb->isA("KickoffTabBar")) { + bool enabled = t->isEnabled() && tb->isEnabled(); + QPixmap pixmap; + + if(!KApplicationMode) { + QIconSet::Mode mode = (t->identifier() && tb->keyboardFocusTab()) ? QIconSet::Active : QIconSet::Normal; + pixmap = t->iconSet()->pixmap( QIconSet::Small, mode ); + if(!enabled) + pixmap = disableIcon(&pixmap); + } + else { + QIconSet::Mode mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + if ( mode == QIconSet::Normal && (t->identifier() && tb->keyboardFocusTab()) ) + mode = QIconSet::Active; + pixmap = t->iconSet()->pixmap( QIconSet::Small, mode ); + } + + int pixw = pixmap.width(); + int pixh = pixmap.height(); + QRect ir = r; + ir.setLeft( tr.left() - pixw - 4 ); + ir.setRight( tr.right() - 2 ); + int yoff = 0; + if(!currentTab) { + yoff = pixelMetric(QStyle::PM_TabBarTabShiftVertical, tb); + } + + switch(tb->shape()) { + case QTabBar::RoundedAbove: + case QTabBar::TriangularAbove: + ir.setHeight(ir.height()+4); + break; + default: + if(!konqTab) + ir.setHeight(ir.height()-2); + } + + p->drawPixmap( ir.left() + 2, ir.center().y()-pixh/2+ yoff, pixmap ); + } + + QColor textColor = cg.foreground(); + if(konqTab) + textColor = cg.foreground() != tb->palette().active().foreground() ? cg.foreground() : tb->palette().active().foreground(); + else if(konsoleMode) + textColor = tb->palette().active().foreground(); + + dominoDrawItem( p, tr, alignment, cg, flags & Style_Enabled, 0, t->text(), -1, &textColor/*&cg.foreground()*/, textEffectSettings.mode > 0 ? 1 : 0); + break; + } + + case CE_MenuBarItem: { + + bool active = flags & Style_Active; + bool focused = flags & Style_HasFocus; + bool down = flags & Style_Down; + + if (active && focused) { + + if(!macStyleBar) + p->fillRect(r, cg.background()); // gtk-qt engine fix + + QColor c = down ? dGetColor(cg.background(), 15) : dGetColor(cg.background(), 25); + + p->fillRect(QRect(r.left()+3,r.y()+1, r.width()-7, r.height()), c); + p->fillRect(QRect(r.left(),r.top()+4, 3, r.height()-7), c); + p->fillRect(QRect(r.right()-3, r.y()+4, 3, r.height()-7), c); + + QPixmap pix = tintImage(qembed_findImage("menuItem"), c); + p->drawPixmap(r.left(),r.y()+1, pix, 0, 0, 3, 3); + p->drawPixmap(r.left(),r.bottom()-2, pix, 0, 3, 3, 3); + p->drawPixmap(r.right()-3,r.y()+1, pix, 3, 0, 3, 3); + p->drawPixmap(r.right()-3,r.bottom()-2, pix, 3, 3, 3, 3); + } + + p->setPen(cg.foreground() ); + drawItem(p, r, AlignVCenter | AlignHCenter | ShowPrefix | DontClip | SingleLine, cg, true, 0, + opt.menuItem()->text(), -1, &cg.foreground() ); + break; + } + + // POPUPMENU ITEM (highlighted on mouseover) + // ------------------------------------------ + case CE_PopupMenuItem: { + + const QPopupMenu *popupmenu = static_cast< const QPopupMenu * >( widget ); + QMenuItem *mi = opt.menuItem(); + + if ( !mi ) + break; + + bool checked = popupmenu->isCheckable() && mi->isChecked(); + int tab = opt.tabWidth(); + int maxpmw = mi->iconSet() || _indentPopupMenuItems ? opt.maxIconWidth() : 0; + int cmwidth = _indentPopupMenuItems ? maxpmw ? 0 : 12 : 16; // checkmark, visible 10 + if(!_indentPopupMenuItems && checked) + maxpmw += cmwidth-1; + bool enabled = mi->isEnabled(); + bool active = flags & Style_Active; + bool reverse = QApplication::reverseLayout(); + bool separator = mi->isSeparator(); + + + QColor color; + if(separator || (active && enabled)) { + + color = separator ? dGetColor(_popupMenuColor, 20) : _selMenuItemColor; + float val = 0; + int ph = popupmenu->rect().height()/2; + int part = separator ? QMAX(1, ph/r.y()+r.height()) : QMAX(1, ph/r.height()); + + if(_drawPopupMenuGradient) { + if(r.y()+r.height()/2 < ph) { + for( int i=r.y(); i < ph; i += part) { + val += 0.5; + } + color = lightenColor(color, (int)val); + } + else { + for( int i=0; i < r.y()-ph; i += part) { + val += 0.5; + } + color = darkenColor(color, (int)val); + } + } + } + + + + // Draw the menu item background + if (active) { + if (enabled) { + QColor c = color; + p->fillRect(QRect(r.x()+3, r.y(), r.width()-6, r.height()), c); + p->fillRect(QRect(r.x(), r.y()+3, 3, r.height()-6), c); + p->fillRect(QRect(r.x()+r.width()-3, r.y()+3, 3, r.height()-6), c); + + QPixmap pix = tintImage(qembed_findImage("menuItem"), c); + bitBlt(p->device(), r.x(), r.y(), &pix, 0, 0, 3, 3, Qt::CopyROP); + bitBlt(p->device(), r.x(), r.bottom()-2, &pix, 0, 3, 3, 3, Qt::CopyROP); + bitBlt(p->device(), r.x()+r.width()-3, r.y(), &pix, 3, 0, 3, 3, Qt::CopyROP); + bitBlt(p->device(), r.x()+r.width()-3, r.bottom()-2, &pix, 3, 3, 3, 3, Qt::CopyROP); + + } + } + + // Are we a menu item separator? + if(separator) { + p->setPen(color); + p->drawLine(r.x(), r.y()+2, r.right(), r.y()+2); + break; + } + + if(checked) { + // We only have to draw the background if the menu item is inactive - + // if it's active the "pressed" background is already drawn + QRect cmr = visualRect( QRect( r.x()+itemFrame , r.y() + 1, QMIN(QMAX(maxpmw, cmwidth), r.height() - 2), r.height() - 2 ), r ); + + // Draw the checkmark + SFlags cflags = Style_On; + if (enabled) + cflags |= Style_Enabled; + + if(reverse && _indentPopupMenuItems) + drawPrimitive( PE_CheckMark, p, QRect(cmr.x() + (maxpmw ? (maxpmw-16)/2-4 : -1), cmr.y(), cmr.width(), cmr.height()), cg, cflags ); + else if(_indentPopupMenuItems) + drawPrimitive( PE_CheckMark, p, QRect(cmr.x() + (maxpmw ? (maxpmw-16)/2-3 : -6), cmr.y(), cmr.width(), cmr.height()), cg, cflags ); + else + drawPrimitive( PE_CheckMark, p, QRect(reverse ? cmr.x()+cmr.width()-15 : cmr.x()-3, cmr.y(), cmr.width(), cmr.height()), cg, cflags ); + + + + } + if(!(_indentPopupMenuItems && checked) && mi->iconSet()) { + QRect cr = visualRect( QRect( (reverse ? r.x()-2 : r.x()) + itemFrame, r.y() + 1, maxpmw -1 , r.height() - 2 ), r ); + QIconSet::Mode mode; + + // Select the correct icon from the iconset + QPixmap pixmap; + if(KApplicationMode) { + if (active) + mode = enabled ? QIconSet::Active : QIconSet::Disabled; + else + mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); + } + else { + pixmap = mi->iconSet()->pixmap(QIconSet::Small, active ? QIconSet::Active : QIconSet::Normal); + if(!enabled) + pixmap = disableIcon(&pixmap); + } + + if(checked && !reverse) + cr.setX(cr.x()+cmwidth); + p->drawPixmap( cr.x(), cr.y(), pixmap ); + } + + // Time to draw the menu item label... + int xm = itemFrame + maxpmw; // X position margin + if(_indentPopupMenuItems) + xm += cmwidth; + + int xp = reverse ? // X position + r.x() + tab+ itemFrame*2 + itemHMargin + maxpmw +cmwidth + (_indentPopupMenuItems ? 16 : 0) - xm: + r.x() + xm; + + + // Label width (minus the width of the accelerator portion) + int tw = r.width() - xm - tab - arrowHMargin - itemHMargin * 3 - itemFrame + 1; + + // Set the color for enabled and disabled text + // (used for both active and inactive menu items) + p->setPen( enabled ? cg.buttonText() : cg.mid() ); + + // This color will be used instead of the above if the menu item + // is active and disabled at the same time. (etched text) + QColor discol = cg.mid(); + + // Does the menu item draw it's own label? + if(mi->custom()) { + int m = 2; + // Save the painter state in case the custom + // paint method changes it in some way + mi->custom()->paint( p, cg, active, enabled, xp, r.y()+m, tw, r.height()-2*m ); + } + else { + // The menu item doesn't draw it's own label + QString s = mi->text(); + // Does the menu item have a text label? + if ( !s.isNull() ) { + int t = s.find( '\t' ); + int m = 2; + int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine; + text_flags |= reverse ? AlignRight : AlignLeft; + + QColor draw = (active && enabled) ? cg.highlightedText() : cg.foreground(); + p->setPen(draw); + + // Does the menu item have a tabstop? (for the accelerator text) + if ( t >= 0 ) { + + int arrowMargin = (mi->popup() || _indentPopupMenuItems ) ? itemHMargin + arrowHMargin : 0; + + int tabx = reverse ? r.x() + arrowMargin + itemFrame : r.x() + r.width() - tab - arrowMargin- itemFrame; + + // Draw the right part of the label (accelerator text) + //p->drawText( tabx, r.y()+m, tab, r.height()-2*m, text_flags, s.mid( t+1 ) ); + dominoDrawItem( p, QRect(tabx, r.y()+m, tab, r.height()-2*m), text_flags, cg, flags & Style_Enabled, 0, s.mid( t+1 ), -1, &draw); + s = s.left( t ); + } + + // Draw the left part of the label (or the whole label + // if there's no accelerator) + //p->drawText( xp, r.y()+m, tw, r.height()-2*m, text_flags, s, t ); + dominoDrawItem( p, QRect(xp, r.y()+m, tw, r.height()-2*m), text_flags, cg, flags & Style_Enabled, 0, s, t, &draw); + p->setPen(cg.text()); + } + + // The menu item doesn't have a text label + // Check if it has a pixmap instead + else if ( mi->pixmap() ) { + QPixmap *pixmap = mi->pixmap(); + + // Draw the pixmap + if ( pixmap->depth() == 1 ) + p->setBackgroundMode( OpaqueMode ); + + int diffw = ( ( r.width() - pixmap->width() ) / 2 ) + + ( ( r.width() - pixmap->width() ) % 2 ); + p->drawPixmap( r.x()+diffw, r.y()+1, *pixmap ); + + if ( pixmap->depth() == 1 ) + p->setBackgroundMode( TransparentMode ); + } + } + + // Does the menu item have a submenu? + if ( mi->popup() ) { + PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; + + int dim = pixelMetric(PM_MenuButtonIndicator) - 1; + QRect vr = visualRect( QRect( r.x() + r.width() - 5 - 1 - dim, + r.y() + r.height() / 2 - dim / 2, dim, dim), r ); + + TextEffect textEffectMode_save = textEffectSettings.mode; + if(textEffectSettings.mode == TextEffect_OnlyButton) + textEffectSettings.mode = TextEffect_None; + if(enabled) { + p->setPen(active? cg.highlightedText(): cg.foreground()); + drawPrimitive( arrow, p, vr, cg, Style_Enabled); + } + else { + p->setPen(cg.mid()); + drawPrimitive( arrow, p, vr, cg, Style_Default); + } + textEffectSettings.mode = textEffectMode_save; + } + break; + } + + case CE_ToolBoxTab: { + + bool selected= (flags & Style_Selected && ((QToolBox*)widget)->currentItem()); + + QPixmap pix(widget->size()); + QPainter painter(&pix); + + QColor background = (flags&Style_Down && !selected) ? darkenColor(cg.background(), 15) : cg.background(); + + painter.fillRect(QRect(5, 0, r.width()-10, r.height()), background); + renderGradient(&painter, QRect(r.x(), r.y(), 5, r.height()), background.light(120), background, false); + renderGradient(&painter, QRect(r.width()-5, r.y(), 5, r.height()), background, background.light(115), false); + painter.setPen(cg.background().dark(120)); + painter.drawLine(r.x(), r.bottom(), r.width(), r.bottom()); + painter.setPen((hoveredToolBoxTab && !selected) ? dGetColor(cg.background(), 95) : dGetColor(cg.background(), 45)); + + PrimitiveElement arrow; + QRect re = QRect(r.x()+6,r.y(),r.x()+10,r.height()); + if(selected) { + arrow = PE_ArrowDown; + re.setY(re.y()+1); + } + else { + arrow = PE_ArrowRight; + } + drawPrimitive(arrow, &painter, re, cg, Style_Enabled); + + p->drawPixmap(r.x(), r.y(), pix); + break; + } + + case CE_HeaderLabel: + { + QRect rect = r; + const QHeader* header = (const QHeader *) widget; + int section = opt.headerSection(); + + QIconSet* icon = header->iconSet( section ); + if ( icon ) { + QPixmap pixmap = icon->pixmap( QIconSet::Small, + flags & Style_Enabled ? + QIconSet::Normal : QIconSet::Disabled ); + int pixw = pixmap.width(); + int pixh = pixmap.height(); + // "pixh - 1" because of tricky integer division + + QRect pixRect = rect; + pixRect.setY( rect.center().y() - (pixh - 1) / 2 ); + drawItem ( p, pixRect, AlignVCenter, cg, flags & Style_Enabled, + &pixmap, QString::null ); + if (QApplication::reverseLayout()) + rect.setRight(rect.right() - pixw - 2); + else + rect.setLeft(rect.left() + pixw + 2); + } + + if (rect.isValid()) + dominoDrawItem ( p, rect, AlignVCenter, cg, flags & Style_Enabled, + 0, header->label( section ), -1, &(cg.buttonText()), textEffectSettings.mode > 0 ? 1 : 0 ); + break; + } + default: + KStyle::drawControl(element, p, widget, r, cg, flags, opt); + } +} + +void DominoStyle::drawControlMask(ControlElement element, + QPainter *p, + const QWidget *w, + const QRect &r, + const QStyleOption &opt) const +{ + + switch (element) { + case CE_PushButton: { + break; + } + case CE_CheckBox: { + drawPrimitive(PE_IndicatorMask, p, r, w->colorGroup(), Style_Default, opt); + break; + } + case CE_RadioButton : { + drawPrimitive(PE_ExclusiveIndicatorMask, p, r, w->colorGroup(), Style_Default, opt); + break; + } + default: { + break; + //KStyle::drawControlMask (element, p, w, r, opt); + } + } +} + +void DominoStyle::drawComplexControl(ComplexControl control, + QPainter *p, + const QWidget *widget, + const QRect &r, + const QColorGroup &cg, + SFlags flags, + SCFlags controls, + SCFlags active, + const QStyleOption& opt) const +{ + const bool reverseLayout = QApplication::reverseLayout(); + + const bool enabled = (flags & Style_Enabled); + + //return KStyle::drawComplexControl(control, p, widget, r, cg, flags, controls, active, opt); + + switch(control) { + + // COMBOBOX + // -------- + case CC_ComboBox: { + + static const unsigned int handleWidth = 15; + const QComboBox *cb = dynamic_cast(widget); + bool editable = cb && cb->editable(); + bool isDown = cb && cb->listBox() && cb->listBox()->isVisible(); + bool hasFocus =(flags&Style_HasFocus); + const QColor inputColor = enabled ? (editable ? cg.base() : cg.button()) : cg.background(); + const QColor bg = (cb && cb->parentWidget()) ? cb->parentWidget()->paletteBackgroundColor() : cg.background(); + bool hasPixmap = cb && cb->count() > 0 && cb->pixmap(cb->currentItem()); + uint contourFlags = 0; + bool isKhtmlWidget = khtmlWidgets.contains(cb); + + if(isKhtmlWidget || (cb && cb->parentWidget() && cb->parentWidget()->paletteBackgroundPixmap())) { + contourFlags |= Draw_AlphaBlend; + buttonContour->setAlphaMode(); + } + else { + p->fillRect(QRect(r.x(), r.y(), 6, r.height()), bg); + p->fillRect(QRect(r.width()-6, r.y(), 6, r.height()), bg); + } + + if(hasPixmap && editable && r.width() > 40) { + int x = reverseLayout ? handleWidth+3 : 6; + QRegion mask(x, 0, 17, r.height()); + if(!reverseLayout) + mask += QRegion(x-2, 4, 2, r.height()-9); + p->setClipRegion(mask); + } + + contourFlags |= Round_UpperLeft|Round_BottomLeft|Round_UpperRight|Round_BottomRight|Draw_Right|Draw_Top| + Draw_Bottom|Draw_Left|Is_Button|Is_Horizontal; + uint surfaceFlags = Is_Button|Is_Horizontal; + if(isDown) { + surfaceFlags |= Is_Down; + contourFlags |= Is_Down; + } + renderSurface(p, QRect(r.left()+2, r.top()+2, r.width()-4, r.height()-5), cg.background(), cg.button(), cg.background(), surfaceFlags); + + if(isDown) + buttonContour->setState(Contour_Pressed); + else if(enabled && cb == hoverWidget) + buttonContour->setState(Contour_MouseOver); + renderContour(p, r, bg, cg.button(), contourFlags); + + + if(editable) { + QColor lineEditColor = enabled ? cg.base() : cg.background(); + QString isEnabled = enabled ? "1" : "0"; + QPixmap* lineEditBtnEdges; // shared with spinwidget + if(!(lineEditBtnEdges = QPixmapCache::find(QString::number(cg.button().pixel(), 16)+QString::number(lineEditColor.pixel(), 16)+"lineEditBtnEdges"+isEnabled))) { // + buttoncolor + + // To not make the button contour appear thicker with dark button gradiens, we need a tad smaller rounding for the lineEdit edges. + QPixmap pixmap(1, r.height()); + QPainter painter(&pixmap); + flatMode = true; + renderSurface(&painter, QRect(0, 0, 1, r.height()), cg.background(), cg.button(), cg.background(), surfaceFlags); + flatMode = false; + QImage img = pixmap.convertToImage(); + + // Test, if we have a dark button. Not accurate, but... + QColor c1 = QColor(img.pixel(0, r.y()+4)); + QColor c2 = QColor(img.pixel(0, r.height()-6)); + int v, v1, v2; + c1.getHsv(&v, &v ,&v1); + c2.getHsv(&v, &v ,&v2); + QImage edges = tintImage(qembed_findImage( (v1+v2)/2 < 200 ? "lineEditBtnEdges-d" : "lineEditBtnEdges"), lineEditColor); + + if(enabled) { + QImage shadow = qembed_findImage("lineEditBtnShadow"); + blend(shadow, edges, edges); + } + lineEditBtnEdges = new QPixmap(edges); + QPixmapCache::insert(QString::number(cg.button().pixel(), 16)+QString::number(lineEditColor.pixel(), 16)+"lineEditBtnEdges"+isEnabled, lineEditBtnEdges); + } + + if(reverseLayout) { + bitBlt(p->device(), r.width()-6, r.y()+3, lineEditBtnEdges, 3, 0, 3, 3); + bitBlt(p->device(), r.width()-6, r.height()-7, lineEditBtnEdges, 3, 3, 3, 3); + } + else { + bitBlt(p->device(), r.x()+3, r.y()+3, lineEditBtnEdges, 0, 0, 3, 3); + bitBlt(p->device(), r.x()+3, r.height()-7, lineEditBtnEdges, 0, 3, 3, 3); + } + } + + + QRect ar(reverseLayout ? r.left()+3 : r.width()-handleWidth-1, r.height()/2-2, handleWidth, 6); + if(hasFocus && focusIndicatorSettings.indicateFocus && enabled && cb) { + QRect editField = querySubControlMetrics(control, widget, SC_ComboBoxEditField); + int pw = hasPixmap ? (cb->pixmap(cb->currentItem()))->width()+2 : 0; + + if(!editable) { + int fmheight = p->fontMetrics().height(); + if(reverseLayout) + editField.addCoords(pw+17, editField.height()/2-fmheight/2-1,0 , 0); + else + editField.addCoords(2+pw, editField.height()/2-fmheight/2-1,0 , 0); + QRect re = focusIndicatorSettings.drawUnderline ? subRect(SR_ComboBoxFocusRect, cb) : editField; + drawFocusIndicator(p, re, AlignLeft, cg, true, 0, cb->currentText(), -1, focusIndicatorSettings.buttonColor, focusIndicatorSettings.drawUnderline, true); + } + } + + if(isDown) { + uint shadowFlags = Draw_Top|Draw_Right|Draw_Bottom|Draw_Left; + QRect sr; + if(editable) { + shadowFlags |= reverseLayout? Round_UpperLeft|Round_BottomLeft|Rectangular_UpperRight|Rectangular_BottomRight : + Rectangular_UpperLeft|Rectangular_BottomLeft|Round_UpperRight|Round_BottomRight; + sr = QRect(reverseLayout ? r.left()+2 : r.width()-handleWidth-3, r.y()+2, handleWidth+3, r.height()-3); + } + else { + shadowFlags |= Round_UpperLeft|Round_BottomLeft|Round_UpperRight|Round_BottomRight; + sr = QRect(r.x()+2, r.y()+2, r.width()-2, r.height()-3); + } + + renderButtonShadow(p, sr, shadowFlags); + } + buttonContour->reset(); + + p->setPen(cb ? cb->palette().active().buttonText() : qApp->palette().active().buttonText()); + uint aflags = Style_Default|Style_Raised; + if(enabled) + aflags |= Style_Enabled; + drawPrimitive(PE_ArrowDown, p, ar, cg, aflags); + + p->setPen(cg.foreground()); + break; + } + + // TOOLBUTTON + // ---------- + case CC_ToolButton: { + + QToolButton *tb = (QToolButton *) widget; + + if(_toolBtnAsBtn && ::qt_cast(tb)) { + + const bool reverse = QApplication::reverseLayout(); + KToolBar *bar = dynamic_cast(tb->parentWidget()); + if(!bar) break; + KToolBarButton* btn = ::qt_cast(tb); + KToolBarButton* prevBtn = 0; + KToolBarButton* nextBtn = 0; + bool prevBtnIsOn = false; + bool nextBtnIsOn = false; + bool isOn = flags &Style_On || flags &Style_Down; + bool isDown = flags &Style_Down; + const bool horizontal = bar->orientation() == Qt::Horizontal; + + QRect cr = r , sr = r, bsr = r; + int index = bar->itemIndex(btn->id()); + + if(bar->getButton(bar->idAt(index-1))) { + prevBtn = bar->getButton(bar->idAt(index-1)); + if((!reverse) ? (horizontal) ? prevBtn->x() + prevBtn->width() != btn->x() : prevBtn->y() + prevBtn->height() != btn->y() : + (horizontal) ? prevBtn->x() != btn->x()+btn->width() : prevBtn->y() + prevBtn->height() != btn->y() + ) + prevBtn = 0; + else + prevBtnIsOn = prevBtn->isOn(); + } + if(bar->getButton(bar->idAt(index+1))) { + nextBtn= bar->getButton(bar->idAt(index+1)); + if((!reverse) ? (horizontal) ? nextBtn->x() != btn->x() + btn->width() : nextBtn->y() != btn->y() + btn->height() : + (horizontal) ? nextBtn->x() + nextBtn->width() != btn->x() : nextBtn->y() != btn->y() + btn->height() + ) + nextBtn = 0; + else + nextBtnIsOn = nextBtn->isOn(); + } + + bool drawSeparator = false; + uint contourFlags = Is_Button; + uint surfaceFlags = Is_Button; + + if(horizontal) { + surfaceFlags |=Is_Horizontal; + contourFlags |=Is_Horizontal; + } + + if(isOn) { + surfaceFlags |= Is_Down; + contourFlags |= Is_Down; + } + + QPixmap buffer(btn->size()); + QPainter painter(&buffer); + + if(tb->parentWidget() && tb->parentWidget()->paletteBackgroundPixmap()) { + painter.drawTiledPixmap(0, 0, tb->width(), tb->height(), *tb->parentWidget()->paletteBackgroundPixmap(), tb->geometry().x(), tb->geometry().y()); + contourFlags |= Draw_AlphaBlend; + } + else + painter.fillRect(buffer.rect(), cg.brush(QColorGroup::Background)); + + + if(prevBtn) { + if(nextBtn) { + // middle + if(horizontal) { + contourFlags |= Draw_Top|Draw_Bottom; + cr.setLeft(r.left()-6); + cr.setWidth(r.width()+12); + bsr.setLeft(r.left()-2); + bsr.setWidth(r.width()+3); + sr.addCoords(-1, 2, 0, -3); + drawSeparator = true; + } + else { + contourFlags |= Draw_Left|Draw_Right; + cr.setY(r.y()-6); + cr.setHeight(r.height()+13); + bsr.addCoords(2, 0, 0, 1); + sr.addCoords(2, -1, -2, 0); + drawSeparator = true; + } + } + else { + // right / bottom + if(!horizontal) { + contourFlags |= Draw_Bottom|Draw_Right|Draw_Left|Round_BottomRight|Round_BottomLeft; + cr.setY(r.y()-6); + cr.setHeight(r.height()+6); + bsr.addCoords(2, 0, 0, -1); + sr.addCoords(2, -1, -2, -3); + } + else if(!reverse) { + contourFlags |= Draw_Top|Draw_Bottom|Draw_Right|Round_UpperRight|Round_BottomRight; + cr.setLeft(r.left()-6); + cr.setWidth(r.width()+5); + bsr.setLeft(r.left()-2); + bsr.setWidth(r.width()+1); + sr.addCoords(-1, 2, -3, -3); + + } + else { // reverse + contourFlags |= Draw_Top|Draw_Bottom|Draw_Left|Round_UpperLeft|Round_BottomLeft; + cr.setWidth(r.width()+6); + bsr.setWidth(r.width()+1); + sr.addCoords(2, 2, 0, -3); + drawSeparator = true; + } + } + } + else { + if(nextBtn) { + // left / top + if(!horizontal) { + contourFlags |= Draw_Top|Draw_Left|Draw_Right|Round_UpperLeft|Round_UpperRight; + cr.setHeight(r.height()+7); + bsr.addCoords(2, 2, 0, +1); + sr.addCoords(2, 2, -2, 0); + drawSeparator = true; + } + else if(!reverse) { + contourFlags |= Draw_Top|Draw_Bottom|Draw_Left|Round_UpperLeft|Round_BottomLeft; + cr.setWidth(r.width()+6); + bsr.setWidth(r.width()+1); + sr.addCoords(2, 2, 0, -3); + drawSeparator = true; + } + else { //reverse + contourFlags |= Draw_Top|Draw_Bottom|Draw_Right|Round_UpperRight|Round_BottomRight; + cr.setLeft(r.left()-6); + cr.setWidth(r.width()+5); + bsr.setLeft(r.left()-2); + bsr.setWidth(r.width()+1); + sr.addCoords(-1, 2, -3, -3); + } + } + else { + // full + if(horizontal) { + cr.setWidth(r.width()-1); + bsr.setWidth(r.width()-1); + sr.addCoords(2, 2, -3, -3); + } + else { + bsr.addCoords(2, 2, 0, -1); + sr.addCoords(2, 2, -2, -3); + } + contourFlags |= Draw_Top|Draw_Bottom|Draw_Left|Draw_Right|Round_UpperLeft|Round_BottomLeft| + Round_UpperRight|Round_BottomRight; + + } + } + + + renderSurface(&painter, sr, cg.background(), cg.background(), cg.background(), surfaceFlags); + drawControl(CE_ToolButtonLabel, &painter, widget, r, cg, flags,opt); + renderContour(&painter, cr, cg.background(), cg.background(), contourFlags); + + + /////////////////////////////////////////// drop down indicator + + if(tb->popup()) { + QString isEnabled = enabled ? "1" : "0"; + QPixmap* arrow; + QColor color = btn->palette().active().buttonText(); + if(!(arrow = QPixmapCache::find(QString::number(color.pixel(), 16)+"arrow_down"+isEnabled))) { + QImage ar = tintImage(qembed_findImage("arrow_down"), color); + if(!isEnabled) { + ar = setImageOpacity(ar, 25); + } + arrow = new QPixmap(ar); + QPixmapCache::insert(QString::number(color.pixel(), 16)+"arrow_down"+isEnabled, arrow); + } + + QPoint point; + if(prevBtn) + if(nextBtn) + if(horizontal) + point = QPoint(cr.width()-19, cr.bottom()-8); + else + point = QPoint(cr.width()-8, cr.bottom()-12); + else + if(!horizontal) + point = QPoint(cr.width()-8, cr.bottom()-8); + else if(!reverse) + point = QPoint(cr.width()-15, cr.bottom()-8); + else // reverse + point = QPoint(cr.width()-13, cr.bottom()-8); + else + if(nextBtn) + if(!horizontal) + point = QPoint(cr.width()-8, cr.bottom()-12); + else if(!reverse) + point = QPoint(cr.width()-13, cr.bottom()-8); + else //reverse + point = QPoint(cr.width()-15, cr.bottom()-8); + else + if(horizontal) + point = QPoint(cr.width()-9, cr.bottom()-8); + else + point = QPoint(cr.width()-8, cr.bottom()-8); + + bitBlt(&buffer, point.x(), point.y(), arrow); + + } + + + /////////////////////////////////////////// separator + + if(drawSeparator) { // on the right side of the button + + ContourState cState; + if(reverse && horizontal) { + if( ((enabled && !isDown) || (prevBtn && prevBtn == hoverWidget)) && (hoverWidget && (tb == hoverWidget || (prevBtn == hoverWidget && prevBtn->isEnabled() && !prevBtn->isDown()))) ) + cState = Contour_MouseOver; + else if(isDown || (prevBtn && prevBtn->isDown())) + cState = Contour_Pressed; + else + cState = Contour_Default; + } + else { + if( ((enabled && !isDown) || (nextBtn &&nextBtn == hoverWidget)) && (hoverWidget && (tb == hoverWidget || (nextBtn == hoverWidget && nextBtn->isEnabled() && !nextBtn->isDown()))) ) + cState = Contour_MouseOver; + else if(isDown || (nextBtn && nextBtn->isDown())) + cState = Contour_Pressed; + else + cState = Contour_Default; + } + + painter.setPen(alphaBlendColors(buttonContour->contourColor(cState), cg.background(), 218)); + if(horizontal) + painter.drawLine(r.width()-1, r.top()+1, r.width()-1, r.bottom()-2); + else + painter.drawLine(r.x()+1, r.bottom(), r.width()-2, r.bottom()); + + } + + + /////////////////////////////////////////// button shadow + + if(isOn && buttonContour->drawButtonSunkenShadow) { + uint shadowFlags; + if(prevBtnIsOn) { // or above is on + if(nextBtnIsOn) { // or below is on + if(horizontal) { + shadowFlags = Draw_Top|Draw_Bottom; + bsr.addCoords(-3, 2, +5, -1); + } + else { + shadowFlags = Draw_Left|Draw_Right; + bsr.addCoords(0, -5, 0, +4); + } + } + else { + if(horizontal) { + if(!reverse) { + shadowFlags = Draw_Top|Draw_Bottom|Draw_Right; + shadowFlags |= contourFlags& Round_UpperRight ? Round_UpperRight : Rectangular_UpperRight; + shadowFlags |= contourFlags& Round_BottomRight ? Round_BottomRight : Rectangular_BottomRight; + bsr.addCoords(-3, 2, 0, -1); + } + else { + shadowFlags = Draw_Top|Draw_Bottom|Draw_Left; + shadowFlags |= contourFlags& Round_UpperLeft ? Round_UpperLeft : Rectangular_UpperLeft; + shadowFlags |= contourFlags& Round_BottomLeft ? Round_BottomLeft : Rectangular_BottomLeft; + bsr.addCoords(2, 2, 5, -1); + } + } + else { + shadowFlags = Draw_Bottom|Draw_Left|Draw_Right; + shadowFlags |= contourFlags& Round_BottomLeft ? Round_BottomLeft : Rectangular_BottomLeft; + shadowFlags |= contourFlags& Round_BottomRight ? Round_BottomRight : Rectangular_BottomRight; + bsr.setY(bsr.y()-5); + } + } + } + else if(nextBtnIsOn) { + if(horizontal) { + if(!reverse) { + shadowFlags = Draw_Top|Draw_Bottom|Draw_Left; + shadowFlags |= (contourFlags& Round_UpperLeft) ? Round_UpperLeft : Rectangular_UpperLeft; + shadowFlags |= (contourFlags& Round_BottomLeft) ? Round_BottomLeft : Rectangular_BottomLeft; + bsr.addCoords(2, 2, 5, -1); + } + else { + shadowFlags = Draw_Top|Draw_Bottom|Draw_Right; + shadowFlags |= contourFlags& Round_UpperRight ? Round_UpperRight : Rectangular_UpperRight; + shadowFlags |= contourFlags& Round_BottomRight ? Round_BottomRight : Rectangular_BottomRight; + bsr.addCoords(-3, 2, 0, -1); + } + } + else { + shadowFlags = Draw_Top|Draw_Left|Draw_Right; + shadowFlags |= contourFlags& Round_UpperLeft ? Round_UpperLeft : Rectangular_UpperLeft; + shadowFlags |= contourFlags& Round_UpperRight ? Round_UpperRight : Rectangular_UpperRight; + bsr.setHeight(bsr.height()+4); + } + } + else { + if(horizontal) { + shadowFlags = Draw_Top|Draw_Bottom|Draw_Left|Draw_Right; + shadowFlags |= contourFlags& Round_UpperLeft ? Round_UpperLeft : Rectangular_UpperLeft; + shadowFlags |= contourFlags& Round_UpperRight ? Round_UpperRight : Rectangular_UpperRight; + shadowFlags |= contourFlags& Round_BottomRight ? Round_BottomRight : Rectangular_BottomRight; + shadowFlags |= contourFlags& Round_BottomLeft ? Round_BottomLeft : Rectangular_BottomLeft; + bsr.addCoords(2, 2, 0, -1); + } + else { + shadowFlags = Draw_Top|Draw_Bottom|Draw_Left|Draw_Right; + shadowFlags |= contourFlags& Round_UpperLeft ? Round_UpperLeft : Rectangular_UpperLeft; + shadowFlags |= contourFlags& Round_UpperRight ? Round_UpperRight : Rectangular_UpperRight; + shadowFlags |= contourFlags& Round_BottomRight ? Round_BottomRight : Rectangular_BottomRight; + shadowFlags |= contourFlags& Round_BottomLeft ? Round_BottomLeft : Rectangular_BottomLeft; + } + } + renderButtonShadow(&painter, bsr, shadowFlags); + } + + btn->setUpdatesEnabled(false); + btn->setErasePixmap(buffer); + btn->setUpdatesEnabled(true); + btn->erase(); + + } + else if(_toolBtnAsBtn) { // not a KToolBarButton + + if(kickerMode && !(flags&(Style_Raised))) + break; + + const QRect br = querySubControlMetrics(control, widget, SC_ToolButton, opt); + if(br.width() < 16 || br.height()< 16) + break; + + QColorGroup g = widget->colorGroup(); + QColor bg; + if(widget->parentWidget() && widget->paletteBackgroundColor() != widget->parentWidget()->paletteBackgroundColor()) { + bg = widget->parentWidget()->paletteBackgroundColor(); + g.setColor(QColorGroup::Background, bg); + } + else + bg = widget->paletteBackgroundColor(); + + if(!widget->paletteBackgroundPixmap()) { + p->fillRect(QRect(br.x(), br.y(), 6, 6), bg); + p->fillRect(QRect(br.width()-6, br.y(), 6, 6), bg); + p->fillRect(QRect(br.width()-6, br.height()-7, 6, 7), bg); + p->fillRect(QRect(br.x(), br.height()-7, 6, 7), bg); + } + else { + buttonContour->setAlphaMode(); + } + + if(/*flags &Style_On || */flags &Style_Down) + buttonContour->setState(Contour_Pressed); + if(enabled && tb == hoverWidget) + buttonContour->setState(Contour_MouseOver); + else if(flags & Style_Default) + buttonContour->setState(Contour_DefaultButton); + + renderButton(p, br, g, (flags & Style_On || flags & Style_Down), flags & Style_MouseOver, true, enabled, khtmlWidgets.contains(opt.widget()) ); + buttonContour->reset(); + + + if(tb->popup()) { + QString isEnabled = enabled ? "1" : "0"; + QPixmap* arrow; + QColor color = tb->palette().active().buttonText(); + if(!(arrow = QPixmapCache::find(QString::number(color.pixel(), 16)+"arrow_down"+isEnabled))) { + QImage ar = tintImage(qembed_findImage("arrow_down"), color); + if(!isEnabled) { + ar = setImageOpacity(ar, 25); + } + arrow = new QPixmap(ar); + QPixmapCache::insert(QString::number(color.pixel(), 16)+"arrow_down"+isEnabled, arrow); + } + bitBlt(p->device(), r.width()-8, r.bottom()-8, arrow); + } + + } + else { + + bool isKbtn = ::qt_cast(tb); + QPixmap buffer(tb->size()); + QPainter painter(&buffer); + + QColor bg = cg.background(); + + if(tb->parentWidget() && tb->parentWidget()->paletteBackgroundPixmap()) { + painter.drawTiledPixmap(0, 0, tb->width(), tb->height(), *tb->parentWidget()->paletteBackgroundPixmap(), tb->geometry().x(), tb->geometry().y()); + } + else if(tb->parentWidget() && widget->paletteBackgroundColor() != widget->parentWidget()->paletteBackgroundColor()) { + bg = widget->parentWidget()->paletteBackgroundColor(); + painter.fillRect(buffer.rect(), bg); + } + else + painter.fillRect(buffer.rect(), cg.brush(QColorGroup::Background)); + + + QRect fr = QRect(1, 1, r.width()-2, r.height()-2); + bool isOn = flags &Style_On; + if(isOn) { + QRegion reg(fr.x()+2, fr.y()+1, fr.width()-4, fr.height()-2); + reg += QRegion(fr.x()+1, fr.y()+2, fr.width()-2, fr.height()-4); + painter.setClipRegion(reg); + painter.fillRect(r, alphaBlendColors(black, bg, 15)); + painter.setClipping(false); + } + if(isKbtn) + drawControl(CE_ToolButtonLabel, &painter, widget, r, cg, flags,opt); + + if(isOn) { + QColor color = buttonContour->contourColor(Contour_Default); + QPixmap* frame; + if(!(frame = QPixmapCache::find(QString::number(color.pixel(), 16)+"toolBtnFrameThin"))) { + frame = new QPixmap(tintImage(qembed_findImage("toolBtnFrameThin"), color)); + QPixmapCache::insert(QString::number(color.pixel(), 16)+"toolBtnFrameThin", frame); + } + + bitBlt(&buffer, fr.x(), fr.y(), frame, 0, 0, 4, 4); + bitBlt(&buffer, fr.width()-3, fr.y(), frame, 4, 0, 4, 4); + bitBlt(&buffer, fr.x(), fr.height()-3, frame, 0, 4, 4, 4); + bitBlt(&buffer, fr.width()-3, fr.height()-3, frame, 4, 4, 4, 4); + + painter.setPen(alphaBlendColors(color, bg, 195)); + painter.drawLine(fr.x()+4, fr.y(), fr.width()-4, fr.y()); + painter.drawLine(fr.x(), fr.y()+4, fr.x(), fr.height()-4); + painter.drawLine(fr.width(), fr.y()+4, fr.width(), fr.height()-4); + painter.drawLine(fr.x()+4, fr.height(), fr.width()-4, fr.height()); + } + + if(tb->popup() && (!tb->iconSet().isNull() || tb->text() || tb->pixmap())) { + QString isEnabled = enabled ? "1" : "0"; + QPixmap* arrow; + QColor color = tb->palette().active().buttonText(); + if(!(arrow = QPixmapCache::find(QString::number(color.pixel(), 16)+"arrow_down"+isEnabled))) { + QImage ar = tintImage(qembed_findImage("arrow_down"), color); + if(!isEnabled) { + ar = setImageOpacity(ar, 25); + } + arrow = new QPixmap(ar); + QPixmapCache::insert(QString::number(color.pixel(), 16)+"arrow_down"+isEnabled, arrow); + } + bitBlt(&buffer, r.width()-8, r.bottom()-4, arrow); + } + + if(isKbtn) { + tb->setUpdatesEnabled(false); + tb->setErasePixmap(buffer); + tb->erase(); + tb->setUpdatesEnabled(true); + } + else + p->drawPixmap(0, 0, buffer); + } + + p->setPen(cg.buttonText() ); + break; + } + + // SPINWIDGETS + // ----------- + case CC_SpinWidget: { + + if(active == SC_SpinWidgetUp || active == SC_SpinWidgetDown) + break; + + static const unsigned int handleWidth = 15; + const QSpinWidget *sw = dynamic_cast(widget); + const QColor bg = cg.background(); + SFlags sflags = flags; + PrimitiveElement pe; + bool enabled = sw && sw->isEnabled(); + const QColor buttonColor = enabled ? cg.button() : cg.background(); + + uint contourFlags = Round_UpperLeft|Round_BottomLeft|Round_UpperRight|Round_BottomRight|Draw_Right|Draw_Top| + Draw_Bottom|Draw_Left|Is_Button|Is_Horizontal; + + // fill edges + if(sw && !sw->paletteBackgroundPixmap()) { + p->fillRect(QRect(r.x(), r.y(), 6, r.height()), bg); + p->fillRect(QRect(r.width()-6, r.y(), 6, r.height()), bg); + } + else { + contourFlags |= Draw_AlphaBlend; + buttonContour->setAlphaMode(); + } + + uint surfaceFlags = Is_Button|Is_Horizontal; + if(flags& Style_Down) { + surfaceFlags |= Is_Down; + contourFlags |= Is_Down; + } + renderSurface(p, QRect(r.x()+2, r.y()+2, r.width()-4, r.height()-5), cg.background(), cg.button(), cg.button(), surfaceFlags); + + if(flags & Style_Down) + buttonContour->setState(Contour_Pressed); + else if(enabled && sw == hoverWidget) + buttonContour->setState(Contour_MouseOver); + renderContour(p, r, cg.background(), cg.button(), contourFlags); + + if(flags & Style_Down) + renderButtonShadow(p, QRect(r.x()+2, r.y()+2, r.width()-2, r.height()-3), contourFlags); + buttonContour->reset(); + + +// QColor lineEditColor = enabled ? cg.base() : cg.background(); + QColor lineEditColor = enabled ? cg.base() : dynamic_cast(sw->parentWidget()) ? + ((DominoQSpinBox*)sw->parentWidget())->editor()->palette().active().background(): qApp->palette().active().background(); + QString isEnabled = enabled ? "1" : "0"; + QPixmap* lineEditBtnEdges; + + if(!(lineEditBtnEdges = QPixmapCache::find(QString::number(cg.button().pixel(), 16)+QString::number(lineEditColor.pixel(), 16)+"lineEditBtnEdges"+isEnabled))) { + + // To not make the button contour appear thicker with dark button gradiens, we need a tad smaller rounding for the lineEdit edges. + QPixmap pixmap(1, r.height()); + QPainter painter(&pixmap); + flatMode = true; + renderSurface(&painter, QRect(0, 0, 1, r.height()), cg.background(), cg.button(), cg.button(), surfaceFlags); + flatMode = false; + QImage img = pixmap.convertToImage(); + + // Test, if we have a dark button. Not accurate, but... + QColor c1 = QColor(img.pixel(0, r.y()+4)); + QColor c2 = QColor(img.pixel(0, r.height()-6)); + int v, v1, v2; + c1.getHsv(&v, &v ,&v1); + c2.getHsv(&v, &v ,&v2); + + QImage edges = tintImage(qembed_findImage( (v1+v2)/2 < 127 ? "lineEditBtnEdges-d" : "lineEditBtnEdges"), lineEditColor); + + if(enabled) { + QImage shadow = qembed_findImage("lineEditBtnShadow"); + blend(shadow, edges, edges); + } + lineEditBtnEdges = new QPixmap(edges); + QPixmapCache::insert(QString::number(cg.button().pixel(), 16)+QString::number(lineEditColor.pixel(), 16)+"lineEditBtnEdges"+isEnabled, lineEditBtnEdges); + } + + if(reverseLayout) { + bitBlt(p->device(), r.width()-6, r.y()+3, lineEditBtnEdges, 3, 0, 3, 3); + bitBlt(p->device(), r.width()-6, r.height()-7, lineEditBtnEdges, 3, 3, 3, 3); + } + else { + bitBlt(p->device(), r.x()+3, r.y()+3, lineEditBtnEdges, 0, 0, 3, 3); + bitBlt(p->device(), r.x()+3, r.height()-7, lineEditBtnEdges, 0, 3, 3, 3); + } + + + QRect upRect = QRect(reverseLayout ? r.left()+2 : r.right()-handleWidth-1, r.height()/2-7, handleWidth, 6); + QRect downRect = QRect(reverseLayout ? r.left()+2 : r.right()-handleWidth-1, r.height()/2+1, handleWidth, 6); + // icons... + //p->setPen(cg.foreground()); + p->setPen(sw ? sw->palette().active().buttonText() : qApp->palette().active().buttonText()); + + sflags = Style_Default; + if(enabled) + sflags |= Style_Enabled; + if (active == SC_SpinWidgetUp) { + sflags |= Style_On; + sflags |= Style_Sunken; + } else + sflags |= Style_Raised; + + if (sw->buttonSymbols() == QSpinWidget::PlusMinus) { + pe = PE_SpinWidgetPlus; + upRect.moveTop(upRect.y()+1); + } + else + pe = PE_SpinWidgetUp; + drawPrimitive(pe, p, upRect, cg, sflags); + + sflags = Style_Default; + if(enabled) + sflags |= Style_Enabled; + if (active == SC_SpinWidgetDown) { + sflags |= Style_On; + sflags |= Style_Sunken; + } else + sflags |= Style_Raised; + if (sw->buttonSymbols() == QSpinWidget::PlusMinus) + pe = PE_SpinWidgetMinus; + else + pe = PE_SpinWidgetDown; + drawPrimitive(pe, p, downRect, cg, sflags); + + break; + } + + case CC_ScrollBar: { // TODO: find a way to draw pressed buttons + + const QScrollBar *sb = (const QScrollBar*)widget; + bool maxedOut = (sb->minValue() == sb->maxValue()); + bool horizontal = (sb->orientation() == Qt::Horizontal); + SFlags sflags = ((horizontal ? Style_Horizontal : Style_Default) | + (maxedOut ? Style_Default : Style_Enabled)); + + QRect addline, subline, subline2, addpage, subpage, slider, first, last; + subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, opt); + addline = querySubControlMetrics(control, widget, SC_ScrollBarAddLine, opt); + subpage = querySubControlMetrics(control, widget, SC_ScrollBarSubPage, opt); + addpage = querySubControlMetrics(control, widget, SC_ScrollBarAddPage, opt); + slider = querySubControlMetrics(control, widget, SC_ScrollBarSlider, opt); +// first = querySubControlMetrics(control, widget, SC_ScrollBarFirst, opt); +// last = querySubControlMetrics(control, widget, SC_ScrollBarLast, opt); +// subline2 = addline; + +// if (horizontal) +// subline2.moveBy(-addline.width(), 0); +// else +// subline2.moveBy(0, -addline.height()); + + // Draw the up/left button set + if ((controls & SC_ScrollBarSubLine) && subline.isValid()) { + drawPrimitive(PE_ScrollBarSubLine, p, subline, cg, + sflags | (active == SC_ScrollBarSubLine ? + Style_Down : Style_Default)); + + + subline2 = addline; + if (horizontal) + subline2.moveBy(-addline.width(), 0); + else + subline2.moveBy(0, -addline.height()); + + if (subline2.isValid()) + drawPrimitive((QStyle::PrimitiveElement)PE_ScrollBarSubLine2, p, subline2, cg, + sflags | (active == SC_ScrollBarSubLine ? + Style_Down : Style_Default)); + } + + if ((controls & SC_ScrollBarAddLine) && addline.isValid()) + drawPrimitive(PE_ScrollBarAddLine, p, addline, cg, + sflags | ((active == SC_ScrollBarAddLine) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarSubPage) && subpage.isValid()) + drawPrimitive(PE_ScrollBarSubPage, p, subpage, cg, + sflags | ((active == SC_ScrollBarSubPage) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarAddPage) && addpage.isValid()) + drawPrimitive(PE_ScrollBarAddPage, p, addpage, cg, + sflags | ((active == SC_ScrollBarAddPage) ? + Style_Down : Style_Default)); + +// if ((controls & SC_ScrollBarFirst) && first.isValid()) +// drawPrimitive(PE_ScrollBarFirst, p, first, cg, +// sflags | ((active == SC_ScrollBarFirst) ? +// Style_Down : Style_Default)); +// +// if ((controls & SC_ScrollBarLast) && last.isValid()) +// drawPrimitive(PE_ScrollBarLast, p, last, cg, +// sflags | ((active == SC_ScrollBarLast) ? +// Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarSlider) && slider.isValid()) { + drawPrimitive(PE_ScrollBarSlider, p, slider, cg, + sflags | ((active == SC_ScrollBarSlider) ? + Style_Down : Style_Default)); + } + break; + } + + + + case CC_TitleBar: { + + QRect ir; + bool down; + QColorGroup g = widget->colorGroup(); + + if ( controls & SC_TitleBarLabel ) { + QPixmap pix(10, r.height()); + pix.fill(g.background()); + + QPainter painter(&pix); + renderGradient(&painter, QRect(0, 0, 10, r.height()/2), g.background().light(120), g.background(), true); + painter.setPen(g.background().dark(105)); + painter.drawLine(0, r.bottom(), 10, r.bottom()); + p->drawTiledPixmap(0,0, r.width(), r.height(), pix); + + ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarLabel ), widget ); + p->setPen( g.foreground() ); + p->drawText(ir.x()+2, ir.y(), ir.width()-2, ir.height(), AlignCenter | AlignVCenter | SingleLine, widget->caption() ); + } + if ( controls & SC_TitleBarCloseButton ) { + ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarCloseButton ), widget ); + down = active & SC_TitleBarCloseButton; + p->drawPixmap(ir.x(), ir.y(), qembed_findImage("DockCloseButton"), 0, down ? 12 : 0, 12, 12); + } + if ( controls & SC_TitleBarMaxButton ) { + ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarMaxButton ), widget ); + down = active & SC_TitleBarMaxButton; + p->drawPixmap(ir.x(), ir.y(), qembed_findImage("OverlapButton"), 0, down ? 12 : 0, 12, 12); + } + if ( controls & SC_TitleBarNormalButton) { + ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarNormalButton ), widget ); + down = active & SC_TitleBarNormalButton; + p->drawPixmap(ir.x(), ir.y(), qembed_findImage("ToDesktopButton"), 0, down ? 12 : 0, 12, 12); + } + if ( controls & SC_TitleBarMinButton) { + ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarMinButton ), widget ); + down = active & SC_TitleBarMinButton; + p->drawPixmap(ir.x(), ir.y(), qembed_findImage("DockbackButton"), 0, down ? 12 : 0, 12, 12); + } + if ( controls & SC_TitleBarSysMenu ) { + if ( widget->icon() ) { + ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarSysMenu ), widget ); + drawItem( p, ir, AlignCenter, widget->colorGroup(), TRUE, widget->icon(), QString::null ); + } + } + + break; + } + default: + KStyle::drawComplexControl(control, p, widget, + r, cg, flags, controls, + active, opt); + break; + } +} + +QRect DominoStyle::subRect(SubRect r, const QWidget *widget) const +{ + switch (r) { + case SR_PushButtonContents: { + const QPushButton* btn = static_cast(widget); + QRect rw = widget->rect(); + if(btn->text().isEmpty()) + return QRect(rw.left()+2, rw.top()+2, rw.width()-4, rw.height()-4); + return QRect(rw.left()+2, rw.top()+3, rw.width()-4, rw.height()-7); + } + case SR_PushButtonFocusRect: + { + QRect rect, wrect(widget->rect()); + const QPushButton *button = (const QPushButton *) widget; + int dbw1 = 0, dbw2 = 0; + if (button->isDefault() || button->autoDefault()) { + dbw1 = pixelMetric(PM_ButtonDefaultIndicator, widget); + dbw2 = dbw1 * 2; + } + + int dfw1 = pixelMetric(PM_DefaultFrameWidth, widget) * 2, + dfw2 = dfw1 * 2; + + rect.setRect(wrect.x() + dfw1 + dbw1, + wrect.y() + dfw1 + dbw1, + wrect.width() - dfw2 - dbw2, + wrect.height() - dfw2 - dbw2); + return rect; + } + case SR_ComboBoxFocusRect: { + return QRect(4, 3, widget->width()-8, widget->height()-7); +// return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField ); + } + case SR_CheckBoxFocusRect: + { + QRect cr = subRect(SR_CheckBoxContents, widget); + QRect fr = KStyle::subRect(r, widget); + if(cr.width() <= 0) // no text + fr.setHeight(fr.height()+2); + else + fr.addCoords(+2, 0, -2, 0); + return fr; + } + case SR_RadioButtonFocusRect: + { + QRect cr = subRect(SR_CheckBoxContents, widget); + QRect fr = KStyle::subRect(r, widget); + if(cr.width() <= 0) // no text + fr.setHeight(fr.height()+2); + else + fr.addCoords(+2, 0, -2, 0); + return fr; + } + case SR_ProgressBarGroove: { + return QRect(widget->rect()); + } + case SR_ProgressBarContents: + case SR_ProgressBarLabel: { + QRect rw = widget->rect(); + return QRect(rw.left()+2, rw.top()+2, rw.width()-4, rw.height()-4 ); + } + case SR_ToolBoxTabContents: { + QRect rw = widget->rect(); + return QRect(rw.left()+18, rw.top(), rw.width()-18, rw.height()); + } + default: { + return KStyle::subRect(r, widget); + } + } +} + + + +QRect DominoStyle::querySubControlMetrics(ComplexControl control, + const QWidget *widget, + SubControl subcontrol, + const QStyleOption &opt) const +{ + if (!widget) { + return QRect(); + } + + QRect r(widget->rect()); + switch (control) { + case CC_ComboBox: { + switch (subcontrol) { + case SC_ComboBoxEditField: { + const QComboBox* cb = dynamic_cast(widget); + if(!cb) // maybe kdevelop's KComboView + return QRect(r.left()+4, r.top()+3, r.width()-4-15-3, r.height()-7); + if(!cb->editable()) + return QRect(r.left()+3, r.top()+3, r.width()-4-15-2, r.height()-6); + + return QRect(r.left()+3, r.top()+3, r.width()-4-15-2, r.height()-7); + } + default: { + return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); + } + } + break; + } + case CC_SpinWidget: { + const int fw = 2; // Frame width... + const int buttonsWidth = 15; + const bool heightDividable = ((r.height()%2) == 0); + + const int buttonsLeft = r.right()-buttonsWidth+1-fw; + switch (subcontrol) { + case SC_SpinWidgetUp: { // rect without 2px frame + return QRect(buttonsLeft, r.top()+3, buttonsWidth+1, r.height()/2-3 ); + } + case SC_SpinWidgetDown: { + if(heightDividable) { + return QRect(buttonsLeft, r.top()+r.height()/2+1, buttonsWidth+1, r.height()/2-3); + } else { + return QRect(buttonsLeft, r.top()+r.height()/2+1, buttonsWidth+1, r.height()/2-2); + } + } + case SC_SpinWidgetFrame: { + return QRect(r.left(), r.top(), r.width(), r.height() ); + } + case SC_SpinWidgetEditField: { + return QRect(r.left()+1+fw, r.top()+1+fw, r.width()-(buttonsWidth+2+fw*2), r.height()-3-fw*2); + } + case SC_SpinWidgetButtonField: { + return QRect(buttonsLeft, r.top()+2, buttonsWidth, r.height()-5); + } + default: { + return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); + } + } + break; + } + + case CC_ScrollBar: { + + const QScrollBar *scrollbar = (const QScrollBar *) widget; + int sliderstart = scrollbar->sliderStart(); + const int buttonw = 15 /*- (fw * 2)*/; + const int buttonh = 15 /*- (fw * 2)*/; + + int maxlen = ((scrollbar->orientation() == Qt::Horizontal) ? + scrollbar->width() : scrollbar->height()) - buttonh * 3; + + // calculate slider length + if (scrollbar->maxValue() != scrollbar->minValue()) { + uint range = scrollbar->maxValue() - scrollbar->minValue(); + sliderlen = (scrollbar->pageStep() * maxlen) / + (range + scrollbar->pageStep()); + + if ( sliderlen < 32 || range > INT_MAX/2 ) + sliderlen = 32; + if ( sliderlen > maxlen ) + sliderlen = maxlen; + } + else + sliderlen = maxlen; + + switch(subcontrol) { + case SC_ScrollBarAddLine: { // bottom/right button + if (scrollbar->orientation() == Qt::Horizontal) { + return QRect(scrollbar->width() - buttonw , 0, buttonw, buttonh); + } else { + return QRect(0, scrollbar->height() - buttonh, buttonw, buttonh); + } + } + case SC_ScrollBarSubLine: { // top/left button + return QRect(0, 0, buttonw, buttonh); + } + case SC_ScrollBarSubPage: // top/left + if (scrollbar->orientation() == Qt::Horizontal) + return QRect(buttonw, 0, sliderstart-buttonw+1, buttonw); + return QRect(0, buttonh, buttonw, sliderstart-buttonw+1); + + case SC_ScrollBarAddPage: // bottom/left + if (scrollbar->orientation() == Qt::Horizontal) + return QRect(sliderstart + sliderlen-1, 0, maxlen - sliderstart - sliderlen + buttonw+1, buttonw); + return QRect(0, sliderstart + sliderlen-1, buttonw, maxlen - sliderstart - sliderlen + buttonw+1); + + case SC_ScrollBarGroove: + if (scrollbar->orientation() == Qt::Horizontal) + return QRect(buttonw , 0, maxlen, buttonw); + return QRect(0, buttonw, buttonw, maxlen); + + case SC_ScrollBarSlider: + if (scrollbar->orientation() == Qt::Horizontal) + return QRect(sliderstart, 0, sliderlen, buttonw); + return QRect(0, sliderstart, buttonw, sliderlen); + default: + break; + } + } + default: { + return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); + } + } +} + +int DominoStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +{ + //return KStyle::pixelMetric(m, widget); + + switch(m) { + // FRAMES + // ------ + case PM_DefaultFrameWidth: { + + if(widget) { + if(dynamic_cast(widget)) + return 3; + + // stolen from baghira + if (dynamic_cast(widget->parentWidget()) && widget->parentWidget()->parentWidget() && (widget->parentWidget()->parentWidget()->isA("KonqMainWindow") || widget->parentWidget()->parentWidget()->isA("KonqFrameContainer"))) + return 0; + + } + return 2; + } + case PM_MenuBarFrameWidth: + return 1; + case PM_SpinBoxFrameWidth: + return 2; + + // CHECKBOXES / RADIO BUTTONS + // -------------------------- + case PM_IndicatorWidth: // Checkbox 18x19 + return 18; + case PM_IndicatorHeight: + return 19; + + case PM_ExclusiveIndicatorWidth: // Radiobutton 17x17 + case PM_ExclusiveIndicatorHeight: + return 17; + + // TABS + // ---- + case PM_TabBarTabVSpace: { + const QTabBar * tb = (const QTabBar *) widget; + + switch(tb->shape()) { + case QTabBar::RoundedAbove: + case QTabBar::RoundedBelow: + return 12; + default: + return 4; + } + + } + case PM_TabBarTabShiftVertical: { + + const QTabBar * tb = (const QTabBar *) widget; + switch (tb->shape()) { + case QTabBar::RoundedAbove: + return 1; + case QTabBar::RoundedBelow: + return (tb->parentWidget() && tb->parentWidget()->isA("KonqFrameTabs"))? 0 : -1; + default: + return 0; + } + } + case PM_TabBarTabShiftHorizontal: { + return 0; + } + case PM_TabBarTabOverlap: { + return 1; + } + case PM_TabBarBaseOverlap: { + const QTabWidget * tw = (const QTabWidget *) widget; + if(((DominoQTabWidget*)tw)->tabBar()->isHidden() || tw->isA("KonqFrameTabs")) + return 0; + return (tw->tabPosition() == QTabWidget::Top) ? -3 : -4; + } +#if (QT_VERSION >= 0x030300) // requires Qt 3.3 + // extra space between menubar items + case PM_MenuBarItemSpacing: { + return 6; + } +#endif + +// #if (QT_VERSION >= 0x030300) // requires Qt 3.3 +// // extra space between toolbar items +// case PM_ToolBarItemSpacing: { +// return 4; +// } +// #endif + + // SCROLL BAR +// case PM_ScrollBarSliderMin: { +// return 21; +// } + + case PM_ScrollBarExtent: { + return 15; + } + + case PM_DockWindowSeparatorExtent: + return 6; + + // SPLITTERS + // --------- + case PM_SplitterWidth: { + return 6; + } + + // PROGRESSBARS + // ------------ + case PM_ProgressBarChunkWidth: + return 10; + + // SLIDER + // ------ + case PM_SliderLength: + case PM_SliderThickness: + return 15; + + // MENU INDICATOR + // -------------- + case PM_MenuButtonIndicator: + return 8; + + case PM_ButtonDefaultIndicator: { + return 0; + } + + case PM_ButtonMargin: { + //return 2; + return 4; + } + case PM_HeaderMargin: + return 2; + case PM_ButtonShiftVertical: + case PM_ButtonShiftHorizontal: { + return 0; + } + case PM_CheckListControllerSize: // radio controller + case PM_CheckListButtonSize: { // box controller + return 16; + } +// case PM_PopupMenuFrameVerticalExtra: +// return 1; +// case PM_PopupMenuFrameHorizontalExtra: +// return 1; + default: + return KStyle::pixelMetric(m, widget); + } +} + + +QSize DominoStyle::sizeFromContents(ContentsType t, + const QWidget *widget, + const QSize &s, + const QStyleOption &opt) const +{ + //return KStyle::sizeFromContents (t, widget, s, opt); + + switch (t) { + + case CT_PushButton: + { + const QPushButton* btn = static_cast(widget); + + int w = s.width(); + int h = s.height(); + if ( btn->text().isEmpty() && s.width() < 32 ) { + w += pixelMetric(PM_ButtonMargin, widget)*2; + h += pixelMetric(PM_ButtonMargin, widget)*2; + return QSize(w, h); + } + + int bm = pixelMetric(PM_ButtonMargin, widget); + int fw = pixelMetric(PM_DefaultFrameWidth, widget) * 2; + w += bm + fw + 22; + h += bm + fw; + return QSize(w, h < 26 ? 26+_buttonHeightAdjustment : h+4 ); + } + case CT_ComboBox: { + int bm = pixelMetric(PM_ButtonMargin, widget); + int fw = pixelMetric(PM_DefaultFrameWidth, widget) * 2; + int w = s.width(); + int h = s.height(); + w += bm + fw + 22; + h += bm + fw-3; + return QSize(w, h < 26 ? 26+_buttonHeightAdjustment : h+4 ); + } + + case CT_TabBarTab: { + // konqi = tabbar + // other = tab control + // this is total crap but it helps to reduce the flicker in konqi. + ///////////////////// + QTabBar* tb = 0; + if(::qt_cast(widget)) + tb = ::qt_cast(widget); + else + return QSize(s.width(), s.height()); + + if(!strcmp(widget->name(), "tabbar") && widget->parentWidget()->isA("KonqFrameTabs")) { + + QTab* tab = opt.tab(); + int count = tb->count(); + + int fm = tb->fontMetrics().width("about:blank"); + if(tb->parentWidget()->width() <= opt.tab()->rect().x()+44+fm) + return QSize(s.width(), s.height()); + + int dots = tb->fontMetrics().width("."); + if((dots*minTabLength+44)*count >= tb->width()) // 44 = frame+iconwidth + return QSize(s.width(), s.height()); + + QSize sz = KStyle::sizeFromContents( t, widget, s, opt ); + + QString str; + str.fill(' ', minTabLength); + if( tab->text().isEmpty() || tab->text() == str) { + tab->setText("about:blank"); + //return QSize( fm+44, 26 ); + return QSize( fm+44, s.height()); + } + return QSize(s.width(), s.height()); + } + else { + switch (tb->shape()) { + case QTabBar::RoundedAbove: + case QTabBar::RoundedBelow: + return QSize( s.width(), s.height()-2 ); + default: + return QSize( s.width(), s.height() ); // triangular + } + } + } + + case CT_ToolButton: { + if(dynamic_cast(widget)) { + if(dynamic_cast(widget->parentWidget())) // smaller cornerWidget + return QSize( s.width()+9, s.height()+7 ); + return QSize( s.width()+11, s.height()+7 ); + } + return KStyle::sizeFromContents (t, widget, s, opt); // KMultiTabBar buttons + } + case CT_SpinBox: { + QSize sz = KStyle::sizeFromContents( t, widget, s, opt ); + int h = sz.height()%2 != 0 ? sz.height()+1 : sz.height(); + return ( QSize( sz.width(), h < 24 ? 24 : h) ); + } + + case CT_Header: { + QSize sz = KStyle::sizeFromContents( t, widget, s, opt ); + return QSize(sz.width(), sz.height()-2); + } + + case CT_PopupMenuItem: { + if (!widget || opt.isDefault()) + return s; +// static const int itemHMargin = 6; +// static const int itemFrame = 7; +// static const int arrowHMargin = 6; + + const QPopupMenu *popup = dynamic_cast(widget); + QMenuItem *mi = opt.menuItem(); + int maxpmw = opt.maxIconWidth(); + int w = s.width(), h = s.height(); // includes pixmap width + int cmwidth = 16; + + + if (mi->custom()) { + w = mi->custom()->sizeHint().width(); + h = mi->custom()->sizeHint().height(); + if (!mi->custom()->fullSpan() ) + h += 4; + } else if (mi->widget()) { + // don't change the size in this case. + } else if (mi->isSeparator()) { + w = 20; + h = 5; + } else { + if (mi->pixmap()) { + h = QMAX(h, mi->pixmap()->height() + 2); + } else { + h = QMAX(h, 16 + 2 ); + h = QMAX(h, popup->fontMetrics().height() + 4 ); + } + + if (mi->iconSet()) { + h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height() + 2); + } + } + + if(_indentPopupMenuItems) { + w += itemHMargin + arrowHMargin + itemFrame*2; + } + else { + w += itemFrame*2; + + if (mi->popup()) { + w += itemHMargin + arrowHMargin; + } + if (maxpmw) { + w += itemHMargin; + } + } + + int t; + if (!mi->text().isNull() && (t = mi->text().find('\t')) && t >= 0 && mi->text().at(t+1) != 0) { + // space between text and accel + checkmark width (in guiStyle "Windows" isCheckable() returns always true...) + w += 18+cmwidth; + } + else + w += cmwidth; + + return QSize(w, h); + } + default: + return KStyle::sizeFromContents (t, widget, s, opt); + } + + return KStyle::sizeFromContents (t, widget, s, opt); +} + +int DominoStyle::styleHint( StyleHint stylehint, + const QWidget *widget, + const QStyleOption &option, + QStyleHintReturn* returnData ) const +{ + switch (stylehint) { + case SH_PopupMenu_SubMenuPopupDelay: + //return 96; // Motif-like delay... + return 250; + case SH_GroupBox_TextLabelVerticalAlignment: { + return Qt::AlignTop; + } + case SH_ScrollBar_BackgroundMode: { + return Qt::PaletteBackground; + } + case SH_ScrollBar_ScrollWhenPointerLeavesControl: + // if set to false (the default) it will also scroll when the subPage button is pressed, so no choice here (Qt 3.6) + return true; + case SH_TabBar_Alignment: { + return _centerTabs ? AlignHCenter : AlignLeft; + } + case SH_ToolBox_SelectedPageTitleBold: { + return false; + } + case SH_LineEdit_PasswordCharacter: + { + if (widget) { + const QFontMetrics &fm = widget->fontMetrics(); + if (fm.inFont(QChar(0x25CF))) { + return 0x25CF; + } else if (fm.inFont(QChar(0x2022))) { + return 0x2022; + } + } + return '*'; + } + default: + return KStyle::styleHint(stylehint, widget, option, returnData); + } +} + +QPixmap DominoStyle::stylePixmap(StylePixmap stylepixmap, const QWidget* widget, const QStyleOption& opt) const { + + switch (stylepixmap) { + case SP_DockWindowCloseButton: + case SP_TitleBarCloseButton: + return QPixmap(qembed_findImage("DockCloseButton").copy(0,0,12,12)); + case SP_TitleBarMinButton: + return QPixmap(qembed_findImage("DockbackButton").copy(0,0,12,12)); + case SP_TitleBarMaxButton: + return QPixmap(qembed_findImage("OverlapButton").copy(0,0,12,12)); + case SP_TitleBarNormalButton: + return QPixmap(qembed_findImage("ToDesktopButton").copy(0,0,12,12)); + default: + return KStyle::stylePixmap(stylepixmap, widget, opt); + } +} + + +QColor DominoStyle::lightenColor(const QColor &color, const int value) const +{ + if(value < 0) + return darkenColor(color, QABS(value)); + int r, g, b; + color.getRgb(&r, &g, &b); + r += value; + if(r > 255) + r =255; + g += value; + if(g > 255) + g =255; + b += value; + if(b > 255) + b =255; + return QColor(r, g, b); +} + +QColor DominoStyle::darkenColor(const QColor &color, const int value) const +{ + if(value < 0) + return lightenColor(color, QABS(value)); + int r, g, b; + color.getRgb(&r, &g, &b); + r -= value; + if(r < 0) + r = 0; + g -= value; + if(g < 0) + g = 0; + b -= value; + if(b < 0) + b = 0; + return QColor(r, g, b); +} + +QColor DominoStyle::dGetColor(const QColor &color, const int value) const +{ + int h, s, v; + color.getHsv(&h, &s, &v); + return (v<127)? lightenColor(color, value): darkenColor(color, value); +} + + +QPixmap* DominoStyle::renderLineEditShadow(QWidget* widget, QRect r, QColor bg, uint flags, bool /*reverse*/) { + + bool drawLeft = flags& Draw_Left; + bool drawRight = flags& Draw_Right; + + int x, y, w, h; + r.rect(&x, &y, &w, &h); + if(!drawLeft) { + x = -3; + w += 3; + } + else if(!drawRight) + w += 3; + QRect rect(x, y, w, h); + + + QColor tintColor; + QString enabled = widget->isEnabled() ? "1" : "0"; + if(!widget->isEnabled()) + tintColor =bg; + else + tintColor = alphaBlendColors(Qt::black, bg, 30+35); + + QPixmap* prBgShadow; + if(!(prBgShadow = QPixmapCache::find(QString::number(bg.pixel(), 16)+QString::number(qApp->palette().active().background().pixel(), 16)+"leBgShadow"+enabled))) { + prBgShadow = new QPixmap(4,4); + prBgShadow->fill(bg); + QPixmap pix = tintImage(qembed_findImage("progressShadow2"), tintColor); + bitBlt(prBgShadow, 0, 0, &pix); + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(qApp->palette().active().background().pixel(), 16)+"leBgShadow"+enabled, prBgShadow); + } + + + QPixmap* pix = new QPixmap(rect.size()); + pix->fill(bg); + + if(widget->isEnabled()) { + QPainter p(pix); + + QColor color_d = alphaBlendColors(tintColor, bg, 170); + QColor color_m = alphaBlendColors(tintColor, bg, 85); + QColor color_l = alphaBlendColors(tintColor, bg, 25); + + p.setPen(color_d); + p.drawLine(rect.x()+2, rect.y(), rect.right()-2, rect.y()); + p.setPen(color_m); + p.drawLine(rect.x()+2, rect.y()+1, rect.right()-2, rect.y()+1); + p.setPen(color_l); + p.drawLine(rect.x()+2, rect.y()+2, rect.right()-2, rect.y()+2); + p.drawLine(rect.x()+2, rect.bottom(), rect.right()-2, rect.bottom()); + + //p.setPen(color_l); + p.drawLine(rect.x()+1, rect.y()+3, rect.x()+1, rect.bottom()-1); // l + p.drawLine(rect.right()-1, rect.y()+3, rect.right()-1, rect.bottom()-1); // r + + p.setPen(color_m); + p.drawLine(rect.x(), rect.y()+3, rect.x(), rect.bottom()-1); // l + p.drawLine(rect.right(), rect.y()+3, rect.right(), rect.bottom()-1); // r + + bitBlt(pix, rect.right()-1, rect.y(), prBgShadow, 2, 0, 2, 3, Qt::CopyROP); + bitBlt(pix, rect.x(), rect.y(), prBgShadow, 0, 0, 2, 3, Qt::CopyROP); + bitBlt(pix, rect.right()-1, rect.bottom(), prBgShadow, 2, 3, 2, 1, Qt::CopyROP); + bitBlt(pix, rect.x(), rect.bottom(), prBgShadow, 0, 3, 2, 1, Qt::CopyROP); + + p.end(); + } + return pix; +} + +QColor DominoStyle::getGroupBoxColor(const QWidget* w) const { + QWidget* parent = w->parentWidget(); + int tint = groupBoxSettings.customColor ? 0 : groupBoxSettings.brightness; + while(dynamic_cast(parent)) { + parent = parent->parentWidget(); + tint += groupBoxSettings.brightness; + } + + return QColor(darkenColor(groupBoxSettings.customColor ? groupBoxSettings.color : + qApp->palette().active().background(), tint)); + +} + +QPixmap* DominoStyle::createCheckMark(const QColor color) const { + + QImage checkMark_enabled = qembed_findImage("checkmark"); + QImage checkMark_disabled = setImageOpacity(checkMark_enabled, 25); + + QImage img(32, 17, 32); // left enabled, right disabled + img.setAlphaBuffer(true); + for(int x=0; x < checkMark_enabled.width(); ++x) { + for(int y=0; y < checkMark_enabled.height(); ++y) { + img.setPixel(x, y, checkMark_enabled.pixel(x, y)); + } + } + for(int x=0; x < checkMark_disabled.width(); ++x) { + for(int y=0; y < checkMark_disabled.height(); ++y) { + img.setPixel(x+16, y, checkMark_disabled.pixel(x, y)); + } + } + + return new QPixmap(tintImage(img, color)); +} + +QPixmap* DominoStyle::createRadioIndicator(const QColor color) const { + + QImage dot_enabled = tintImage(qembed_findImage("rb-dot"),color); + + blend(qembed_findImage("rb-dot-shadow"), dot_enabled, dot_enabled); + QImage dot_disabled = setImageOpacity(dot_enabled, 25); + + QImage img(10, 5, 32); + img.setAlphaBuffer(true); + for(int x=0; x < dot_enabled.width(); ++x) { + for(int y=0; y < dot_enabled.height(); ++y) { + img.setPixel(x, y, dot_enabled.pixel(x, y)); + } + } + for(int x=0; x < dot_disabled.width(); ++x) { + for(int y=0; y < dot_disabled.height(); ++y) { + img.setPixel(x+5, y, dot_disabled.pixel(x, y)); + } + } + + return new QPixmap(img); +} + + +void DominoStyle::drawFocusIndicator(QPainter *p, const QRect &r, int flags, const QColorGroup cg, bool /*enabled*/, + const QPixmap* /*pixmap*/, const QString & text, int /*len = -1*/, const QColor& highlight, bool drawLine, bool isButton) const +{ + + if(drawLine) { +// p->setPen(cg.foreground()); +// QPixmap edges = tintImage(qembed_findImage("indicatorEdges"), cg.foreground()); +// bitBlt(p->device(), r.x(), r.bottom()-1, &edges, 0, 0, 2, 1, Qt::CopyROP); +// bitBlt(p->device(), r.right()-2, r.bottom()-1, &edges, 2, 0, 2, 1, Qt::CopyROP); +// p->drawLine(r.x()+2, r.bottom()-1, r.right()-3, r.bottom()-1); + QFont font = p->font(); + font.setUnderline(true); + p->setFont(font); + } + else { + QRect br = p->fontMetrics().boundingRect(r.x(), r.y(), r.width(), r.height(), flags, text); + QPainter pixPainter; + QPixmap textPixmap(br.width()+2, br.height()+2); + textPixmap.fill(QColor(0,0,0)); + pixPainter.begin(&textPixmap); + pixPainter.setPen(white); + pixPainter.setFont(p->font()); + pixPainter.drawText( QRect(1, 1, br.width()-1, br.height()-1), flags, text ); + pixPainter.end(); + + + DominoQPixmap* pixm = (DominoQPixmap*)&textPixmap; + + uint height = pixm->height(); + uint width = pixm->width(); + + pixm->data->alphapm = new QPixmap; + + DominoQPixmap* alphapm = (DominoQPixmap*)pixm->data->alphapm; + + alphapm->data->w = width; + alphapm->data->h = height; + alphapm->data->d = 8; + alphapm->hd = XCreatePixmap(alphapm->x11Display(), RootWindow(alphapm->x11Display(), alphapm->x11Screen()), width, height, 8); + alphapm->rendhd = (HANDLE) XftDrawCreateAlpha( alphapm->x11Display(), alphapm->hd, 8 ); + + XImage *axi = XCreateImage(alphapm->x11Display(), (Visual *) alphapm->x11Visual(), 8, ZPixmap, 0, 0, width, height, 8, 0); + axi->data = (char *) malloc((unsigned) axi->bytes_per_line * height); + + XImage* xi = XGetImage( qt_xdisplay(), pixm->handle(), 0, 0, width, height, AllPlanes, ZPixmap ); + + register int alpha; + register float AXIS_FACTOR = 2.0; + register float DIAGONAL_FACTOR = 1.0; + register double alphaShadow; + register int customalpha = isButton ? focusIndicatorSettings.buttonOpacity : focusIndicatorSettings.opacity; + + for(register uint x = 1; x < width-1; ++x) { + for(register uint y = 1; y < height-1; ++y) { + + alphaShadow = (qBlue(XGetPixel(xi,x-1,y-1)) * DIAGONAL_FACTOR + + qBlue(XGetPixel(xi,x-1,y )) * AXIS_FACTOR + + qBlue(XGetPixel(xi,x-1,y+1)) * DIAGONAL_FACTOR + + qBlue(XGetPixel(xi,x ,y-1)) * AXIS_FACTOR + + 0 + + qBlue(XGetPixel(xi,x ,y+1)) * AXIS_FACTOR + + qBlue(XGetPixel(xi,x+1,y-1)) * DIAGONAL_FACTOR + + qBlue(XGetPixel(xi,x+1,y )) * AXIS_FACTOR + + qBlue(XGetPixel(xi,x+1,y+1)) * DIAGONAL_FACTOR) / 2.0; // / multiplicationFactor + + alpha = (int)alphaShadow; + XPutPixel(axi, x, y, QMIN(255, alpha) *customalpha >> 8); + } + } + + GC gc = XCreateGC(alphapm->x11Display(), alphapm->hd, 0, 0); + XPutImage(alphapm->x11Display(), alphapm->hd, gc, axi, 0, 0, 0, 0, width, height); + + textPixmap.fill(highlight); + + QRect fr = QRect(br.x(), br.y(), QMIN((int)width-2, r.width()) , QMIN((int)height-2, r.height())); + if(fr.x() < r.x()) { + p->setClipRegion(r); + fr.setWidth(fr.width()+abs(fr.x())+2); + } + if(fr.isValid()) + p->drawPixmap(fr.x(), fr.y(), textPixmap, 1, 1, fr.width() , fr.height()); + if(fr.x() < r.x()) + p->setClipping(false); + + if(axi) + XDestroyImage(axi); + if(xi) + XDestroyImage(xi); + XFreeGC(alphapm->x11Display(), gc); + + p->setPen(cg.foreground()); + } +} + +QPixmap DominoStyle::renderOutlineIcon(const QPixmap* icon) const +{ + QImage img = icon->convertToImage(); + QImage outlineIcon(img.width()+2, img.height()+2, 32); + outlineIcon.setAlphaBuffer(true); + + register unsigned int *outlineIconData = (unsigned int*) outlineIcon.bits(); + register uint total = outlineIcon.width()*outlineIcon.height(); + for (register uint current = 0 ; current < total ; ++current ) { + outlineIconData[ current ] = 0x00000000; + } + + bitBlt(&outlineIcon, 0, 0, &img); + bitBlt(&outlineIcon, 1, 0, &img); + bitBlt(&outlineIcon, 2, 0, &img); + bitBlt(&outlineIcon, 0, 1, &img); + bitBlt(&outlineIcon, 2, 1, &img); + bitBlt(&outlineIcon, 0, 2, &img); + bitBlt(&outlineIcon, 1, 2, &img); + bitBlt(&outlineIcon, 2, 2, &img); + + register uint customalpha = focusIndicatorSettings.buttonOpacity; + for (register uint current = 0 ; current < total ; ++current ) { + outlineIconData[ current ] = qRgba( focusIndicatorSettings.buttonColor.red(), focusIndicatorSettings.buttonColor.green(), focusIndicatorSettings.buttonColor.blue(), qAlpha(outlineIconData[ current ]) * customalpha >> 8); + } + + return QPixmap(outlineIcon); +} + + + + +void DominoStyle::drawItem( QPainter *p, const QRect &r, + int flags, const QColorGroup &g, bool enabled, + const QPixmap *pixmap, const QString& text, int len, + const QColor* penColor ) const +{ + dominoDrawItem(p, r, flags, g, enabled, pixmap, text, len, penColor, false); +} + +void DominoStyle::dominoDrawItem( QPainter *p, const QRect &r, + int flags, const QColorGroup &g, bool enabled, + const QPixmap *pixmap, const QString& text, int len, + const QColor* penColor, bool buttonTextEffect ) const +{ + + int x = r.x(); + int y = r.y(); + int w = r.width(); + int h = r.height(); + + p->setPen( penColor?*penColor:g.foreground() ); + if ( pixmap ) { + QPixmap pm( *pixmap ); + bool clip = (flags & Qt::DontClip) == 0; + if ( clip ) { + if ( pm.width() < w && pm.height() < h ) { + clip = FALSE; + } else { + p->save(); + QRegion cr = QRect(x, y, w, h); + if (p->hasClipping()) + cr &= p->clipRegion(QPainter::CoordPainter); + p->setClipRegion(cr); + } + } + if ( (flags & Qt::AlignVCenter) == Qt::AlignVCenter ) + y += h/2 - pm.height()/2; + else if ( (flags & Qt::AlignBottom) == Qt::AlignBottom) + y += h - pm.height(); + if ( (flags & Qt::AlignRight) == Qt::AlignRight ) + x += w - pm.width(); + else if ( (flags & Qt::AlignHCenter) == Qt::AlignHCenter ) + x += w/2 - pm.width()/2; + else if ( ((flags & Qt::AlignLeft) != Qt::AlignLeft) && QApplication::reverseLayout() ) // AlignAuto && rightToLeft + x += w - pm.width(); + + p->drawPixmap( x, y, pm ); + if ( clip ) + p->restore(); + } + else if ( !text.isNull() ) { + + + if(textEffectSettings.mode > 1 || buttonTextEffect) { // 0=none, 1=only buttons, 2=everywhere + + QRect br = p->fontMetrics().boundingRect(x, y, w, h, flags, text); + QPainter pixPainter; + QPixmap textPixmap(br.width(), br.height()); + textPixmap.fill(QColor(0,0,0)); + pixPainter.begin(&textPixmap); + pixPainter.setPen(white); + pixPainter.setFont(p->font()); + pixPainter.drawText( QRect(0,0,br.width(), br.height()), flags, text ); + pixPainter.end(); + + DominoQPixmap* pixm = (DominoQPixmap*)&textPixmap; + + uint height = pixm->height(); + uint width = pixm->width(); + + pixm->data->alphapm = new QPixmap; + + DominoQPixmap* alphapm = (DominoQPixmap*)pixm->data->alphapm; + + alphapm->data->w = width; + alphapm->data->h = height; + alphapm->data->d = 8; + alphapm->hd = XCreatePixmap(alphapm->x11Display(), RootWindow(alphapm->x11Display(), alphapm->x11Screen()), width, height, 8); + alphapm->rendhd = (HANDLE) XftDrawCreateAlpha( alphapm->x11Display(), alphapm->hd, 8 ); + + XImage *axi = XCreateImage(alphapm->x11Display(), (Visual *) alphapm->x11Visual(), 8, ZPixmap, 0, 0, width, height, 8, 0); + axi->data = (char *) malloc((unsigned) axi->bytes_per_line * height); + XImage* xi = XGetImage( qt_xdisplay(), pixm->handle(), 0, 0, width, height, AllPlanes, ZPixmap ); + + register int alpha; + register int customalpha = buttonTextEffect ? textEffectSettings.buttonOpacity : textEffectSettings.opacity; + for(register uint y = 0; y < height; ++y) { + for(register uint x = 0; x < width; ++x) { + alpha = (XGetPixel(xi, x, y)& 0xff ) * customalpha >> 8; // blue as alpha + XPutPixel(axi, x, y, alpha); + } + } + + GC gc = XCreateGC(alphapm->x11Display(), alphapm->hd, 0, 0); + XPutImage(alphapm->x11Display(), alphapm->hd, gc, axi, 0, 0, 0, 0, width, height); + + + if(buttonTextEffect) { + textPixmap.fill(textEffectSettings.buttonColor); + + QRect tr = QRect(br.x()+textEffectSettings.buttonPos.x(), br.y()+textEffectSettings.buttonPos.y(), r.width(), r.height()); + if(tr.x() < r.x()) { + p->setClipRegion(r); + tr.setWidth(tr.width()+r.x()+abs(tr.x())); + } + p->drawPixmap(tr.x(), tr.y(), textPixmap, 0, 0, tr.width(), tr.height()); + if(tr.x() < r.x()) + p->setClipping(false); + } + else { + textPixmap.fill(textEffectSettings.color); + + QRect tr = QRect(br.x()+textEffectSettings.pos.x(), br.y()+textEffectSettings.pos.y(), r.width(), r.height()); + if(tr.x() < r.x()) { + p->setClipRegion(r); + tr.setWidth(tr.width()+r.x()+abs(tr.x())); + } + p->drawPixmap(tr.x(), tr.y(), textPixmap, 0, 0, tr.width(), tr.height()); + if(tr.x() < r.x()) + p->setClipping(false); + } + + if(axi); + XDestroyImage(axi); + if(xi) + XDestroyImage(xi); + XFreeGC(alphapm->x11Display(), gc); + } + + if(!enabled) + p->setPen(g.text()); + p->drawText( r.x(), r.y(), r.width(), r.height(), flags, text, len ); + + + } +} + + +QWidget::BackgroundOrigin DominoStyle::setPixmapOrigin(QWidget::BackgroundOrigin origin) +{ + switch(origin) { + case QWidget::WidgetOrigin: + return QWidget::ParentOrigin; + case QWidget::ParentOrigin: + return QWidget::AncestorOrigin; + default: + return origin; + break; + } +} + +void DominoStyle::setDominoButtonPalette(QWidget* widget, PaletteTyp type) { + QPalette pal; + switch(type) { + case Palette_Application: + pal = qApp->palette(); + break; + case Palette_Parent: + pal = widget->parentWidget()->palette(); + break; + case Palette_Widget: + pal = widget->palette(); + default: + break; + } + + int h, s, v; + pal.active().buttonText().hsv(&h, &s, &v); + QColor disabledColor = alphaBlendColors(pal.active().buttonText(), v < 127 ? white : black, 150); + pal.setColor(QPalette::Disabled, QColorGroup::Text, disabledColor); + + widget->setPalette(pal); +} + + +void DominoStyle::updateTabWidgetFrame() { + + QTabWidget* tw = dynamic_cast(sender()->parent()); + QWidget* w = tw ? tw->currentPage() : 0; + if(!w) + return; + QFrame* f = dynamic_cast(w->parentWidget()); + if(f) { + QRect r = f->rect(); + if(tw->tabPosition() == QTabWidget::Top) + r= QRect(r.x(), r.y(), r.width(), 3); + else + r= QRect(r.x(), r.y()+r.height()-4, r.width(), 2); + f->repaint(r, false); + } +} + +QPixmap DominoStyle::disableIcon(const QPixmap* icon) const { + + QImage img = icon->convertToImage(); + register uint pixels = img.depth() > 8 ? img.width()*img.height() : img.numColors(); + register uint *data = img.depth() > 8 ? (unsigned int *)img.bits() : (unsigned int *)img.colorTable(); + register uint val, i; + for(i=0; i < pixels; ++i){ + val = qGray(data[i]); + data[i] = qRgba(val, val, val, qAlpha(data[i])); + } + img = setImageOpacity(img, 50); + + return QPixmap(img); +} + + +// same as in renderSurface() but with darker colors +void DominoStyle::renderTabSeparator(QPainter *p, const QRect &r, const QColor buttonColor, bool tabAbove) const { + + const DSurface* ds = tabAbove ? &tabTopSurface : &tabBottomSurface; + + int top = r.y()+r.height()*ds->g1Top/100; + int bottom = r.height()*ds->g1Bottom/100; + int top2 = r.y()+r.height()*ds->g2Top/100; + int bottom2 = r.height()*ds->g2Bottom/100-top2; + + QColor c1; + QColor c2; + QColor c3; + QColor c4; + QColor bg; + + if(buttonColor != qApp->palette().active().button()) { + c1 = alphaBlendColors(buttonColor, ds->g1Color1, 127); + c2 = alphaBlendColors(buttonColor, ds->g1Color2, 127); + c3 = alphaBlendColors(buttonColor, ds->g2Color1, 127); + c4 = alphaBlendColors(buttonColor, ds->g2Color2, 127); + bg = alphaBlendColors(buttonColor, ds->background, 127); + } + else { + c1 = ds->g1Color1; + c2 = ds->g1Color2; + c3 = ds->g2Color1; + c4 = ds->g2Color2; + bg = ds->background; + } + + const int alpha = 35; // 55, 25 + p->fillRect(r, alphaBlendColors(QColor(0,0,0),bg , alpha)); + switch(ds->numGradients) { + case 1: { + c1 = alphaBlendColors(QColor(0,0,0), c1, alpha); + c2 = alphaBlendColors(QColor(0,0,0), c2, alpha); + renderGradient(p, QRect(r.x(), top, r.width(), bottom), c1, c2, true); + break; + } + case 2: { + c1 = alphaBlendColors(QColor(0,0,0), c1, alpha); + c2 = alphaBlendColors(QColor(0,0,0), c2, alpha); + c3 = alphaBlendColors(QColor(0,0,0), c3, alpha); + c4 = alphaBlendColors(QColor(0,0,0), c4, alpha); + renderGradient(p, QRect(r.x(), top, r.width(), bottom), c1, c2, true); + renderGradient(p, QRect(r.x(), top2, r.width(), bottom2), c3, c4, true); + } + default: + break; + } +} + +void DominoStyle::renderGroupBox(QObject *obj, QEvent *ev) { + + QGroupBox* gb = dynamic_cast(obj); + bool paintEvent = ev->type() == QEvent::Paint; + QRect r = gb->rect(); + + if(gb->isFlat()) { + + QString title = gb->title(); + int titleHeight = gb->fontMetrics().height(); + int titleWidth = gb->fontMetrics().width(title); + if(title.contains("&")) + titleWidth -= gb->fontMetrics().width("&"); + QPainter p(gb); +// p.setPen(qApp->palette().active().background().dark(120)); + p.setPen(alphaBlendColors(gb->paletteForegroundColor(), gb->paletteBackgroundColor(), 40)); + p.drawLine(0, titleHeight/2-2, r.width()/2-titleWidth/2-4, titleHeight/2-2); + p.drawLine(r.width()/2+titleWidth/2+4, titleHeight/2-2, r.width(), titleHeight/2-2); + + QColorGroup cg = gb->parentWidget()->colorGroup(); + dominoDrawItem(&p, QRect(r.width()/2-titleWidth/2, -1, r.width(), titleHeight), ShowPrefix, cg, Style_Enabled, 0, title, -1, &cg.foreground(), false); + p.setPen(cg.foreground()); + ((DominoQGroupBox*)gb)->drawContents(&p); + } + else { + QString title = gb->title(); + int titleHeight = gb->fontMetrics().height(); + QColor outsideColor = gb->parentWidget() ? gb->parentWidget()->paletteBackgroundColor() : gb->paletteBackgroundColor(); + QColor insideColor = groupBoxSettings.tintBackground ? getGroupBoxColor(gb) : gb->paletteBackgroundColor(); + bool pixmapExists = groupBoxPixmaps.contains(gb); + + if(paintEvent && pixmapExists) { + QPainter p; + if(!title.isEmpty()) { + int titleWidth = gb->fontMetrics().width(title); + if(title.contains("&")) + titleWidth -= gb->fontMetrics().width("&"); + + QPainter p(groupBoxPixmaps[gb]); + QRect titleRect = QRect((r.width()-titleWidth)/2, -1, r.width(), titleHeight); + p.fillRect(titleRect, outsideColor); + dominoDrawItem(&p, titleRect, ShowPrefix, gb->colorGroup(), true, 0, title, -1, &gb->foregroundColor(), false); + p.end(); + } + // only needed for the case if a disabled groupbox gets disabled for a second time. + // Qt3 just changes the palette to disabled without checking if it already is (and removes here the "hidden" background pixmap) + bitBlt(gb, 0, 0, groupBoxPixmaps[gb]); + p.begin(gb); + ((DominoQGroupBox*)gb)->drawContents(&p); + return; + } + + bool isCheckable = gb->isCheckable(); + int x = r.x(); + int y = isCheckable ? r.y()+titleHeight+5 : (title.isNull() || title.isEmpty()) ? QMAX(r.y()-1, 0) : r.y()+titleHeight-1; + int w = r.width(); + int h = r.height(); + +// if(y+16 > h || 16 > w) // don't overlap the pixmaps +// return; + + + QPixmap buffer(r.width(), r.height()); + + QPainter p(&buffer); + p.fillRect(QRect(0, 0, w, y), outsideColor); + p.fillRect(QRect(x+3, y+3, w-6, h-6-y), insideColor); + + QPixmap* gbPix = 0; + if(!(gbPix = QPixmapCache::find(QString::number(outsideColor.pixel(), 16)+QString::number(insideColor.pixel(), 16)+"groupbox"))) { + gbPix = new QPixmap(16, 16); + gbPix->fill(outsideColor); + + QPixmap groupBoxPixMask = qembed_findImage("groupBoxMask"); + groupBoxPixMask.fill(insideColor); + bitBlt(gbPix, 0, 0, &groupBoxPixMask); + + QPixmap groupBoxPix = qembed_findImage("groupBox"); + bitBlt(gbPix, 0, 0, &groupBoxPix); + + QPixmapCache::insert(QString::number(outsideColor.pixel(), 16)+QString::number(insideColor.pixel(), 16)+"groupbox", gbPix); + } + + bitBlt(&buffer, 0, y, gbPix, 0, 0, 8, 8); + bitBlt(&buffer, w-8, y, gbPix, 8, 0, 8, 8); + bitBlt(&buffer, 0, h-8, gbPix, 0, 8, 8, 8); + bitBlt(&buffer, w-8, h-8, gbPix, 8, 8, 8, 8 ); + + // top + QColor c1 = alphaBlendColors(QColor(255,255,255), outsideColor, 25); + QColor c2 = alphaBlendColors(QColor(0,0,0), insideColor, 70); + QColor c3 = alphaBlendColors(QColor(0,0,0), insideColor, 30); + // left + right + QColor c4 = alphaBlendColors(QColor(255,255,255), outsideColor, 40); + QColor c5 = c3; //alphaBlendColors(QColor(0,0,0), insideColor, 30); + QColor c6 = alphaBlendColors(QColor(0,0,0), insideColor, 4); + // bottom + QColor c7 = alphaBlendColors(QColor(6,6,6), insideColor, 25); + QColor c8 = alphaBlendColors(QColor(255,255,255), outsideColor, 79); + QColor c9 = alphaBlendColors(QColor(255,255,255), outsideColor, 30); + + + // top + p.setPen(c1); + p.drawLine(r.left()+8, y, r.right()-8, y); + p.setPen(c2); + p.drawLine(r.left()+8, y+1, r.right()-8, y+1); + p.setPen(c3); + p.drawLine(r.left()+8, y+2, r.right()-8, y+2); + // bottom + p.setPen(c7); + p.drawLine(r.left()+8, r.bottom()-2, r.right()-8, r.bottom()-2); + p.setPen(c8); + p.drawLine(r.left()+8, r.bottom()-1, r.right()-8, r.bottom()-1); + p.setPen(c9); + p.drawLine(r.left()+8, r.bottom(), r.right()-8, r.bottom()); + // left / right + p.setPen(c4); + p.drawLine(r.left(), y+8, r.left(), r.bottom()-8); + p.drawLine(r.right(), y+8, r.right(), r.bottom()-8); + p.setPen(c5); + p.drawLine(r.left()+1, y+8, r.left()+1, r.bottom()-8); + p.drawLine(r.right()-1, y+8, r.right()-1, r.bottom()-8); + p.setPen(c6); + p.drawLine(r.left()+2, y+8, r.left()+2, r.bottom()-8); + p.drawLine(r.right()-2, y+8, r.right()-2, r.bottom()-8); + + p.end(); + + if(ev->type() == QEvent::Resize) + XSetWindowBackgroundPixmap( gb->x11Display(), gb->winId(), buffer.handle()); + else if(paintEvent) { + if(!title.isEmpty()) { + int titleWidth = gb->fontMetrics().width(title); + if(title.contains("&")) + titleWidth -= gb->fontMetrics().width("&"); + + p.begin(&buffer); + QRect titleRect = QRect((r.width()-titleWidth)/2, -1, r.width(), titleHeight); + p.fillRect(titleRect, outsideColor); + dominoDrawItem(&p, titleRect, ShowPrefix, gb->colorGroup(), true, 0, title, -1, &gb->foregroundColor(), false); + p.end(); + } + bitBlt(gb, 0, 0, &buffer); + + p.begin(gb); + ((DominoQGroupBox*)gb)->drawContents(&p); + } + + + if(pixmapExists) + delete groupBoxPixmaps[gb]; + groupBoxPixmaps[gb] = new QPixmap(buffer); + + } +} + +void DominoStyle::spinBoxValueChanged(int value) { + QSpinBox* sb = (QSpinBox*)sender(); + if(spinWidgetDown) { + spinWidgetDown = !(value == sb->maxValue() || value == sb->minValue()); + if(!spinWidgetDown) { + // if we repaint directly, the last mousePressEvent wouldn't be down + QTimer::singleShot( 200, ((DominoQSpinBox*)sb)->editor()->parentWidget(), SLOT(repaint()) ); + } + } +} + +uint DominoStyle::preMultiplyColor(const uint &c) const { + XRenderColor clr; + uint color = c << 8 | qAlpha(c); + + uint red = (color >> 24) & 0xff; + uint green = (color >> 16) & 0xff; + uint blue = (color >> 8) & 0xff; + uint alpha = (color >> 0) & 0xff; + + red = red * alpha / 255; + green = green * alpha / 255; + blue = blue * alpha / 255; + + clr.red = (red << 8) + red; + clr.green = (green << 8) + green; + clr.blue = (blue << 8) + blue; + clr.alpha = (alpha << 8) + alpha; + + return qRgba(clr.red, clr.green, clr.blue, clr.alpha); +} + +void DominoStyle::toolPopupPressed() { + QToolButton* tb = (QToolButton*)sender(); + if(!tb ) + return; + if(tb->popup() && tb->isEnabled() && tb->isDown()) { + popupButton = tb; + connect(popupTimer, SIGNAL(timeout()), this, SLOT(popupToolMenu())); + popupTimer->start(600, true); + } +} + +void DominoStyle::popupToolMenu() { + if(!popupButton ) + return; + + if(popupButton->popup() && !popupButton->popup()->isVisible() && popupButton->isEnabled() && popupButton->isDown()) { + popupButton->openPopup(); + } + popupButton = 0; +} + +void DominoStyle::toolPopupReleased() { + if(!popupButton) + return; + + if(popupTimer->isActive()) { + popupTimer->stop(); + popupButton = 0; + } +} + +#include "eventfilter.cpp" +#include "domino.moc" diff --git a/domino/domino.h b/domino/domino.h new file mode 100644 index 0000000..617f111 --- /dev/null +++ b/domino/domino.h @@ -0,0 +1,865 @@ +/* Domino widget style for KDE 3 + Copyright (C) 2006 Michael Lentner + + based on the KDE style "Plastik": + Copyright (C) 2003 Sandro Giessl + + based on the KDE style "dotNET": + Copyright (C) 2001-2002, Chris Lee + Carsten Pfeiffer + Karol Szwed + Drawing routines completely reimplemented from KDE3 HighColor, which was + originally based on some stuff from the KDE2 HighColor. + + based on drawing routines of the style "Keramik": + Copyright (c) 2002 Malte Starostik + (c) 2002,2003 Maksim Orlovich + based on the KDE3 HighColor Style + Copyright (C) 2001-2002 Karol Szwed + (C) 2001-2002 Fredrik Höglund + Drawing routines adapted from the KDE2 HCStyle, + Copyright (C) 2000 Daniel M. Duley + (C) 2000 Dirk Mueller + (C) 2001 Martijn Klingens + Progressbar code based on KStyle, + Copyright (C) 2001-2002 Karol Szwed + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __DOMINO_H +#define __DOMINO_H + +#include +#include +#include +#include "misc.h" +#include "data.h" +#include + + +// #include +#include +class ButtonContour; +class RubberWidget; +class Rubber; + + + enum ContourType +{ + Contour_Sunken = 0, + Contour_Raised = 1, + Contour_Simple = 2 +}; + + enum ContourState +{ + Contour_Default = 0, + Contour_Pressed = 1, + Contour_MouseOver = 2, + Contour_DefaultButton = 3 +}; + + enum TextEffect +{ + TextEffect_None = 0, + TextEffect_OnlyButton = 1, + TextEffect_Everywhere = 2 +}; + + struct DSurface { + int numGradients; + QColor g1Color1; + QColor g1Color2; + QColor g2Color1; + QColor g2Color2; + QColor background; + int g1Top; + int g1Bottom; + int g2Top; + int g2Bottom; + }; + + +class DominoStyle : public KStyle +{ + Q_OBJECT + +public: + + DominoStyle(); + virtual ~DominoStyle(); + + enum PaletteTyp + { + Palette_Application, + Palette_Parent, + Palette_Widget + }; + + void polish(QApplication* app ); + void polish(QWidget* widget ); + void polish( QPalette &p ); + void unPolish(QWidget* widget ); + + void drawKStylePrimitive(KStylePrimitive kpe, + QPainter* p, + const QWidget* widget, + const QRect &r, + const QColorGroup &cg, + SFlags flags = Style_Default, + const QStyleOption& = QStyleOption::Default ) const; + + void drawPrimitive(PrimitiveElement pe, + QPainter *p, + const QRect &r, + const QColorGroup &cg, + SFlags flags = Style_Default, + const QStyleOption &opt = QStyleOption::Default ) const; + + void drawControl(ControlElement element, + QPainter *p, + const QWidget *widget, + const QRect &r, + const QColorGroup &cg, + SFlags flags = Style_Default, + const QStyleOption& = QStyleOption::Default ) const; + + void drawControlMask( ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const; + + void drawComplexControl(ComplexControl control, + QPainter *p, + const QWidget *widget, + const QRect &r, + const QColorGroup &cg, + SFlags flags = Style_Default, + SCFlags controls = SC_All, + SCFlags active = SC_None, + const QStyleOption& = QStyleOption::Default ) const; + + int pixelMetric(PixelMetric m, + const QWidget *widget = 0 ) const; + + QRect subRect(SubRect r, + const QWidget *widget ) const; + + QRect querySubControlMetrics(ComplexControl control, + const QWidget *widget, + SubControl subcontrol, + const QStyleOption &opt = QStyleOption::Default ) const; + + QSize sizeFromContents(QStyle::ContentsType t, + const QWidget *w, + const QSize &s, + const QStyleOption &o) const; + + int styleHint(StyleHint, const QWidget * = 0, + const QStyleOption & = QStyleOption::Default, + QStyleHintReturn * = 0 ) const; + + + QPixmap stylePixmap(StylePixmap stylepixmap, const QWidget* widget, const QStyleOption& opt) const; + + void drawItem( QPainter *p, const QRect &r, + int flags, const QColorGroup &g, bool enabled, + const QPixmap *pixmap, const QString &text, + int len = -1, const QColor *penColor = 0) const; + + void dominoDrawItem( QPainter *p, const QRect &r, + int flags, const QColorGroup &g, bool enabled, + const QPixmap *pixmap, const QString &text, + int len = -1, const QColor *penColor = 0, bool buttonTextEffect = 0 ) const; + + void setDominoButtonPalette(QWidget* widget, PaletteTyp type); + + virtual void drawFocusIndicator(QPainter *p, + const QRect &r, + int flags, + const QColorGroup cg, + bool /*enabled*/, + const QPixmap* /*pixmap*/, + const QString & text, + int /*len = -1*/, + const QColor& highlight = 0, + bool drawLine = true, + bool isButton = false) const; + + QPixmap renderOutlineIcon(const QPixmap* icon) const; + + void renderSurface(QPainter *p, + const QRect &r, + const QColor &backgroundColor, + const QColor &buttonColor, + const QColor &highlightColor, + const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| + Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight|Is_Horizontal) const; + + inline QWidget::BackgroundOrigin setPixmapOrigin(QWidget::BackgroundOrigin origin); + + mutable Rubber* rubber; + mutable QRect oldRubberRect; + mutable bool viewPortPressed; + mutable bool ignoreNextFocusRect; + uint _argbRubberBandColor; + mutable bool compositeManagerRunning; + const QWidget* rubberViewPort; + +protected: + + enum RubberType + { + ArgbRubber = 1, + LineRubber = 2, + DistRubber = 3 + }; + RubberType rubberBandType; + + enum TabPosition + { + First , + Middle, + Last, + Single + }; + + struct TextEffectSettings { + TextEffect mode; + QColor color; + QColor buttonColor; + int opacity; + int buttonOpacity; + QPoint pos; + QPoint buttonPos; + }; + + struct GroupBoxSettings { + bool tintBackground; + int brightness; + bool customColor; + QColor color; + }; + + struct FocusIndicatorSettings { + QColor color; + int opacity; + QColor buttonColor; + int buttonOpacity; + bool drawUnderline; + bool indicateFocus; + }; + + + mutable TextEffectSettings textEffectSettings; + GroupBoxSettings groupBoxSettings; + FocusIndicatorSettings focusIndicatorSettings; + + ButtonContour* buttonContour; + + enum SurfaceFlags { + Draw_Left = 0x00000001, + Draw_Right = 0x00000002, + Draw_Top = 0x00000004, + Draw_Bottom = 0x00000008, + Is_Horizontal = 0x00000200, + Is_Highlight = 0x00000400, + Is_Default = 0x00000800, + Is_Disabled = 0x00001000, + Round_UpperLeft = 0x00002000, + Round_UpperRight = 0x00004000, + Round_BottomLeft = 0x00008000, + Round_BottomRight = 0x00010000, + Rectangular_UpperLeft = 0x00000010, + Rectangular_UpperRight = 0x10000020, + Rectangular_BottomLeft = 0x00000040, + Rectangular_BottomRight = 0x00000080, + + Draw_AlphaBlend = 0x00020000, + Is_ComboBox = 0x00080000, + Is_Button = 0x00100000, + Is_CheckItem = 0x00200000, + Is_RadioButton = 0x00400000, + Is_TabTop = 0x00000100, + Is_TabBottom = 0x01000000, + Is_ActiveTabTop = 0x00040000, + Is_ActiveTabBottom = 0x00800000, + Is_ScrollBarBtn = 0x02000000, + Is_Header = 0x04000000, + Is_ScrollBarGroove = 0x08000000, + Is_Slider = 0x20000000, + Is_Down = 0x40000000 + }; + + enum DominoStyleFlags { + Domino_noCache = 0x80000000 + }; + + enum DominoPrimitiveElement { + PE_ScrollBarSubLine2 = 0xf000001 + }; + + void renderContour(QPainter *p, + const QRect &r, + const QColor &backgroundColor, + const QColor &contourColor, + const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| + Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const; + + void renderButtonShadow(QPainter *p, const QRect &r, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| + Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight|Is_Horizontal) const; + + QPixmap* renderLineEditShadow(QWidget* widget, QRect rect, QColor bg, uint flags, bool reverse); + + inline void renderPixel(QPainter *p, + const QPoint &pos, + const int alpha, + const QColor &color, + const QColor &background = QColor(), + bool fullAlphaBlend = true) const; + + void renderButton(QPainter *p, + const QRect &r, + const QColorGroup &g, + bool sunken = false, + bool mouseOver = false, + bool horizontal = true, + bool enabled = true, + bool khtmlMode = false) const; + + void renderHeader(QPainter *p, + const QRect &r, + const QColorGroup &g, + bool sunken = false, + bool mouseOver = false, + bool horizontal = true, + bool enabled = true) const; + + void renderGradient(QPainter *p, + const QRect &r, + const QColor &c1, + const QColor &c2, + bool horizontal = true) const; + + void renderTab(QPainter *p, + const QRect &r, + const QColorGroup &g, + bool mouseOver = false, + const bool selected = false, + const bool bottom = false, + const TabPosition pos = Middle, + const bool triangular = false, + const bool cornerWidget = false, + const bool konqTab = false) const; + + DSurface btnSurface; + DSurface tabTopSurface; + DSurface activeTabTopSurface; + DSurface tabBottomSurface; + DSurface activeTabBottomSurface; + DSurface scrollBarSurface; + DSurface scrollBarGrooveSurface; + DSurface headerSurface; + DSurface checkItemSurface; + + bool eventFilter(QObject *, QEvent *); + + QString configMode; + void removeCachedSbPix(const QColor &color) { + QPixmapCache::remove("sHCap"+QString::number(color.pixel(), 16)+"1"+configMode); + QPixmapCache::remove("sHCap"+QString::number(color.pixel(), 16)+"0"+configMode); + QPixmapCache::remove("sVCap"+QString::number(color.pixel(), 16)+"1"+configMode); + QPixmapCache::remove("sVCap"+QString::number(color.pixel(), 16)+"0"+configMode); + QPixmapCache::remove(QString::number(color.pixel(), 16)+"sh"+configMode); + QPixmapCache::remove(QString::number(color.pixel(), 16)+"sv"+configMode); + QPixmapCache::remove(QString::number(color.pixel(), 16)+"ah"+configMode); + QPixmapCache::remove(QString::number(color.pixel(), 16)+"av"+configMode); + }; + + QColor getGroupBoxColor(const QWidget* w) const; + QPixmap* createCheckMark(const QColor color) const; + QPixmap* createRadioIndicator(const QColor color) const; + QPixmap disableIcon(const QPixmap* icon) const;; + + QWidget* hoverWidget; + + QPixmap* checkMark; + QPixmap* radioIndicator; + QPixmap* popupFrame; + QPixmap* border1; + mutable bool alphaButtonMode; + bool KApplicationMode; + QColor _checkMarkColor; + + QMap groupBoxPixmaps; + uint preMultiplyColor(const uint &c) const; + QToolButton* popupButton; + QTimer* popupTimer; + QPoint popupMousePressPos; + +protected slots: + void khtmlWidgetDestroyed(QObject* w); + void groupBoxDestroyed(QObject* w); + + //Animation slots. + void updateProgressPos(); + void updateScrollPos(); // smoothscroll + + void progressBarDestroyed(QObject* bar); + inline QColor dGetColor(const QColor &color, const int value) const; + inline QColor lightenColor(const QColor &color, const int value) const; + inline QColor darkenColor(const QColor &color, const int value) const; + void updateTabWidgetFrame(); + void spinBoxValueChanged(int); + void toolPopupPressed(); + void popupToolMenu(); + void toolPopupReleased(); + +private: + // Disable copy constructor and = operator + DominoStyle( const DominoStyle & ); + DominoStyle& operator=( const DominoStyle & ); + + bool kickerMode; + bool konquerorMode; + bool konsoleMode; + + mutable bool flatMode; + bool sideRepaint; + bool _animateProgressBar; + bool _drawTriangularExpander; + bool _customCheckMarkColor; + bool _smoothScrolling; + QColor _toolTipColor; + int _buttonHeightAdjustment; + bool _customPopupMenuColor; + QColor _popupMenuColor; + bool _customSelMenuItemColor; + QColor _selMenuItemColor; + bool _drawPopupMenuGradient; + bool _indentPopupMenuItems; + bool _centerTabs; + bool _wheelSwitchesTabs; + bool _customSliderHandleContourColor; + bool _drawButtonSunkenShadow; + bool _toolBtnAsBtn; + bool _highlightToolBtnIcon; + + bool konqTab; + int minTabLength; + bool macStyleBar; + int konqTabBarContrast; + bool spinWidgetDown; + + mutable int sliderlen; + + // smoothscrolling + int scrollDistance; + bool scrollVertical; + QScrollView* scrollWidget; + QTimer* scrollTimer; + + bool hoveredToolBoxTab; + + // track khtml widgets. + QMap khtmlWidgets; + + //Animation support. + QMap progAnimWidgets; + + // pixmap cache. + enum CacheEntryType { + cSurface, + cGradientTile, + cAlphaDot + }; + + struct CacheEntry + { + CacheEntryType type; + int width; + int height; + QRgb c1Rgb; + QRgb c2Rgb; + bool horizontal; + + QPixmap* pixmap; + + CacheEntry(CacheEntryType t, int w, int h, QRgb c1, QRgb c2 = 0, + bool hor = false, QPixmap* p = 0 ): + type(t), width(w), height(h), c1Rgb(c1), c2Rgb(c2), horizontal(hor), pixmap(p) + {} + + ~CacheEntry() + { + delete pixmap; + } + + int key() + { + // create an int key from the properties which is used to refer to entries in the QIntCache. + // the result may not be 100% correct as we don't have so much space in one integer -- use + // == operator after find to make sure we got the right one. :) + return horizontal ^ (type<<1) ^ (width<<5) ^ (height<<10) ^ (c1Rgb<<19) ^ (c2Rgb<<22); + } + + bool operator == (const CacheEntry& other) + { + bool match = (type == other.type) && + (width == other.width) && + (height == other.height) && + (c1Rgb == other.c1Rgb) && + (c1Rgb == other.c1Rgb) && + (horizontal = other.horizontal); +// if(!match) { +// qDebug("operator ==: CacheEntries don't match!"); +// qDebug("width: %d\t\tother width: %d", width, other.width); +// qDebug("height: %d\t\tother height: %d", height, other.height); +// qDebug("fgRgb: %d\t\tother fgRgb: %d", fgRgb, other.fgRgb); +// qDebug("bgRgb: %d\t\tother bgRgb: %d", bgRgb, other.bgRgb); +// qDebug("surfaceFlags: %d\t\tother surfaceFlags: %d", surfaceFlags, other.surfaceFlags); +// } + return match; + } + }; + QIntCache *pixmapCache; + + // For KPE_ListViewBranch + mutable QBitmap *verticalLine; + mutable QBitmap *horizontalLine; + + // For progress bar animation + QTimer *animationTimer; + + void renderTabSeparator(QPainter *p, const QRect &r, const QColor buttonColor, bool tabAbove) const; + void renderGroupBox(QObject *obj, QEvent *ev); +}; + + + +class ButtonContour +{ + friend class DominoStyleConfig; + friend class DominoStyle; + + public: + ButtonContour(); + virtual ~ButtonContour(); + + static const int num_states = 4; + static const int num_types = 3; + ContourType defaultType; + ContourType type; + ContourState state; + bool alpha_mode; + bool drawButtonSunkenShadow; + int created[num_types][num_states]; + int shadowCreated[num_states]; + + QColor contour[num_states]; + uint c1[num_types][num_states]; // top shadow + uint c2[num_types][num_states]; // outer ring + uint c3[num_types][num_states]; // inner ring + uint c4[num_types][num_states]; // bottom first shadow line + uint c5[num_types][num_states]; // bottom second shadow line + uint c6[num_types][num_states]; // first left shadow line + QPixmap* btnEdges[num_types][num_states]; + QPixmap* btnVLines[num_types][num_states]; + QPixmap* btnHLines[num_types][num_states]; + + // for sunken type and sunken flat buttons + QPixmap* buttonShadowRectangular[num_states]; + QPixmap* buttonShadowRound [num_states]; + QPixmap* buttonShadowHlines[num_states]; + QPixmap* buttonShadowVlines[num_states]; + + + bool alphaMode() { + return alpha_mode; + } + uint color1() { + return c1[type][state]; + } + uint color2() { + return c2[type][state]; + } + uint color3() { + return c3[type][state]; + } + uint color4() { + return c4[type][state]; + } + uint color5() { + return c5[type][state]; + } + uint color6() { + return c6[type][state]; + } + QColor contourColor(int t) { + return contour[t]; + } + QPixmap* buttonEdges() { + return btnEdges[type][state]; + } + QPixmap* buttonVLines() { + return btnVLines[type][state]; + } + QPixmap* buttonHLines() { + return btnHLines[type][state]; + } + void setType(ContourType t = Contour_Sunken) { + type = t; + createPixmaps(type, state); + } + void setState(ContourState s = Contour_Default) { + state = s; + if(s == Contour_Pressed && type != Contour_Sunken) + type = Contour_Simple; + createPixmaps(type, state); + } + void setContour(ContourType t = Contour_Sunken, ContourState s = Contour_Default) { + type = t; + state = s; + createPixmaps(type, state); + } + void setColor(ContourState s, QColor color) { + contour[s] = color; + + uint c2_tmp; + uint c3_tmp; + if(defaultType == Contour_Sunken /*|| defaultType == Contour_Simple*/) { + c2_tmp = qRgba(contour[s].red(), contour[s].green(), contour[s].blue(), 218); + c3_tmp = qRgba(contour[s].red(), contour[s].green(), contour[s].blue(), 35); + } + else { + c2_tmp = qRgba(contour[s].red(), contour[s].green(), contour[s].blue(), 203); + + QColor whiteColor(qRgba(Qt::white.red(), Qt::white.green(), Qt::white.blue(), 34)); + QColor blackColor(qRgba(contour[s].red(), contour[s].green(), contour[s].blue(), 35)); + + c3_tmp = blendColors(whiteColor, blackColor).rgb(); + } + + for(int t = 0; t < num_types; t++) { + c2[t][s] = c2_tmp; // outer ring + c3[t][s] = c3_tmp; // inner ring + } + } + void setDefaultType(ContourType t = Contour_Raised, bool create = true) { + defaultType = t; + type = t; + if(create) + createPixmaps(type, state); + } + void setAlphaMode() { + alpha_mode = true; + } + void reset() { + type = defaultType; + state = Contour_Default; + alpha_mode = false; + } + + QPixmap* shadowRound() { + return buttonShadowRound[state]; + } + QPixmap* shadowRectangular() { + return buttonShadowRectangular[state]; + } + QPixmap* shadowHLines() { + return buttonShadowHlines[state]; + } + QPixmap* shadowVLines() { + return buttonShadowVlines[state]; + } + + void createPixmaps(ContourType t = Contour_Sunken, ContourState s = Contour_Default) { + type = t; + state = s; + + + // for pressed sunken buttons + pressed KMultiTabbarTabs + if(drawButtonSunkenShadow && !shadowCreated[state]) { + + QColor shadowColor = alphaBlendColors(Qt::black, contour[state], 120); + buttonShadowRectangular[state] = new QPixmap(tintImage(qembed_findImage("btnPressedShadowRectangular"), shadowColor)); + buttonShadowRound[state] = new QPixmap(tintImage(qembed_findImage("btnPressedShadowRound"), shadowColor)); + buttonShadowHlines[state] = new QPixmap(tintImage(qembed_findImage("btnPressedShadowHLines"), shadowColor)); + buttonShadowVlines[state] = new QPixmap(tintImage(qembed_findImage("btnPressedShadowVLines"), shadowColor)); + shadowCreated[state] = 1; + } + + + if(created[type][state]) + return; + + QImage btnVLines_img; + QImage btnHLines_img; + QImage btnShadow_img; + + switch(type) { + case Contour_Simple: // now pressed raised! + btnShadow_img = qembed_findImage("btnRSPr"); // the inner white ring + blend(tintImage(qembed_findImage("btn"), contour[state]), btnShadow_img, btnShadow_img); + btnHLines_img = qembed_findImage("btnHRSPr"); + blend(tintImage(qembed_findImage("btnH"), contour[state]), btnHLines_img, btnHLines_img); + btnVLines_img = qembed_findImage("btnVRSPr"); + blend(tintImage(qembed_findImage("btnV"), contour[state]), btnVLines_img, btnVLines_img); + break; + case Contour_Sunken: + btnShadow_img = qembed_findImage("btnSSh"); + blend(tintImage(qembed_findImage("btn"), contour[state]), btnShadow_img, btnShadow_img); + btnHLines_img = qembed_findImage("btnHSSh"); + blend(tintImage(qembed_findImage("btnH"), contour[state]), btnHLines_img, btnHLines_img); + btnVLines_img = qembed_findImage("btnVSSh"); + blend(tintImage(qembed_findImage("btnV"), contour[state]), btnVLines_img, btnVLines_img); + break; + case Contour_Raised: + btnShadow_img = qembed_findImage("btn17RaisedShadow3"); // the inner white ring + outer shadow + blend(tintImage(qembed_findImage("btn"), contour[state]), btnShadow_img, btnShadow_img); + btnHLines_img = qembed_findImage("btnHRSh"); + blend(tintImage(qembed_findImage("btnH"), contour[state]), btnHLines_img, btnHLines_img); + btnVLines_img = qembed_findImage("btnVRSh"); + blend(tintImage(qembed_findImage("btnV"), contour[state]), btnVLines_img, btnVLines_img); + default: + break; + } + + btnEdges[type][state] = new QPixmap(btnShadow_img); + btnVLines[type][state] = new QPixmap(btnVLines_img); + btnHLines[type][state] = new QPixmap(btnHLines_img); + created[type][state] = 1; + } +}; + +class RubberWidget : public QWidget +{ + public: + RubberWidget(Window window); + ~RubberWidget(); +}; + +class Rubber +{ + friend class DominoStyle; + + public: + Rubber(uint col); + ~Rubber(); + + Visual* visual; + Colormap colormap; + XSetWindowAttributes wsa; + Window window; + + RubberWidget* parent; + RubberWidget* rubber; + QRegion mask; + uint color; + + void destroy() { + if(parent) { + delete rubber; + delete parent; + window = 0; + parent = 0; + rubber = 0; + } + } + void create(QRect& r, QRegion& mask); + void updateMask(QRegion& mask); +}; + + +// DominoXXX classes to access protected (or private...) members +class DominoQGroupBox : public QGroupBox +{ + friend class DominoStyle; + public: + DominoQGroupBox( QWidget* parent=0, const char* name=0 ) + : QGroupBox( parent, name ) {} +}; + +class DominoQWidget : public QWidget +{ + friend class DominoStyleConfig; + friend class DominoStyle; + public: + DominoQWidget( QWidget* parent=0, const char* name=0 ) + : QWidget( parent, name ) {} + +}; + +class DominoQFrame : public QFrame +{ + friend class DominoStyle; + public: + DominoQFrame( QFrame* parent=0, const char* name=0 ) + : QFrame( parent, name ) {} +}; + +// QWhatsThis +class DominoQWhatsThat : public QWidget +{ + friend class DominoStyle; + public: + DominoQWhatsThat(): QWidget() {} + private: + QString text; +}; + +class DominoKToolBarButton : public KToolBarButton +{ + friend class DominoStyle; + public: + DominoKToolBarButton(): KToolBarButton() {} +}; + +class DominoQListBoxItem : public QListBoxItem +{ + friend class DominoStyle; + public: + DominoQListBoxItem(): QListBoxItem() {} +}; + +class DominoQTabWidget : public QTabWidget +{ + friend class DominoStyleConfig; + friend class DominoStyle; + public: + DominoQTabWidget( QWidget* parent=0, const char* name=0 ) + : QTabWidget( parent, name ) {} +}; + +class DominoQSpinBox : public QSpinBox +{ + friend class DominoStyle; + public: + DominoQSpinBox( QFrame* parent=0, const char* name=0 ) + : QSpinBox( parent, name ) {} +}; + +class DominoQPixmap : public QPixmap +{ + friend class DominoStyle; + public: + DominoQPixmap( int w, int h, int depth = -1) : QPixmap(w, h, depth) {} +}; + +class DominoQButton : public QButton +{ + friend class DominoStyle; + public: + DominoQButton(): QButton() {} +}; + +#endif // __DOMINO_H diff --git a/domino/domino.themerc b/domino/domino.themerc new file mode 100644 index 0000000..30ae7f5 --- /dev/null +++ b/domino/domino.themerc @@ -0,0 +1,7 @@ +[Misc] +Name=Domino +Comment=A style with customizable color gradients +Comment[de]=Ein Stil mit anpassbaren Farbverläufen +ConfigPage=kstyle_domino_config +[KDE] +WidgetStyle=Domino diff --git a/domino/eventfilter.cpp b/domino/eventfilter.cpp new file mode 100644 index 0000000..a3dce1c --- /dev/null +++ b/domino/eventfilter.cpp @@ -0,0 +1,1840 @@ +/* + Copyright (C) 2006 Michael Lentner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +bool DominoStyle::eventFilter(QObject *obj, QEvent *ev) +{ + +// qDebug("className: %s -- name: %s", obj->className(), obj->name()); + + if(dynamic_cast(obj)) { + + switch(ev->type()) { + case QEvent::Paint: { + + QComboBox* cb = dynamic_cast(obj); + bool khtmlWidget = khtmlWidgets.contains(cb); + const QColorGroup & g = cb->colorGroup(); + + QPixmap buffer; + QPainter p; + if(khtmlWidget) + p.begin(cb); + else { + buffer.resize(cb->width(), cb->height()); + p.begin(&buffer); + } + + p.setFont(cb->font()); + + + if(!khtmlWidget && cb->parentWidget() && cb->parentWidget()->backgroundPixmap()){ + + QPoint point = cb->backgroundOffset(); + p.drawTiledPixmap( 0, 0, cb->width(), cb->height(), + *cb->parentWidget()->backgroundPixmap(), + point.x(), point.y() ); + } + + + QStyle::SFlags flags = QStyle::Style_Default; + if (cb->isEnabled()) + flags |= QStyle::Style_Enabled; + if (cb->hasFocus()) + flags |= QStyle::Style_HasFocus; + + if(!cb->listBox()) { + + drawComplexControl( QStyle::CC_ComboBox, &p, cb, cb->rect(), g, + flags, (uint)QStyle::SC_All, /*(cb->arrowDown ? */QStyle::SC_ComboBoxArrow /*: QStyle::SC_None )*/); + + QRect re = querySubControlMetrics( QStyle::CC_ComboBox, cb, QStyle::SC_ComboBoxEditField ); + re = QStyle::visualRect(re, cb); + p.setClipRect( re ); + + QString str = 0; + const QPixmap *pix = 0; + if(cb->count() > 0) { + str = cb->text(cb->currentItem()); + cb->pixmap(cb->currentItem()); + } + if ( !str.isNull() ) { +// p.save(); +// p.setFont(cb->font()); +// QFontMetrics fm(cb->font()); +// int x = re.x(), y = re.y() + fm.ascent(); +// if( pix ) +// x += pix->width() + 5; +// p.drawText( x, y, str ); +// p.restore(); + dominoDrawItem( &p, re, AlignCenter, cb->colorGroup(), + cb->isEnabled(), 0, str, -1, + &cb->colorGroup().buttonText(), textEffectSettings.mode > 0 ? 1 : 0 ); + } + if ( pix ) { + p.fillRect( re.x(), re.y(), pix->width() + 4, re.height(), + cb->colorGroup().brush( QColorGroup::Base ) ); + p.drawPixmap( re.x() + 2, re.y() + + ( re.height() - pix->height() ) / 2, *pix ); + } + } + else { + drawComplexControl( QStyle::CC_ComboBox, &p, cb, cb->rect(), g, + flags, (uint)QStyle::SC_All, /*(d->arrowDown ? */QStyle::SC_ComboBoxArrow/* : QStyle::SC_None )*/); + QRect re = querySubControlMetrics( QStyle::CC_ComboBox, cb, QStyle::SC_ComboBoxEditField ); + re = QStyle::visualRect(re, cb); + p.setClipRect( re ); + + if ( !cb->editable() ) { + + QString str = 0; + const QPixmap *pix = 0; + if(cb->count() > 0) { + str = cb->text(cb->currentItem()); + pix = cb->pixmap(cb->currentItem()); + } + + re.addCoords(+2, 0, 0, -1); + if(pix) { + drawItem( &p, QRect(re.left()+1, re.top(), re.width(), re.height()-1), AlignLeft|AlignVCenter, cb->colorGroup(), + cb->isEnabled(), pix, 0, -1, &cb->colorGroup().buttonText() ); + re.setX(re.x()+pix->width()+2); + } + if(!str.isNull()) { + dominoDrawItem( &p, QRect(re.left(), re.top(), re.width(), re.height()), AlignLeft|AlignVCenter, cb->colorGroup(), + cb->isEnabled(), 0, str, -1, &cb->colorGroup().buttonText(), textEffectSettings.mode > 0 ? 1 : 0 ); + } + else if(!pix) { + DominoQListBoxItem * item = (DominoQListBoxItem*)cb->listBox()->item( cb->currentItem() ); + if ( item ) { + int itemh = item->height( cb->listBox() ); + p.translate( re.x(), re.y() +(re.height()- itemh)/2); + item->paint( &p ); + } + } + } + else if ( cb->listBox() && cb->listBox()->item( cb->currentItem() ) ) { + + QListBoxItem * item = cb->listBox()->item( cb->currentItem() ); + const QPixmap *pix = item->pixmap(); + if ( pix ) { + if(re.width() < pix->width()) + return true; + QColor color = cb->isEnabled() ? cb->lineEdit()->paletteBackgroundColor() : cb->lineEdit()->palette().active().background(); + QPixmap* shadowPix = renderLineEditShadow(cb, QRect(0, 0, pix->width() + 3, re.height()), color, Draw_Left, QApplication::reverseLayout()); + + if(!QApplication::reverseLayout()) { + int x = re.x(); + int y = re.y(); + int w = pix->width() + 4; + int h = re.height()+re.y(); + + QRegion mask(x+3, y, w+3, h); + mask += QRegion(x, y+3, 3, h-9); + p.setClipRegion(mask); + } + bitBlt(shadowPix, 3, ( shadowPix->height() - pix->height() ) / 2, pix); + p.drawPixmap(re.x(), re.y(), *shadowPix); + delete shadowPix; + } + } + } + p.end(); + if(!khtmlWidget) { + p.begin(cb); + p.drawPixmap(0, 0, buffer); + } + + return true; + + } + case QEvent::Enter: { + QButton* btn = static_cast(obj); + if(btn->isEnabled()) { + hoverWidget = btn; + btn->repaint(false); + } + return false; + } + case QEvent::Leave: { + QButton* btn = static_cast(obj); + if(btn->isEnabled()) { + hoverWidget = 0; + btn->repaint(false); + } + return false; + } + case QEvent::PaletteChange: { + setDominoButtonPalette(static_cast(obj), Palette_Widget); + return true; + } + case QEvent::ParentPaletteChange: { + setDominoButtonPalette(dynamic_cast(obj), Palette_Parent); + return false; + } + case QEvent::ApplicationPaletteChange: { + if(!khtmlWidgets.contains(static_cast(obj))) + setDominoButtonPalette(static_cast(obj), Palette_Application); + return true; + } + default: + return false; + } + } + + // don't repaint the combobox if the mouse moves over the listbox. + if(dynamic_cast(obj) && dynamic_cast(obj->parent())) { + + if(dynamic_cast(obj->parent())) { + if(ev->type() == QEvent::Show) { + QComboBox* cb = dynamic_cast(obj->parent()); + cb->repaint(false); + cb->setUpdatesEnabled(false); + return false; + } + if(ev->type() == QEvent::Hide) { + QComboBox* cb = dynamic_cast(obj->parent()); + cb->setUpdatesEnabled(true); + cb->repaint(false); + return false; + } + } + // don't return here + } + + if (dynamic_cast(obj) || (dynamic_cast(obj) && dynamic_cast(obj)->frameShape() == QFrame::LineEditPanel) || obj->isA("QDateTimeEditor")) { + + QWidget* lineEdit = dynamic_cast(obj); + bool khtmlMode = khtmlWidgets.contains(lineEdit); + bool isLineEdit = dynamic_cast(obj); + bool isReadOnly = isLineEdit && dynamic_cast(obj)->isReadOnly(); + QFrame* frame = dynamic_cast(obj); + if((isReadOnly || khtmlMode) && frame->frameWidth() <= 0) { + return false; + } + + bool isEnabled = lineEdit->isEnabled(); + bool isSpinWidget = false; + bool isComboBox = false; + bool isDateTimeEditor = false; + bool hasPixmap = false; + bool noFrame = false; + QRect r = lineEdit->rect(); + + if(dynamic_cast(lineEdit->parentWidget())) { + isComboBox = true; + QComboBox* cb = dynamic_cast(lineEdit->parentWidget()); + if(cb->count() > 0 && cb->pixmap(cb->currentItem())) + hasPixmap = true; + } + else if(obj->isA("QDateTimeEditor")) + isDateTimeEditor = true; + else if(dynamic_cast(lineEdit->parentWidget())) + isSpinWidget = true; + else if(isLineEdit && frame->frameShape() == QFrame::NoFrame) + noFrame = true; + +// if(isSpinWidget && !isComboBox && frame->frameShape() == QFrame::NoFrame) +// return false; + + int x, y, w, h; + r.rect(&x, &y, &w, &h); + + switch(ev->type()) { + case QEvent::Show: + if(khtmlMode) + return true; + case QEvent::Resize: { + if(noFrame) return false; + + if(isLineEdit) { + QRect frameRect(r.x()+1, r.y(), r.width()-1, r.height()); + if(frame->frameRect() != frameRect) + frame->setFrameRect(frameRect); + + } + + if(isSpinWidget || isComboBox) { + + if(!hasPixmap && !QApplication::reverseLayout()) { + QRegion mask(x+3, y, w-3, h); + mask += QRegion(x, y+3, 3, h-6); + lineEdit->setMask(mask); + } + else if(QApplication::reverseLayout()) { + QRegion mask(x, y, w-3, h); + mask += QRegion(w-3, y+3, 3, h-6); + lineEdit->setMask(mask); + } + else if(isComboBox) + lineEdit->clearMask(); + } + else if(isDateTimeEditor) { + + if(!QApplication::reverseLayout()) { + QRegion mask(x+2, y, w-2, h); + mask += QRegion(x+1, y+1, 1, h-2); + mask += QRegion(x, y+2, 1, h-4); + lineEdit->setMask(mask); + } + else { + QRegion mask(x, y, w-2, h); + mask += QRegion(w-2, y+1, 1, h-2); + mask += QRegion(w-1, y+2, 1, h-4); + lineEdit->setMask(mask); + } + } + + if(isLineEdit) { + lineEdit->repaint(false); // not realy needed, but removes some flicker + return true; + } + return false; + } + case QEvent::Paint: { + + if(noFrame) + return false; + + const QColorGroup cg = lineEdit->colorGroup(); + const QColor bg = !isEnabled ? cg.background() : lineEdit->paletteBackgroundColor(); + QPainter p; + + if(isSpinWidget || isComboBox || isDateTimeEditor) { + + // QDateTimeEditor doesn't respect background pixmaps :( + if(w <1 || h <1 || isDateTimeEditor) + return false; + + uint flags = hasPixmap ? Draw_Right : Draw_Left|Draw_Right; + QPixmap* lineEditPix = renderLineEditShadow(lineEdit, lineEdit->rect(), bg, flags, QApplication::reverseLayout()); + lineEdit->setUpdatesEnabled(false); + lineEdit->setErasePixmap(*lineEditPix); + // update the gap which resulted from the altered frame rect... + lineEdit->erase(QRect(x, y, 1, h)); + lineEdit->setUpdatesEnabled(true); + delete lineEditPix; + return false; + } + + + // normal lineEdit + const QPixmap* parentBgPix = lineEdit->parentWidget() ? lineEdit->parentWidget()->paletteBackgroundPixmap() : 0; + QPixmap* lineEditEdges = 0; + if(khtmlMode || parentBgPix || !(lineEditEdges = QPixmapCache::find(QString::number(bg.pixel(), 16)+QString::number(cg.background().pixel(), 16)+"lEditEdges"))) { + if(khtmlMode) { + + QPixmap insidePix = tintImage(qembed_findImage("lineedit4inside"), bg); + bitBlt(lineEdit, x, y, &insidePix, 0, 0, 4, 4); + bitBlt(lineEdit, w-4, y, &insidePix, 4, 0, 4, 4); + bitBlt(lineEdit, x, h-4, &insidePix, 0, 4, 4, 4); + bitBlt(lineEdit, w-4, h-4, &insidePix, 4, 4, 4, 4); + + QPixmap edgesPix = qembed_findImage("lineedit4edges"); + bitBlt(lineEdit, x, y, &edgesPix, 0, 0, 4, 4); + bitBlt(lineEdit, w-4, y, &edgesPix, 4, 0, 4, 4); + bitBlt(lineEdit, x, h-4, &edgesPix, 0, 4, 4, 4); + bitBlt(lineEdit, w-4, h-4, &edgesPix, 4, 4, 4, 4); + } + else { + + lineEditEdges = new QPixmap(8, 8); + if(parentBgPix) { + QPoint offset = lineEdit->parentWidget()->backgroundOffset(); + offset += QPoint(lineEdit->geometry().x(), lineEdit->geometry().y()); + QPainter painter(lineEditEdges); + painter.drawTiledPixmap(0, 0, 4, 4, *parentBgPix, offset.x(), offset.y()); + painter.drawTiledPixmap(4, 0, 4, 4, *parentBgPix, offset.x()+r.width()-4, offset.y()); + painter.drawTiledPixmap(0, 4, 4, 4, *parentBgPix, offset.x(), offset.y()+r.height()-4); + painter.drawTiledPixmap(4, 4, 4, 4, *parentBgPix, offset.x()+r.width()-4, offset.y()+r.height()-4); + } + else + lineEditEdges->fill(cg.background()); + + QPixmap tmpPix = tintImage(qembed_findImage("lineedit4inside"), bg); + bitBlt(lineEditEdges, 0, 0, &tmpPix, 0, 0, 8, 8); + + QPixmap tmpPix2 = qembed_findImage("lineedit4edges"); + bitBlt(lineEditEdges, 0, 0, &tmpPix2, 0, 0, 8, 8); + + if(!parentBgPix) + QPixmapCache::insert(QString::number(bg.pixel(), 16)+QString::number(cg.background().pixel(), 16)+"lEditEdges", *lineEditEdges); + } + } + + + QPixmap* lineEditPix = 0; + + if(khtmlMode) + p.begin(lineEdit); + else { + lineEditPix = new QPixmap(w, h); + p.begin(lineEditPix); + + bitBlt(lineEditPix, x, y, lineEditEdges, 0, 0, 4, 4); + bitBlt(lineEditPix, w-4, y, lineEditEdges, 4, 0, 4, 4); + bitBlt(lineEditPix, x, h-4, lineEditEdges, 0, 4, 4, 4); + bitBlt(lineEditPix, w-4, h-4, lineEditEdges, 4, 4, 4, 4); + + } + + p.fillRect(QRect(x+4, y, w-8, h), bg); + p.fillRect(QRect(x, y+4, 4, h-8), bg); + p.fillRect(QRect(w-4, y+4, 4, h-8), bg); + + QColor top_1 = alphaBlendColors(QColor(26, 26, 26), bg, 125); + QColor top_2 = alphaBlendColors(QColor(18, 18, 18), bg, 50); + QColor top_3 = alphaBlendColors(QColor(16, 16, 16), bg, 6); + QColor bottom = alphaBlendColors(QColor(0, 0, 0), bg, 30); + + QColor left_1 = alphaBlendColors(QColor(0, 0, 0), bg, 78); + QColor left_2 = alphaBlendColors(QColor(0, 0, 0), bg, 10); + + p.setPen(top_1); + p.drawLine(x+4, y, w-5, y); + p.setPen(top_2); + p.drawLine(x+4, y+1, w-5, y+1); + p.setPen(top_3); + p.drawLine(x+4, y+2, w-5, y+2); + p.setPen(bottom); + p.drawLine(x+4, h-1, w-5, h-1); + + p.setPen(left_1); + p.drawLine(x, y+4, x, h-4); + p.drawLine(w-1, y+4, w-1, h-4); + p.setPen(left_2); + p.drawLine(x+1, y+4, x+1, h-4); + p.drawLine(w-2, y+4, w-2, h-4); + p.end(); + + + if(!khtmlMode) { + + if(isLineEdit) { + // simply drawing the pixmap would be faster, but the problem with the base color as erase color for disabled lineEdits would remain. + XSetWindowBackgroundPixmap( lineEdit->x11Display(), lineEdit->winId(), lineEditPix->handle()); +// // erase the frame + lineEdit->erase(x, y, w, 2); + lineEdit->erase(x, h-4, w, 4); + lineEdit->erase(x, y+2, 3, h-4); + lineEdit->erase(w-3, y+2, 3, h-4); + } + else { + bitBlt(lineEdit, 0, 0, lineEditPix); + } + delete lineEditPix; + } + return false; + } + case QEvent::MouseButtonPress: + case 6/*QEvent::KeyPress*/: { + // it will be reseted in QLineEdit::mouseMoveEvent() + if(isLineEdit && !khtmlMode && isEnabled && !isReadOnly && !isDateTimeEditor) + static_cast(obj)->setCursor(Qt::blankCursor); + return false; + } + case QEvent::ApplicationPaletteChange: + if(!khtmlMode) { + lineEdit->setBackgroundMode(QWidget::PaletteBase); + lineEdit->setPalette(qApp->palette()); + } + return true; + case QEvent::ParentPaletteChange: + if(!khtmlMode) { + lineEdit->setBackgroundMode(QWidget::PaletteBase); + lineEdit->setPalette(lineEdit->parentWidget()->palette()); + } + return true; + case QEvent::PaletteChange: + if(!khtmlMode) { + lineEdit->setBackgroundMode(QWidget::PaletteBase); + lineEdit->setPalette(lineEdit->palette()); + } + return true; + case QEvent::Wheel: + case QEvent::Hide: + case 7/*QEvent::KeyRelease*/: + // jump to smoothscrolling + if(_smoothScrolling) + break; + default: + return false; + } + } + + + + + // argb rubberBand + if(!strcmp(obj->name(), "qt_viewport") && rubberBandType == ArgbRubber) { + switch(ev->type()) { + case QEvent::ChildRemoved: + case QEvent::DragMove: + case QEvent::DragEnter: { + if(rubber) { + viewPortPressed = false; + oldRubberRect = QRect(); + rubber->destroy(); + } + return false; + } + case QEvent::MouseButtonPress: { + viewPortPressed = true; + rubberViewPort = static_cast(obj); + break; + } + case QEvent::MouseButtonRelease: + if(rubber) { + viewPortPressed = false; + rubberViewPort = 0; + oldRubberRect = QRect(); + if(dynamic_cast(obj->parent()) && rubber->window) + ignoreNextFocusRect = true; + rubber->destroy(); + } + +#if KDE_VERSION >= 0x30506 + case QEvent::Show: { + char selectionName[64]; + snprintf(selectionName, 64, "_NET_WM_CM_S%d", DefaultScreen(qt_xdisplay())); + Atom compSelection = XInternAtom(qt_xdisplay(), selectionName, False); + if(XGetSelectionOwner(qt_xdisplay(), compSelection)) { + compositeManagerRunning = true; + } + else { + compositeManagerRunning = false; + } + } +#endif + default: + break; + } + } + + + // smoothscrolling + if(dynamic_cast(obj) && _smoothScrolling) { + switch(ev->type()) { + case QEvent::Wheel: { + QWheelEvent* e = (QWheelEvent*)ev; + QScrollView* sv = dynamic_cast(obj); + bool pageSteps = false; + int pageStep = sv->verticalScrollBar()->pageStep(); + int lineStep = sv->verticalScrollBar()->lineStep(); + scrollVertical = e->orientation() == Qt::Vertical; + + QScrollBar* scrollBar = scrollVertical ? sv->verticalScrollBar() : sv->horizontalScrollBar(); + + int step = QMIN( QApplication::wheelScrollLines()*lineStep, pageStep ); + if ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) { + step = pageStep; + pageSteps = true; + } + int dy = (e->delta()*step)/120; + + e->accept(); + scrollWidget = sv; + scrollDistance += dy; + + // don't accumulate to much + if(scrollDistance < 0) { + scrollDistance = pageSteps? QMAX(scrollDistance, pageStep*2-(pageStep*4)): scrollDistance; + int minDistance = scrollBar->maxValue() - scrollBar->value(); + scrollDistance = QMAX(scrollDistance, minDistance-(minDistance*2)); + } + else { + scrollDistance = pageSteps? QMIN(scrollDistance, pageStep*2): scrollDistance; + scrollDistance = QMIN(scrollDistance, scrollBar->value()); + } + + if(scrollDistance != 0) { + scrollTimer->start(pageSteps? 4: 14); + } + + return true; + } + case 7: { // ?? 7 = QEvent::KeyRelease + QKeyEvent* ke = (QKeyEvent*)ev; + if(scrollTimer->isActive() && (ke->key() == Qt::Key_Shift || ke->key() == Qt::Key_Control)) { + scrollTimer->stop(); + scrollDistance = 0; + } + return false; + } + case QEvent::WindowActivate: + case QEvent::WindowDeactivate: + // fixes the scrollbar flicker + return true; + case QEvent::Hide: + case QEvent::Show: + scrollDistance = 0; + // don't return here (because of konqframe and ?) + default: + break; + } + } + + + if ( dynamic_cast(obj) ) { + + switch(ev->type()) { + case QEvent::WindowActivate: { + QScrollBar* sb = dynamic_cast(obj); + if(sb->backgroundMode() == Qt::NoBackground && !sb->testWState(WState_HasMouse)) { + sb->setBackgroundMode(Qt::PaletteButton); + } + return true; + } + case QEvent::Show: { + // no flicker in konqi and konsole, hits maybe others, too. + if(obj->parent()->parent() && (!strcmp(obj->parent()->parent()->name(), "KonqFrame") || !strcmp(obj->parent()->parent()->name(), "tab pages"))) { + dynamic_cast(obj)->setBackgroundMode(Qt::NoBackground); + } + scrollDistance = 0; + return true; + } + case QEvent::Hide: + scrollDistance = 0; + return true; + case QEvent::Resize: { + QScrollBar* sb = dynamic_cast(obj); + if(sb->backgroundMode() != Qt::NoBackground && sb->isVisible()) { + sb->setBackgroundMode(Qt::NoBackground); + } + return false; + } + case QEvent::ParentPaletteChange: { + QScrollBar* sb = dynamic_cast(obj); + sb->setBackgroundMode(Qt::PaletteButton); + sb->setPalette(sb->parentWidget()->palette()); + return true; + } + case QEvent::PaletteChange: { + QScrollBar* sb = dynamic_cast(obj); + sb->setBackgroundMode(Qt::PaletteButton); + sb->setPalette(sb->palette()); + return true; + } + case QEvent::ApplicationPaletteChange: { // ### + QScrollBar* sb = dynamic_cast(obj); + removeCachedSbPix(sb->paletteBackgroundColor()); + sb->setBackgroundMode(Qt::PaletteButton); +// sb->update(); + return false; + } + case QEvent::Wheel: { + if(!_smoothScrolling) + return false; + QWheelEvent* e = (QWheelEvent*)ev; + QScrollBar* sb = dynamic_cast(obj); + if(!dynamic_cast(sb->parentWidget())) + return false; + + bool pageSteps = false; + int pageStep = sb->pageStep(); + int lineStep = sb->lineStep(); + + int step = QMIN( QApplication::wheelScrollLines()*lineStep, pageStep ); + if ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) { + step = pageStep; + pageSteps = true; + } + int dy = (e->delta()*step)/120; + + e->accept(); + scrollWidget = dynamic_cast(sb->parentWidget()); + scrollDistance += dy; + + // don't accumulate to much + if(scrollDistance < 0) { + scrollDistance = pageSteps? QMAX(scrollDistance, pageStep*2-(pageStep*4)): scrollDistance; + int minDistance = sb->maxValue() - sb->value(); + scrollDistance = QMAX(scrollDistance, minDistance-(minDistance*2)); + } + else { + scrollDistance = pageSteps? QMIN(scrollDistance, pageStep*2): scrollDistance; + scrollDistance = QMIN(scrollDistance, sb->value()); + } + + scrollVertical = sb->orientation() == Qt::Vertical; + if(scrollDistance != 0) { + scrollTimer->start(pageSteps? 4: 14); + } + + return true; + } + case 7: { // ?? 7 = QEvent::KeyRelease + QKeyEvent* ke = (QKeyEvent*)ev; + if(scrollTimer->isActive() && (ke->key() == Qt::Key_Shift || ke->key() == Qt::Key_Control)) { + scrollTimer->stop(); + scrollDistance = 0; + } + return false; + } + default: + return false; + } + } + + + if ( dynamic_cast(obj) && _animateProgressBar) + { + switch(ev->type()) { + case QEvent::Show: + if(!animationTimer->isActive()) + animationTimer->start( 50, false ); + return true; + case QEvent::Hide: + if(animationTimer->isActive()) + animationTimer->stop(); + return true; + case QEvent::ApplicationPaletteChange: + setDominoButtonPalette(static_cast(obj), Palette_Application); + return true; + case QEvent::ParentPaletteChange: + setDominoButtonPalette(static_cast(obj), Palette_Parent); + return true; + case QEvent::PaletteChange: + setDominoButtonPalette(static_cast(obj), Palette_Widget); + return true; + default: + return false; + } + } + + if (dynamic_cast(obj)) { + if(ev->type() == QEvent::PaletteChange) { + QStatusBar* sb = dynamic_cast(obj); + sb->setPaletteBackgroundColor(qApp->palette().active().background()); + sb->setPaletteForegroundColor(qApp->palette().active().foreground()); + return true; + } + return false; + } + + if (dynamic_cast(obj) && dynamic_cast(obj)->frameShape() == QFrame::GroupBoxPanel) { + QGroupBox* gb = dynamic_cast(obj); + QRect r = gb->rect(); + + switch(ev->type()) { + case QEvent::Paint: { +// if(y+16 > h || 16 > w) // don't overlap the pixmaps +// return false; + renderGroupBox(obj, ev); + return true; + } + case QEvent::Resize: { + if(!gb->isFlat()) + renderGroupBox(obj, ev); + return false; + } + case QEvent::ApplicationPaletteChange: + case QEvent::PaletteChange: + case QEvent::ParentPaletteChange: { + + if(gb->isFlat() || gb->lineWidth() <= 0) { + return false; + } + + QColor outsideColor = gb->parentWidget() ? gb->parentWidget()->paletteBackgroundColor() : gb->paletteBackgroundColor(); + QColor insideColor = groupBoxSettings.tintBackground ? getGroupBoxColor(gb) : gb->paletteBackgroundColor(); + + QPalette pal(qApp->palette()); + pal.setColor(QPalette::Active, QColorGroup::Background, insideColor); + pal.setColor(QPalette::Inactive, QColorGroup::Background, insideColor); + pal.setColor(QPalette::Disabled, QColorGroup::Background, insideColor); + pal.setColor(QPalette::Disabled, QColorGroup::Text, alphaBlendColors(pal.active().foreground(), insideColor, 40)); + gb->setPalette(pal); + + + if(gb->isCheckable()) { + ((QCheckBox*)gb->child("qt_groupbox_checkbox", 0, false))->setPaletteBackgroundColor(outsideColor); + } + + if(groupBoxPixmaps.contains(gb)) { + delete groupBoxPixmaps[gb]; + groupBoxPixmaps.remove(gb); + } + return false; + } + default: + return false; + } + } + + if(dynamic_cast(obj)) { + + switch(ev->type()) { + case QEvent::Paint: { + + QSpinWidget* sw = static_cast(obj); + QPixmap buffer(sw->size()); + QPainter p(&buffer); + + if(sw->parentWidget() && sw->parentWidget()->parentWidget() && sw->parentWidget()->parentWidget()->backgroundPixmap()) { + QPoint point = sw->backgroundOffset(); + p.drawTiledPixmap( 0, 0, sw->width(), sw->height(), + *sw->parentWidget()->parentWidget()->backgroundPixmap(), point.x(), point.y() ); + } + + + + /////// + QStyle::SFlags flags = QStyle::Style_Default; + if (sw->isEnabled()) + flags |= QStyle::Style_Enabled; + if (sw->hasFocus() || sw->focusProxy() && sw->focusProxy()->hasFocus()) + flags |= QStyle::Style_HasFocus; + if(spinWidgetDown && sw->hasMouse()) + flags |= QStyle::Style_Down; + QRect fr = QStyle::visualRect(querySubControlMetrics( QStyle::CC_SpinWidget, sw, QStyle::SC_SpinWidgetFrame ), sw ); + drawComplexControl( QStyle::CC_SpinWidget, &p, sw, sw->rect(), sw->colorGroup(), flags, (uint)QStyle::SC_All, QStyle::SC_None ); + p.end(); + p.begin(sw); + p.drawPixmap(0,0,buffer); + return true; + } + case QEvent::MouseButtonRelease: + case QEvent::MouseButtonPress: + case QEvent::MouseButtonDblClick: { + QSpinWidget* sw = static_cast(obj); + QPainter p(sw); + + QStyle::SFlags flags = QStyle::Style_Default; + if (sw->isEnabled()) + flags |= QStyle::Style_Enabled; + if (sw->hasFocus() || sw->focusProxy() && sw->focusProxy()->hasFocus()) + flags |= QStyle::Style_HasFocus; + if(ev->type() != QEvent::MouseButtonRelease && dynamic_cast(sw->parentWidget())) { + QSpinBox* sb = dynamic_cast(sw->parentWidget()); + QMouseEvent* e = (QMouseEvent*)ev; + + if(sb->downRect().contains(e->pos()) && sb->value() != sb->minValue()) { + flags |= QStyle::Style_Down; + spinWidgetDown = true; + } + if(sb->upRect().contains(e->pos()) && sb->value() != sb->maxValue()) { + flags |= QStyle::Style_Down; + spinWidgetDown = true; + } + if(spinWidgetDown) { + if(sw->paletteBackgroundPixmap()) + sw->erase(); + drawComplexControl( QStyle::CC_SpinWidget, &p, sw, sw->rect(), sw->colorGroup(), flags, (uint)QStyle::SC_All, QStyle::SC_None); + } + return false; + + } + else + spinWidgetDown = false; + + if(sw->paletteBackgroundPixmap()) + sw->erase(); + drawComplexControl( QStyle::CC_SpinWidget, &p, sw, sw->rect(), sw->colorGroup(), flags, (uint)QStyle::SC_All, QStyle::SC_None); + return false; + } + case QEvent::Enter: { + QPushButton* btn = static_cast(obj); + if(!btn->isEnabled()) + return false; + hoverWidget = btn; + btn->repaint(btn->paletteBackgroundPixmap()); + return false; + } + case QEvent::Leave: { + spinWidgetDown = false; + QPushButton* btn = static_cast(obj); + if(!btn->isEnabled()) + return false; + hoverWidget = 0; + btn->repaint(btn->paletteBackgroundPixmap()); + return false; + } + case QEvent::ApplicationPaletteChange: + setDominoButtonPalette(dynamic_cast(obj), Palette_Application); + return true; + case QEvent::ParentPaletteChange: + setDominoButtonPalette(dynamic_cast(obj), Palette_Parent); + return true; + case QEvent::PaletteChange: + setDominoButtonPalette(dynamic_cast(obj), Palette_Parent); + return true; + default: + break; + } + return false; + } + + + if (dynamic_cast(obj)) { + + switch(ev->type()) { + case QEvent::Wheel: { + QWheelEvent* e = (QWheelEvent*)ev; + QTabWidget* tw = dynamic_cast(obj->parent()); + if(!tw) + return false; + + int current = tw->currentPageIndex(); + int count = tw->count(); + + if(count < 2) + return false; + + current = e->delta() > 0 ? current - 1 : current + 1; + + if(current > count - 1) + current = 0; + else if(current < 0) + current = count - 1; + if(tw->page(current)->isEnabled()) + tw->setCurrentPage(current ); + return true; + } + case QEvent::ApplicationPaletteChange: + setDominoButtonPalette(dynamic_cast(obj), Palette_Application); + return true; + case QEvent::ParentPaletteChange: + setDominoButtonPalette(dynamic_cast(obj), Palette_Parent); + return true; + case QEvent::PaletteChange: + setDominoButtonPalette(dynamic_cast(obj), Palette_Widget); + return true; + default: + return false; + } + } + + if (dynamic_cast(obj)) { + + QTabWidget* tw = dynamic_cast(obj); + if(tw->isA("KonqFrameTabs")) { + + QColorGroup cg = qApp->palette().active(); + switch (ev->type()) { + case QEvent::Paint: { + QRect r = tw->rect(); + int top, height; + if(tw->tabPosition() == QTabWidget::Top) { + top = r.top(); + height = r.height()-tw->currentPage()->height(); + } + else { + top = r.top()+tw->currentPage()->height(); + height = r.height(); + } + + QPainter p(tw); + p.setPen(cg.background()); + p.drawLine(r.left(), top, r.width(), top); + + p.setPen(cg.background().dark(120)); + p.drawLine(r.left(), top+1, r.width(), top+1); + + p.setPen(cg.background().dark(konqTabBarContrast+20)); + p.drawLine(r.left(), top+2, r.width(), top+2); + return true; + } + case QEvent::Show: + case QEvent::PaletteChange: + case QEvent::ApplicationPaletteChange: { + if(tw->eraseColor() != cg.background().dark(konqTabBarContrast)) + tw->setEraseColor(cg.background().dark(konqTabBarContrast)); + return true; + } + default: + return false; + } + } + else if(ev->type() == QEvent::Wheel) { + if(!tw) + return false; + + QRect r = tw->rect(); + QRect re = ((DominoQTabWidget*)tw)->tabBar()->rect(); + int top; + if(tw->tabPosition() == QTabWidget::Top) { + top = r.top(); + } + else { + top = r.top() + tw->height()-re.height() - 2; + } + + QWheelEvent* e = (QWheelEvent*)ev; + if(QRect(re.x(), top, r.width(), re.height()).contains(e->pos())) { + int current = tw->currentPageIndex(); + int count = tw->count(); + if(count < 2) + return false; + + current = e->delta() > 0 ? current - 1 : current + 1; + + if(current > count - 1) + current = 0; + else if(current < 0) + current = count - 1; + if(tw->page(current)->isEnabled()) + tw->setCurrentPage(current); + return true; + } + } + if(ev->type() == QEvent::LayoutHint) { + if(!tw) + return false; + QWidget* w; + if((w = tw->cornerWidget(Qt::TopRight))) { + if(!w->width() != 25 || w->height() != 23) + w->setFixedSize(25, 23); + } + if((w = tw->cornerWidget(Qt::TopLeft))) { + if(!w->width() != 25 || w->height() != 23) + w->setFixedSize(25, 23); + } + if((w = tw->cornerWidget(Qt::BottomRight))) { + if(!w->width() != 25 || w->height() != 23) + w->setFixedSize(25, 23); + } + if((w = tw->cornerWidget(Qt::BottomLeft))) { + if(!w->width() != 25 || w->height() != 23) + w->setFixedSize(25, 23); + } + + return false; + } + return false; + } + if(::qt_cast(obj)) { + switch(ev->type()) { + case QEvent::Paint: { + KToolBar *bar = dynamic_cast(obj->parent()); + if(!bar) return false; // KMyMoney2 + KToolBarButton* btn = dynamic_cast(obj); + int index = bar->itemIndex(btn->id()); + + + if(_toolBtnAsBtn && sideRepaint == false) { + sideRepaint = true; + KToolBarButton* sideBtn; + if((sideBtn = bar->getButton(bar->idAt(index-1)))) { + sideBtn->repaint(false); + } + if((sideBtn = bar->getButton(bar->idAt(index+1)))) { + sideBtn->repaint(false); + } + sideRepaint = false; + } + + + SFlags flags = QStyle::Style_Default; + SCFlags active = QStyle::SC_None; + if(btn->isOn()) flags |= QStyle::Style_On; + if (btn->isDown()) { + flags |= QStyle::Style_Down; + active |= QStyle::SC_ToolButton; + } + if (btn->isEnabled()) flags |= QStyle::Style_Enabled; + if (btn->isEnabled() && btn->hasMouse()) flags |= QStyle::Style_Raised; + if (btn->hasFocus()) flags |= QStyle::Style_HasFocus; + //SCFlags controls, + + QPainter p(btn); + + if(btn->isDown()/* || btn->isOn()*/) + buttonContour->setState(Contour_Pressed); + else if(btn == hoverWidget && btn->isEnabled()) + buttonContour->setState(Contour_MouseOver); + + drawComplexControl(QStyle::CC_ToolButton, &p, btn, btn->rect(), btn->colorGroup(), flags, QStyle::SC_ToolButton, active, QStyleOption()); + buttonContour->reset(); + return true; + } + case QEvent::MouseButtonPress: { + if(((QMouseEvent*)ev)->button() == Qt::RightButton) + return false; + KToolBarButton* btn = dynamic_cast(obj); + btn->setUpdatesEnabled(false); + if(!btn->isOn()) btn->setOn(true); + btn->setUpdatesEnabled(true); + hoverWidget = 0; + return false; + } + case QEvent::MouseButtonRelease: { + if(((QMouseEvent*)ev)->button() == Qt::RightButton) + return false; + KToolBarButton* btn = dynamic_cast(obj); + btn->setUpdatesEnabled(false); + if(btn->isOn()) btn->setOn(false); + btn->setUpdatesEnabled(true); + if(btn->hasMouse()) + hoverWidget = btn; + return false; + } + case QEvent::MouseButtonDblClick: { + if(((QMouseEvent*)ev)->button() == Qt::RightButton) + return false; + KToolBarButton* btn = dynamic_cast(obj); + if(!btn->isOn()) btn->setOn(true); + hoverWidget = 0; + return false; + } + case QEvent::Enter: { + KToolBarButton* btn = dynamic_cast(obj); + if(btn->isEnabled()) { + hoverWidget = btn; + btn->repaint(false); + } + return false; + } + case QEvent::Leave: { + KToolBarButton* btn = dynamic_cast(obj); + if(btn == hoverWidget) { + hoverWidget = 0; + btn->repaint(false); + } + return false; + } + case QEvent::Move: { + if(_toolBtnAsBtn) { + KToolBarButton* btn = dynamic_cast(obj); + btn->repaint(false); + } + return false; + } + case QEvent::ApplicationPaletteChange: { + setDominoButtonPalette(static_cast(obj), Palette_Application); + return true; + } + default: + return false; + } + } + + if(dynamic_cast(obj) && dynamic_cast(obj)->paletteBackgroundPixmap()) { + if (ev->type() == QEvent::Paint) { + QRadioButton* rb = static_cast(obj); + + rb->removeEventFilter(this); + QApplication::sendEvent(rb, (QPaintEvent*)ev); + rb->installEventFilter(this); + + QStyle::SFlags flags = QStyle::Style_Default; + if ( rb->isEnabled() ) + flags |= QStyle::Style_Enabled; + if ( rb->hasFocus() ) + flags |= QStyle::Style_HasFocus; + if ( rb->isDown() ) + flags |= QStyle::Style_Down; + if ( rb->hasMouse() ) + flags |= QStyle::Style_MouseOver; + if ( rb->state() == QButton::On ) + flags |= QStyle::Style_On; + else if ( rb->state() == QButton::Off ) + flags |= QStyle::Style_Off; + + QPainter p(rb); + drawControl(CE_RadioButton, &p, rb, QRect(0,0,17,17), rb->palette().active(), flags); + return true; + } + if (ev->type() == QEvent::Show && !strcmp(obj->name(), "__khtml")) { + QRadioButton* rb = static_cast(obj); + QBitmap bm(rb->size()); + bm.fill(color0); + rb->setMask(bm); + } + return false; + } + + if (obj->isA("KonqCheckBox")) { + + if (ev->type() == QEvent::Show || ev->type() == QEvent::ApplicationPaletteChange) { // at least doesn't flicker in the unchecked state ;-) + QButton* btn = dynamic_cast(obj); + QPixmap pix(btn->size()); + pix.fill(qApp->palette().active().background()); + QPainter p(&pix); + drawControl( CE_CheckBox, &p, btn, QRect(0,0,18,19), qApp->palette().active(), Style_Default|Style_Off, QStyleOption::Default); + btn->setErasePixmap(pix); + return true; + } + if (ev->type() == QEvent::Paint) { + QButton* btn = dynamic_cast(obj); + btn->erase(); + SFlags flags = Style_Default; + if ( btn->isDown() ) + flags |= Style_Down; + if ( btn->state() == QButton::On ) + flags |= Style_On; + else if ( btn->state() == QButton::Off ) + flags |= Style_Off; + if ( btn->isEnabled() ) + flags |= Style_Enabled; + QPainter p(btn); + drawPrimitive(PE_CheckMark, &p, QRect(0,0,16,17), qApp->palette().active(), flags); + return true; + } + return false; + } + + if(dynamic_cast(obj)) { + if (ev->type() == QEvent::Paint) { + QCheckBox* cb = static_cast(obj); + + bool khtmlWidget = !strcmp(obj->name(), "__khtml"); + if(khtmlWidget || cb->paletteBackgroundPixmap()) { + if(khtmlWidget) { + // this prevents the checkbox been erased before the rest of the html page + QBitmap bm(cb->size()); + bm.fill(color0); + cb->setMask(bm); + } + else { + // draws a masked checkbox + cb->removeEventFilter(this); + QApplication::sendEvent(cb, (QPaintEvent*)ev); + cb->installEventFilter(this); + } + // draws the missing alpha part + QStyle::SFlags flags = QStyle::Style_Default; + if ( cb->isEnabled() ) + flags |= QStyle::Style_Enabled; + if ( cb->hasFocus() ) + flags |= QStyle::Style_HasFocus; + if ( cb->isDown() ) + flags |= QStyle::Style_Down; + if ( cb->hasMouse() ) + flags |= QStyle::Style_MouseOver; + if ( cb->state() == QButton::On ) + flags |= QStyle::Style_On; + else if ( cb->state() == QButton::Off ) + flags |= QStyle::Style_Off; + else if ( cb->state() == QButton::NoChange ) + flags |= QStyle::Style_NoChange; + + QPainter p(cb); + drawControl(CE_CheckBox, &p, cb, QRect(0,0,18,19), cb->palette().active(), flags); + return true; + } + return false; + } + return false; + } + + if(dynamic_cast(obj)) { + switch(ev->type()) { + case QEvent::Resize: + case QEvent::Show: { + QWidget* w = static_cast(obj); + QRect r = w->rect(); + QRegion mask(r.x()+2, r.y(), r.width()-4, r.height()); + mask += QRegion(r.x(), r.y()+2, r.width(), r.height()-4); + mask += QRegion(r.x()+1, r.y()+1, r.width()-2, r.height()-2); + w->setMask(mask); + return false; + } + case QEvent::Hide: + static_cast(obj)->setBackgroundMode(NoBackground); + return false; + case QEvent::ApplicationPaletteChange: + if(obj->isA("PanelKMenu")) { + QWidget* w = static_cast(obj); + QPalette pal = qApp->palette(); + pal.setColor(QColorGroup::ButtonText, alphaBlendColors(_popupMenuColor, pal.active().foreground(), 150)); + w->setPalette(pal); + return true; + } + default: + return false; + } + } + + + if(dynamic_cast(obj) && !obj->isA("KDockButton_Private") || dynamic_cast(obj) ) { + QWidget* w = static_cast(obj); + + switch(ev->type()) { + case QEvent::Enter: { + if(!w->isEnabled()) return false; + hoverWidget = w; + w->repaint(false); + return false; + } + case QEvent::Leave: { + if(!w->isEnabled()) return false; + hoverWidget = 0; + w->repaint(false); + return false; + } + case QEvent::MouseButtonPress: { + if(dynamic_cast(obj)) { + QMouseEvent* e = (QMouseEvent*)ev; + if(e->button() == Qt::LeftButton) + popupMousePressPos = e->pos(); + } + return false; + } + case QEvent::MouseMove: { + QMouseEvent* e = (QMouseEvent*)ev; + if(dynamic_cast(obj) && popupTimer->isActive() && ((e->pos()-popupMousePressPos).manhattanLength() > 4 /*KGlobalSettings::dndEventDelay()*/)) + popupToolMenu(); + return false; + } + case QEvent::ParentPaletteChange: { + if(obj->isA("QToolButton")) { + + if(w->parentWidget() && !khtmlWidgets.contains(w)) { + w->setUpdatesEnabled(false); + if(w->parentWidget()->paletteBackgroundPixmap()) { + w->setBackgroundOrigin(setPixmapOrigin(w->parentWidget()->backgroundOrigin())); + setDominoButtonPalette(w, Palette_Parent); + } + else { + w->setBackgroundMode(PaletteBackground); + w->setBackgroundOrigin(QWidget::WidgetOrigin); + setDominoButtonPalette(w, Palette_Parent); + } + w->setUpdatesEnabled(true); + w->repaint(true); + } + return true; + } + else + setDominoButtonPalette(w, Palette_Parent); + return true; + break; + } + case QEvent::PaletteChange: { + setDominoButtonPalette(w, Palette_Widget); + return true; + } + case QEvent::ApplicationPaletteChange: { + return true; + } + default: + return false; + } + } + if(obj->isA("QDockWindowHandle") || obj->isA("AppletHandleDrag")) { + if ((ev->type() == QEvent::Enter) && static_cast(obj)->isEnabled()) { + QWidget* w = static_cast(obj); + hoverWidget = w; + w->repaint(true); + return false; + } + if (ev->type() == QEvent::Leave && static_cast(obj) == hoverWidget) { + hoverWidget = 0; + static_cast(obj)->repaint(true); + return false; + } + return false; + } + + if(obj->isA("KDockButton_Private")) { + if (ev->type() == QEvent::Paint) { + QPixmap* btnPix = 0; + QButton* btn = static_cast(obj); + if(!(btnPix = QPixmapCache::find(QString::number(btn->paletteBackgroundColor().pixel(), 16)+btn->name()))) { + QPixmap* tmpPix = new QPixmap(qembed_findImage(btn->name())); + if(!tmpPix) + return false; + btnPix = new QPixmap(12, 24); + btnPix->fill(btn->paletteBackgroundColor()); + bitBlt(btnPix, 0, 0, tmpPix); + QPixmapCache::insert(QString::number(btn->paletteBackgroundColor().pixel(), 16)+btn->name(), btnPix); + } + + if(btn->isOn() || btn->isDown()) + bitBlt(btn, 0, 1, btnPix, 0, 12, 12, 12); + else + bitBlt(btn, 0, 1, btnPix, 0, 0, 12, 12); + return true; + } + return false; + } + + if(dynamic_cast(obj)) { + + switch(ev->type()) { + case QEvent::Paint: { + + KPopupTitle* pt = static_cast(obj); + QRect r = pt->rect(); + QPainter p(pt); + + if(pt->parentWidget() && pt->parentWidget()->paletteBackgroundPixmap()) { + QPoint point = QPoint(pt->geometry().x(), pt->geometry().y()); + p.drawTiledPixmap( 0, 0, pt->width(), pt->height(), + *pt->parentWidget()->backgroundPixmap(), + point.x(), point.y() ); + } + + QFont f = p.font(); + f.setBold(true); + p.setFont(f); + + if(!pt->icon().isNull()) { + int titleWidth = p.fontMetrics().width(pt->title()); + p.drawPixmap((r.width()-titleWidth)/2-4-pt->icon().width(), (r.height()-pt->icon().height())/2, pt->icon()); + } + if (!pt->title().isNull()) { + p.setPen(alphaBlendColors(_popupMenuColor, pt->paletteForegroundColor(), 150)); + p.drawText(0, 0, r.width(), r.height(), AlignCenter | SingleLine, pt->title()); + } + return true; + } + default: + return false; + } + } + if(dynamic_cast(obj) && obj->parent() && obj->parent()->isA("QToolBox")) { + QWidget* w = dynamic_cast(obj); + if(!w->isEnabled()) + return false; + if(ev->type() == QEvent::Enter) { + hoveredToolBoxTab = true; + w->repaint(false); + return false; + } + if(ev->type() == QEvent::Leave) { + hoveredToolBoxTab = false; + w->repaint(false); + return false; + } + if(ev->type() == QEvent::Move) { + hoveredToolBoxTab = false; + return false; + } + return false; + } + if(dynamic_cast(obj)) { + switch(ev->type()) { + case QEvent::ApplicationPaletteChange: + static_cast(obj)->setBackgroundMode(Qt::PaletteBackground); + setDominoButtonPalette(static_cast(obj), Palette_Application); + return true; + case QEvent::ParentPaletteChange: + setDominoButtonPalette(static_cast(obj), Palette_Parent); + return true; + case QEvent::PaletteChange: + static_cast(obj)->setBackgroundMode(Qt::PaletteBackground); + setDominoButtonPalette(static_cast(obj), Palette_Widget); + return true; + default: + return false; + } + return false; + } + + if(dynamic_cast(obj)) { + switch(ev->type()) { + case QEvent::LayoutHint: { + QDockWindow* dw = dynamic_cast(obj); + if(!dw->widget()) + return false; + if(!dw->area()) { + dw->setFrameStyle(QFrame::Panel|QFrame::Sunken); + dw->setLineWidth(1); + QRect r = dw->rect(); + QRegion mask(r); + mask -= QRegion(0, 0, 1, 1); + mask -= QRegion(r.width()-1, 0, 1, 1); + mask -= QRegion(0, r.height()-1, 1, 1); + mask -= QRegion(r.width()-1, r.height()-1, 1, 1); + dw->setMask(mask); + } + else if(dw->frameStyle() == QFrame::Panel|QFrame::Sunken) { + dw->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); + dw->setLineWidth(2); + dw->clearMask(); + } + } + default: + break; + + } + } + else if(obj->isA("QWorkspaceChild")) { + switch(ev->type()) { + case QEvent::Show: + case QEvent::Resize: { + QWidget* w = static_cast(obj); + QRect r = w->rect(); + QRegion mask(r); + mask -= QRegion(0, 0, 1, 1); + mask -= QRegion(r.width()-1, 0, 1, 1); + mask -= QRegion(0, r.height()-1, 1, 1); + mask -= QRegion(r.width()-1, r.height()-1, 1, 1); + w->setMask(mask); + } + default: + break; + } + } + + if(obj->isA("QDockWindowResizeHandle")) { + if(ev->type() == QEvent::PaletteChange) + static_cast(obj)->setBackgroundMode(Qt::PaletteBackground); + return false; + } + + if(obj->isA("QWhatsThat")) { // QWhatsThis + + if (ev->type() == QEvent::Show) { + QWidget* w = dynamic_cast(obj); + w->setBackgroundMode(Qt::NoBackground); + QRect r = w->rect(); + QRegion mask(r.x()+3, r.y(), r.width()-6, r.height()); + mask += QRegion(r.x()+2, r.y()+1, r.width()-4, r.height()-2); + mask += QRegion(r.x()+1, r.y()+2, r.width()-2, r.height()-4); + mask += QRegion(r.x(), r.y()+3, r.width(), r.height()-6); + w->setMask(mask); + return true; + } + + if (ev->type() == QEvent::Paint) { + DominoQWhatsThat* dwt = (DominoQWhatsThat*)obj; + QString text = dwt->text; + QRect r = dwt->rect(); + + int x = r.x(); + int y = r.y(); + int w = r.width(); + int h = r.height(); + + QRegion mask(x+1, y+4, w-2, h-8); + mask += QRegion(x+2, y+3, w-4, h-6); + mask += QRegion(x+3, y+2, w-6, h-4); + mask += QRegion(x+4, y+1, w-8, h-2); + + QPainter p(dwt); + p.setClipRegion(mask); + renderGradient(&p, QRect(r.left(), r.top(), r.width(), r.height()), _toolTipColor.light(110), _toolTipColor.dark(105), true); + p.setClipping(false); + + QColor tabContour2 = qApp->palette().active().background().dark(150); + + p.save(); + p.setPen(tabContour2); + p.drawLine(x+7,y, w-8,y); // top + p.drawLine(x+7,h-1, w-8,h-1); // bottom + p.drawLine(x,y+7, x,h-8); // left + p.drawLine(w-1,y+7, w-1,h-8); // right + p.restore(); + + bitBlt(dwt, x, y, border1, 0, 0, 7, 7); + bitBlt(dwt, w-7, y, border1, 7, 0, 7, 7); + bitBlt(dwt, x, h-7, border1, 0, 7, 7, 7); + bitBlt(dwt, w-7, h-7, border1, 7, 7, 7, 7); + + r.addCoords( 12, 8, -12, -8 ); + + if(QStyleSheet::mightBeRichText( text )) { + QSimpleRichText* srt = new QSimpleRichText( text, dwt->font()); + srt->draw(&p, r.x(), r.y(), r, qApp->palette().active(), 0); + } + else { + r.addCoords( 2, 3, 0, 0 ); + p.drawText( r, AlignAuto + AlignTop + WordBreak + ExpandTabs, text ); + } + + return true; + } + return false; + } + + + if(obj->isA("KonqFileTip")) { + + if (ev->type() == QEvent::Show || ev->type() == QEvent::Paint) { + + QWidget* widget = dynamic_cast(obj); + QRect r = widget->rect(); + + QPixmap pix(r.size()); + QPainter p(&pix); + renderGradient(&p, QRect(r.left(), r.top(), r.width(), r.height()), _toolTipColor.light(110), _toolTipColor.dark(105), true); + + if(ev->type() == QEvent::Show) { + dynamic_cast(widget)->setFrameStyle(QFrame::NoFrame); + widget->setBackgroundMode(Qt::NoBackground); + + QRegion mask(r.x()+3, r.y(), r.width()-6, r.height()); + mask += QRegion(r.x()+2, r.y()+1, r.width()-4, r.height()-2); + mask += QRegion(r.x()+1, r.y()+2, r.width()-2, r.height()-4); + mask += QRegion(r.x(), r.y()+3, r.width(), r.height()-6); + dynamic_cast(widget)->setMask(mask); + + QObjectList *list = const_cast(widget->children()); + QObjectListIt it( *list ); + QObject * o; + while ( (o = it.current()) != 0 ) { + ++it; + if(dynamic_cast(o)) { + QLabel* l = dynamic_cast(o); + l->setBackgroundOrigin(QWidget::ParentOrigin); + l->setPaletteBackgroundPixmap(pix); + } + } + } + p.end(); + + if(ev->type() == QEvent::Paint) { + + int x = r.x(); + int y = r.y(); + int w = r.width(); + int h = r.height(); + + QRegion mask(x+1, y+4, w-2, h-8); + mask += QRegion(x+2, y+3, w-4, h-6); + mask += QRegion(x+3, y+2, w-6, h-4); + mask += QRegion(x+4, y+1, w-8, h-2); + + p.begin(widget); + p.setClipRegion(mask); + p.drawPixmap(0, 0, pix); + p.setClipping(false); + + QColor tabContour2 = qApp->palette().active().background().dark(150); + p.setPen(tabContour2); + p.drawLine(x+7,y, w-8,y); // top + p.drawLine(x+7,h-1, w-8,h-1); // bottom + p.drawLine(x,y+7, x,h-8); // left + p.drawLine(w-1,y+7, w-1,h-8); // right + + bitBlt(widget, x, y, border1, 0, 0, 7, 7); + bitBlt(widget, w-7, y, border1, 7, 0, 7, 7); + bitBlt(widget, x, h-7, border1, 0, 7, 7, 7); + bitBlt(widget, w-7, h-7, border1, 7, 7, 7, 7); + + } + + return true; + } + return false; + } + + if(obj->isA("QTipLabel")) { + + if (ev->type() == QEvent::Show) { + QLabel* l = dynamic_cast(obj); + l->resize( l->width()+2, l->height()+2); + l->setBackgroundMode(Qt::NoBackground); + int x, y, w, h; + l->rect().rect(&x, &y, &w, &h); + + QRegion mask(x, y+3, w, h-6); + mask += QRegion(x+1, y+2, w-2, h-4); + mask += QRegion(x+2, y+1, w-4, h-2); + mask += QRegion(x+3, y, w-6, h); + l->setMask(mask); + return true; + } + if (ev->type() == QEvent::Paint) { + + QLabel* label = dynamic_cast(obj); + QRect r = label->rect(); + + int x = r.x(); + int y = r.y(); + int w = r.width(); + int h = r.height(); + + // one pixel smaler as the mask + QRegion mask(x+1, y+4, w-2, h-8); + mask += QRegion(x+2, y+3, w-4, h-6); + mask += QRegion(x+3, y+2, w-6, h-4); + mask += QRegion(x+4, y+1, w-8, h-2); + + QPainter p(label); + p.setClipRegion(mask); + + renderGradient(&p, QRect(r.left(), r.top(), r.width(), r.height()), _toolTipColor.light(110), _toolTipColor.dark(105), true); + p.setClipping(false); + + QColor tabContour2 = qApp->palette().active().background().dark(150); + p.setPen(tabContour2); + p.drawLine(x+7,y, w-8,y); // top + p.drawLine(x+7,h-1, w-8,h-1); // bottom + p.drawLine(x,y+7, x,h-8); // left + p.drawLine(w-1,y+7, w-1,h-8); // right + + bitBlt(label, x, y, border1, 0, 0, 7, 7); + bitBlt(label, w-7, y, border1, 7, 0, 7, 7); + bitBlt(label, x, h-7, border1, 0, 7, 7, 7); + bitBlt(label, w-7, h-7, border1, 7, 7, 7, 7); + + QSimpleRichText* srt = new QSimpleRichText(label->text(), label->font()); + srt->setWidth(r.width()-5); + srt->draw(&p, r.x()+4, r.y(), r, qApp->palette().active(),0); + delete srt; + } + return true; + } + if(obj->isA("QViewportWidget") && dynamic_cast(obj->parent())) { + switch(ev->type()) { + case QEvent::MouseButtonPress: + case 6/*QEvent::KeyPress*/: { + QTextEdit* te = dynamic_cast(obj->parent()); + if(te->isEnabled() && !te->isReadOnly()) + static_cast(obj)->setCursor(Qt::blankCursor); + return false; + } + default: + return false; + } + } + + if (dynamic_cast(obj)) { // at last because other widgets may include a frame. + + QFrame* f = dynamic_cast(obj); + const QRect r = f->rect(); + + if (ev->type() == QEvent::Paint) { + + switch(f->frameShape()){ + case QFrame::HLine: { + QPainter p(f); +// p.setPen(f->paletteBackgroundColor().dark(120)); + p.setPen(alphaBlendColors(f->paletteForegroundColor(), f->paletteBackgroundColor(), 40)); + p.drawLine(0,0,f->frameRect().width(),0); + return true; + } + case QFrame::VLine: { + QPainter p(f); + p.setPen(alphaBlendColors(f->paletteForegroundColor(), f->paletteBackgroundColor(), 40)); + p.drawLine(0,0,0,f->frameRect().height()); + return true; + } + case QFrame::WinPanel: + case QFrame::Panel: { + if(f->parentWidget() && f->parentWidget()->isA("KDockSplitter")) { + + if(!f->erasePixmap()) { + bool horizontal = (r.width() > r.height()); + QPixmap pix(r.size()); + QPainter p(&pix); + renderGradient(&p, r, lightenColor(f->paletteBackgroundColor(), 40), darkenColor(f->paletteBackgroundColor(), 30), horizontal); + f->setErasePixmap(pix); + } + return true; + } + + QPainter p(f); + QColor frameColor; + if(f->frameShape() == QFrame::Panel && f->frameShadow() == QFrame::Plain) // used as a selection in kspread + frameColor = f->paletteBackgroundColor().dark(160); + else if(dynamic_cast(obj) && dynamic_cast(obj->parent())) + frameColor = f->paletteBackgroundColor().dark(190); + else + frameColor = f->paletteBackgroundColor().dark(120); + + + p.setPen(frameColor); + p.drawRect(f->rect()); + + QPaintEvent* e = (QPaintEvent*)ev; + p.setClipRegion(e->region().intersect(f->contentsRect())); + DominoQFrame* df = (DominoQFrame*)f; + df->drawContents(&p); + + DominoQWidget* dw = (DominoQWidget*)f; + QPaintEvent* event = new QPaintEvent(e->region().intersect(f->contentsRect())); + dw->paintEvent(event); + return true; + } + case QFrame::ToolBarPanel: { + if(f->isA("KonqSidebarTree")) { + QPainter p(f); + p.setPen(qApp->palette().active().background().dark(120)); + p.drawRect(f->rect()); + return true; + } + return false; + } + case QFrame::Box: { + if(f->parentWidget() && !strcmp(f->parentWidget()->name(), "KonqFrame")) { + QPainter p(f); + p.fillRect(r.width()-16, r.height()-16, 15, 15, qApp->palette().active().background()); // 15x15 scrollview cornerwidget gap + return true; + } + else if(konquerorMode && f->isA("KHTMLView")) { + QPainter p(f); + p.setPen(qApp->palette().active().background().dark(120)); + p.drawRect(f->rect()); + return true; + } + } + default: + return false; + } + } + + if (ev->type() == QEvent::Show || ev->type() == QEvent::ApplicationPaletteChange) { // ApplicationPaletteChange for style changes + + switch(f->frameShape()){ + case QFrame::TabWidgetPanel: + if(ev->type() == QEvent::ApplicationPaletteChange) { + + if(f->lineWidth() != 4) + f->setLineWidth(4); + if(f->frameRect() != QRect(0, 0, f->width(), f->height()-1)) + f->setFrameRect(QRect(0, 0, f->width(), f->height()-1)); + if(f->margin() != 0) + f->setMargin(0); + + QWidget* w = f->parentWidget(); + for(int i=0; i<3; i++) { // the third parentcheck is for the tabWidget on kcm khtml_plugins + if(!w) break; + if(dynamic_cast(w)) { + f->setPaletteBackgroundColor(qApp->palette().active().background()); + break; + } + w = w->parentWidget(); + } + } + return true; + case QFrame::Box: + if(f->parentWidget() && !strcmp(f->parentWidget()->name(), "KonqFrame")) { + f->setEraseColor(qApp->palette().active().background().dark(120)); + f->erase(); + return true; + } + case QFrame::Panel: + if(ev->type() == QEvent::ApplicationPaletteChange && f->parentWidget() && f->parentWidget()->isA("KDockSplitter")) { + f->setBackgroundMode(Qt::PaletteBackground); + return true; + } + default: + return false; + } + return false; + } + if(ev->type() == QEvent::LayoutHint && f->frameShape() == QFrame::TabWidgetPanel) { // don't look broken in kcm stylePreview + if(f->lineWidth() != 4) + f->setLineWidth(4); + if(f->frameRect() != QRect(0, 0, f->width(), f->height()-1)) + f->setFrameRect(QRect(0, 0, f->width(), f->height()-1)); + if(f->margin() != 0) + f->setMargin(0); + + return false; + } + } + + // nothing matched + return false; + +} diff --git a/domino/misc.cpp b/domino/misc.cpp new file mode 100644 index 0000000..b5b337f --- /dev/null +++ b/domino/misc.cpp @@ -0,0 +1,173 @@ + + +/* + * Copyright 2003, Sandro Giessl + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "misc.h" +#include +#include +#include + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#undef WORDS_BIGENDIAN +#define WORDS_LITTLEENDIAN 1 +#endif +#if __BYTE_ORDER == __BIG_ENDIAN + #undef WORDS_LITTLEENDIAN + #define WORDS_BIGENDIAN 1 +#endif + + + + +QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) +{ + QRgb rgb = bgColor.rgb(); + QRgb rgb_b = fgColor.rgb(); + uint alpha; + if(a > 255) alpha = 255; + else if(a < 0) alpha = 0; + else alpha = a; + uint inv_alpha = 255 - alpha; + + return QColor((qRed(rgb_b)*inv_alpha + qRed(rgb)*alpha)>>8, + (qGreen(rgb_b)*inv_alpha + qGreen(rgb)*alpha)>>8, + (qBlue(rgb_b)*inv_alpha + qBlue(rgb)*alpha)>>8 ); +} + +QColor blendColors(const QColor &bgColor, const QColor &fgColor) +{ + + uint fg_r = fgColor.red(); + uint fg_g = fgColor.green(); + uint fg_b = fgColor.blue(); + uint fg_a = qAlpha(fgColor.rgb()); + + uint bg_r = bgColor.red(); + uint bg_g = bgColor.green(); + uint bg_b = bgColor.blue(); + uint bg_a = qAlpha(bgColor.rgb()); + + uint ac = 65025 - (255 - fg_a) * (255 - bg_a); + uint res_r = ((255 - fg_a) * bg_r * bg_a + fg_a * fg_r * 255 + 127) / ac; + uint res_g = ((255 - fg_a) * bg_g * bg_a + fg_a * fg_g * 255 + 127) / ac; + uint res_b = ((255 - fg_a) * bg_b * bg_a + fg_a * fg_b * 255 + 127) / ac; + uint res_a = (ac+127)/255; + + return QColor(qRgba(res_r,res_g, res_b, res_a )); +} + +QImage tintImage(const QImage &img, const QColor &tintColor) { + + QImage *result = new QImage(img.width(), img.height(), 32, 0, QImage::IgnoreEndian); + result->setAlphaBuffer( true ); + register uint *data = (unsigned int*) img.bits(); + register uint *resultData = (unsigned int*) result->bits(); + register uint total = img.width()*img.height(); + for ( uint current = 0 ; current < total ; ++current ) { + resultData[ current ] = qRgba( tintColor.red(), tintColor.green(), tintColor.blue(), qAlpha( data[ current ] )); + } + return *result; +} + +QImage setImageOpacity(const QImage &img, const uint &p) { + QImage *result = new QImage(img.width(), img.height(), 32, 0, QImage::IgnoreEndian); + result->setAlphaBuffer( true ); + register uint *data = (unsigned int*) img.bits(); + register uint *resultData = (unsigned int*) result->bits(); + register uint alpha; + register uint total = img.width()*img.height(); + for ( uint current = 0 ; current < total ; ++current ) { + alpha = qAlpha( data[ current ] ) * p / 100; + resultData[ current ] = qRgba( qRed( data[ current ] ), qGreen( data[ current ] ), qBlue( data[ current ] ), alpha ); + } + return *result; +} + +bool blend( const QImage & upper, const QImage & lower, QImage & output) +// adopted from kimageeffect::blend - that is not endian safe and cannot handle complex alpha combinations... +{ + if + ( + upper.width() > lower.width() || + upper.height() > lower.height() || + upper.depth() != 32 || + lower.depth() != 32 + ) + return false; + + output = lower.copy(); + + uchar *i, *o; + register uint a, ab, ac; + register uint col; + register uint w = upper.width(); + int row(upper.height() - 1); + + do + { + i = upper.scanLine(row); + o = output.scanLine(row); + + col = w << 2; + + --col; + + do + { +#ifdef WORDS_BIGENDIAN + while (!(a = i[col-3]) && (col != 3)) +#else + while (!(a = i[col]) && (col != 3)) +#endif + { + --col; --col; --col; --col; + } +#ifdef WORDS_BIGENDIAN + if ((ab = o[col-3])) +#else + if ((ab = o[col])) +#endif + { + ac = 65025 - (255 - a) * (255 - ab); +#ifndef WORDS_BIGENDIAN + o[col]= (ac+127)/255; + --col; +#endif + o[col] = ((255 - a) * o[col] * ab + a * i[col] * 255 + 127) / ac; + --col; + o[col] = ((255 - a) * o[col] * ab + a * i[col] * 255 + 127) / ac; + --col; + o[col] = ((255 - a) * o[col] * ab + a * i[col] * 255 + 127) / ac; +#ifdef WORDS_BIGENDIAN + --col; + o[col]= (ac+127)/255; +#endif + } + else + { + o[col] = i[col]; --col; + o[col] = i[col]; --col; + o[col] = i[col]; --col; + o[col] = i[col]; + } + } while (col--); + } while (row--); + return true; +} diff --git a/domino/misc.h b/domino/misc.h new file mode 100644 index 0000000..18026b5 --- /dev/null +++ b/domino/misc.h @@ -0,0 +1,28 @@ + +/* + * Copyright 2003, Sandro Giessl + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __MISC_H +#define __MISC_H + +QColor blendColors(const QColor &backgroundColor, const QColor &foregroundColor); +QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); +QImage tintImage(const QImage &img, const QColor &tintColor); +QImage setImageOpacity(const QImage &img, const uint &p); +bool blend( const QImage & upper, const QImage & lower, QImage & output); +#endif // __MISC_H diff --git a/dominoConfig/Makefile.am b/dominoConfig/Makefile.am new file mode 100644 index 0000000..d2c5ac4 --- /dev/null +++ b/dominoConfig/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = $(all_includes) -I/usr/include/freetype2 + +noinst_HEADERS = dominoconf.h +kde_module_LTLIBRARIES = kstyle_domino_config.la +kstyle_domino_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kstyle_domino_config_la_LIBADD = $(LIB_KDEUI) ../domino/domino.la $(LIB_QT) $(LIB_KDECORE) -lkdefx $(LIB_KIO) +kstyle_domino_config_la_SOURCES = dominoconf.cpp +kstyle_domino_config_la_METASOURCES = AUTO diff --git a/dominoConfig/configData.h b/dominoConfig/configData.h new file mode 100644 index 0000000..60478fd --- /dev/null +++ b/dominoConfig/configData.h @@ -0,0 +1,73 @@ +/* + Copyright (C) 2006 Michael Lentner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + + +#ifndef _QEMBED_Config +#define _QEMBED_Config +#include +#include +static const QRgb tabIndicatorArrow_data[] = { + 0x0,0x0,0x0,0x10000000,0x4e000000,0x10000000,0x0,0x0,0x0,0x0,0x0,0x18000000,0x5f000000,0x66000000, + 0x5f000000,0x18000000,0x0,0x0,0x0,0x21000000,0x63000000,0x66000000,0x66000000,0x66000000,0x63000000,0x20000000,0x0,0x28000000, + 0x62000000,0x63000000,0x66000000,0x66000000,0x66000000,0x63000000,0x62000000,0x27000000,0x0,0x0,0x0,0x60000000,0x66000000,0x60000000, + 0x0,0x0,0x0,0x0,0x0,0x0,0x60000000,0x66000000,0x60000000,0x0,0x0,0x0,0x0,0x0, + 0x0,0x61000000,0x66000000,0x61000000,0x0,0x0,0x0,0x0,0x0,0x0,0x61000000,0x66000000,0x61000000,0x0, + 0x0,0x0,0x0,0x0,0x0,0x62000000,0x66000000,0x62000000,0x0,0x0,0x0 +}; + +/* Generated by qembed */ +static struct ConfigEmbedImage { + int width, height, depth; + const unsigned char *data; + int numColors; + const QRgb *colorTable; + bool alpha; + const char *name; +} config_embed_image_vec[] = { + { 9, 9, 32, (const unsigned char*)tabIndicatorArrow_data, 0, 0, TRUE, "tabIndicatorArrow" }, + { 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const QImage& config_findImage( const QString& name ) +{ + static QDict dict; + QImage* img = dict.find( name ); + if ( !img ) { + for ( int i = 0; config_embed_image_vec[i].data; i++ ) { + if ( strcmp(config_embed_image_vec[i].name, name.latin1()) == 0 ) { + img = new QImage((uchar*)config_embed_image_vec[i].data, + config_embed_image_vec[i].width, + config_embed_image_vec[i].height, + config_embed_image_vec[i].depth, + (QRgb*)config_embed_image_vec[i].colorTable, + config_embed_image_vec[i].numColors, + QImage::BigEndian ); + if ( config_embed_image_vec[i].alpha ) + img->setAlphaBuffer( TRUE ); + dict.insert( name, img ); + break; + } + } + if ( !img ) { + static QImage dummy; + return dummy; + } + } + return *img; +} + +#endif diff --git a/dominoConfig/dominoconf.cpp b/dominoConfig/dominoconf.cpp new file mode 100644 index 0000000..1984c56 --- /dev/null +++ b/dominoConfig/dominoconf.cpp @@ -0,0 +1,4341 @@ +/* +Copyright (C) 2006 Michael Lentner + +based on the Plastik configuration dialog: +Copyright (C) 2003 Sandro Giessl + +based on the Keramik configuration dialog: +Copyright (c) 2003 Maksim Orlovich + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include FT_FREETYPE_H + +#include "dominoconf.h" +// #include <../domino.h> +#include <../domino/misc.cpp> + +#include "configData.h" + + + +extern "C" +{ + KDE_EXPORT QWidget* allocate_kstyle_config(QWidget* parent) + { + KGlobal::locale()->insertCatalogue("kstyle_domino_config"); + return new DominoStyleConfig(parent); + } +} + + +DominoStyleConfig::DominoStyleConfig(QWidget* parent): QWidget(parent) +{ + + previewStyle = new PreviewStyle(); + previewStyle->configMode = "1"; + styleConfig = this; + initialized = false; + + int dummy; + hasCompositeExtension = XQueryExtension(qt_xdisplay(), "Composite", &dummy, &dummy, &dummy); + + //Should have no margins here, the dialog provides them + QVBoxLayout* layout = new QVBoxLayout(this, 0, 1); + KGlobal::locale()->insertCatalogue("kstyle_domino_config"); + + DominoKTabWidget *tabWidget = new DominoKTabWidget(this); + layout->addWidget(tabWidget); + +//////////////////////////////////////////////////////////////////////////// +// tab 1 +//////////////////////////////////////////////////////////////////////////// + + QScrollView* sv = new QScrollView(tabWidget); + sv->setVScrollBarMode(QScrollView::AlwaysOn); + QWidget* scrollWidget = new QWidget(sv->viewport()); + sv->addChild(scrollWidget); + sv->setResizePolicy( QScrollView::AutoOneFit ); + QVBoxLayout* page1layout = new QVBoxLayout(scrollWidget); + page1layout->setMargin(5); + tabWidget->addTab(sv, i18n("General")); + + animateProgressBar = new QCheckBox(i18n("Animate progress bars"), scrollWidget); + animateProgressBar->setFocus(); + centerTabs = new QCheckBox(i18n("Center tabs"), scrollWidget); + drawTriangularExpander = new QCheckBox(i18n("Triangular tree expander"), scrollWidget); + smoothScrolling = new QCheckBox(i18n("Smoother scrolling (works best with line steps bigger than 3)"), scrollWidget); + + + QHBox *hbox5 = new QHBox(scrollWidget); + hbox5->layout()->addItem(new QSpacerItem(23, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + buttonHeightAdjustmentLabel = new QLabel(hbox5); + buttonHeightAdjustment = new DSpinBox(-5, 5, 1, hbox5); + buttonHeightAdjustment->setAlignRight(); + buttonHeightAdjustment->setSuffix(" px"); + + customCheckMarkColor = new QCheckBox(i18n("Custom checkmark color"), scrollWidget); + QHBox *hbox3 = new QHBox(scrollWidget); + hbox3->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + checkMarkColor = new KColorButton(hbox3); + + customToolTipColor = new QCheckBox(i18n("Custom tooltip color"), scrollWidget); + QHBox *hbox4 = new QHBox(scrollWidget); + hbox4->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + toolTipColor = new KColorButton(hbox4); + + highlightToolBtnIcons = new QCheckBox(i18n("Highlight tool button icons on mouse over"), scrollWidget); + + toolBtnAsBtn = new QCheckBox(i18n("Draw tool buttons as normal buttons"), scrollWidget); + + // rubber options + + QHBox *hbox27 = new QHBox(scrollWidget); + hbox27->layout()->addItem(new QSpacerItem(23, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + labelRubberOptions = new QLabel(i18n("Rubber band options:"), hbox27 ); + + QHBox *hbox28 = new QHBox(scrollWidget); + hbox28->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + QVButtonGroup* btg = new QVButtonGroup(hbox28); + btg->setColumnLayout(0, Qt::Vertical ); + btg->layout()->setSpacing( 2 ); + btg->layout()->setMargin( 11 ); + btg->setExclusive(true); + + lineRubber = new QRadioButton(i18n("Solid line"), btg); + distRubber = new QRadioButton(i18n("Distribution's default"), btg); + argbRubber = new QRadioButton(i18n("Semi transparent (requires a running composite manager)"), btg); + argbRubber->setEnabled(hasCompositeExtension); + + QHBox *hbox29 = new QHBox(btg); + hbox29->setSpacing(2); + hbox29->layout()->addItem(new QSpacerItem(23, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + labelArgbRubberColor = new QLabel(i18n("Color:"), hbox29); + argbRubberColor = new KColorButton(hbox29); + argbRubberColor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + labelArgbRubberOpacity = new QLabel(i18n("Opacity:"), hbox29); + argbRubberOpacity = new DSpinBox(hbox29); + argbRubberOpacity->setAlignRight(); + argbRubberOpacity->setMaxValue(100); + + btg->layout()->add(lineRubber); + btg->layout()->add(distRubber); + btg->layout()->add(argbRubber); + + btg->layout()->add(hbox29); + + if(!hasCompositeExtension) { + argbRubberOpacity->setEnabled(false); + argbRubberColor->setEnabled(false); + labelArgbRubberColor->setEnabled(false); + labelArgbRubberOpacity->setEnabled(false); + } + + connect(btg, SIGNAL(released(int)), SLOT(rubberSelChanged(int))); + connect(argbRubber, SIGNAL(toggled(bool)), SLOT(updateArgbRubberOptions(bool))); + + // popupMenu options + + QHBox *hbox25 = new QHBox(scrollWidget); + hbox25->layout()->addItem(new QSpacerItem(23, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + labelPopupMenuOptions = new QLabel(i18n("Popupmenu options:"), hbox25 ); + + + QHBox *hbox26 = new QHBox(scrollWidget); + hbox26->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + QGroupBox* menuOptionsGb = new QGroupBox(hbox26); + menuOptionsGb->setColumnLayout(0, Qt::Vertical ); + menuOptionsGb->layout()->setSpacing( 2 ); + menuOptionsGb->layout()->setMargin( 11 ); + + + customPopupMenuColor = new QCheckBox(i18n("Custom popupmenu color"), menuOptionsGb); + QHBox *hbox6 = new QHBox(menuOptionsGb); + hbox6->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + popupMenuColor = new KColorButton(hbox6); + + + customSelMenuItemColor = new QCheckBox(i18n("Custom selected menu item color"), menuOptionsGb); + QHBox *hbox24 = new QHBox(menuOptionsGb); + hbox24->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + selMenuItemColor = new KColorButton(hbox24); + + drawPopupMenuGradient = new QCheckBox(i18n("Draw a gradient"), menuOptionsGb); + indentPopupMenuItems = new QCheckBox(i18n("Indent menu items"), menuOptionsGb); + + menuOptionsGb->layout()->add(customPopupMenuColor); + menuOptionsGb->layout()->add(hbox6); + menuOptionsGb->layout()->add(customSelMenuItemColor); + menuOptionsGb->layout()->add(hbox24); + menuOptionsGb->layout()->add(drawPopupMenuGradient); + menuOptionsGb->layout()->add(indentPopupMenuItems); + + + // groupbox + tintGroupBoxBackground = new QCheckBox(i18n("Tint groupbox background"), scrollWidget); + QHBox *hbox12 = new QHBox(scrollWidget); + hbox12->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + grFrame = new QGroupBox(hbox12); + grFrame->setColumnLayout(0, Qt::Vertical ); + grFrame->layout()->setSpacing( 6 ); + grFrame->layout()->setMargin( 11 ); + +// grFrame->setFrameShape( QFrame::StyledPanel ); +// grFrame->setFrameShadow( QFrame::Raised ); + QVBoxLayout* grFrameLayout = new QVBoxLayout(grFrame->layout(), QBoxLayout::BottomToTop); + + QFrame* prTintGroupBoxFrame = new QFrame(grFrame); + prTintGroupBoxFrame->setPaletteBackgroundColor(qApp->palette().active().background()); + prTintGroupBoxFrame->setFrameShape( QFrame::StyledPanel ); + prTintGroupBoxFrame->setFrameShadow( QFrame::Raised ); + QVBoxLayout* prTintGroupBoxFrameLayout = new QVBoxLayout(prTintGroupBoxFrame, QBoxLayout::BottomToTop); + prTintGroupBoxFrameLayout->setMargin(20); + gb1 = new QGroupBox(1, Qt::Vertical, prTintGroupBoxFrame); + gb1->setStyle(previewStyle); + gb1->setMinimumWidth(30); + gb1->setMinimumHeight(70); + gb2 = new QGroupBox(1, Qt::Vertical, gb1); + gb2->setStyle(previewStyle); + gb3 = new QGroupBox(gb2); + gb3->setStyle(previewStyle); +// grFrameLayout->addWidget(gb1); + prTintGroupBoxFrameLayout->addWidget(gb1); + grFrameLayout->addWidget(prTintGroupBoxFrame); + + grValueLabel = new QLabel("0", grFrame); + grValueLabel->setMinimumWidth(50); + QLabel* grLabel1 = new QLabel(i18n("Brightness:"), grFrame); + QLabel* grLabel2 = new QLabel(i18n("brighter"), grFrame); + QLabel* grLabel3 = new QLabel(i18n("darker"), grFrame); + grSlider = new QSlider(-50, 50, 1, 0, Qt::Horizontal, grFrame); + + QHBoxLayout* grHBoxLayout1 = new QHBoxLayout(0, 0, 6); + grHBoxLayout1->addWidget(grLabel1); + grHBoxLayout1->addWidget(grValueLabel); + grHBoxLayout1->addItem( new QSpacerItem( 61, 21, QSizePolicy::Preferred, QSizePolicy::Minimum ) ); + grHBoxLayout1->addWidget(grLabel2); + grHBoxLayout1->addWidget(grSlider); + grHBoxLayout1->addWidget(grLabel3); + grFrameLayout->addLayout(grHBoxLayout1); + + QVBoxLayout* grVBoxLayout2 = new QVBoxLayout(0, 0, 6); + customGroupBoxBackgroundColor = new QCheckBox(i18n("Custom background color"), grFrame); + QHBox *hbox13 = new QHBox(grFrame); + hbox13->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + groupBoxBackgroundColor = new KColorButton(hbox13); + + grVBoxLayout2->addWidget(customGroupBoxBackgroundColor); + grVBoxLayout2->addWidget(hbox13); + grFrameLayout->addLayout(grVBoxLayout2); + + connect(grSlider, SIGNAL(valueChanged(int)), this, SLOT(grValueLabelNum(int))); + connect(grSlider, SIGNAL(valueChanged(int)), this, SLOT(updateGroupBoxSettings())); + connect(groupBoxBackgroundColor, SIGNAL(changed(const QColor&)), this, SLOT(updateGroupBoxSettings())); + connect(tintGroupBoxBackground, SIGNAL(toggled(bool)), this, SLOT(updateGroupBoxSettings())); + connect(tintGroupBoxBackground, SIGNAL(toggled(bool)), this, SLOT(resetGroupBoxBackgroundColor())); + connect(tintGroupBoxBackground, SIGNAL(toggled(bool)), grFrame, SLOT(setEnabled(bool))); + connect(customGroupBoxBackgroundColor, SIGNAL(toggled(bool)), this, SLOT(updateGroupBoxSettings())); + connect(customGroupBoxBackgroundColor, SIGNAL(toggled(bool)), groupBoxBackgroundColor, SLOT(setEnabled(bool))); + + + // focusIndicator + indicateFocus = new QCheckBox(scrollWidget); + QHBox *hbox14 = new QHBox(scrollWidget); + hbox14->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + + indicateFocusFrame = new QGroupBox(hbox14); +// indicateFocusFrame->setFrameShape( QFrame::StyledPanel ); +// indicateFocusFrame->setFrameShadow( QFrame::Raised ); + indicateFocusFrame->setColumnLayout(0, Qt::Vertical ); + indicateFocusFrame->layout()->setSpacing( 6 ); + indicateFocusFrame->layout()->setMargin( 11 ); + QGridLayout* indicateFocusLayout = new QGridLayout( indicateFocusFrame->layout(), 2, 2 ); + indicateFocusLayout->setAlignment( Qt::AlignTop ); + + QHBoxLayout* hbox11 = new QHBoxLayout(0, 0, 6); + indicatorModeCombo = new QComboBox(indicateFocusFrame); + hbox11->addWidget( indicatorModeCombo ); + hbox11->addItem( new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + + QHBoxLayout* hbox7 = new QHBoxLayout(0, 0, 6); + labelIndicatorColor = new QLabel(indicateFocusFrame); + labelIndicatorColor->setMinimumWidth(labelIndicatorColor->fontMetrics().width(i18n("Button color:"))); + hbox7->addWidget( labelIndicatorColor ); +// hbox7->addItem( new QSpacerItem( 21, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ) ); + indicatorColor = new KColorButton( indicateFocusFrame ); + indicatorColor->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed ); + hbox7->addWidget( indicatorColor ); + + labelIndicatorColorOpacity = new QLabel(i18n("Opacity:"), indicateFocusFrame); + hbox7->addWidget( labelIndicatorColorOpacity ); + indicatorOpacity = new QSpinBox(0, 100, 1, indicateFocusFrame); + hbox7->addWidget( indicatorOpacity ); + + + QHBoxLayout* hbox8 = new QHBoxLayout(0, 0, 5); + labelIndicatorBtnColor = new QLabel(indicateFocusFrame ); + hbox8->addWidget( labelIndicatorBtnColor ); +// hbox8->addItem( new QSpacerItem( 21, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ) ); + indicatorBtnColor = new KColorButton( indicateFocusFrame ); + indicatorBtnColor->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed ); + indicatorBtnColor->setFocusPolicy(QWidget::NoFocus); + hbox8->addWidget( indicatorBtnColor ); + + labelIndicatorBtnColorOpacity = new QLabel(i18n("Opacity:"), indicateFocusFrame); + hbox8->addWidget( labelIndicatorBtnColorOpacity ); + indicatorBtnOpacity = new QSpinBox(0, 100, 1, indicateFocusFrame); + hbox8->addWidget( indicatorBtnOpacity ); + + + QFrame* prFrame = new QFrame( indicateFocusFrame); + prFrame->setPaletteBackgroundColor(qApp->palette().active().background()); + prFrame->setFrameShape( QFrame::StyledPanel ); + prFrame->setFrameShadow( QFrame::Raised ); + QVBoxLayout* prFrameLayout = new QVBoxLayout( prFrame, 3, 6); + + QHBoxLayout* hbox9 = new QHBoxLayout(0, 0, 6); + hbox9->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + indicatorPrevWidget = new IndicatorPrevWidget( prFrame, "IndicatorPrevWidget"/*, Qt::WNoAutoErase*/ ); + int width = indicatorPrevWidget->fontMetrics().width(i18n("focused")); + indicatorPrevWidget->setMinimumWidth(width+8); + hbox9->addWidget( indicatorPrevWidget ); + hbox9->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + + QHBoxLayout* hbox10 = new QHBoxLayout(0, 0, 6); + hbox10->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + indicatorPrevButton = new IndicatorPrevButton( prFrame ); + width = indicatorPrevButton->fontMetrics().width(i18n("focused")); + indicatorPrevButton->setMinimumWidth(width+16); + hbox10->addWidget( indicatorPrevButton ); + hbox10->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + prFrameLayout->addLayout(hbox9); + prFrameLayout->addLayout(hbox10); + + indicateFocusLayout->addMultiCellLayout( hbox11, 0, 0, 0, 2 ); + indicateFocusLayout->addLayout(hbox7, 1, 0); + indicateFocusLayout->addLayout(hbox8, 2, 0); + indicateFocusLayout->addMultiCellWidget( prFrame, 1, 2, 1, 2 ); + + connect(indicatorModeCombo, SIGNAL( activated(int)), this, SLOT(indicatorModeChanged())); + connect(indicatorModeCombo, SIGNAL(activated(int)), this, SLOT(updateFocusIndicatorSettings())); + connect(indicateFocus, SIGNAL(toggled(bool)), indicatorPrevButton, SLOT(setEnabled(bool))); + connect(indicateFocus, SIGNAL(toggled(bool)), indicateFocusFrame, SLOT(setEnabled(bool))); + + + + // text effect + drawTextEffect = new QCheckBox(scrollWidget); + QHBox *hbox15 = new QHBox(scrollWidget); + hbox15->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + textEffectFrame = new QGroupBox(hbox15); +// textEffectFrame->setFrameShape( QFrame::StyledPanel ); +// textEffectFrame->setFrameShadow( QFrame::Raised ); + textEffectFrame->setColumnLayout(0, Qt::Vertical ); + textEffectFrame->layout()->setSpacing( 6 ); + textEffectFrame->layout()->setMargin( 11 ); + QGridLayout* textEffectLayout = new QGridLayout( textEffectFrame->layout(), 2, 2 ); + textEffectLayout->setAlignment( Qt::AlignTop ); + + QHBoxLayout* hbox16 = new QHBoxLayout(0, 0, 6); + labelTextEffectColor = new QLabel(textEffectFrame); + labelTextEffectColor->setMinimumWidth(labelTextEffectColor->fontMetrics().width(i18n("Button color:"))); + hbox16->addWidget( labelTextEffectColor ); + textEffectColor = new KColorButton( textEffectFrame ); + textEffectColor->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed ); + hbox16->addWidget( textEffectColor ); + + labelTextEffectColorOpacity = new QLabel(i18n("Opacity:"), textEffectFrame); + hbox16->addWidget( labelTextEffectColorOpacity ); + textEffectOpacity = new QSpinBox(0, 100, 1, textEffectFrame); + hbox16->addWidget( textEffectOpacity ); + + labelTextEffectPos = new QLabel(i18n("Position:"), textEffectFrame); + hbox16->addWidget( labelTextEffectPos ); + + textEffectPos = new QComboBox(textEffectFrame); + textEffectPos->insertItem(i18n("top left"), 0); + textEffectPos->insertItem(i18n("top"), 1); + textEffectPos->insertItem(i18n("top right"), 2); + textEffectPos->insertItem(i18n("right"), 3); + textEffectPos->insertItem(i18n("bottom right"), 4); + textEffectPos->insertItem(i18n("bottom"), 5); + textEffectPos->insertItem(i18n("bottom left"), 6); + textEffectPos->insertItem(i18n("left"), 7); + hbox16->addWidget( textEffectPos ); + + + QHBoxLayout* hbox17 = new QHBoxLayout(0, 0, 5); + labelTextEffectButtonColor = new QLabel(textEffectFrame); + hbox17->addWidget( labelTextEffectButtonColor ); + textEffectButtonColor = new KColorButton( textEffectFrame ); + textEffectButtonColor->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed ); + textEffectButtonColor->setFocusPolicy(QWidget::NoFocus); + hbox17->addWidget( textEffectButtonColor ); + + labelTextEffectButtonColorOpacity = new QLabel(i18n("Opacity:"), textEffectFrame); + hbox17->addWidget( labelTextEffectButtonColorOpacity ); + textEffectButtonOpacity = new QSpinBox(0, 100, 1, textEffectFrame); + hbox17->addWidget( textEffectButtonOpacity ); + + labelTextEffectButtonPos = new QLabel(i18n("Position:"), textEffectFrame); + hbox17->addWidget( labelTextEffectButtonPos ); + + textEffectButtonPos = new QComboBox(textEffectFrame); + textEffectButtonPos->insertItem(i18n("top left"), 0); + textEffectButtonPos->insertItem(i18n("top"), 1); + textEffectButtonPos->insertItem(i18n("top right"), 2); + textEffectButtonPos->insertItem(i18n("right"), 3); + textEffectButtonPos->insertItem(i18n("bottom right"), 4); + textEffectButtonPos->insertItem(i18n("bottom"), 5); + textEffectButtonPos->insertItem(i18n("bottom left"), 6); + textEffectButtonPos->insertItem(i18n("left"), 7); + hbox17->addWidget( textEffectButtonPos ); + + + QFrame* prTextEffectFrame = new QFrame( textEffectFrame); + prTextEffectFrame->setPaletteBackgroundColor(qApp->palette().active().background()); + prTextEffectFrame->setFrameShape( QFrame::StyledPanel ); + prTextEffectFrame->setFrameShadow( QFrame::Raised ); + QVBoxLayout* prTextEffectFrameLayout = new QVBoxLayout( prTextEffectFrame, 3, 6); + + QHBoxLayout* hbox18 = new QHBoxLayout(0, 0, 6); + hbox18->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + textEffectPrevWidget = new TextEffectPrevWidget( prTextEffectFrame, "TextEffectPrevWidget", Qt::WNoAutoErase); + textEffectPrevWidget->setStyle(previewStyle); + width = textEffectPrevWidget->fontMetrics().width(i18n("123 text")); + textEffectPrevWidget->setMinimumWidth(width+8); + hbox18->addWidget( textEffectPrevWidget ); + hbox18->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + + QHBoxLayout* hbox19 = new QHBoxLayout(0, 0, 6); + hbox19->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + textEffectPrevButton = new TextEffectPrevButton( prTextEffectFrame ); + textEffectPrevButton->setStyle(previewStyle); + textEffectPrevButton->setText("123 text"); + width = textEffectPrevButton->fontMetrics().width(i18n("123 text")); + //textEffectPrevButton->setMinimumWidth(width+16); + + hbox19->addWidget( textEffectPrevButton ); + hbox19->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + prTextEffectFrameLayout->addLayout(hbox18); + prTextEffectFrameLayout->addLayout(hbox19); + + textEffectModeCombo = new QComboBox(textEffectFrame); + QHBoxLayout* hbox20 = new QHBoxLayout(0, 0, 6); + hbox20->addWidget( textEffectModeCombo ); + hbox20->addItem( new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + + textEffectLayout->addMultiCellLayout( hbox20, 0, 0, 0, 2 ); + textEffectLayout->addLayout(hbox16, 1, 0); + textEffectLayout->addLayout(hbox17, 2, 0); + textEffectLayout->addMultiCellWidget( prTextEffectFrame, 1, 2, 1, 2 ); + + connect(drawTextEffect, SIGNAL(toggled(bool)), textEffectFrame, SLOT(setEnabled(bool))); + connect(drawTextEffect, SIGNAL(toggled(bool)), this, SLOT(updateTextEffectSettings())); + connect(textEffectModeCombo, SIGNAL( activated(int)), this, SLOT(textEffectModeChanged())); + connect(textEffectModeCombo, SIGNAL( activated(int)), this, SLOT(updateTextEffectSettings())); + + + drawButtonSunkenShadow = new QCheckBox(i18n("Draw a shadow on pressed sunken buttons"), scrollWidget); + connect(drawButtonSunkenShadow, SIGNAL(toggled(bool)), this, SLOT(updateButtonContourSettings())); + + QHBox *hbox21 = new QHBox(scrollWidget); + hbox21->layout()->addItem(new QSpacerItem(23, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + buttonTypLabel = new QLabel(i18n("Button Type:"), hbox21); + buttonContourType = new QComboBox(hbox21); + buttonContourType->insertItem(i18n("Sunken"), 0); + buttonContourType->insertItem(i18n("Raised"), 1); + + + + // button contour colors + QHBox *hbox22 = new QHBox(scrollWidget); + hbox22->layout()->addItem(new QSpacerItem(23, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + labelButtonContourColors = new QLabel(i18n("Button contour colors:"), hbox22 ); + + + QHBox *hbox23 = new QHBox(scrollWidget); + hbox23->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) ); + + QGroupBox* buttonContourColorFrame = new QGroupBox(hbox23); +// buttonContourColorFrame->setFrameShape( QFrame::StyledPanel ); +// buttonContourColorFrame->setFrameShadow( QFrame::Raised ); + buttonContourColorFrame->setColumnLayout(0, Qt::Vertical ); + buttonContourColorFrame->layout()->setSpacing( 6 ); + buttonContourColorFrame->layout()->setMargin( 11 ); + + QGridLayout* buttonContourColorFrameLayout = new QGridLayout( buttonContourColorFrame->layout(), 4, 3 ); + buttonContourColorFrameLayout->setAlignment( Qt::AlignTop ); + + QLabel* labelSC = new QLabel(i18n("Standard color:"), buttonContourColorFrame); + buttonContourColor = new KColorButton(buttonContourColorFrame); + QLabel* labelMC = new QLabel(i18n("Mouseover color:"), buttonContourColorFrame); + buttonMouseOverContourColor = new KColorButton(buttonContourColorFrame); + QLabel* labelPC = new QLabel(i18n("Pressed color:"), buttonContourColorFrame); + buttonPressedContourColor = new KColorButton(buttonContourColorFrame); + QLabel* labelDBC = new QLabel(i18n("Defaultbutton color:"), buttonContourColorFrame); + buttonDefaultButtonContourColor = new KColorButton(buttonContourColorFrame); + + buttonContourColorFrameLayout->addWidget(labelSC, 0, 0); + buttonContourColorFrameLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Preferred, QSizePolicy::Minimum) ); + buttonContourColorFrameLayout->addWidget(buttonContourColor, 0, 1); + buttonContourColorFrameLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Expanding, QSizePolicy::Minimum) ); + + buttonContourColorFrameLayout->addWidget(labelMC, 1, 0); + buttonContourColorFrameLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Preferred, QSizePolicy::Minimum) ); + buttonContourColorFrameLayout->addWidget(buttonMouseOverContourColor, 1, 1); + + buttonContourColorFrameLayout->addWidget(labelPC, 2, 0); + buttonContourColorFrameLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Preferred, QSizePolicy::Minimum) ); + buttonContourColorFrameLayout->addWidget(buttonPressedContourColor, 2, 1); + + buttonContourColorFrameLayout->addWidget(labelDBC, 3, 0); + buttonContourColorFrameLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Preferred, QSizePolicy::Minimum) ); + buttonContourColorFrameLayout->addWidget(buttonDefaultButtonContourColor, 3, 1); + + + + QGroupBox* prButtonContourColorFrame = new QGroupBox(buttonContourColorFrame); + prButtonContourColorFrame->setPaletteBackgroundColor(qApp->palette().active().background()); + prButtonContourColorFrame->setFrameShape( QFrame::StyledPanel ); + prButtonContourColorFrame->setFrameShadow( QFrame::Raised ); + + + QHBoxLayout* prButtonContourColorFrameLayout = new QHBoxLayout( prButtonContourColorFrame, 3, 6); + + prButtonContourColorFrameLayout->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + buttonContourPrevButton = new QPushButton(prButtonContourColorFrame); + ((DominoQWidget*)buttonContourPrevButton)->setWFlags(Qt::WNoAutoErase); + buttonContourPrevButton->setStyle(previewStyle); + prButtonContourColorFrameLayout->addWidget( buttonContourPrevButton ); + prButtonContourColorFrameLayout->addItem(new QSpacerItem( 61, 21, QSizePolicy::Expanding, QSizePolicy::Minimum )); + + buttonContourColorFrameLayout->addMultiCellWidget(prButtonContourColorFrame, 0, 3, 2, 2); + + + connect(buttonContourType, SIGNAL(activated(int)), this, SLOT(updateButtonContourSettings())); + + connect(buttonContourColor, SIGNAL(changed(const QColor&)), this, SLOT(updateButtonContourSettings())); + connect(buttonMouseOverContourColor, SIGNAL(changed(const QColor&)), this, SLOT(updateButtonContourSettings())); + connect(buttonPressedContourColor, SIGNAL(changed(const QColor&)), this, SLOT(updateButtonContourSettings())); + connect(buttonDefaultButtonContourColor, SIGNAL(changed(const QColor&)), this, SLOT(updateButtonContourSettings())); + + + + + page1layout->add(animateProgressBar); + page1layout->add(centerTabs); + page1layout->add(drawTriangularExpander); + page1layout->add(smoothScrolling); + page1layout->add(highlightToolBtnIcons); + page1layout->add(toolBtnAsBtn); + page1layout->add(hbox5); + page1layout->add(customCheckMarkColor); + page1layout->add(hbox3); + page1layout->add(customToolTipColor); + page1layout->add(hbox4); + page1layout->add(hbox27); + page1layout->addSpacing(3); + page1layout->add(hbox28); + page1layout->addSpacing(8); + page1layout->add(hbox25); + page1layout->addSpacing(3); + page1layout->add(hbox26); + page1layout->addSpacing(8); + page1layout->add(tintGroupBoxBackground); + page1layout->add(hbox12); + page1layout->addSpacing(8); + page1layout->add(indicateFocus); + page1layout->add(hbox14); + page1layout->addSpacing(8); + page1layout->add(drawTextEffect); + page1layout->add(hbox15); + page1layout->addSpacing(8); + page1layout->add(drawButtonSunkenShadow); + page1layout->addSpacing(8); + page1layout->add(hbox21); + page1layout->addSpacing(8); + page1layout->add(hbox22); + page1layout->addSpacing(3); + page1layout->add(hbox23); + page1layout->addStretch(1); + + + QWidget *page2 = new QWidget(); + tabWidget->addTab(page2, "Custom Gradients"); + + QVBoxLayout* page2layout = new QVBoxLayout(page2); + +//////////////////////////////////////////////////////////////////////////// +// tab 2 (custom Gradients) +//////////////////////////////////////////////////////////////////////////// + + tabWidget2 = new DominoKTabWidget( page2, "tabWidget2" ); + connect(tabWidget2, SIGNAL(testCanDecode(const QDragMoveEvent *, bool &)), SLOT(testCanDecode(const QDragMoveEvent *, bool &))); + page2layout->add(tabWidget2); + +//////////////////////////////////////////////////////////////////////////// +// tab 2.1 (buttons) +//////////////////////////////////////////////////////////////////////////// + + tab1 = new QWidget( tabWidget2, "tab1" ); + tab1Layout = new QVBoxLayout( tab1, 11, 6, "tab1Layout"); + + groupBox22 = new QGroupBox( tab1, "groupBox22" ); + groupBox22->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox22->sizePolicy().hasHeightForWidth() ) ); + groupBox22->setColumnLayout(0, Qt::Vertical ); + groupBox22->layout()->setSpacing( 0 ); + groupBox22->layout()->setMargin( 11 ); + groupBox22Layout = new QGridLayout( groupBox22->layout() ); + groupBox22Layout->setAlignment( Qt::AlignTop ); + spacer6 = new QSpacerItem( 83, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22Layout->addItem( spacer6, 3, 3 ); + + textLabel1_2 = new QLabel( groupBox22, "textLabel1_2" ); + textLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) ); + textLabel1_2->setTextFormat( QLabel::PlainText ); + + groupBox22Layout->addWidget( textLabel1_2, 3, 4 ); + + kColorButton27_2 = new KColorButton( groupBox22, "kColorButton27_2" ); + kColorButton27_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, kColorButton27_2->sizePolicy().hasHeightForWidth() ) ); + kColorButton27_2->setMinimumSize( QSize( 75, 0 ) ); + + groupBox22Layout->addWidget( kColorButton27_2, 3, 5 ); + spacer3 = new QSpacerItem( 12, 25, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22Layout->addItem( spacer3, 3, 6 ); + + groupBox10_2_2_2 = new QGroupBox( groupBox22, "groupBox10_2_2_2" ); + groupBox10_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, groupBox10_2_2_2->sizePolicy().hasHeightForWidth() ) ); + groupBox10_2_2_2->setMinimumSize( QSize( 170, 0 ) ); + groupBox10_2_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox10_2_2_2->layout()->setSpacing( 6 ); + groupBox10_2_2_2->layout()->setMargin( 11 ); + groupBox10_2_2_2Layout = new QVBoxLayout( groupBox10_2_2_2->layout() ); + groupBox10_2_2_2Layout->setAlignment( Qt::AlignTop ); + + + pushButton16 = new QPushButton(groupBox10_2_2_2, "dominoPreviewWidget" ); + pushButton16->setStyle(previewStyle); + groupBox10_2_2_2Layout->addWidget( pushButton16 ); + + comboBox17 = new QComboBox( FALSE, groupBox10_2_2_2, "dominoPreviewWidget" ); + comboBox17->setStyle(previewStyle); + groupBox10_2_2_2Layout->addWidget( comboBox17 ); + + spinBox44 = new DSpinBox( groupBox10_2_2_2, "dominoPreviewWidget" ); + spinBox44->spinWidget()->setStyle(previewStyle); + spinBox44->setAlignRight(); + groupBox10_2_2_2Layout->addWidget( spinBox44 ); + + groupBox22Layout->addMultiCellWidget( groupBox10_2_2_2, 0, 1, 0, 0 ); + spacer43 = new QSpacerItem( 5, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22Layout->addMultiCell( spacer43, 0, 1, 1, 1 ); + + groupBox8_2_2_2 = new QGroupBox( groupBox22, "groupBox8_2_2_2" ); + groupBox8_2_2_2->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox8_2_2_2->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(btn1GradientChanged())); + groupBox8_2_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox8_2_2_2->layout()->setSpacing( 7 ); + groupBox8_2_2_2->layout()->setMargin( 4 ); + groupBox8_2_2_2Layout = new QGridLayout( groupBox8_2_2_2->layout() ); + groupBox8_2_2_2Layout->setAlignment( Qt::AlignTop ); + + textLabel4_3_2_2_2 = new QLabel( groupBox8_2_2_2, "textLabel4_3_2_2_2" ); + textLabel4_3_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2Layout->addWidget( textLabel4_3_2_2_2, 1, 0 ); + + spinBox2_2_2_2_2 = new DSpinBox( groupBox8_2_2_2, "spinBox2_2_2_2_2" ); + spinBox2_2_2_2_2->setAlignRight(); + spinBox2_2_2_2_2->setMaxValue( 100 ); + + groupBox8_2_2_2Layout->addWidget( spinBox2_2_2_2_2, 1, 1 ); + + textLabel2_2_2_2_2 = new QLabel( groupBox8_2_2_2, "textLabel2_2_2_2_2" ); + textLabel2_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2Layout->addWidget( textLabel2_2_2_2_2, 1, 2 ); + + kColorButton1_2_2_2_2 = new KColorButton( groupBox8_2_2_2, "kColorButton1_2_2_2_2" ); + + groupBox8_2_2_2Layout->addWidget( kColorButton1_2_2_2_2, 1, 3 ); + + textLabel3_3_2_2_2 = new QLabel( groupBox8_2_2_2, "textLabel3_3_2_2_2" ); + textLabel3_3_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2Layout->addWidget( textLabel3_3_2_2_2, 0, 0 ); + + spinBox1_2_2_2_2 = new DSpinBox( groupBox8_2_2_2, "spinBox1_2_2_2_2" ); + spinBox1_2_2_2_2->setAlignRight(); + spinBox1_2_2_2_2->setMaxValue( 100 ); + + groupBox8_2_2_2Layout->addWidget( spinBox1_2_2_2_2, 0, 1 ); + + textLabel1_4_2_2_2 = new QLabel( groupBox8_2_2_2, "textLabel1_4_2_2_2" ); + textLabel1_4_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2Layout->addWidget( textLabel1_4_2_2_2, 0, 2 ); + + kColorButton2_4_2_2_2 = new KColorButton( groupBox8_2_2_2, "kColorButton2_4_2_2_2" ); + + groupBox8_2_2_2Layout->addWidget( kColorButton2_4_2_2_2, 0, 3 ); + + groupBox22Layout->addMultiCellWidget( groupBox8_2_2_2, 0, 0, 2, 6 ); + + groupBox9_2_2_2 = new QGroupBox( groupBox22, "groupBox9_2_2_2" ); + groupBox9_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox9_2_2_2->sizePolicy().hasHeightForWidth() ) ); + groupBox9_2_2_2->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox9_2_2_2->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(btn2GradientChanged())); + groupBox9_2_2_2->setChecked( FALSE ); + groupBox9_2_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox9_2_2_2->layout()->setSpacing( 7 ); + groupBox9_2_2_2->layout()->setMargin( 4 ); + groupBox9_2_2_2Layout = new QGridLayout( groupBox9_2_2_2->layout() ); + groupBox9_2_2_2Layout->setAlignment( Qt::AlignTop ); + + textLabel4_4_2_2_2 = new QLabel( groupBox9_2_2_2, "textLabel4_4_2_2_2" ); + textLabel4_4_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2Layout->addWidget( textLabel4_4_2_2_2, 1, 0 ); + + spinBox2_3_2_2_2 = new DSpinBox( groupBox9_2_2_2, "spinBox2_3_2_2_2" ); + spinBox2_3_2_2_2->setAlignRight(); + spinBox2_3_2_2_2->setMaxValue( 100 ); + + groupBox9_2_2_2Layout->addWidget( spinBox2_3_2_2_2, 1, 1 ); + + textLabel3_4_2_2_2 = new QLabel( groupBox9_2_2_2, "textLabel3_4_2_2_2" ); + textLabel3_4_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2Layout->addWidget( textLabel3_4_2_2_2, 0, 0 ); + + spinBox1_3_2_2_2 = new DSpinBox( groupBox9_2_2_2, "spinBox1_3_2_2_2" ); + spinBox1_3_2_2_2->setAlignRight(); + spinBox1_3_2_2_2->setMaxValue( 100 ); + + groupBox9_2_2_2Layout->addWidget( spinBox1_3_2_2_2, 0, 1 ); + + kColorButton1_3_2_2_2 = new KColorButton( groupBox9_2_2_2, "kColorButton1_3_2_2_2" ); + kColorButton1_3_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, kColorButton1_3_2_2_2->sizePolicy().hasHeightForWidth() ) ); + + groupBox9_2_2_2Layout->addWidget( kColorButton1_3_2_2_2, 1, 3 ); + + kColorButton2_5_2_2_2 = new KColorButton( groupBox9_2_2_2, "kColorButton2_5_2_2_2" ); + + groupBox9_2_2_2Layout->addWidget( kColorButton2_5_2_2_2, 0, 3 ); + + textLabel1_5_2_2_2 = new QLabel( groupBox9_2_2_2, "textLabel1_5_2_2_2" ); + textLabel1_5_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2Layout->addWidget( textLabel1_5_2_2_2, 0, 2 ); + + textLabel2_3_2_2_2 = new QLabel( groupBox9_2_2_2, "textLabel2_3_2_2_2" ); + textLabel2_3_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2Layout->addWidget( textLabel2_3_2_2_2, 1, 2 ); + + groupBox22Layout->addMultiCellWidget( groupBox9_2_2_2, 1, 1, 2, 6 ); + spacer46 = new QSpacerItem( 20, 7, QSizePolicy::Minimum, QSizePolicy::Fixed ); + groupBox22Layout->addItem( spacer46, 2, 4 ); + spacer2 = new QSpacerItem( 82, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22Layout->addItem( spacer2, 3, 2 ); + tab1Layout->addWidget( groupBox22 ); + + layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); + spacer7 = new QSpacerItem( 270, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout9->addItem( spacer7 ); + + textLabel7_4 = new QLabel( tab1, "textLabel7_4" ); + layout9->addWidget( textLabel7_4 ); + + comboBox3_4 = new QComboBox( FALSE, tab1, "comboBox3_4" ); + layout9->addWidget( comboBox3_4 ); + + pushButton4_4 = new QPushButton( tab1, "pushButton4_4" ); + connect(pushButton4_4, SIGNAL(clicked()), SLOT(copyColorsToButton())); + layout9->addWidget( pushButton4_4 ); + tab1Layout->addLayout( layout9 ); + tabWidget2->insertTab( tab1, QString::fromLatin1("") ); + +///////////////////////////////////////////////// +// tab 2.2 (tabs) +///////////////////////////////////////////////// + tab2 = new QWidget( tabWidget2, "tab2" ); + tab2Layout = new QVBoxLayout( tab2, 11, 6, "tab2Layout"); + + groupBox22_2 = new QGroupBox( tab2, "groupBox22_2" ); + groupBox22_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox22_2->sizePolicy().hasHeightForWidth() ) ); + groupBox22_2->setColumnLayout(0, Qt::Vertical ); + groupBox22_2->layout()->setSpacing( 0 ); + groupBox22_2->layout()->setMargin( 11 ); + groupBox22_2Layout = new QGridLayout( groupBox22_2->layout() ); + groupBox22_2Layout->setAlignment( Qt::AlignTop ); + spacer46_2 = new QSpacerItem( 20, 7, QSizePolicy::Minimum, QSizePolicy::Fixed ); + groupBox22_2Layout->addItem( spacer46_2, 2, 5 ); + spacer43_2 = new QSpacerItem( 5, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2Layout->addMultiCell( spacer43_2, 0, 1, 1, 1 ); + + groupBox8_2_2_2_2 = new QGroupBox( groupBox22_2, "groupBox8_2_2_2_2" ); + groupBox8_2_2_2_2->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox8_2_2_2_2->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(tab1GradientChanged())); + groupBox8_2_2_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox8_2_2_2_2->layout()->setSpacing( 7 ); + groupBox8_2_2_2_2->layout()->setMargin( 4 ); + groupBox8_2_2_2_2Layout = new QGridLayout( groupBox8_2_2_2_2->layout() ); + groupBox8_2_2_2_2Layout->setAlignment( Qt::AlignTop ); + + textLabel4_3_2_2_2_2 = new QLabel( groupBox8_2_2_2_2, "textLabel4_3_2_2_2_2" ); + textLabel4_3_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2Layout->addWidget( textLabel4_3_2_2_2_2, 1, 0 ); + + spinBox2_2_2_2_2_2 = new DSpinBox( groupBox8_2_2_2_2, "spinBox2_2_2_2_2_2" ); + spinBox2_2_2_2_2_2->setAlignRight(); + spinBox2_2_2_2_2_2->setMaxValue( 100 ); + + groupBox8_2_2_2_2Layout->addWidget( spinBox2_2_2_2_2_2, 1, 1 ); + + textLabel2_2_2_2_2_2 = new QLabel( groupBox8_2_2_2_2, "textLabel2_2_2_2_2_2" ); + textLabel2_2_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2Layout->addWidget( textLabel2_2_2_2_2_2, 1, 2 ); + + kColorButton1_2_2_2_2_2 = new KColorButton( groupBox8_2_2_2_2, "kColorButton1_2_2_2_2_2" ); + + groupBox8_2_2_2_2Layout->addWidget( kColorButton1_2_2_2_2_2, 1, 3 ); + + textLabel3_3_2_2_2_2 = new QLabel( groupBox8_2_2_2_2, "textLabel3_3_2_2_2_2" ); + textLabel3_3_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2Layout->addWidget( textLabel3_3_2_2_2_2, 0, 0 ); + + spinBox1_2_2_2_2_2 = new DSpinBox( groupBox8_2_2_2_2, "spinBox1_2_2_2_2_2" ); + spinBox1_2_2_2_2_2->setAlignRight(); + spinBox1_2_2_2_2_2->setMaxValue( 100 ); + + groupBox8_2_2_2_2Layout->addWidget( spinBox1_2_2_2_2_2, 0, 1 ); + + textLabel1_4_2_2_2_2 = new QLabel( groupBox8_2_2_2_2, "textLabel1_4_2_2_2_2" ); + textLabel1_4_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2Layout->addWidget( textLabel1_4_2_2_2_2, 0, 2 ); + + kColorButton2_4_2_2_2_2 = new KColorButton( groupBox8_2_2_2_2, "kColorButton2_4_2_2_2_2" ); + + groupBox8_2_2_2_2Layout->addWidget( kColorButton2_4_2_2_2_2, 0, 3 ); + + groupBox22_2Layout->addMultiCellWidget( groupBox8_2_2_2_2, 0, 0, 2, 6 ); + + groupBox9_2_2_2_2 = new QGroupBox( groupBox22_2, "groupBox9_2_2_2_2" ); + groupBox9_2_2_2_2->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox9_2_2_2_2->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(tab2GradientChanged())); + groupBox9_2_2_2_2->setChecked( FALSE ); + groupBox9_2_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox9_2_2_2_2->sizePolicy().hasHeightForWidth() ) ); + groupBox9_2_2_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox9_2_2_2_2->layout()->setSpacing( 7 ); + groupBox9_2_2_2_2->layout()->setMargin( 4 ); + groupBox9_2_2_2_2Layout = new QGridLayout( groupBox9_2_2_2_2->layout() ); + groupBox9_2_2_2_2Layout->setAlignment( Qt::AlignTop ); + + textLabel4_4_2_2_2_2 = new QLabel( groupBox9_2_2_2_2, "textLabel4_4_2_2_2_2" ); + textLabel4_4_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2Layout->addWidget( textLabel4_4_2_2_2_2, 1, 0 ); + + spinBox2_3_2_2_2_2 = new DSpinBox( groupBox9_2_2_2_2, "spinBox2_3_2_2_2_2" ); + spinBox2_3_2_2_2_2->setButtonSymbols( QSpinBox::UpDownArrows ); + spinBox2_3_2_2_2_2->setAlignRight(); + spinBox2_3_2_2_2_2->setMaxValue( 100 ); + + groupBox9_2_2_2_2Layout->addWidget( spinBox2_3_2_2_2_2, 1, 1 ); + + textLabel3_4_2_2_2_2 = new QLabel( groupBox9_2_2_2_2, "textLabel3_4_2_2_2_2" ); + textLabel3_4_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2Layout->addWidget( textLabel3_4_2_2_2_2, 0, 0 ); + + spinBox1_3_2_2_2_2 = new DSpinBox( groupBox9_2_2_2_2, "spinBox1_3_2_2_2_2" ); + spinBox1_3_2_2_2_2->setAlignRight(); + spinBox1_3_2_2_2_2->setMaxValue( 100 ); + + groupBox9_2_2_2_2Layout->addWidget( spinBox1_3_2_2_2_2, 0, 1 ); + + kColorButton1_3_2_2_2_2 = new KColorButton( groupBox9_2_2_2_2, "kColorButton1_3_2_2_2_2" ); + kColorButton1_3_2_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, kColorButton1_3_2_2_2_2->sizePolicy().hasHeightForWidth() ) ); + + groupBox9_2_2_2_2Layout->addWidget( kColorButton1_3_2_2_2_2, 1, 3 ); + + kColorButton2_5_2_2_2_2 = new KColorButton( groupBox9_2_2_2_2, "kColorButton2_5_2_2_2_2" ); + + groupBox9_2_2_2_2Layout->addWidget( kColorButton2_5_2_2_2_2, 0, 3 ); + + textLabel1_5_2_2_2_2 = new QLabel( groupBox9_2_2_2_2, "textLabel1_5_2_2_2_2" ); + textLabel1_5_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2Layout->addWidget( textLabel1_5_2_2_2_2, 0, 2 ); + + textLabel2_3_2_2_2_2 = new QLabel( groupBox9_2_2_2_2, "textLabel2_3_2_2_2_2" ); + textLabel2_3_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2Layout->addWidget( textLabel2_3_2_2_2_2, 1, 2 ); + + groupBox22_2Layout->addMultiCellWidget( groupBox9_2_2_2_2, 1, 1, 2, 6 ); + spacer6_2 = new QSpacerItem( 83, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2Layout->addItem( spacer6_2, 3, 3 ); + + textLabel1_2_2 = new QLabel( groupBox22_2, "textLabel1_2_2" ); + textLabel1_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel1_2_2->sizePolicy().hasHeightForWidth() ) ); + textLabel1_2_2->setTextFormat( QLabel::PlainText ); + + groupBox22_2Layout->addWidget( textLabel1_2_2, 3, 4 ); + spacer2_2 = new QSpacerItem( 82, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2Layout->addItem( spacer2_2, 3, 2 ); + spacer3_2 = new QSpacerItem( 12, 25, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2Layout->addItem( spacer3_2, 3, 6 ); + + kColorButton27_2_2 = new KColorButton( groupBox22_2, "kColorButton27_2_2" ); + kColorButton27_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, kColorButton27_2_2->sizePolicy().hasHeightForWidth() ) ); + kColorButton27_2_2->setMinimumSize( QSize( 75, 0 ) ); + + groupBox22_2Layout->addWidget( kColorButton27_2_2, 3, 5 ); + + groupBox10_2_2_2_2 = new QGroupBox( groupBox22_2, "groupBox10_2_2_2_2" ); + groupBox10_2_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, groupBox10_2_2_2_2->sizePolicy().hasHeightForWidth() ) ); + groupBox10_2_2_2_2->setMinimumSize( QSize( 170, 0 ) ); + groupBox10_2_2_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox10_2_2_2_2->layout()->setSpacing( 6 ); + groupBox10_2_2_2_2->layout()->setMargin( 11 ); + groupBox10_2_2_2_2Layout = new QVBoxLayout( groupBox10_2_2_2_2->layout() ); + groupBox10_2_2_2_2Layout->setAlignment( Qt::AlignTop ); + + prevTopTabWidget = new DominoKTabPrevWidget(groupBox10_2_2_2_2); + prevTopTabWidget->setStyle(previewStyle); + tabBarTop = new PreviewTabBar(0); + tabBarTop->setStyle(previewStyle); + ((DominoQTabWidget*)prevTopTabWidget)->setTabBar(tabBarTop); + + prevTopPage1 = new TabWidgetIndicator(prevTopTabWidget); + prevTopPage2 = new TabWidgetIndicator(prevTopTabWidget); + prevTopPage3 = new TabWidgetIndicator(prevTopTabWidget); + + prevTopTabWidget->addTab(prevTopPage1, " 1 "); + prevTopTabWidget->addTab(prevTopPage2, " 2 "); + prevTopTabWidget->addTab(prevTopPage3, " 3 "); + prevTopTabWidget->page(0)->parentWidget()->setPaletteBackgroundColor(qApp->palette().active().background()); + prevTopTabWidget->setCurrentPage(1); + + prevBottomTabWidget = new DominoKTabPrevWidget(groupBox10_2_2_2_2); + prevBottomTabWidget->setStyle(previewStyle); + tabBarBottom = new PreviewTabBar(0); + tabBarBottom->setStyle(previewStyle); + ((DominoQTabWidget*)prevBottomTabWidget)->setTabBar(tabBarBottom); + prevBottomTabWidget->setTabPosition(QTabWidget::Bottom); + + prevBottomPage1 = new TabWidgetIndicator(prevBottomTabWidget); + prevBottomPage2 = new TabWidgetIndicator(prevBottomTabWidget); + prevBottomPage3 = new TabWidgetIndicator(prevBottomTabWidget); + + prevBottomTabWidget->addTab(prevBottomPage1, " 1 "); + prevBottomTabWidget->addTab(prevBottomPage2, " 2 "); + prevBottomTabWidget->addTab(prevBottomPage3, " 3 "); + prevBottomTabWidget->page(0)->parentWidget()->setPaletteBackgroundColor(qApp->palette().active().background()); + prevBottomTabWidget->setCurrentPage(1); + + groupBox10_2_2_2_2Layout->addWidget(prevTopTabWidget); + groupBox10_2_2_2_2Layout->addWidget(prevBottomTabWidget); + + + groupBox22_2Layout->addMultiCellWidget( groupBox10_2_2_2_2, 0, 1, 0, 0 ); + tab2Layout->addWidget( groupBox22_2 ); + + layout9_2 = new QHBoxLayout( 0, 0, 6, "layout9_2"); + + tabComboLayout = new QHBoxLayout( 0, 0, 6, "tabComboLayout"); + tabPosCombo = new QComboBox( FALSE, tab2, "tabPosCombo" ); + tabComboLayout->addWidget( tabPosCombo ); + + tabStateCombo = new QComboBox( FALSE, tab2, "tabStateCombo" ); + tabComboLayout->addWidget( tabStateCombo ); + + QSpacerItem* spacer_combo2 = new QSpacerItem( 20, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + tabComboLayout->addItem( spacer_combo2 ); + + layout9_2->addLayout( tabComboLayout ); + + + spacer7_2 = new QSpacerItem( 270, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout9_2->addItem( spacer7_2 ); + + textLabel7_4_2 = new QLabel( tab2, "textLabel7_4_2" ); + layout9_2->addWidget( textLabel7_4_2 ); + + comboBox3_4_2 = new QComboBox( FALSE, tab2, "comboBox3_4_2" ); + layout9_2->addWidget( comboBox3_4_2 ); + + pushButton4_4_2 = new QPushButton( tab2, "pushButton4_4_2" ); + connect(pushButton4_4_2, SIGNAL(clicked()), SLOT(copyColorsToTab())); + layout9_2->addWidget( pushButton4_4_2 ); + + tab2Layout->addLayout( layout9_2 ); + tabWidget2->insertTab( tab2, QString::fromLatin1("") ); + + + + +///////////////////////////////////////////////// +// tab 2.3 (scrollbars) +///////////////////////////////////////////////// + tab3 = new QWidget( tabWidget2, "tab3" ); + tab3Layout = new QVBoxLayout( tab3, 11, 6, "tab3Layout"); + + groupBox22_2_2 = new QGroupBox( tab3, "groupBox22_2_2" ); + groupBox22_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox22_2_2->sizePolicy().hasHeightForWidth() ) ); + groupBox22_2_2->setColumnLayout(0, Qt::Vertical ); + groupBox22_2_2->layout()->setSpacing( 0 ); + groupBox22_2_2->layout()->setMargin( 11 ); + groupBox22_2_2Layout = new QGridLayout( groupBox22_2_2->layout() ); + groupBox22_2_2Layout->setAlignment( Qt::AlignTop ); + + groupBox8_2_2_2_2_4 = new QGroupBox( groupBox22_2_2, "groupBox8_2_2_2_2_4" ); + groupBox8_2_2_2_2_4->setCheckable( TRUE ); + groupBox8_2_2_2_2_4->setColumnLayout(0, Qt::Vertical ); + groupBox8_2_2_2_2_4->layout()->setSpacing( 7 ); + groupBox8_2_2_2_2_4->layout()->setMargin( 4 ); + groupBox8_2_2_2_2_4Layout = new QGridLayout( groupBox8_2_2_2_2_4->layout() ); + groupBox8_2_2_2_2_4Layout->setAlignment( Qt::AlignTop ); + connect(((QCheckBox*)groupBox8_2_2_2_2_4->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(scrollBar1GradientChanged())); + + textLabel4_3_2_2_2_2_4 = new QLabel( groupBox8_2_2_2_2_4, "textLabel4_3_2_2_2_2_4" ); + textLabel4_3_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4Layout->addWidget( textLabel4_3_2_2_2_2_4, 1, 0 ); + + spinBox2_2_2_2_2_2_4 = new DSpinBox( groupBox8_2_2_2_2_4, "spinBox2_2_2_2_2_2_4" ); + spinBox2_2_2_2_2_2_4->setAlignRight(); + spinBox2_2_2_2_2_2_4->setMaxValue( 100 ); + + groupBox8_2_2_2_2_4Layout->addWidget( spinBox2_2_2_2_2_2_4, 1, 1 ); + + textLabel2_2_2_2_2_2_4 = new QLabel( groupBox8_2_2_2_2_4, "textLabel2_2_2_2_2_2_4" ); + textLabel2_2_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4Layout->addWidget( textLabel2_2_2_2_2_2_4, 1, 2 ); + + kColorButton1_2_2_2_2_2_4 = new KColorButton( groupBox8_2_2_2_2_4, "kColorButton1_2_2_2_2_2_4" ); + + groupBox8_2_2_2_2_4Layout->addWidget( kColorButton1_2_2_2_2_2_4, 1, 3 ); + + textLabel3_3_2_2_2_2_4 = new QLabel( groupBox8_2_2_2_2_4, "textLabel3_3_2_2_2_2_4" ); + textLabel3_3_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4Layout->addWidget( textLabel3_3_2_2_2_2_4, 0, 0 ); + + spinBox1_2_2_2_2_2_4 = new DSpinBox( groupBox8_2_2_2_2_4, "spinBox1_2_2_2_2_2_4" ); + spinBox1_2_2_2_2_2_4->setAlignRight(); + spinBox1_2_2_2_2_2_4->setMaxValue( 100 ); + + groupBox8_2_2_2_2_4Layout->addWidget( spinBox1_2_2_2_2_2_4, 0, 1 ); + + textLabel1_4_2_2_2_2_4 = new QLabel( groupBox8_2_2_2_2_4, "textLabel1_4_2_2_2_2_4" ); + textLabel1_4_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4Layout->addWidget( textLabel1_4_2_2_2_2_4, 0, 2 ); + + kColorButton2_4_2_2_2_2_4 = new KColorButton( groupBox8_2_2_2_2_4, "kColorButton2_4_2_2_2_2_4" ); + + groupBox8_2_2_2_2_4Layout->addWidget( kColorButton2_4_2_2_2_2_4, 0, 3 ); + + groupBox22_2_2Layout->addMultiCellWidget( groupBox8_2_2_2_2_4, 0, 0, 2, 6 ); + spacer46_2_2 = new QSpacerItem( 20, 7, QSizePolicy::Minimum, QSizePolicy::Fixed ); + groupBox22_2_2Layout->addItem( spacer46_2_2, 2, 5 ); + + groupBox9_2_2_2_2_4 = new QGroupBox( groupBox22_2_2, "groupBox9_2_2_2_2_4" ); + groupBox9_2_2_2_2_4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox9_2_2_2_2_4->sizePolicy().hasHeightForWidth() ) ); + groupBox9_2_2_2_2_4->setCheckable( TRUE ); + groupBox9_2_2_2_2_4->setChecked( FALSE ); + groupBox9_2_2_2_2_4->setColumnLayout(0, Qt::Vertical ); + groupBox9_2_2_2_2_4->layout()->setSpacing( 7 ); + groupBox9_2_2_2_2_4->layout()->setMargin( 4 ); + groupBox9_2_2_2_2_4Layout = new QGridLayout( groupBox9_2_2_2_2_4->layout() ); + groupBox9_2_2_2_2_4Layout->setAlignment( Qt::AlignTop ); + + connect(((QCheckBox*)groupBox9_2_2_2_2_4->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(scrollBar2GradientChanged())); + + textLabel4_4_2_2_2_2_4 = new QLabel( groupBox9_2_2_2_2_4, "textLabel4_4_2_2_2_2_4" ); + textLabel4_4_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4Layout->addWidget( textLabel4_4_2_2_2_2_4, 1, 0 ); + + spinBox2_3_2_2_2_2_4 = new DSpinBox( groupBox9_2_2_2_2_4, "spinBox2_3_2_2_2_2_4" ); + spinBox2_3_2_2_2_2_4->setAlignRight(); + spinBox2_3_2_2_2_2_4->setMaxValue( 100 ); + + groupBox9_2_2_2_2_4Layout->addWidget( spinBox2_3_2_2_2_2_4, 1, 1 ); + + textLabel3_4_2_2_2_2_4 = new QLabel( groupBox9_2_2_2_2_4, "textLabel3_4_2_2_2_2_4" ); + textLabel3_4_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4Layout->addWidget( textLabel3_4_2_2_2_2_4, 0, 0 ); + + spinBox1_3_2_2_2_2_4 = new DSpinBox( groupBox9_2_2_2_2_4, "spinBox1_3_2_2_2_2_4" ); + spinBox1_3_2_2_2_2_4->setAlignRight(); + spinBox1_3_2_2_2_2_4->setMaxValue( 100 ); + + groupBox9_2_2_2_2_4Layout->addWidget( spinBox1_3_2_2_2_2_4, 0, 1 ); + + kColorButton1_3_2_2_2_2_4 = new KColorButton( groupBox9_2_2_2_2_4, "kColorButton1_3_2_2_2_2_4" ); + kColorButton1_3_2_2_2_2_4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, kColorButton1_3_2_2_2_2_4->sizePolicy().hasHeightForWidth() ) ); + + groupBox9_2_2_2_2_4Layout->addWidget( kColorButton1_3_2_2_2_2_4, 1, 3 ); + + kColorButton2_5_2_2_2_2_4 = new KColorButton( groupBox9_2_2_2_2_4, "kColorButton2_5_2_2_2_2_4" ); + + groupBox9_2_2_2_2_4Layout->addWidget( kColorButton2_5_2_2_2_2_4, 0, 3 ); + + textLabel1_5_2_2_2_2_4 = new QLabel( groupBox9_2_2_2_2_4, "textLabel1_5_2_2_2_2_4" ); + textLabel1_5_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4Layout->addWidget( textLabel1_5_2_2_2_2_4, 0, 2 ); + + textLabel2_3_2_2_2_2_4 = new QLabel( groupBox9_2_2_2_2_4, "textLabel2_3_2_2_2_2_4" ); + textLabel2_3_2_2_2_2_4->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4Layout->addWidget( textLabel2_3_2_2_2_2_4, 1, 2 ); + + groupBox22_2_2Layout->addMultiCellWidget( groupBox9_2_2_2_2_4, 1, 1, 2, 6 ); + + groupBox10_2_2_2_2_4 = new QGroupBox( groupBox22_2_2, "groupBox10_2_2_2_2_4" ); + groupBox10_2_2_2_2_4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, groupBox10_2_2_2_2_4->sizePolicy().hasHeightForWidth() ) ); + groupBox10_2_2_2_2_4->setMinimumSize( QSize( 170, 0 ) ); + groupBox10_2_2_2_2_4->setColumnLayout(0, Qt::Vertical ); + groupBox10_2_2_2_2_4->layout()->setSpacing( 6 ); + groupBox10_2_2_2_2_4->layout()->setMargin( 11 ); + groupBox10_2_2_2_2_4Layout = new QGridLayout( groupBox10_2_2_2_2_4->layout() ); + groupBox10_2_2_2_2_4Layout->setAlignment( Qt::AlignTop ); + spacer35 = new QSpacerItem( 112, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox10_2_2_2_2_4Layout->addItem( spacer35, 0, 0 ); + + scrollBar5 = new QScrollBar( groupBox10_2_2_2_2_4, "dominoPreviewWidget" ); + scrollBar5->setStyle(previewStyle); + + scrollBar5->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); + scrollBar5->setOrientation( QScrollBar::Vertical ); + scrollBar5->setMaxValue(50); + groupBox10_2_2_2_2_4Layout->addWidget( scrollBar5, 0, 1 ); + + scrollBar6 = new QScrollBar( groupBox10_2_2_2_2_4, "dominoPreviewWidget" ); + scrollBar6->setStyle(previewStyle); + scrollBar6->setOrientation( QScrollBar::Horizontal ); + scrollBar6->setMaxValue(50); + groupBox10_2_2_2_2_4Layout->addWidget( scrollBar6, 1, 0 ); + + + ////////////////////////////////// + groupBox22_2_2Layout->addMultiCellWidget( groupBox10_2_2_2_2_4, 0, 1, 0, 0 ); + spacer43_2_2 = new QSpacerItem( 5, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2_2Layout->addItem( spacer43_2_2, 1, 1 ); + spacer3_2_2 = new QSpacerItem( 12, 25, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2_2Layout->addItem( spacer3_2_2, 3, 6 ); + spacer6_2_2 = new QSpacerItem( 83, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2_2Layout->addItem( spacer6_2_2, 3, 3 ); + + kColorButton27_2_2_2 = new KColorButton( groupBox22_2_2, "kColorButton27_2_2_2" ); + kColorButton27_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, kColorButton27_2_2_2->sizePolicy().hasHeightForWidth() ) ); + kColorButton27_2_2_2->setMinimumSize( QSize( 75, 0 ) ); + + groupBox22_2_2Layout->addWidget( kColorButton27_2_2_2, 3, 5 ); + spacer2_2_2 = new QSpacerItem( 82, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2_2Layout->addItem( spacer2_2_2, 3, 2 ); + + textLabel1_2_2_2 = new QLabel( groupBox22_2_2, "textLabel1_2_2_2" ); + textLabel1_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel1_2_2_2->sizePolicy().hasHeightForWidth() ) ); + textLabel1_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox22_2_2Layout->addWidget( textLabel1_2_2_2, 3, 4 ); + tab3Layout->addWidget( groupBox22_2_2 ); + + layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); + comboBox7 = new QComboBox( FALSE, tab3, "comboBox7" ); + layout6->addWidget( comboBox7 ); + spacer7_2_3 = new QSpacerItem( 246, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout6->addItem( spacer7_2_3 ); + + textLabel7_4_2_3 = new QLabel( tab3, "textLabel7_4_2_3" ); + layout6->addWidget( textLabel7_4_2_3 ); + + comboBox3_4_2_3 = new QComboBox( FALSE, tab3, "comboBox3_4_2_3" ); + layout6->addWidget( comboBox3_4_2_3 ); + + pushButton4_4_2_3 = new QPushButton( tab3, "pushButton4_4_2_3" ); + connect(pushButton4_4_2_3, SIGNAL(clicked()), SLOT(copyColorsToScrollBar())); + + layout6->addWidget( pushButton4_4_2_3 ); + tab3Layout->addLayout( layout6 ); + tabWidget2->insertTab( tab3, QString::fromLatin1("") ); + +///////////////////////////////////////////////// +// tab 2.4 (headers) +///////////////////////////////////////////////// + tab4 = new QWidget( tabWidget2, "tab4" ); + tab4Layout = new QVBoxLayout( tab4, 11, 6, "tab4Layout"); + + groupBox22_2_2_3 = new QGroupBox( tab4, "groupBox22_2_2_3" ); + groupBox22_2_2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox22_2_2_3->sizePolicy().hasHeightForWidth() ) ); + groupBox22_2_2_3->setColumnLayout(0, Qt::Vertical ); + groupBox22_2_2_3->layout()->setSpacing( 0 ); + groupBox22_2_2_3->layout()->setMargin( 11 ); + groupBox22_2_2_3Layout = new QGridLayout( groupBox22_2_2_3->layout() ); + groupBox22_2_2_3Layout->setAlignment( Qt::AlignTop ); + spacer3_2_2_2 = new QSpacerItem( 12, 25, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2_2_3Layout->addItem( spacer3_2_2_2, 3, 6 ); + spacer6_2_2_2 = new QSpacerItem( 83, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2_2_3Layout->addItem( spacer6_2_2_2, 3, 3 ); + + kColorButton27_2_2_2_2 = new KColorButton( groupBox22_2_2_3, "kColorButton27_2_2_2_2" ); + kColorButton27_2_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, kColorButton27_2_2_2_2->sizePolicy().hasHeightForWidth() ) ); + kColorButton27_2_2_2_2->setMinimumSize( QSize( 75, 0 ) ); + + groupBox22_2_2_3Layout->addWidget( kColorButton27_2_2_2_2, 3, 5 ); + spacer2_2_2_2 = new QSpacerItem( 82, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2_2_3Layout->addItem( spacer2_2_2_2, 3, 2 ); + spacer46_2_2_2 = new QSpacerItem( 20, 7, QSizePolicy::Minimum, QSizePolicy::Fixed ); + groupBox22_2_2_3Layout->addItem( spacer46_2_2_2, 2, 5 ); + + textLabel1_2_2_2_2 = new QLabel( groupBox22_2_2_3, "textLabel1_2_2_2_2" ); + textLabel1_2_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel1_2_2_2_2->sizePolicy().hasHeightForWidth() ) ); + textLabel1_2_2_2_2->setTextFormat( QLabel::PlainText ); + + groupBox22_2_2_3Layout->addWidget( textLabel1_2_2_2_2, 3, 4 ); + spacer43_2_2_2 = new QSpacerItem( 5, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2_2_3Layout->addItem( spacer43_2_2_2, 1, 1 ); + + groupBox10_2_2_2_2_4_3 = new QGroupBox( groupBox22_2_2_3, "groupBox10_2_2_2_2_4_3" ); + groupBox10_2_2_2_2_4_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, groupBox10_2_2_2_2_4_3->sizePolicy().hasHeightForWidth() ) ); + groupBox10_2_2_2_2_4_3->setMinimumSize( QSize( 170, 0 ) ); + groupBox10_2_2_2_2_4_3->setColumnLayout(0, Qt::Vertical ); + groupBox10_2_2_2_2_4_3->layout()->setSpacing( 6 ); + groupBox10_2_2_2_2_4_3->layout()->setMargin( 11 ); + groupBox10_2_2_2_2_4_3Layout = new QVBoxLayout( groupBox10_2_2_2_2_4_3->layout() ); + groupBox10_2_2_2_2_4_3Layout->setAlignment( Qt::AlignTop ); + + frame3 = new QFrame( groupBox10_2_2_2_2_4_3, "frame3" ); + frame3->setFrameShape( QFrame::StyledPanel ); + frame3->setFrameShadow( QFrame::Raised ); // ?^ + frame3->setLineWidth( 1 ); + frame3Layout = new QVBoxLayout( frame3, 2, 6, "frame3Layout"); + + layout1 = new QVBoxLayout( 0, 0, 0, "layout1"); + + header1 = new QHeader(frame3, "dominoPreviewWidget"); + header1->setStyle(previewStyle); + header1->setMovingEnabled(false); + header1->setStretchEnabled(true); + header1->addLabel("Header"); + + + + layout1->addWidget( header1); + listBox1 = new QListBox( frame3, "listBox1" ); + listBox1->setLineWidth(0); + + layout1->addWidget( listBox1 ); + frame3Layout->addLayout( layout1 ); + groupBox10_2_2_2_2_4_3Layout->addWidget( frame3 ); + + ////////////////////////////////////// + groupBox22_2_2_3Layout->addMultiCellWidget( groupBox10_2_2_2_2_4_3, 0, 1, 0, 0 ); + + groupBox8_2_2_2_2_4_3 = new QGroupBox( groupBox22_2_2_3, "groupBox8_2_2_2_2_4_3" ); + groupBox8_2_2_2_2_4_3->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox8_2_2_2_2_4_3->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(header1GradientChanged())); + + groupBox8_2_2_2_2_4_3->setColumnLayout(0, Qt::Vertical ); + groupBox8_2_2_2_2_4_3->layout()->setSpacing( 7 ); + groupBox8_2_2_2_2_4_3->layout()->setMargin( 4 ); + groupBox8_2_2_2_2_4_3Layout = new QGridLayout( groupBox8_2_2_2_2_4_3->layout() ); + groupBox8_2_2_2_2_4_3Layout->setAlignment( Qt::AlignTop ); + + textLabel4_3_2_2_2_2_4_3 = new QLabel( groupBox8_2_2_2_2_4_3, "textLabel4_3_2_2_2_2_4_3" ); + textLabel4_3_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( textLabel4_3_2_2_2_2_4_3, 1, 0 ); + + spinBox2_2_2_2_2_2_4_3 = new DSpinBox( groupBox8_2_2_2_2_4_3, "spinBox2_2_2_2_2_2_4_3" ); + spinBox2_2_2_2_2_2_4_3->setAlignRight(); + spinBox2_2_2_2_2_2_4_3->setMaxValue( 100 ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( spinBox2_2_2_2_2_2_4_3, 1, 1 ); + + textLabel2_2_2_2_2_2_4_3 = new QLabel( groupBox8_2_2_2_2_4_3, "textLabel2_2_2_2_2_2_4_3" ); + textLabel2_2_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( textLabel2_2_2_2_2_2_4_3, 1, 2 ); + + kColorButton1_2_2_2_2_2_4_3 = new KColorButton( groupBox8_2_2_2_2_4_3, "kColorButton1_2_2_2_2_2_4_3" ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( kColorButton1_2_2_2_2_2_4_3, 1, 3 ); + + textLabel3_3_2_2_2_2_4_3 = new QLabel( groupBox8_2_2_2_2_4_3, "textLabel3_3_2_2_2_2_4_3" ); + textLabel3_3_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( textLabel3_3_2_2_2_2_4_3, 0, 0 ); + + spinBox1_2_2_2_2_2_4_3 = new DSpinBox( groupBox8_2_2_2_2_4_3, "spinBox1_2_2_2_2_2_4_3" ); + spinBox1_2_2_2_2_2_4_3->setAlignRight(); + spinBox1_2_2_2_2_2_4_3->setMaxValue( 100 ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( spinBox1_2_2_2_2_2_4_3, 0, 1 ); + + textLabel1_4_2_2_2_2_4_3 = new QLabel( groupBox8_2_2_2_2_4_3, "textLabel1_4_2_2_2_2_4_3" ); + textLabel1_4_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( textLabel1_4_2_2_2_2_4_3, 0, 2 ); + + kColorButton2_4_2_2_2_2_4_3 = new KColorButton( groupBox8_2_2_2_2_4_3, "kColorButton2_4_2_2_2_2_4_3" ); + + groupBox8_2_2_2_2_4_3Layout->addWidget( kColorButton2_4_2_2_2_2_4_3, 0, 3 ); + + groupBox22_2_2_3Layout->addMultiCellWidget( groupBox8_2_2_2_2_4_3, 0, 0, 2, 6 ); + + groupBox9_2_2_2_2_4_3 = new QGroupBox( groupBox22_2_2_3, "groupBox9_2_2_2_2_4_3" ); + groupBox9_2_2_2_2_4_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox9_2_2_2_2_4_3->sizePolicy().hasHeightForWidth() ) ); + groupBox9_2_2_2_2_4_3->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox9_2_2_2_2_4_3->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(header2GradientChanged())); + groupBox9_2_2_2_2_4_3->setChecked( FALSE ); + groupBox9_2_2_2_2_4_3->setColumnLayout(0, Qt::Vertical ); + groupBox9_2_2_2_2_4_3->layout()->setSpacing( 7 ); + groupBox9_2_2_2_2_4_3->layout()->setMargin( 4 ); + groupBox9_2_2_2_2_4_3Layout = new QGridLayout( groupBox9_2_2_2_2_4_3->layout() ); + groupBox9_2_2_2_2_4_3Layout->setAlignment( Qt::AlignTop ); + + textLabel4_4_2_2_2_2_4_3 = new QLabel( groupBox9_2_2_2_2_4_3, "textLabel4_4_2_2_2_2_4_3" ); + textLabel4_4_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( textLabel4_4_2_2_2_2_4_3, 1, 0 ); + + spinBox2_3_2_2_2_2_4_3 = new DSpinBox( groupBox9_2_2_2_2_4_3, "spinBox2_3_2_2_2_2_4_3" ); + spinBox2_3_2_2_2_2_4_3->setAlignRight(); + spinBox2_3_2_2_2_2_4_3->setMaxValue( 100 ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( spinBox2_3_2_2_2_2_4_3, 1, 1 ); + + textLabel3_4_2_2_2_2_4_3 = new QLabel( groupBox9_2_2_2_2_4_3, "textLabel3_4_2_2_2_2_4_3" ); + textLabel3_4_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( textLabel3_4_2_2_2_2_4_3, 0, 0 ); + + spinBox1_3_2_2_2_2_4_3 = new DSpinBox( groupBox9_2_2_2_2_4_3, "spinBox1_3_2_2_2_2_4_3" ); + spinBox1_3_2_2_2_2_4_3->setAlignRight(); + spinBox1_3_2_2_2_2_4_3->setMaxValue( 100 ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( spinBox1_3_2_2_2_2_4_3, 0, 1 ); + + kColorButton1_3_2_2_2_2_4_3 = new KColorButton( groupBox9_2_2_2_2_4_3, "kColorButton1_3_2_2_2_2_4_3" ); + kColorButton1_3_2_2_2_2_4_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, kColorButton1_3_2_2_2_2_4_3->sizePolicy().hasHeightForWidth() ) ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( kColorButton1_3_2_2_2_2_4_3, 1, 3 ); + + kColorButton2_5_2_2_2_2_4_3 = new KColorButton( groupBox9_2_2_2_2_4_3, "kColorButton2_5_2_2_2_2_4_3" ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( kColorButton2_5_2_2_2_2_4_3, 0, 3 ); + + textLabel1_5_2_2_2_2_4_3 = new QLabel( groupBox9_2_2_2_2_4_3, "textLabel1_5_2_2_2_2_4_3" ); + textLabel1_5_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( textLabel1_5_2_2_2_2_4_3, 0, 2 ); + + textLabel2_3_2_2_2_2_4_3 = new QLabel( groupBox9_2_2_2_2_4_3, "textLabel2_3_2_2_2_2_4_3" ); + textLabel2_3_2_2_2_2_4_3->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3Layout->addWidget( textLabel2_3_2_2_2_2_4_3, 1, 2 ); + + groupBox22_2_2_3Layout->addMultiCellWidget( groupBox9_2_2_2_2_4_3, 1, 1, 2, 6 ); + tab4Layout->addWidget( groupBox22_2_2_3 ); + + layout21 = new QHBoxLayout( 0, 0, 6, "layout21"); + spacer7_2_3_3 = new QSpacerItem( 354, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout21->addItem( spacer7_2_3_3 ); + + textLabel7_4_2_3_3 = new QLabel( tab4, "textLabel7_4_2_3_3" ); + layout21->addWidget( textLabel7_4_2_3_3 ); + + comboBox3_4_2_3_3 = new QComboBox( FALSE, tab4, "comboBox3_4_2_3_3" ); + layout21->addWidget( comboBox3_4_2_3_3 ); + + pushButton4_4_2_3_3 = new QPushButton( tab4, "pushButton4_4_2_3_3" ); + connect(pushButton4_4_2_3_3, SIGNAL(clicked()), SLOT(copyColorsToHeader())); + layout21->addWidget( pushButton4_4_2_3_3 ); + tab4Layout->addLayout( layout21 ); + tabWidget2->insertTab( tab4, QString::fromLatin1("") ); + +///////////////////////////////////////////////// +// tab 2.5 (radio/checkboxes) +///////////////////////////////////////////////// + + tab5 = new QWidget( tabWidget2, "tab5" ); + tab5Layout = new QVBoxLayout( tab5, 11, 6, "tab5Layout"); + + groupBox22_2_2_3_2 = new QGroupBox( tab5, "groupBox22_2_2_3_2" ); + groupBox22_2_2_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox22_2_2_3_2->sizePolicy().hasHeightForWidth() ) ); + groupBox22_2_2_3_2->setColumnLayout(0, Qt::Vertical ); + groupBox22_2_2_3_2->layout()->setSpacing( 0 ); + groupBox22_2_2_3_2->layout()->setMargin( 11 ); + groupBox22_2_2_3_2Layout = new QGridLayout( groupBox22_2_2_3_2->layout() ); + groupBox22_2_2_3_2Layout->setAlignment( Qt::AlignTop ); + + groupBox8_2_2_2_2_4_3_2 = new QGroupBox( groupBox22_2_2_3_2, "groupBox8_2_2_2_2_4_3_2" ); + groupBox8_2_2_2_2_4_3_2->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox8_2_2_2_2_4_3_2->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(checkItem1GradientChanged())); + groupBox8_2_2_2_2_4_3_2->setChecked( FALSE ); + groupBox8_2_2_2_2_4_3_2->setColumnLayout(0, Qt::Vertical ); + groupBox8_2_2_2_2_4_3_2->layout()->setSpacing( 7 ); + groupBox8_2_2_2_2_4_3_2->layout()->setMargin( 4 ); + groupBox8_2_2_2_2_4_3_2Layout = new QGridLayout( groupBox8_2_2_2_2_4_3_2->layout() ); + groupBox8_2_2_2_2_4_3_2Layout->setAlignment( Qt::AlignTop ); + + textLabel4_3_2_2_2_2_4_3_2 = new QLabel( groupBox8_2_2_2_2_4_3_2, "textLabel4_3_2_2_2_2_4_3_2" ); + textLabel4_3_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( textLabel4_3_2_2_2_2_4_3_2, 1, 0 ); + + spinBox2_2_2_2_2_2_4_3_2 = new DSpinBox( groupBox8_2_2_2_2_4_3_2, "spinBox2_2_2_2_2_2_4_3_2" ); + spinBox2_2_2_2_2_2_4_3_2->setAlignRight(); + spinBox2_2_2_2_2_2_4_3_2->setMaxValue( 100 ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( spinBox2_2_2_2_2_2_4_3_2, 1, 1 ); + + textLabel2_2_2_2_2_2_4_3_2 = new QLabel( groupBox8_2_2_2_2_4_3_2, "textLabel2_2_2_2_2_2_4_3_2" ); + textLabel2_2_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( textLabel2_2_2_2_2_2_4_3_2, 1, 2 ); + + kColorButton1_2_2_2_2_2_4_3_2 = new KColorButton( groupBox8_2_2_2_2_4_3_2, "kColorButton1_2_2_2_2_2_4_3_2" ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( kColorButton1_2_2_2_2_2_4_3_2, 1, 3 ); + + textLabel3_3_2_2_2_2_4_3_2 = new QLabel( groupBox8_2_2_2_2_4_3_2, "textLabel3_3_2_2_2_2_4_3_2" ); + textLabel3_3_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( textLabel3_3_2_2_2_2_4_3_2, 0, 0 ); + + spinBox1_2_2_2_2_2_4_3_2 = new DSpinBox( groupBox8_2_2_2_2_4_3_2, "spinBox1_2_2_2_2_2_4_3_2" ); + spinBox1_2_2_2_2_2_4_3_2->setAlignRight(); + spinBox1_2_2_2_2_2_4_3_2->setMaxValue( 100 ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( spinBox1_2_2_2_2_2_4_3_2, 0, 1 ); + + textLabel1_4_2_2_2_2_4_3_2 = new QLabel( groupBox8_2_2_2_2_4_3_2, "textLabel1_4_2_2_2_2_4_3_2" ); + textLabel1_4_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( textLabel1_4_2_2_2_2_4_3_2, 0, 2 ); + + kColorButton2_4_2_2_2_2_4_3_2 = new KColorButton( groupBox8_2_2_2_2_4_3_2, "kColorButton2_4_2_2_2_2_4_3_2" ); + + groupBox8_2_2_2_2_4_3_2Layout->addWidget( kColorButton2_4_2_2_2_2_4_3_2, 0, 3 ); + + groupBox22_2_2_3_2Layout->addMultiCellWidget( groupBox8_2_2_2_2_4_3_2, 0, 0, 2, 6 ); + spacer3_2_2_3 = new QSpacerItem( 12, 25, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2_2_3_2Layout->addItem( spacer3_2_2_3, 3, 6 ); + spacer6_2_2_3 = new QSpacerItem( 83, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2_2_3_2Layout->addItem( spacer6_2_2_3, 3, 3 ); + + kColorButton27_2_2_2_3 = new KColorButton( groupBox22_2_2_3_2, "kColorButton27_2_2_2_3" ); + kColorButton27_2_2_2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, kColorButton27_2_2_2_3->sizePolicy().hasHeightForWidth() ) ); + kColorButton27_2_2_2_3->setMinimumSize( QSize( 75, 0 ) ); + + groupBox22_2_2_3_2Layout->addWidget( kColorButton27_2_2_2_3, 3, 5 ); + spacer2_2_2_3 = new QSpacerItem( 82, 25, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox22_2_2_3_2Layout->addItem( spacer2_2_2_3, 3, 2 ); + spacer46_2_2_3 = new QSpacerItem( 20, 7, QSizePolicy::Minimum, QSizePolicy::Fixed ); + groupBox22_2_2_3_2Layout->addItem( spacer46_2_2_3, 2, 5 ); + + textLabel1_2_2_2_3 = new QLabel( groupBox22_2_2_3_2, "textLabel1_2_2_2_3" ); + textLabel1_2_2_2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel1_2_2_2_3->sizePolicy().hasHeightForWidth() ) ); + textLabel1_2_2_2_3->setTextFormat( QLabel::PlainText ); + + groupBox22_2_2_3_2Layout->addWidget( textLabel1_2_2_2_3, 3, 4 ); + spacer43_2_2_2_2 = new QSpacerItem( 5, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + groupBox22_2_2_3_2Layout->addItem( spacer43_2_2_2_2, 1, 1 ); + + groupBox10_2_2_2_2_4_3_2 = new QGroupBox( groupBox22_2_2_3_2, "groupBox10_2_2_2_2_4_3_2" ); + groupBox10_2_2_2_2_4_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, groupBox10_2_2_2_2_4_3_2->sizePolicy().hasHeightForWidth() ) ); + groupBox10_2_2_2_2_4_3_2->setMinimumSize( QSize( 170, 0 ) ); + groupBox10_2_2_2_2_4_3_2->setColumnLayout(0, Qt::Vertical ); + groupBox10_2_2_2_2_4_3_2->layout()->setSpacing( 6 ); + groupBox10_2_2_2_2_4_3_2->layout()->setMargin( 11 ); + groupBox10_2_2_2_2_4_3_2Layout = new QVBoxLayout( groupBox10_2_2_2_2_4_3_2->layout() ); + groupBox10_2_2_2_2_4_3_2Layout->setAlignment( Qt::AlignTop ); + + radioButton2 = new PreviewRadioButton( groupBox10_2_2_2_2_4_3_2, "dominoPreviewWidget" ); + radioButton2->setStyle(previewStyle); + groupBox10_2_2_2_2_4_3_2Layout->addWidget( radioButton2 ); + + checkBox2 = new PreviewCheckBox( groupBox10_2_2_2_2_4_3_2, "dominoPreviewWidget" ); + checkBox2->setStyle(previewStyle); + groupBox10_2_2_2_2_4_3_2Layout->addWidget( checkBox2 ); + + groupBox22_2_2_3_2Layout->addMultiCellWidget( groupBox10_2_2_2_2_4_3_2, 0, 1, 0, 0 ); + + groupBox9_2_2_2_2_4_3_2 = new QGroupBox( groupBox22_2_2_3_2, "groupBox9_2_2_2_2_4_3_2" ); + groupBox9_2_2_2_2_4_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, groupBox9_2_2_2_2_4_3_2->sizePolicy().hasHeightForWidth() ) ); + groupBox9_2_2_2_2_4_3_2->setCheckable( TRUE ); + connect(((QCheckBox*)groupBox9_2_2_2_2_4_3_2->child("qt_groupbox_checkbox", 0, false)), SIGNAL(clicked()), SLOT(checkItem2GradientChanged())); + + groupBox9_2_2_2_2_4_3_2->setChecked( FALSE ); + groupBox9_2_2_2_2_4_3_2->setColumnLayout(0, Qt::Vertical ); + groupBox9_2_2_2_2_4_3_2->layout()->setSpacing( 7 ); + groupBox9_2_2_2_2_4_3_2->layout()->setMargin( 4 ); + groupBox9_2_2_2_2_4_3_2Layout = new QGridLayout( groupBox9_2_2_2_2_4_3_2->layout() ); + groupBox9_2_2_2_2_4_3_2Layout->setAlignment( Qt::AlignTop ); + + textLabel4_4_2_2_2_2_4_3_2 = new QLabel( groupBox9_2_2_2_2_4_3_2, "textLabel4_4_2_2_2_2_4_3_2" ); + textLabel4_4_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( textLabel4_4_2_2_2_2_4_3_2, 1, 0 ); + + spinBox2_3_2_2_2_2_4_3_2 = new DSpinBox( groupBox9_2_2_2_2_4_3_2, "spinBox2_3_2_2_2_2_4_3_2" ); + spinBox2_3_2_2_2_2_4_3_2->setAlignRight(); + spinBox2_3_2_2_2_2_4_3_2->setMaxValue( 100 ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( spinBox2_3_2_2_2_2_4_3_2, 1, 1 ); + + textLabel3_4_2_2_2_2_4_3_2 = new QLabel( groupBox9_2_2_2_2_4_3_2, "textLabel3_4_2_2_2_2_4_3_2" ); + textLabel3_4_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( textLabel3_4_2_2_2_2_4_3_2, 0, 0 ); + + spinBox1_3_2_2_2_2_4_3_2 = new DSpinBox( groupBox9_2_2_2_2_4_3_2, "spinBox1_3_2_2_2_2_4_3_2" ); + spinBox1_3_2_2_2_2_4_3_2->setAlignRight(); + spinBox1_3_2_2_2_2_4_3_2->setMaxValue( 100 ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( spinBox1_3_2_2_2_2_4_3_2, 0, 1 ); + + kColorButton1_3_2_2_2_2_4_3_2 = new KColorButton( groupBox9_2_2_2_2_4_3_2, "kColorButton1_3_2_2_2_2_4_3_2" ); + kColorButton1_3_2_2_2_2_4_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, kColorButton1_3_2_2_2_2_4_3_2->sizePolicy().hasHeightForWidth() ) ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( kColorButton1_3_2_2_2_2_4_3_2, 1, 3 ); + + kColorButton2_5_2_2_2_2_4_3_2 = new KColorButton( groupBox9_2_2_2_2_4_3_2, "kColorButton2_5_2_2_2_2_4_3_2" ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( kColorButton2_5_2_2_2_2_4_3_2, 0, 3 ); + + textLabel1_5_2_2_2_2_4_3_2 = new QLabel( groupBox9_2_2_2_2_4_3_2, "textLabel1_5_2_2_2_2_4_3_2" ); + textLabel1_5_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( textLabel1_5_2_2_2_2_4_3_2, 0, 2 ); + + textLabel2_3_2_2_2_2_4_3_2 = new QLabel( groupBox9_2_2_2_2_4_3_2, "textLabel2_3_2_2_2_2_4_3_2" ); + textLabel2_3_2_2_2_2_4_3_2->setTextFormat( QLabel::PlainText ); + + groupBox9_2_2_2_2_4_3_2Layout->addWidget( textLabel2_3_2_2_2_2_4_3_2, 1, 2 ); + + groupBox22_2_2_3_2Layout->addMultiCellWidget( groupBox9_2_2_2_2_4_3_2, 1, 1, 2, 6 ); + tab5Layout->addWidget( groupBox22_2_2_3_2 ); + + layout22 = new QHBoxLayout( 0, 0, 6, "layout22"); + spacer7_2_3_3_2 = new QSpacerItem( 354, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout22->addItem( spacer7_2_3_3_2 ); + + textLabel7_4_2_3_3_2 = new QLabel( tab5, "textLabel7_4_2_3_3_2" ); + layout22->addWidget( textLabel7_4_2_3_3_2 ); + + comboBox3_4_2_3_3_2 = new QComboBox( FALSE, tab5, "comboBox3_4_2_3_3_2" ); + layout22->addWidget( comboBox3_4_2_3_3_2 ); + + pushButton4_4_2_3_3_2 = new QPushButton( tab5, "pushButton4_4_2_3_3_2" ); + connect(pushButton4_4_2_3_3_2, SIGNAL(clicked()), SLOT(copyColorsToCheckItem())); + + layout22->addWidget( pushButton4_4_2_3_3_2 ); + tab5Layout->addLayout( layout22 ); + tabWidget2->insertTab( tab5, QString::fromLatin1("") ); + + + + /// resize( QSize(673, 465).expandedTo(minimumSizeHint()) ); + /// clearWState( WState_Polished ); + +//////////////////////////////////////////////////////////////////////////// + // tab 3 load/save scheme +//////////////////////////////////////////////////////////////////////////// + + + QWidget *page3 = new QWidget(tabWidget); + + tab_lsLayout = new QVBoxLayout( page3, 11, 6, "tab_lsLayout"); + + groupBox_ls = new QGroupBox( page3, "groupBox21" ); + groupBox_ls->setColumnLayout(0, Qt::Vertical ); + groupBox_ls->layout()->setSpacing( 6 ); + groupBox_ls->layout()->setMargin( 11 ); + groupBox_lsLayout = new QHBoxLayout( groupBox_ls->layout() ); + groupBox_lsLayout->setAlignment( Qt::AlignTop ); + + listView_ls = new QListView( groupBox_ls, "listView_ls" ); + listView_ls->addColumn( tr( "Name" ) ); + listView_ls->header()->setMovingEnabled(false); + listView_ls->setResizeMode(QListView::LastColumn); + listView_ls->setShowSortIndicator(true); + connect(listView_ls, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotDelPerm(QListViewItem*))); + connect(listView_ls, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), SLOT(slotLoad())); + + schemeList = new SchemeList(); + getConfigSchemes(); + + groupBox_lsLayout->addWidget( listView_ls ); + + layout8 = new QVBoxLayout( 0, 0, 6, "layout8"); + loadButton = new QPushButton( groupBox_ls, "loadButton" ); + connect(loadButton, SIGNAL(clicked()), SLOT(slotLoad())); + layout8->addWidget( loadButton ); + + saveButton = new QPushButton( groupBox_ls, "saveButton" ); + connect(saveButton, SIGNAL(clicked()), SLOT(slotSave())); + layout8->addWidget( saveButton ); + + deleteButton = new QPushButton( groupBox_ls, "deleteButton" ); + connect(deleteButton, SIGNAL(clicked()), SLOT(slotDelete())); + layout8->addWidget( deleteButton ); + + importButton = new QPushButton( groupBox_ls, "importButton" ); + connect(importButton, SIGNAL(clicked()), SLOT(slotImport())); + layout8->addWidget( importButton ); + + spacer32 = new QSpacerItem( 31, 141, QSizePolicy::Minimum, QSizePolicy::Expanding ); + layout8->addItem( spacer32 ); + groupBox_lsLayout->addLayout( layout8 ); + + + tab_lsLayout->addWidget( groupBox_ls ); + currentConfigLabel = new QLabel(page3); + tab_lsLayout->addWidget(currentConfigLabel); + tabWidget->addTab(page3, "Load/Save"); + +// resize( QSize(673, 465).expandedTo(minimumSizeHint()) ); + languageChange(); + + //////////////////////////////////////////////////////////////////////////////////////////////////////// + + loadConfig("domino"); // dominorc, the current one + initialized = true; + configLoaded = false; + updateChanged(); // enable or disable widgets + + // scrollbar buttons or groove + connect(comboBox7, SIGNAL( activated(const QString &)), SLOT(userLoadScrollBarConfig())); + // btn + connect(kColorButton2_4_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(btnPv1(const QColor&))); + connect(kColorButton1_2_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(btnPv2(const QColor&))); + connect(kColorButton2_5_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(btnPv3(const QColor&))); + connect(kColorButton1_3_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(btnPv4(const QColor&))); + connect(kColorButton27_2, SIGNAL(changed(const QColor&)),this, SLOT(btnPv5(const QColor&))); + connect(spinBox1_2_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(btnPv6(int))); + connect(spinBox2_2_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(btnPv7(int))); + connect(spinBox1_3_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(btnPv8(int))); + connect(spinBox2_3_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(btnPv9(int))); + // header + connect(kColorButton2_4_2_2_2_2_4_3, SIGNAL(changed(const QColor&)),this, SLOT(hPv1(const QColor&))); + connect(kColorButton1_2_2_2_2_2_4_3, SIGNAL(changed(const QColor&)),this, SLOT(hPv2(const QColor&))); + connect(kColorButton2_5_2_2_2_2_4_3, SIGNAL(changed(const QColor&)),this, SLOT(hPv3(const QColor&))); + connect(kColorButton1_3_2_2_2_2_4_3, SIGNAL(changed(const QColor&)),this, SLOT(hPv4(const QColor&))); + connect(kColorButton27_2_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(hPv5(const QColor&))); + connect(spinBox1_2_2_2_2_2_4_3, SIGNAL(valueChanged(int)), this, SLOT(hPv6(int))); + connect(spinBox2_2_2_2_2_2_4_3, SIGNAL(valueChanged(int)), this, SLOT(hPv7(int))); + connect(spinBox1_3_2_2_2_2_4_3, SIGNAL(valueChanged(int)), this, SLOT(hPv8(int))); + connect(spinBox2_3_2_2_2_2_4_3, SIGNAL(valueChanged(int)), this, SLOT(hPv9(int))); + // checkBox + connect(kColorButton2_4_2_2_2_2_4_3_2, SIGNAL(changed(const QColor&)),this, SLOT(chbPv1(const QColor&))); + connect(kColorButton1_2_2_2_2_2_4_3_2, SIGNAL(changed(const QColor&)),this, SLOT(chbPv2(const QColor&))); + connect(kColorButton2_5_2_2_2_2_4_3_2, SIGNAL(changed(const QColor&)),this, SLOT(chbPv3(const QColor&))); + connect(kColorButton1_3_2_2_2_2_4_3_2, SIGNAL(changed(const QColor&)),this, SLOT(chbPv4(const QColor&))); + connect(kColorButton27_2_2_2_3, SIGNAL(changed(const QColor&)),this, SLOT(chbPv5(const QColor&))); + connect(spinBox1_2_2_2_2_2_4_3_2, SIGNAL(valueChanged(int)), this, SLOT(chbPv6(int))); + connect(spinBox2_2_2_2_2_2_4_3_2, SIGNAL(valueChanged(int)), this, SLOT(chbPv7(int))); + connect(spinBox1_3_2_2_2_2_4_3_2, SIGNAL(valueChanged(int)), this, SLOT(chbPv8(int))); + connect(spinBox2_3_2_2_2_2_4_3_2, SIGNAL(valueChanged(int)), this, SLOT(chbPv9(int))); + + // scrollbar + connect(kColorButton2_4_2_2_2_2_4, SIGNAL(changed(const QColor&)),this, SLOT(sbPv1(const QColor&))); + connect(kColorButton1_2_2_2_2_2_4, SIGNAL(changed(const QColor&)),this, SLOT(sbPv2(const QColor&))); + connect(kColorButton2_5_2_2_2_2_4, SIGNAL(changed(const QColor&)),this, SLOT(sbPv3(const QColor&))); + connect(kColorButton1_3_2_2_2_2_4, SIGNAL(changed(const QColor&)),this, SLOT(sbPv4(const QColor&))); + connect(kColorButton27_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(sbPv5(const QColor&))); + connect(spinBox1_2_2_2_2_2_4, SIGNAL(valueChanged(int)), this, SLOT(sbPv6(int))); + connect(spinBox2_2_2_2_2_2_4, SIGNAL(valueChanged(int)), this, SLOT(sbPv7(int))); + connect(spinBox1_3_2_2_2_2_4, SIGNAL(valueChanged(int)), this, SLOT(sbPv8(int))); + connect(spinBox2_3_2_2_2_2_4, SIGNAL(valueChanged(int)), this, SLOT(sbPv9(int))); + // tab + connect(kColorButton2_4_2_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(tabPv1(const QColor&))); + connect(kColorButton1_2_2_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(tabPv2(const QColor&))); + connect(kColorButton2_5_2_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(tabPv3(const QColor&))); + connect(kColorButton1_3_2_2_2_2, SIGNAL(changed(const QColor&)),this, SLOT(tabPv4(const QColor&))); + connect(kColorButton27_2_2, SIGNAL(changed(const QColor&)),this, SLOT(tabPv5(const QColor&))); + connect(spinBox1_2_2_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(tabPv6(int))); + connect(spinBox2_2_2_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(tabPv7(int))); + connect(spinBox1_3_2_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(tabPv8(int))); + connect(spinBox2_3_2_2_2_2, SIGNAL(valueChanged(int)), this, SLOT(tabPv9(int))); + + connect(tabPosCombo, SIGNAL( activated(int)), SLOT(userLoadTabConfig())); + connect(tabStateCombo, SIGNAL( activated(int)), SLOT(userLoadTabConfig())); + + + connect(customCheckMarkColor, SIGNAL(toggled(bool)), SLOT(updateChanged())); + connect(customCheckMarkColor, SIGNAL(toggled(bool)), SLOT(updateCheckItemIndicators())); + connect(checkMarkColor, SIGNAL(changed(const QColor&)), SLOT(updateCheckItemIndicators())); + connect(customToolTipColor, SIGNAL(toggled(bool)), SLOT(updateChanged())); + + connect(customPopupMenuColor, SIGNAL(toggled(bool)), SLOT( updateChanged())); + connect(customSelMenuItemColor, SIGNAL(toggled(bool)), SLOT( updateChanged())); + connect(tintGroupBoxBackground, SIGNAL(toggled(bool)), SLOT( updateChanged())); + + connect(indicatorColor, SIGNAL(changed(const QColor&)), this, SLOT(updateFocusIndicatorSettings())); + connect(indicatorBtnColor, SIGNAL(changed(const QColor&)), this, SLOT(updateFocusIndicatorSettings())); + connect(indicatorOpacity, SIGNAL(valueChanged(int)), this, SLOT(updateFocusIndicatorSettings())); + connect(indicatorBtnOpacity, SIGNAL(valueChanged(int)), this, SLOT(updateFocusIndicatorSettings())); + + connect(textEffectColor, SIGNAL(changed(const QColor&)), this, SLOT(updateTextEffectSettings())); + connect(textEffectPos, SIGNAL(activated(int)), this, SLOT(updateTextEffectSettings())); + connect(textEffectOpacity, SIGNAL(valueChanged(int)), this, SLOT(updateTextEffectSettings())); + + connect(textEffectButtonColor, SIGNAL(changed(const QColor&)), this, SLOT(updateTextEffectSettings())); + connect(textEffectButtonPos, SIGNAL(activated(int)), this, SLOT(updateTextEffectSettings())); + connect(textEffectButtonOpacity, SIGNAL(valueChanged(int)), this, SLOT(updateTextEffectSettings())); + + //languageChange(); + clearWState( WState_Polished ); + + +} + + +// btn +void DominoStyleConfig::btnPv1(const QColor&col) { + previewStyle->btnSurface.g1Color1 = col.name(); + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv2(const QColor&col) { + previewStyle->btnSurface.g1Color2 = col.name(); + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv3(const QColor&col) { + previewStyle->btnSurface.g2Color1 = col.name(); + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv4(const QColor&col) { + previewStyle->btnSurface.g2Color2 = col.name(); + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv5(const QColor&col) { + previewStyle->btnSurface.background = col.name(); + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv6(int i) { + previewStyle->btnSurface.g1Top = i; + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv7(int i) { + previewStyle->btnSurface.g1Bottom = i; + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv8(int i) { + previewStyle->btnSurface.g2Top = i; + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} +void DominoStyleConfig::btnPv9(int i) { + previewStyle->btnSurface.g2Bottom= i; + pushButton16->repaint(false); + comboBox17->repaint(false); + spinBox44->spinWidget()->repaint(false); +} + +// header +void DominoStyleConfig::hPv1(const QColor&col) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g1Color1 = col.name(); +} +void DominoStyleConfig::hPv2(const QColor&col) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g1Color2 = col.name(); +} +void DominoStyleConfig::hPv3(const QColor&col) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g2Color1 = col.name(); +} +void DominoStyleConfig::hPv4(const QColor&col) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g2Color2 = col.name(); +} +void DominoStyleConfig::hPv5(const QColor&col) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.background = col.name(); +} +void DominoStyleConfig::hPv6(int i) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g1Top = i; +} +void DominoStyleConfig::hPv7(int i) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g1Bottom = i; +} +void DominoStyleConfig::hPv8(int i) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g2Top = i; +} +void DominoStyleConfig::hPv9(int i) { + header1->setBackgroundMode(Qt::PaletteBackground); + previewStyle->headerSurface.g2Bottom= i; +} + +// checkBox +void DominoStyleConfig::chbPv1(const QColor&col) { + previewStyle->checkItemSurface.g1Color1 = col.name(); + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv2(const QColor&col) { + previewStyle->checkItemSurface.g1Color2 = col.name(); + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv3(const QColor&col) { + previewStyle->checkItemSurface.g2Color1 = col.name(); + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv4(const QColor&col) { + previewStyle->checkItemSurface.g2Color2 = col.name(); + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv5(const QColor&col) { + previewStyle->checkItemSurface.background = col.name(); + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv6(int i) { + previewStyle->checkItemSurface.g1Top = i; + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv7(int i) { + previewStyle->checkItemSurface.g1Bottom = i; + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv8(int i) { + previewStyle->checkItemSurface.g2Top = i; + checkBox2->repaint(false); + radioButton2->repaint(false); +} +void DominoStyleConfig::chbPv9(int i) { + previewStyle->checkItemSurface.g2Bottom= i; + checkBox2->repaint(false); + radioButton2->repaint(false); +} + +// scrollBar +void DominoStyleConfig::sbPv1(const QColor&col) { + currentScrollBarSurface->g1Color1 = col.name(); + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv2(const QColor&col) { + currentScrollBarSurface->g1Color2 = col.name(); + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv3(const QColor&col) { + currentScrollBarSurface->g2Color1 = col.name(); + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv4(const QColor&col) { + currentScrollBarSurface->g2Color2 = col.name(); + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv5(const QColor&col) { + currentScrollBarSurface->background = col.name(); + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv6(int i) { + currentScrollBarSurface->g1Top = i; + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv7(int i) { + currentScrollBarSurface->g1Bottom = i; + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv8(int i) { + currentScrollBarSurface->g2Top = i; + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} +void DominoStyleConfig::sbPv9(int i) { + currentScrollBarSurface->g2Bottom = i; + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} + +// tabs +void DominoStyleConfig::tabPv1(const QColor&col) { + currentTabSurface->g1Color1 = col.name(); + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv2(const QColor&col) { + currentTabSurface->g1Color2 = col.name(); + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv3(const QColor&col) { + currentTabSurface->g2Color1 = col.name(); + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv4(const QColor&col) { + currentTabSurface->g2Color2 = col.name(); + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv5(const QColor&col) { + currentTabSurface->background = col.name(); + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv6(int i) { + currentTabSurface->g1Top = i; + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv7(int i) { + currentTabSurface->g1Bottom = i; + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv8(int i) { + currentTabSurface->g2Top = i; + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} +void DominoStyleConfig::tabPv9(int i) { + currentTabSurface->g2Bottom = i; + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} + +void DominoStyleConfig::loadConfig(const char* name) { + + QColor background = qApp->palette().active().background(); + QColor button = qApp->palette().active().button(); + QColor highlight = qApp->palette().active().highlight(); + QString cName = name; + QSettings settings; + + settings.beginGroup("/" + cName + "/Settings"); + currentConfig = settings.readEntry("/name", "unnamed"); + origAnimProgressBar = settings.readBoolEntry("/animateProgressBar", true); + animateProgressBar->setChecked(origAnimProgressBar); + origCenterTabs = settings.readBoolEntry("/centerTabs", false); + centerTabs->setChecked(origCenterTabs); + origDrawTriangularExpander = settings.readBoolEntry("/drawTriangularExpander", true); + drawTriangularExpander->setChecked(origDrawTriangularExpander); + origHighlightToolBtnIcons = settings.readBoolEntry("/highlightToolBtnIcon", false); + highlightToolBtnIcons->setChecked(origHighlightToolBtnIcons); + origToolBtnAsBtn = settings.readBoolEntry("/drawToolButtonAsButton", true); + toolBtnAsBtn->setChecked(origToolBtnAsBtn); + + origCustomCheckMarkColor = settings.readBoolEntry("/customCheckMarkColor", false); + customCheckMarkColor->setChecked(origCustomCheckMarkColor); + origCheckMarkColor = settings.readEntry("/checkMarkColor", "black"); + checkMarkColor->setColor(origCheckMarkColor); + + origTintGroupBoxBackground = settings.readBoolEntry("/tintGroupBoxBackground", true); + tintGroupBoxBackground->setChecked(origTintGroupBoxBackground); + origGroupBoxBrightness = settings.readNumEntry("/groupBoxBrightness", 10); + grSlider->setValue(origGroupBoxBrightness); + + origCustomGroupBoxBackgroundColor = settings.readBoolEntry("/customGroupBoxBackgroundColor", false); + customGroupBoxBackgroundColor->setChecked(origCustomGroupBoxBackgroundColor); + origGroupBoxBackgroundColor = settings.readEntry("/groupBoxBackgroundColor", background.dark(110).name()); + groupBoxBackgroundColor->setColor(origGroupBoxBackgroundColor); + + origCustomToolTipColor = settings.readBoolEntry("/customToolTipColor", false); + customToolTipColor->setChecked(origCustomToolTipColor); + origToolTipColor = settings.readEntry("/toolTipColor", QColor(218,218,179).name()); + toolTipColor->setColor(origToolTipColor); + + origSmoothScrolling = settings.readBoolEntry("/smoothScrolling", true); + smoothScrolling->setChecked(origSmoothScrolling); + origButtonHeightAdjustment = settings.readNumEntry("/buttonHeightAdjustment", 0); + buttonHeightAdjustment->setValue(origButtonHeightAdjustment); + + origRubberBandType = settings.readNumEntry("/rubberBandType", 3); + rubberBandType = origRubberBandType; + argbRubber->setChecked(rubberBandType == DominoStyle::ArgbRubber); + lineRubber->setChecked(rubberBandType == DominoStyle::LineRubber); + distRubber->setChecked(rubberBandType == DominoStyle::DistRubber); + + if(argbRubber->isChecked() && !hasCompositeExtension) + distRubber->setChecked(true); + + origArgbRubberColor = settings.readEntry("/rubberBandColor", highlight.name()); + argbRubberColor->setColor(origArgbRubberColor); + origArgbRubberOpacity = settings.readNumEntry("/rubberBandOpacity", 30); + argbRubberOpacity->setValue(origArgbRubberOpacity); + updateArgbRubberOptions(rubberBandType == DominoStyle::ArgbRubber); + + origCustomPopupMenuColor = settings.readBoolEntry("/customPopupMenuColor", false); + customPopupMenuColor->setChecked(origCustomPopupMenuColor); + origPopupMenuColor = settings.readEntry("/popupMenuColor", background.name()); + popupMenuColor->setColor(origPopupMenuColor); + + origCustomSelMenuItemColor = settings.readBoolEntry("/customSelMenuItemColor", false); + customSelMenuItemColor->setChecked(origCustomSelMenuItemColor); + origSelMenuItemColor = settings.readEntry("/selMenuItemColor", highlight.name()); + selMenuItemColor->setColor(origSelMenuItemColor); + origDrawPopupMenuGradient = settings.readBoolEntry("/drawPopupMenuGradient", true); + drawPopupMenuGradient->setChecked(origDrawPopupMenuGradient); + origIndentPopupMenuItems = settings.readBoolEntry("/indentPopupMenuItems", true); + indentPopupMenuItems->setChecked(origIndentPopupMenuItems); + + origIndicateFocus = settings.readBoolEntry("/indicateFocus", true); + indicateFocus->setChecked(origIndicateFocus); + origIndicatorBtnColor = settings.readEntry("/indicatorButtonColor", highlight.name()); + indicatorBtnColor->setColor(origIndicatorBtnColor); + origIndicatorColor = settings.readEntry("/indicatorColor", highlight.name()); + indicatorColor->setColor(origIndicatorColor); + origIndicatorOpacity = settings.readNumEntry("/indicatorColorOpacity", 60); + indicatorOpacity->setValue(origIndicatorOpacity); + origIndicatorBtnOpacity = settings.readNumEntry("/indicatorButtonColorOpacity", 60); + indicatorBtnOpacity->setValue(origIndicatorBtnOpacity); + + origDrawUnderline = settings.readBoolEntry("/drawFocusUnderline", true); + indicatorModeCombo->setCurrentItem(origDrawUnderline); + indicatorModeChanged(); + updateFocusIndicatorSettings(); + + origDrawTextEffect = settings.readBoolEntry("/drawTextEffect", true); + drawTextEffect->setChecked(origDrawTextEffect); + origTextEffectMode = settings.readNumEntry("/textEffectMode", 0); + textEffectModeCombo->setCurrentItem(origTextEffectMode); + origTextEffectColor = settings.readEntry("/textEffectColor", Qt::white.name()); + textEffectColor->setColor(origTextEffectColor); + origTextEffectButtonColor = settings.readEntry("/textEffectButtonColor", Qt::white.name()); + textEffectButtonColor->setColor(origTextEffectButtonColor); + + origTextEffectOpacity = settings.readNumEntry("/textEffectOpacity", 60); + textEffectOpacity->setValue(origTextEffectOpacity); + origTextEffectButtonOpacity = settings.readNumEntry("/textEffectButtonOpacity", 60); + textEffectButtonOpacity->setValue(origTextEffectButtonOpacity); + + origTextEffectPos = settings.readNumEntry("/textEffectPos", 5); + textEffectPos->setCurrentItem(origTextEffectPos); + origTextEffectButtonPos = settings.readNumEntry("/textEffectButtonPos", 5); + textEffectButtonPos->setCurrentItem(origTextEffectButtonPos); + textEffectModeChanged(); + updateTextEffectSettings(); + + origDrawButtonSunkenShadow = settings.readBoolEntry("/drawButtonSunkenShadow", true); + drawButtonSunkenShadow->setChecked(origDrawButtonSunkenShadow); + + origButtonContourType = settings.readNumEntry("/buttonContourType", 1); + buttonContourType->setCurrentItem(origButtonContourType); + origButtonContourColor = settings.readEntry("/buttonContourColor", background.dark(250).name()); + buttonContourColor->setColor(origButtonContourColor); + origButtonDefaultButtonContourColor = settings.readEntry("/buttonDefaultContourColor", highlight.name()); + buttonDefaultButtonContourColor->setColor(origButtonDefaultButtonContourColor); + origButtonMouseOverContourColor = settings.readEntry("/buttonMouseOverContourColor", background.dark(250).name()); + buttonMouseOverContourColor->setColor(origButtonMouseOverContourColor); + origButtonPressedContourColor = settings.readEntry("/buttonPressedContourColor", background.dark(250).name()); + buttonPressedContourColor->setColor(origButtonPressedContourColor); + + // hidden + konqTabBarContrast = settings.readNumEntry("/konqTabBarContrast", 15); + + // buttons / comboBoxes / spinBoxes + + previewStyle->btnSurface.numGradients = settings.readNumEntry("/btnSurface_numGradients", 2); + switch (previewStyle->btnSurface.numGradients) { + case 2: + groupBox8_2_2_2->setChecked(true); + groupBox9_2_2_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2->setChecked(true); + groupBox9_2_2_2->setChecked(false); + break; + default: + groupBox8_2_2_2->setChecked(false); + groupBox9_2_2_2->setChecked(false); + break; + } + kColorButton2_4_2_2_2->setColor(settings.readEntry("/btnSurface_g1Color1", button.name())); + kColorButton1_2_2_2_2->setColor(settings.readEntry("/btnSurface_g1Color2", button.dark(120).name())); + spinBox1_2_2_2_2->setValue(settings.readNumEntry("/btnSurface_g1Top", 0)); + spinBox2_2_2_2_2->setValue(settings.readNumEntry("/btnSurface_g1Bottom", 50)); + kColorButton2_5_2_2_2->setColor(settings.readEntry("/btnSurface_g2Color1", button.dark(120).name())); + kColorButton1_3_2_2_2->setColor(settings.readEntry("/btnSurface_g2Color2", button.dark(110).name())); + spinBox1_3_2_2_2->setValue(settings.readNumEntry("/btnSurface_g2Top", 50)); + spinBox2_3_2_2_2->setValue(settings.readNumEntry("/btnSurface_g2Bottom", 100)); + kColorButton27_2->setColor(settings.readEntry("/btnSurface_background", button.name())); + + + previewStyle->btnSurface.g1Color1 = kColorButton2_4_2_2_2->color(); + previewStyle->btnSurface.g1Color2 = kColorButton1_2_2_2_2->color(); + previewStyle->btnSurface.g2Color1 = kColorButton2_5_2_2_2->color(); + previewStyle->btnSurface.g2Color2 = kColorButton1_3_2_2_2->color(); + previewStyle->btnSurface.g1Top = spinBox1_2_2_2_2->value(); + previewStyle->btnSurface.g1Bottom = spinBox2_2_2_2_2->value(); + previewStyle->btnSurface.g2Top = spinBox1_3_2_2_2->value(); + previewStyle->btnSurface.g2Bottom = spinBox2_3_2_2_2->value(); + previewStyle->btnSurface.background = kColorButton27_2->color(); + + origBtnSurface = previewStyle->btnSurface; + + // tabs + + previewStyle->activeTabTopSurface.numGradients = settings.readNumEntry("/activeTabTopSurface_numGradients", 2); + switch (previewStyle->activeTabTopSurface.numGradients) { + case 2: + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(false); + break; + default: + groupBox8_2_2_2_2->setChecked(false); + groupBox9_2_2_2_2->setChecked(false); + break; + } + kColorButton2_4_2_2_2_2->setColor(settings.readEntry("/activeTabTopSurface_g1Color1", background.light(110).name())); + kColorButton1_2_2_2_2_2->setColor(settings.readEntry("/activeTabTopSurface_g1Color2", background.name())); + kColorButton2_5_2_2_2_2->setColor(settings.readEntry("/activeTabTopSurface_g2Color1", background.name())); + kColorButton1_3_2_2_2_2->setColor(settings.readEntry("/activeTabTopSurface_g2Color2", background.name())); + kColorButton27_2_2->setColor(settings.readEntry("/activeTabTopSurface_background", background.name())); + spinBox1_2_2_2_2_2->setValue(settings.readNumEntry("/activeTabTopSurface_g1Top", 0)); + spinBox2_2_2_2_2_2->setValue(settings.readNumEntry("/activeTabTopSurface_g1Bottom", 50)); + spinBox1_3_2_2_2_2->setValue(settings.readNumEntry("/activeTabTopSurface_g2Top", 50)); + spinBox2_3_2_2_2_2->setValue(settings.readNumEntry("/activeTabTopSurface_g2Bottom", 100)); + + previewStyle->activeTabTopSurface.g1Color1 = kColorButton2_4_2_2_2_2->color().name(); + previewStyle->activeTabTopSurface.g1Color2 = kColorButton1_2_2_2_2_2->color().name(); + previewStyle->activeTabTopSurface.g2Color1 = kColorButton2_5_2_2_2_2->color().name(); + previewStyle->activeTabTopSurface.g2Color2 = kColorButton1_3_2_2_2_2->color().name(); + previewStyle->activeTabTopSurface.background = kColorButton27_2_2->color().name(); + previewStyle->activeTabTopSurface.g1Top = spinBox1_2_2_2_2_2->value(); + previewStyle->activeTabTopSurface.g1Bottom = spinBox2_2_2_2_2_2->value(); + previewStyle->activeTabTopSurface.g2Top = spinBox1_3_2_2_2_2->value(); + previewStyle->activeTabTopSurface.g2Bottom = spinBox2_3_2_2_2_2->value(); + + currentTabSurface = &previewStyle->activeTabTopSurface; + + origActiveTabTopSurface = previewStyle->activeTabTopSurface; + + previewStyle->tabTopSurface.numGradients = settings.readNumEntry("/tabTopSurface_numGradients", 2); + previewStyle->tabTopSurface.g1Color1 = settings.readEntry("/tabTopSurface_g1Color1", background.light(110).name()); + previewStyle->tabTopSurface.g1Color2 = settings.readEntry("/tabTopSurface_g1Color2", background.dark(110).name()); + previewStyle->tabTopSurface.g2Color1 = settings.readEntry("/tabTopSurface_g2Color1", background.dark(110).name()); + previewStyle->tabTopSurface.g2Color2 = settings.readEntry("/tabTopSurface_g2Color2", background.dark(110).name()); + previewStyle->tabTopSurface.background = settings.readEntry("/tabTopSurface_background", background.dark(110).name()); + previewStyle->tabTopSurface.g1Top = settings.readNumEntry("/tabTopSurface_g1Top", 0); + previewStyle->tabTopSurface.g1Bottom = settings.readNumEntry("/tabTopSurface_g1Bottom", 50); + previewStyle->tabTopSurface.g2Top = settings.readNumEntry("/tabTopSurface_g2Top", 50); + previewStyle->tabTopSurface.g2Bottom = settings.readNumEntry("/tabTopSurface_g2Bottom", 100); + + origTabTopSurface = previewStyle->tabTopSurface; + + previewStyle->activeTabBottomSurface.numGradients = settings.readNumEntry("/activeTabBottomSurface_numGradients", 2); + previewStyle->activeTabBottomSurface.g1Color1 = settings.readEntry("/activeTabBottomSurface_g1Color1", background.name()); + previewStyle->activeTabBottomSurface.g1Color2 = settings.readEntry("/activeTabBottomSurface_g1Color2", background.name()); + previewStyle->activeTabBottomSurface.g2Color1 = settings.readEntry("/activeTabBottomSurface_g2Color1", background.name()); + previewStyle->activeTabBottomSurface.g2Color2 = settings.readEntry("/activeTabBottomSurface_g2Color2", background.dark(120).name()); + previewStyle->activeTabBottomSurface.background = settings.readEntry("/activeTabBottomSurface_background", background.name()); + previewStyle->activeTabBottomSurface.g1Top = settings.readNumEntry("/activeTabBottomSurface_g1Top", 0); + previewStyle->activeTabBottomSurface.g1Bottom = settings.readNumEntry("/activeTabBottomSurface_g1Bottom", 50); + previewStyle->activeTabBottomSurface.g2Top = settings.readNumEntry("/activeTabBottomSurface_g2Top", 50); + previewStyle->activeTabBottomSurface.g2Bottom = settings.readNumEntry("/activeTabBottomSurface_g2Bottom", 100); + + origActiveTabBottomSurface = previewStyle->activeTabBottomSurface; + + previewStyle->tabBottomSurface.numGradients = settings.readNumEntry("/tabBottomSurface_numGradients", 2); + previewStyle->tabBottomSurface.g1Color1 = settings.readEntry("/tabBottomSurface_g1Color1", background.dark(110).name()); + previewStyle->tabBottomSurface.g1Color2 = settings.readEntry("/tabBottomSurface_g1Color2", background.dark(110).name()); + previewStyle->tabBottomSurface.g2Color1 = settings.readEntry("/tabBottomSurface_g2Color1", background.dark(110).name()); + previewStyle->tabBottomSurface.g2Color2 = settings.readEntry("/tabBottomSurface_g2Color2", background.dark(120).name()); + previewStyle->tabBottomSurface.background = settings.readEntry("/tabBottomSurface_background", background.dark(110).name()); + previewStyle->tabBottomSurface.g1Top = settings.readNumEntry("/tabBottomSurface_g1Top", 0); + previewStyle->tabBottomSurface.g1Bottom = settings.readNumEntry("/tabBottomSurface_g1Bottom", 50); + previewStyle->tabBottomSurface.g2Top = settings.readNumEntry("/tabBottomSurface_g2Top", 50); + previewStyle->tabBottomSurface.g2Bottom = settings.readNumEntry("/tabBottomSurface_g2Bottom", 100); + + origTabBottomSurface = previewStyle->tabBottomSurface; + + + // headers + + previewStyle->headerSurface.numGradients = settings.readNumEntry("/headerSurface_numGradients", 2); + switch (previewStyle->headerSurface.numGradients) { + case 2: + groupBox8_2_2_2_2_4_3->setChecked(true); + groupBox9_2_2_2_2_4_3->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4_3->setChecked(true); + groupBox9_2_2_2_2_4_3->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4_3->setChecked(false); + groupBox9_2_2_2_2_4_3->setChecked(false); + break; + } + kColorButton2_4_2_2_2_2_4_3->setColor(settings.readEntry("/headerSurface_g1Color1", background.name())); + kColorButton1_2_2_2_2_2_4_3->setColor(settings.readEntry("/headerSurface_g1Color2", background.dark(120).name())); + spinBox1_2_2_2_2_2_4_3->setValue(settings.readNumEntry("/headerSurface_g1Top", 0)); + spinBox2_2_2_2_2_2_4_3->setValue(settings.readNumEntry("/headerSurface_g1Bottom", 50)); + kColorButton2_5_2_2_2_2_4_3->setColor(settings.readEntry("/headerSurface_g2Color1", background.dark(120).name())); + kColorButton1_3_2_2_2_2_4_3->setColor(settings.readEntry("/headerSurface_g2Color2", background.dark(110).name())); + spinBox1_3_2_2_2_2_4_3->setValue(settings.readNumEntry("/headerSurface_g2Top", 50)); + spinBox2_3_2_2_2_2_4_3->setValue(settings.readNumEntry("/headerSurface_g2Bottom", 100)); + kColorButton27_2_2_2_2->setColor(settings.readEntry("/headerSurface_background", background.name())); + + previewStyle->headerSurface.g1Color1 = kColorButton2_4_2_2_2_2_4_3->color(); + previewStyle->headerSurface.g1Color2 = kColorButton1_2_2_2_2_2_4_3->color(); + previewStyle->headerSurface.g2Color1 = kColorButton2_5_2_2_2_2_4_3->color(); + previewStyle->headerSurface.g2Color2 = kColorButton1_3_2_2_2_2_4_3->color(); + previewStyle->headerSurface.g1Top = spinBox1_2_2_2_2_2_4_3->value(); + previewStyle->headerSurface.g1Bottom = spinBox2_2_2_2_2_2_4_3->value(); + previewStyle->headerSurface.g2Top = spinBox1_3_2_2_2_2_4_3->value(); + previewStyle->headerSurface.g2Bottom = spinBox2_3_2_2_2_2_4_3->value(); + previewStyle->headerSurface.background = kColorButton27_2_2_2_2->color(); + + origHeaderSurface = previewStyle->headerSurface; + + + // radio / checkboxes + + previewStyle->checkItemSurface.numGradients = settings.readNumEntry("/checkItemSurface_numGradients", 2); + switch (previewStyle->checkItemSurface.numGradients) { + case 2: + groupBox8_2_2_2_2_4_3_2->setChecked(true); + groupBox9_2_2_2_2_4_3_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4_3_2->setChecked(true); + groupBox9_2_2_2_2_4_3_2->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4_3_2->setChecked(false); + groupBox9_2_2_2_2_4_3_2->setChecked(false); + break; + } + kColorButton2_4_2_2_2_2_4_3_2->setColor(settings.readEntry("/checkItemSurface_g1Color1", button.name())); + kColorButton1_2_2_2_2_2_4_3_2->setColor(settings.readEntry("/checkItemSurface_g1Color2", button.dark(120).name())); + spinBox1_2_2_2_2_2_4_3_2->setValue(settings.readNumEntry("/checkItemSurface_g1Top", 0)); + spinBox2_2_2_2_2_2_4_3_2->setValue(settings.readNumEntry("/checkItemSurface_g1Bottom", 50)); + kColorButton2_5_2_2_2_2_4_3_2->setColor(settings.readEntry("/checkItemSurface_g2Color1", button.dark(120).name())); + kColorButton1_3_2_2_2_2_4_3_2->setColor(settings.readEntry("/checkItemSurface_g2Color2", button.dark(110).name())); + spinBox1_3_2_2_2_2_4_3_2->setValue(settings.readNumEntry("/checkItemSurface_g2Top", 50)); + spinBox2_3_2_2_2_2_4_3_2->setValue(settings.readNumEntry("/checkItemSurface_g2Bottom", 100)); + kColorButton27_2_2_2_3->setColor(settings.readEntry("/checkItemSurface_background", button.name())); + + previewStyle->checkItemSurface.g1Color1 = kColorButton2_4_2_2_2_2_4_3_2->color(); + previewStyle->checkItemSurface.g1Color2 = kColorButton1_2_2_2_2_2_4_3_2->color(); + previewStyle->checkItemSurface.g2Color1 = kColorButton2_5_2_2_2_2_4_3_2->color(); + previewStyle->checkItemSurface.g2Color2 = kColorButton1_3_2_2_2_2_4_3_2->color(); + previewStyle->checkItemSurface.g1Top = spinBox1_2_2_2_2_2_4_3_2->value(); + previewStyle->checkItemSurface.g1Bottom = spinBox2_2_2_2_2_2_4_3_2->value(); + previewStyle->checkItemSurface.g2Top = spinBox1_3_2_2_2_2_4_3_2->value(); + previewStyle->checkItemSurface.g2Bottom = spinBox2_3_2_2_2_2_4_3_2->value(); + previewStyle->checkItemSurface.background = kColorButton27_2_2_2_3->color(); + + origCheckItemSurface = previewStyle->checkItemSurface; + + // schrollBarButtons + previewStyle->scrollBarSurface.numGradients = settings.readNumEntry("/scrollBarSurface_numGradients", 2); + previewStyle->scrollBarSurface.g1Color1 = settings.readEntry("/scrollBarSurface_g1Color1", button.name()); + previewStyle->scrollBarSurface.g1Color2 = settings.readEntry("/scrollBarSurface_g1Color2", button.dark(120).name()); + previewStyle->scrollBarSurface.g2Color1 = settings.readEntry("/scrollBarSurface_g2Color1", button.dark(120).name()); + previewStyle->scrollBarSurface.g2Color2 = settings.readEntry("/scrollBarSurface_g2Color2", button.dark(110).name()); + previewStyle->scrollBarSurface.g1Top = settings.readNumEntry("/scrollBarSurface_g1Top", 0); + previewStyle->scrollBarSurface.g1Bottom = settings.readNumEntry("/scrollBarSurface_g1Bottom", 50); + previewStyle->scrollBarSurface.g2Top = settings.readNumEntry("/scrollBarSurface_g2Top", 50); + previewStyle->scrollBarSurface.g2Bottom = settings.readNumEntry("/scrollBarSurface_g2Bottom", 100); + previewStyle->scrollBarSurface.background = settings.readEntry("/scrollBarSurface_background", button.name()); + + origScrollBarSurface = previewStyle->scrollBarSurface; + + // schrollBarGroove + previewStyle->scrollBarGrooveSurface.numGradients = settings.readNumEntry("/scrollBarGrooveSurface_numGradients", 0); + previewStyle->scrollBarGrooveSurface.g1Color1 = settings.readEntry("/scrollBarGrooveSurface_g1Color1", background.name()); + previewStyle->scrollBarGrooveSurface.g1Color2 = settings.readEntry("/scrollBarGrooveSurface_g1Color2", background.dark(120).name()); + previewStyle->scrollBarGrooveSurface.g2Color1 = settings.readEntry("/scrollBarGrooveSurface_g2Color1", background.dark(120).name()); + previewStyle->scrollBarGrooveSurface.g2Color2 = settings.readEntry("/scrollBarGrooveSurface_g2Color2", background.dark(110).name()); + previewStyle->scrollBarGrooveSurface.g1Top = settings.readNumEntry("/scrollBarGrooveSurface_g1Top", 0); + previewStyle->scrollBarGrooveSurface.g1Bottom = settings.readNumEntry("/scrollBarGrooveSurface_g1Bottom", 50); + previewStyle->scrollBarGrooveSurface.g2Top = settings.readNumEntry("/scrollBarGrooveSurface_g2Top", 50); + previewStyle->scrollBarGrooveSurface.g2Bottom = settings.readNumEntry("/scrollBarGrooveSurface_g2Bottom", 100); + previewStyle->scrollBarGrooveSurface.background = settings.readEntry("/scrollBarGrooveSurface_background", background.dark(150).name()); + + origScrollBarGrooveSurface = previewStyle->scrollBarGrooveSurface; + + comboBox7->setCurrentItem(0); + + switch(previewStyle->scrollBarSurface.numGradients) { + case 2: + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4->setChecked(false); + groupBox9_2_2_2_2_4->setChecked(false); + break; + } + kColorButton2_4_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g1Color1); + kColorButton1_2_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g1Color2); + spinBox1_2_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g1Top); + spinBox2_2_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g1Bottom); + kColorButton2_5_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g2Color1); + kColorButton1_3_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g2Color2); + spinBox1_3_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g2Top); + spinBox2_3_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g2Bottom); + kColorButton27_2_2_2->setColor(previewStyle->scrollBarSurface.background); + + currentScrollBarSurface = &previewStyle->scrollBarSurface; + + settings.endGroup(); + + currentConfigLabel->setText(i18n("Currently loaded config: ")+currentConfig); + +} + +void DominoStyleConfig::userLoadScrollBarConfig() { + + scrollBar5->setUpdatesEnabled(false); + scrollBar6->setUpdatesEnabled(false); + + // index: groove = 1, buttons/slider = 0 + if(comboBox7->currentItem()) + currentScrollBarSurface = &previewStyle->scrollBarGrooveSurface; + else + currentScrollBarSurface = &previewStyle->scrollBarSurface; + + kColorButton2_4_2_2_2_2_4->setColor(currentScrollBarSurface->g1Color1); + kColorButton1_2_2_2_2_2_4->setColor(currentScrollBarSurface->g1Color2); + spinBox1_2_2_2_2_2_4->setValue(currentScrollBarSurface->g1Top); + spinBox2_2_2_2_2_2_4->setValue(currentScrollBarSurface->g1Bottom); + kColorButton2_5_2_2_2_2_4->setColor(currentScrollBarSurface->g2Color1); + kColorButton1_3_2_2_2_2_4->setColor(currentScrollBarSurface->g2Color2); + spinBox1_3_2_2_2_2_4->setValue(currentScrollBarSurface->g2Top); + spinBox2_3_2_2_2_2_4->setValue(currentScrollBarSurface->g2Bottom); + kColorButton27_2_2_2->setColor(currentScrollBarSurface->background); + + + switch(currentScrollBarSurface->numGradients) { + case 2: + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4->setChecked(false); + groupBox9_2_2_2_2_4->setChecked(false); + break; + } + scrollBar5->setUpdatesEnabled(true); + scrollBar6->setUpdatesEnabled(true); +} + +void DominoStyleConfig::userLoadTabConfig() { + + ((DominoQTabWidget*)prevTopTabWidget)->tabBar()->setUpdatesEnabled(false); + ((DominoQTabWidget*)prevBottomTabWidget)->tabBar()->setUpdatesEnabled(false); + + bool topTabWidgetIsActive = false; + // index: bottom = 1, top = 0 + if(tabPosCombo->currentItem()) + // index: inactive = 1, active = 0 + if(tabStateCombo->currentItem()) + currentTabSurface = &previewStyle->tabBottomSurface; + else + currentTabSurface = &previewStyle->activeTabBottomSurface; + else { + topTabWidgetIsActive = true; + if(tabStateCombo->currentItem()) + currentTabSurface = &previewStyle->tabTopSurface; + else + currentTabSurface = &previewStyle->activeTabTopSurface; + } + + // update arrow indicators + prevBottomPage1->update(); + prevBottomPage2->update(); + prevBottomPage3->update(); + prevTopPage1->update(); + prevTopPage2->update(); + prevTopPage3->update(); + + + kColorButton2_4_2_2_2_2->setColor(currentTabSurface->g1Color1); + kColorButton1_2_2_2_2_2->setColor(currentTabSurface->g1Color2); + kColorButton2_5_2_2_2_2->setColor(currentTabSurface->g2Color1); + kColorButton1_3_2_2_2_2->setColor(currentTabSurface->g2Color2); + kColorButton27_2_2->setColor(currentTabSurface->background); + spinBox1_2_2_2_2_2->setValue(currentTabSurface->g1Top); + spinBox2_2_2_2_2_2->setValue(currentTabSurface->g1Bottom); + spinBox1_3_2_2_2_2->setValue(currentTabSurface->g2Top); + spinBox2_3_2_2_2_2->setValue(currentTabSurface->g2Bottom); + + switch (currentTabSurface->numGradients) { + case 2: + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(false); + break; + default: + groupBox8_2_2_2_2->setChecked(false); + groupBox9_2_2_2_2->setChecked(false); + break; + } + ((DominoQTabWidget*)prevTopTabWidget)->tabBar()->setUpdatesEnabled(true); + ((DominoQTabWidget*)prevBottomTabWidget)->tabBar()->setUpdatesEnabled(true); +} + +void DominoStyleConfig::saveConfig(const char* fileName, const char* schemeName ) { + + QString fName; + QSettings s; + int c; + + if(!strcmp(fileName, "domino")) + fName = fileName; + else + fName = QString("domino_").append(fileName); + + s.beginGroup("/" + fName + "/Settings"); + + s.writeEntry("/name", schemeName); + s.writeEntry("/animateProgressBar", animateProgressBar->isChecked()); + s.writeEntry("/centerTabs", centerTabs->isChecked()); + s.writeEntry("/drawTriangularExpander", drawTriangularExpander->isChecked()); + s.writeEntry("/drawToolButtonAsButton", toolBtnAsBtn->isChecked()); + s.writeEntry("/highlightToolBtnIcon", highlightToolBtnIcons->isChecked()); + s.writeEntry("/customCheckMarkColor", customCheckMarkColor->isChecked()); + s.writeEntry("/checkMarkColor", checkMarkColor->color().name()); + s.writeEntry("/tintGroupBoxBackground", tintGroupBoxBackground->isChecked()); + s.writeEntry("/groupBoxBrightness", grSlider->value()); + s.writeEntry("/customGroupBoxBackgroundColor", customGroupBoxBackgroundColor->isChecked()); + s.writeEntry("/groupBoxBackgroundColor", groupBoxBackgroundColor->color().name()); + s.writeEntry("/customToolTipColor", customToolTipColor->isChecked()); + s.writeEntry("/toolTipColor", toolTipColor->color().name()); + s.writeEntry("/smoothScrolling", smoothScrolling->isChecked()); + s.writeEntry("/buttonHeightAdjustment", buttonHeightAdjustment->value()); + s.writeEntry("/rubberBandType", rubberBandType); + s.writeEntry("/rubberBandColor", argbRubberColor->color().name()); + s.writeEntry("/rubberBandOpacity", argbRubberOpacity->value()); + + s.writeEntry("/customPopupMenuColor", customPopupMenuColor->isChecked()); + s.writeEntry("/popupMenuColor", popupMenuColor->color().name()); + s.writeEntry("/customSelMenuItemColor", customSelMenuItemColor->isChecked()); + s.writeEntry("/selMenuItemColor", selMenuItemColor->color().name()); + s.writeEntry("/drawPopupMenuGradient", drawPopupMenuGradient->isChecked()); + s.writeEntry("/indentPopupMenuItems", indentPopupMenuItems->isChecked()); + + s.writeEntry("/indicateFocus", indicateFocus->isChecked()); + s.writeEntry("/drawFocusUnderline", indicatorModeCombo->currentItem() == 1); + s.writeEntry("/indicatorButtonColor", indicatorBtnColor->color().name()); + s.writeEntry("/indicatorColor", indicatorColor->color().name()); + s.writeEntry("/indicatorColorOpacity", indicatorOpacity->value()); + s.writeEntry("/indicatorButtonColorOpacity", indicatorBtnOpacity->value()); + + s.writeEntry("/drawTextEffect", drawTextEffect->isChecked()); + s.writeEntry("/textEffectMode", textEffectModeCombo->currentItem()); + s.writeEntry("/textEffectColor", textEffectColor->color().name()); + s.writeEntry("/textEffectButtonColor", textEffectButtonColor->color().name()); + s.writeEntry("/textEffectOpacity", textEffectOpacity->value()); + s.writeEntry("/textEffectButtonOpacity", textEffectButtonOpacity->value()); + s.writeEntry("/textEffectPos", textEffectPos->currentItem()); + s.writeEntry("/textEffectButtonPos", textEffectButtonPos->currentItem()); + + s.writeEntry("/drawButtonSunkenShadow", drawButtonSunkenShadow->isChecked()); + + s.writeEntry("/buttonContourType", buttonContourType->currentItem()); + s.writeEntry("/buttonContourColor", buttonContourColor->color().name()); + s.writeEntry("/buttonDefaultContourColor", buttonDefaultButtonContourColor->color().name()); + s.writeEntry("/buttonMouseOverContourColor", buttonMouseOverContourColor->color().name()); + s.writeEntry("/buttonPressedContourColor", buttonPressedContourColor->color().name()); + + // hidden + s.writeEntry("/konqTabBarContrast", konqTabBarContrast); + + ////// + + + // buttons + c = groupBox9_2_2_2->isChecked() ? 2 : groupBox8_2_2_2->isChecked() ? 1 : 0; + + s.writeEntry("/btnSurface_numGradients", c); + s.writeEntry("/btnSurface_g1Color1", kColorButton2_4_2_2_2->color().name()); + s.writeEntry("/btnSurface_g1Color2", kColorButton1_2_2_2_2->color().name()); + s.writeEntry("/btnSurface_g2Color1", kColorButton2_5_2_2_2->color().name()); + s.writeEntry("/btnSurface_g2Color2", kColorButton1_3_2_2_2->color().name()); + s.writeEntry("/btnSurface_g1Top", spinBox1_2_2_2_2->value()); + s.writeEntry("/btnSurface_g1Bottom", spinBox2_2_2_2_2->value()); + s.writeEntry("/btnSurface_g2Top", spinBox1_3_2_2_2->value()); + s.writeEntry("/btnSurface_g2Bottom", spinBox2_3_2_2_2->value()); + s.writeEntry("/btnSurface_background", kColorButton27_2->color().name()); + + // headers + c = groupBox9_2_2_2_2_4_3->isChecked() ? 2 : groupBox8_2_2_2_2_4_3->isChecked() ? 1 : 0; + + s.writeEntry("/headerSurface_numGradients", c); + s.writeEntry("/headerSurface_g1Color1", kColorButton2_4_2_2_2_2_4_3->color().name()); + s.writeEntry("/headerSurface_g1Color2", kColorButton1_2_2_2_2_2_4_3->color().name()); + s.writeEntry("/headerSurface_g2Color1", kColorButton2_5_2_2_2_2_4_3->color().name()); + s.writeEntry("/headerSurface_g2Color2", kColorButton1_3_2_2_2_2_4_3->color().name()); + s.writeEntry("/headerSurface_g1Top", spinBox1_2_2_2_2_2_4_3->value()); + s.writeEntry("/headerSurface_g1Bottom", spinBox2_2_2_2_2_2_4_3->value()); + s.writeEntry("/headerSurface_g2Top", spinBox1_3_2_2_2_2_4_3->value()); + s.writeEntry("/headerSurface_g2Bottom", spinBox2_3_2_2_2_2_4_3->value()); + s.writeEntry("/headerSurface_background", kColorButton27_2_2_2_2->color().name()); + + + // radio/checkboxes + c = groupBox9_2_2_2_2_4_3_2->isChecked() ? 2 : groupBox8_2_2_2_2_4_3_2->isChecked() ? 1 : 0; + + s.writeEntry("/checkItemSurface_numGradients", c); + s.writeEntry("/checkItemSurface_g1Color1", kColorButton2_4_2_2_2_2_4_3_2->color().name()); + s.writeEntry("/checkItemSurface_g1Color2", kColorButton1_2_2_2_2_2_4_3_2->color().name()); + s.writeEntry("/checkItemSurface_g2Color1", kColorButton2_5_2_2_2_2_4_3_2->color().name()); + s.writeEntry("/checkItemSurface_g2Color2", kColorButton1_3_2_2_2_2_4_3_2->color().name()); + s.writeEntry("/checkItemSurface_g1Top", spinBox1_2_2_2_2_2_4_3_2->value()); + s.writeEntry("/checkItemSurface_g1Bottom", spinBox2_2_2_2_2_2_4_3_2->value()); + s.writeEntry("/checkItemSurface_g2Top", spinBox1_3_2_2_2_2_4_3_2->value()); + s.writeEntry("/checkItemSurface_g2Bottom", spinBox2_3_2_2_2_2_4_3_2->value()); + s.writeEntry("/checkItemSurface_background", kColorButton27_2_2_2_3->color().name()); + + + // scrollbars + + // buttons + + s.writeEntry("/scrollBarSurface_numGradients", previewStyle->scrollBarSurface.numGradients); + s.writeEntry("/scrollBarSurface_g1Color1", previewStyle->scrollBarSurface.g1Color1.name()); + s.writeEntry("/scrollBarSurface_g1Color2", previewStyle->scrollBarSurface.g1Color2.name()); + s.writeEntry("/scrollBarSurface_g2Color1", previewStyle->scrollBarSurface.g2Color1.name()); + s.writeEntry("/scrollBarSurface_g2Color2", previewStyle->scrollBarSurface.g2Color2.name()); + s.writeEntry("/scrollBarSurface_g1Top", previewStyle->scrollBarSurface.g1Top); + s.writeEntry("/scrollBarSurface_g1Bottom", previewStyle->scrollBarSurface.g1Bottom); + s.writeEntry("/scrollBarSurface_g2Top", previewStyle->scrollBarSurface.g2Top); + s.writeEntry("/scrollBarSurface_g2Bottom", previewStyle->scrollBarSurface.g2Bottom); + s.writeEntry("/scrollBarSurface_background", previewStyle->scrollBarSurface.background.name()); + + // groove + s.writeEntry("/scrollBarGrooveSurface_numGradients", previewStyle->scrollBarGrooveSurface.numGradients); + s.writeEntry("/scrollBarGrooveSurface_g1Color1", previewStyle->scrollBarGrooveSurface.g1Color1.name()); + s.writeEntry("/scrollBarGrooveSurface_g1Color2", previewStyle->scrollBarGrooveSurface.g1Color2.name()); + s.writeEntry("/scrollBarGrooveSurface_g2Color1", previewStyle->scrollBarGrooveSurface.g2Color1.name()); + s.writeEntry("/scrollBarGrooveSurface_g2Color2", previewStyle->scrollBarGrooveSurface.g2Color2.name()); + s.writeEntry("/scrollBarGrooveSurface_g1Top", previewStyle->scrollBarGrooveSurface.g1Top); + s.writeEntry("/scrollBarGrooveSurface_g1Bottom", previewStyle->scrollBarGrooveSurface.g1Bottom); + s.writeEntry("/scrollBarGrooveSurface_g2Top", previewStyle->scrollBarGrooveSurface.g2Top); + s.writeEntry("/scrollBarGrooveSurface_g2Bottom", previewStyle->scrollBarGrooveSurface.g2Bottom); + s.writeEntry("/scrollBarGrooveSurface_background", previewStyle->scrollBarGrooveSurface.background.name()); + + // tabs + s.writeEntry("/activeTabTopSurface_numGradients", previewStyle->activeTabTopSurface.numGradients); + s.writeEntry("/activeTabTopSurface_g1Color1", previewStyle->activeTabTopSurface.g1Color1.name()); + s.writeEntry("/activeTabTopSurface_g1Color2", previewStyle->activeTabTopSurface.g1Color2.name()); + s.writeEntry("/activeTabTopSurface_g2Color1", previewStyle->activeTabTopSurface.g2Color1.name()); + s.writeEntry("/activeTabTopSurface_g2Color2", previewStyle->activeTabTopSurface.g2Color2.name()); + s.writeEntry("/activeTabTopSurface_g1Top", previewStyle->activeTabTopSurface.g1Top); + s.writeEntry("/activeTabTopSurface_g1Bottom", previewStyle->activeTabTopSurface.g1Bottom); + s.writeEntry("/activeTabTopSurface_g2Top", previewStyle->activeTabTopSurface.g2Top); + s.writeEntry("/activeTabTopSurface_g2Bottom", previewStyle->activeTabTopSurface.g2Bottom); + s.writeEntry("/activeTabTopSurface_background", previewStyle->activeTabTopSurface.background.name()); + + s.writeEntry("/tabTopSurface_numGradients", previewStyle->tabTopSurface.numGradients); + s.writeEntry("/tabTopSurface_g1Color1", previewStyle->tabTopSurface.g1Color1.name()); + s.writeEntry("/tabTopSurface_g1Color2", previewStyle->tabTopSurface.g1Color2.name()); + s.writeEntry("/tabTopSurface_g2Color1", previewStyle->tabTopSurface.g2Color1.name()); + s.writeEntry("/tabTopSurface_g2Color2", previewStyle->tabTopSurface.g2Color2.name()); + s.writeEntry("/tabTopSurface_g1Top", previewStyle->tabTopSurface.g1Top); + s.writeEntry("/tabTopSurface_g1Bottom", previewStyle->tabTopSurface.g1Bottom); + s.writeEntry("/tabTopSurface_g2Top", previewStyle->tabTopSurface.g2Top); + s.writeEntry("/tabTopSurface_g2Bottom", previewStyle->tabTopSurface.g2Bottom); + s.writeEntry("/tabTopSurface_background", previewStyle->tabTopSurface.background.name()); + + s.writeEntry("/activeTabBottomSurface_numGradients", previewStyle->activeTabBottomSurface.numGradients); + s.writeEntry("/activeTabBottomSurface_g1Color1", previewStyle->activeTabBottomSurface.g1Color1.name()); + s.writeEntry("/activeTabBottomSurface_g1Color2", previewStyle->activeTabBottomSurface.g1Color2.name()); + s.writeEntry("/activeTabBottomSurface_g2Color1", previewStyle->activeTabBottomSurface.g2Color1.name()); + s.writeEntry("/activeTabBottomSurface_g2Color2", previewStyle->activeTabBottomSurface.g2Color2.name()); + s.writeEntry("/activeTabBottomSurface_g1Top", previewStyle->activeTabBottomSurface.g1Top); + s.writeEntry("/activeTabBottomSurface_g1Bottom", previewStyle->activeTabBottomSurface.g1Bottom); + s.writeEntry("/activeTabBottomSurface_g2Top", previewStyle->activeTabBottomSurface.g2Top); + s.writeEntry("/activeTabBottomSurface_g2Bottom", previewStyle->activeTabBottomSurface.g2Bottom); + s.writeEntry("/activeTabBottomSurface_background", previewStyle->activeTabBottomSurface.background.name()); + + s.writeEntry("/tabBottomSurface_numGradients", previewStyle->tabBottomSurface.numGradients); + s.writeEntry("/tabBottomSurface_g1Color1", previewStyle->tabBottomSurface.g1Color1.name()); + s.writeEntry("/tabBottomSurface_g1Color2", previewStyle->tabBottomSurface.g1Color2.name()); + s.writeEntry("/tabBottomSurface_g2Color1", previewStyle->tabBottomSurface.g2Color1.name()); + s.writeEntry("/tabBottomSurface_g2Color2", previewStyle->tabBottomSurface.g2Color2.name()); + s.writeEntry("/tabBottomSurface_g1Top", previewStyle->tabBottomSurface.g1Top); + s.writeEntry("/tabBottomSurface_g1Bottom", previewStyle->tabBottomSurface.g1Bottom); + s.writeEntry("/tabBottomSurface_g2Top", previewStyle->tabBottomSurface.g2Top); + s.writeEntry("/tabBottomSurface_g2Bottom", previewStyle->tabBottomSurface.g2Bottom); + s.writeEntry("/tabBottomSurface_background",previewStyle-> tabBottomSurface.background.name()); + +} + +void PreviewCheckBox::paintEvent(QPaintEvent* ) { + + QPainter p(this); + drawButton(&p); +} + +// checkBoxes and radioButtons without pixmapCache +void PreviewCheckBox::drawButton(QPainter *p) { + + QStyle::SFlags flags = QStyle::Style_Default|Domino_noCache; + if ( isEnabled() ) + flags |= QStyle::Style_Enabled; + if ( hasFocus() ) + flags |= QStyle::Style_HasFocus; + if ( isDown() ) + flags |= QStyle::Style_Down; + if ( hasMouse() ) + flags |= QStyle::Style_MouseOver; + if ( state() == QButton::On ) + flags |= QStyle::Style_On; + else if ( state() == QButton::Off ) + flags |= QStyle::Style_Off; +// else if ( state() == QButton::NoChange ) +// flags |= QStyle::Style_NoChange; + + QRect irect = QStyle::visualRect( style().subRect(QStyle::SR_CheckBoxIndicator, this), this ); + p->setBackgroundMode(Qt::OpaqueMode); + drawButtonLabel(p); + + QPixmap pix(18,19); + QPainter painter(&pix); + pix.fill(backgroundColor()); + style().drawControl(QStyle::CE_CheckBox, &painter, this, irect, colorGroup(), flags); + bitBlt(this, 0, 0, &pix); +} + +void PreviewRadioButton::paintEvent(QPaintEvent* ) { + + QPainter p(this); + drawButton(&p); +} + +void PreviewRadioButton::drawButton(QPainter *p) { + + QStyle::SFlags flags = QStyle::Style_Default|Domino_noCache; + if ( isEnabled() ) + flags |= QStyle::Style_Enabled; + if ( hasFocus() ) + flags |= QStyle::Style_HasFocus; + if ( isDown() ) + flags |= QStyle::Style_Down; + if ( hasMouse() ) + flags |= QStyle::Style_MouseOver; + if ( state() == QButton::On ) + flags |= QStyle::Style_On; + else if ( state() == QButton::Off ) + flags |= QStyle::Style_Off; + + QRect irect = QStyle::visualRect( style().subRect(QStyle::SR_RadioButtonIndicator, this), this ); + irect.addCoords(0,-1,0,0); + p->setBackgroundMode(Qt::OpaqueMode); + drawButtonLabel( p ); + + QPixmap pix(17,17); + QPainter painter(&pix); + pix.fill(backgroundColor()); + style().drawControl(QStyle::CE_RadioButton, &painter, this, irect, colorGroup(), flags); + bitBlt(this, 0, 0, &pix); +} + + +void PreviewTabBar::paintEvent(QPaintEvent* event) { + + QString height = QString::number(rect().height()); + QString color = QString::number(palette().active().background().pixel(), 16); + + + QPixmapCache::remove("firsttabEdges2-bottom-sel"+color+height); + QPixmapCache::remove("lasttabEdges2-bottom-sel"+color+height); + QPixmapCache::remove("singletabEdges2-bottom-sel"+color+height); + QPixmapCache::remove("middletabEdges2-bottom-sel"+color+height); + + QPixmapCache::remove("tabEdges2-bottom"+color+height); + + QPixmapCache::remove("firsttabEdges2-top-sel"+color+height); + QPixmapCache::remove("lasttabEdges2-top-sel"+color+height); + QPixmapCache::remove("singletabEdges2-top-sel"+color+height); + QPixmapCache::remove("middletabEdges2-top-sel"+color+height); + QPixmapCache::remove("tabEdges2-top"+color+height); + + QTabBar::paintEvent(event); + +} + + +void PreviewTabBar::mousePressEvent(QMouseEvent* event) { + + QTabWidget* tw = static_cast(parentWidget()); + bool tabsAbove = tw->tabPosition() == QTabWidget::Top; + QPoint point = ((QMouseEvent*)event)->pos(); + QTab* tab = selectTab(point); + if(!tab) + return; + + bool activeTab = currentTab() == tab->identifier(); + bool changed = false; + + if(tabPosCombo->currentItem() == tabsAbove) { + tabPosCombo->setCurrentItem(!tabsAbove); + changed = true; + } + if(tabStateCombo->currentItem() == activeTab) { + tabStateCombo->setCurrentItem(!activeTab); + changed = true; + } + if(changed) + styleConfig->userLoadTabConfig(); +} + +void IndicatorPrevButton::paintEvent(QPaintEvent* /*event*/) +{ + if(!isEnabled()) { + erase(); + return; + } + QStyle::SFlags flags = QStyle::Style_Default; + if (isEnabled()) + flags |= QStyle::Style_Enabled; + if (isDown()) + flags |= QStyle::Style_Down; + if (isOn()) + flags |= QStyle::Style_On; + if (! isFlat() && ! isDown()) + flags |= QStyle::Style_Raised; + if (isDefault()) + flags |= QStyle::Style_ButtonDefault; + + QPixmap buffer(width(), height()); + QPainter p(&buffer); + buffer.fill(paletteBackgroundColor()); + + previewStyle->drawControl(QStyle::CE_PushButton, &p, this, rect(), colorGroup(), flags); + + previewStyle->drawFocusIndicator(&p, style().subRect(QStyle::SR_PushButtonFocusRect, this), AlignHCenter| AlignVCenter |ShowPrefix, + colorGroup(), true, 0, indicatorPreviewText, -1, indicatorBtnColor->color(), (indicatorModeCombo->currentItem() == 1), true); + QColor fg = colorGroup().buttonText(); + + TextEffect textEffectMode_save = previewStyle->textEffectSettings.mode; + if(!drawTextEffect->isChecked()) + previewStyle->textEffectSettings.mode = TextEffect_None; + previewStyle->dominoDrawItem(&p, rect(), AlignHCenter| AlignVCenter |ShowPrefix, colorGroup(), true, 0, indicatorPreviewText, -1, &fg, previewStyle->textEffectSettings.mode > 0 ? 1 : 0); + previewStyle->textEffectSettings.mode = textEffectMode_save; + + p.end(); + p.begin(this); + p.drawPixmap(0,0,buffer); +} + +void IndicatorPrevWidget::paintEvent(QPaintEvent* /*event*/) +{ + if(!isEnabled()) { + erase(); + return; + } + + QPixmap buffer(width(), height()); + QPainter p(&buffer); + buffer.fill(paletteBackgroundColor()); + + previewStyle->drawFocusIndicator(&p, rect(), AlignHCenter| AlignVCenter |ShowPrefix, colorGroup(), true, 0, indicatorPreviewText, + -1, indicatorColor->color(), (indicatorModeCombo->currentItem() == 1)); + QColor fg = colorGroup().foreground(); + previewStyle->drawItem(&p, style().subRect(QStyle::SR_PushButtonFocusRect, this), AlignHCenter| AlignVCenter |ShowPrefix, colorGroup(), + true, 0, indicatorPreviewText, -1, &fg); + + p.end(); + p.begin(this); + p.drawPixmap(0,0,buffer); +} + +void TextEffectPrevButton::paintEvent(QPaintEvent* /*event*/) +{ + + if(!isEnabled()) { + erase(); + return; + } + + + QStyle::SFlags flags = QStyle::Style_Default; + if (isEnabled()) + flags |= QStyle::Style_Enabled; + if (isDown()) { + flags |= QStyle::Style_Down; + } + if (isOn()) + flags |= QStyle::Style_On; + if (! isFlat() && ! isDown()) + flags |= QStyle::Style_Raised; + if (isDefault()) + flags |= QStyle::Style_ButtonDefault; + + QPixmap buffer(width(), height()); + QPainter p(&buffer); + previewStyle->drawControl(QStyle::CE_PushButton, &p, this, rect(), colorGroup(), flags); + + drawButtonLabel(&p); + + p.end(); + p.begin(this); + p.drawPixmap(0,0,buffer); + +} + +void TextEffectPrevWidget::paintEvent(QPaintEvent* /*event*/) +{ + if(!drawTextEffect->isChecked() || textEffectModeCombo->currentItem() == 0) { + erase(); + return; + } + + QPixmap buffer(width(), height()); + buffer.fill(paletteBackgroundColor()); + QPainter p(&buffer); + previewStyle->drawItem(&p, rect(), AlignHCenter| AlignVCenter, colorGroup(), true, 0, textEffectPreviewText); + + p.end(); + p.begin(this); + p.drawPixmap(0,0, buffer); + +} + +void DominoStyleConfig::languageChange() +{ + + ///////////////////////////////////////////////// + // tab 1 (general) + ///////////////////////////////////////////////// + buttonHeightAdjustmentLabel->setText(tr("Button height adjustment:")); + + indicateFocus->setText(tr("Indicate focus")); + indicatorModeCombo->clear(); + indicatorModeCombo->insertItem( tr( "Colored outline" ) ); + indicatorModeCombo->insertItem( tr( "Underline" ) ); + labelIndicatorBtnColor->setText(tr("Button color:")); + labelIndicatorColor->setText(tr("Color:")); + indicatorPreviewText = tr("focused"); + int width = indicatorPrevButton->fontMetrics().width(indicatorPreviewText); + indicatorPrevButton->setMinimumWidth(width+16); + + drawTextEffect->setText(tr("Draw text effect")); + textEffectPreviewText = tr("123 text"); + labelTextEffectButtonColor->setText(tr("Button color:")); + labelTextEffectColor->setText(tr("Color:")); + width = textEffectPrevButton->fontMetrics().width(textEffectPreviewText); + textEffectPrevButton->setMinimumWidth(width+16); + textEffectModeCombo->clear(); + textEffectModeCombo->insertItem( tr( "Only buttons" ), 0 ); + textEffectModeCombo->insertItem( tr( "Everywhere" ), 1 ); + + ///////////////////////////////////////////////// + // tab 2.1 (buttons) + ///////////////////////////////////////////////// + textLabel1_2->setText( tr( "Background Color:" ) ); + kColorButton27_2->setText( QString::null ); + groupBox10_2_2_2->setTitle( tr( "Preview" ) ); + // pushButton16->setText( tr( "PushButton" ) ); + groupBox8_2_2_2->setTitle( tr( "First Gradient" ) ); + textLabel4_3_2_2_2->setText( tr( "ends at:" ) ); + spinBox2_2_2_2_2->setSuffix( tr( " %" ) ); + textLabel2_2_2_2_2->setText( tr( "with color:" ) ); + kColorButton1_2_2_2_2->setText( QString::null ); + textLabel3_3_2_2_2->setText( tr( "starts at:" ) ); + spinBox1_2_2_2_2->setSuffix( tr( " %" ) ); + spinBox1_2_2_2_2->setSpecialValueText( QString::null ); + textLabel1_4_2_2_2->setText( tr( "with color:" ) ); + kColorButton2_4_2_2_2->setText( QString::null ); + groupBox9_2_2_2->setTitle( tr( "Second Gradient" ) ); + textLabel4_4_2_2_2->setText( tr( "ends at:" ) ); + spinBox2_3_2_2_2->setSuffix( tr( " %" ) ); + textLabel3_4_2_2_2->setText( tr( "starts at:" ) ); + spinBox1_3_2_2_2->setSuffix( tr( " %" ) ); + spinBox1_3_2_2_2->setSpecialValueText( QString::null ); + kColorButton1_3_2_2_2->setText( QString::null ); + kColorButton2_5_2_2_2->setText( QString::null ); + textLabel1_5_2_2_2->setText( tr( "with color:" ) ); + textLabel2_3_2_2_2->setText( tr( "with color:" ) ); + textLabel7_4->setText( tr( "Copy from:" ) ); + comboBox3_4->clear(); + comboBox3_4->insertItem( tr( "scrollbars" ) ); + comboBox3_4->insertItem( tr( "headers" ) ); + comboBox3_4->insertItem( tr( "radio/checkboxes" ) ); + pushButton4_4->setText( tr( "OK" ) ); + tabWidget2->changeTab( tab1, tr( "Buttons" ) ); + + ///////////////////////////////////////////////// + // tab 2.2 (tabs) + ///////////////////////////////////////////////// + groupBox8_2_2_2_2->setTitle( tr( "First Gradient" ) ); + textLabel4_3_2_2_2_2->setText( tr( "ends at:" ) ); + spinBox2_2_2_2_2_2->setSuffix( tr( " %" ) ); + textLabel2_2_2_2_2_2->setText( tr( "with color:" ) ); + kColorButton1_2_2_2_2_2->setText( QString::null ); + textLabel3_3_2_2_2_2->setText( tr( "starts at:" ) ); + spinBox1_2_2_2_2_2->setSuffix( tr( " %" ) ); + spinBox1_2_2_2_2_2->setSpecialValueText( QString::null ); + textLabel1_4_2_2_2_2->setText( tr( "with color:" ) ); + kColorButton2_4_2_2_2_2->setText( QString::null ); + groupBox9_2_2_2_2->setTitle( tr( "Second Gradient" ) ); + textLabel4_4_2_2_2_2->setText( tr( "ends at:" ) ); + spinBox2_3_2_2_2_2->setSuffix( tr( " %" ) ); + textLabel3_4_2_2_2_2->setText( tr( "starts at:" ) ); + spinBox1_3_2_2_2_2->setSuffix( tr( " %" ) ); + spinBox1_3_2_2_2_2->setSpecialValueText( QString::null ); + kColorButton1_3_2_2_2_2->setText( QString::null ); + kColorButton2_5_2_2_2_2->setText( QString::null ); + textLabel1_5_2_2_2_2->setText( tr( "with color:" ) ); + textLabel2_3_2_2_2_2->setText( tr( "with color:" ) ); + textLabel1_2_2->setText( tr( "Background Color:" ) ); + kColorButton27_2_2->setText( QString::null ); + groupBox10_2_2_2_2->setTitle( tr( "Preview" ) ); + textLabel7_4_2->setText( tr( "Copy from:" ) ); + comboBox3_4_2->clear(); + comboBox3_4_2->insertItem( tr( "top active tab" ) ); + comboBox3_4_2->insertItem( tr( "top inactive tab" ) ); + comboBox3_4_2->insertItem( tr( "bottom active tab" ) ); + comboBox3_4_2->insertItem( tr( "bottom inactive tab" ) ); + comboBox3_4_2->insertItem( tr( "buttons" ) ); + comboBox3_4_2->insertItem( tr( "scrollbars" ) ); + comboBox3_4_2->insertItem( tr( "headers" ) ); + comboBox3_4_2->insertItem( tr( "radio/checkboxes" ) ); + tabPosCombo->insertItem( tr( "top" ) ); + tabPosCombo->insertItem( tr( "bottom" ) ); + tabStateCombo->insertItem( tr( "active" ) ); + tabStateCombo->insertItem( tr( "inactive" ) ); + pushButton4_4_2->setText( tr( "OK" ) ); + tabWidget2->changeTab( tab2, tr( "Tabs" ) ); + + ///////////////////////////////////////////////// + // tab 2.3 (scrollBars) + ///////////////////////////////////////////////// + groupBox8_2_2_2_2_4->setTitle( tr( "First Gradient" ) ); + textLabel4_3_2_2_2_2_4->setText( tr( "ends at:" ) ); + spinBox2_2_2_2_2_2_4->setSuffix( tr( " %" ) ); + textLabel2_2_2_2_2_2_4->setText( tr( "with color:" ) ); + kColorButton1_2_2_2_2_2_4->setText( QString::null ); + textLabel3_3_2_2_2_2_4->setText( tr( "starts at:" ) ); + spinBox1_2_2_2_2_2_4->setSuffix( tr( " %" ) ); + spinBox1_2_2_2_2_2_4->setSpecialValueText( QString::null ); + textLabel1_4_2_2_2_2_4->setText( tr( "with color:" ) ); + kColorButton2_4_2_2_2_2_4->setText( QString::null ); + groupBox9_2_2_2_2_4->setTitle( tr( "Second Gradient" ) ); + textLabel4_4_2_2_2_2_4->setText( tr( "ends at:" ) ); + spinBox2_3_2_2_2_2_4->setSuffix( tr( " %" ) ); + textLabel3_4_2_2_2_2_4->setText( tr( "starts at:" ) ); + spinBox1_3_2_2_2_2_4->setSuffix( tr( " %" ) ); + spinBox1_3_2_2_2_2_4->setSpecialValueText( QString::null ); + kColorButton1_3_2_2_2_2_4->setText( QString::null ); + kColorButton2_5_2_2_2_2_4->setText( QString::null ); + textLabel1_5_2_2_2_2_4->setText( tr( "with color:" ) ); + textLabel2_3_2_2_2_2_4->setText( tr( "with color:" ) ); + groupBox10_2_2_2_2_4->setTitle( tr( "Preview" ) ); + kColorButton27_2_2_2->setText( QString::null ); + textLabel1_2_2_2->setText( tr( "Background Color:" ) ); + comboBox7->clear(); + comboBox7->insertItem( tr( "Buttons/Slider" ) ); + comboBox7->insertItem( tr( "Groove" ) ); + textLabel7_4_2_3->setText( tr( "Copy from:" ) ); + comboBox3_4_2_3->clear(); + comboBox3_4_2_3->insertItem( tr( "buttons" ) ); + comboBox3_4_2_3->insertItem( tr( "headers" ) ); + comboBox3_4_2_3->insertItem( tr( "radio/checkboxes" ) ); + pushButton4_4_2_3->setText( tr( "OK" ) ); + tabWidget2->changeTab( tab3, tr( "ScrollBars" ) ); + + ///////////////////////////////////////////////// + // tab 2.4 (headers) + ///////////////////////////////////////////////// + kColorButton27_2_2_2_2->setText( QString::null ); + textLabel1_2_2_2_2->setText( tr( "Background Color:" ) ); + groupBox10_2_2_2_2_4_3->setTitle( tr( "Preview" ) ); + groupBox8_2_2_2_2_4_3->setTitle( tr( "First Gradient" ) ); + textLabel4_3_2_2_2_2_4_3->setText( tr( "ends at:" ) ); + spinBox2_2_2_2_2_2_4_3->setSuffix( tr( " %" ) ); + textLabel2_2_2_2_2_2_4_3->setText( tr( "with color:" ) ); + kColorButton1_2_2_2_2_2_4_3->setText( QString::null ); + textLabel3_3_2_2_2_2_4_3->setText( tr( "starts at:" ) ); + spinBox1_2_2_2_2_2_4_3->setSuffix( tr( " %" ) ); + spinBox1_2_2_2_2_2_4_3->setSpecialValueText( QString::null ); + textLabel1_4_2_2_2_2_4_3->setText( tr( "with color:" ) ); + kColorButton2_4_2_2_2_2_4_3->setText( QString::null ); + groupBox9_2_2_2_2_4_3->setTitle( tr( "Second Gradient" ) ); + textLabel4_4_2_2_2_2_4_3->setText( tr( "ends at:" ) ); + spinBox2_3_2_2_2_2_4_3->setSuffix( tr( " %" ) ); + textLabel3_4_2_2_2_2_4_3->setText( tr( "starts at:" ) ); + spinBox1_3_2_2_2_2_4_3->setSuffix( tr( " %" ) ); + spinBox1_3_2_2_2_2_4_3->setSpecialValueText( QString::null ); + kColorButton1_3_2_2_2_2_4_3->setText( QString::null ); + kColorButton2_5_2_2_2_2_4_3->setText( QString::null ); + textLabel1_5_2_2_2_2_4_3->setText( tr( "with color:" ) ); + textLabel2_3_2_2_2_2_4_3->setText( tr( "with color:" ) ); + textLabel7_4_2_3_3->setText( tr( "Copy from:" ) ); + comboBox3_4_2_3_3->clear(); + comboBox3_4_2_3_3->insertItem( tr( "buttons" ) ); + comboBox3_4_2_3_3->insertItem( tr( "scrollbars" ) ); + comboBox3_4_2_3_3->insertItem( tr( "radio/checkboxes" ) ); + pushButton4_4_2_3_3->setText( tr( "OK" ) ); + tabWidget2->changeTab( tab4, tr( "Headers" ) ); + + ///////////////////////////////////////////////// + // tab 2.5 (radio/checkboxes) + ///////////////////////////////////////////////// + groupBox8_2_2_2_2_4_3_2->setTitle( tr( "First Gradient" ) ); + textLabel4_3_2_2_2_2_4_3_2->setText( tr( "ends at:" ) ); + spinBox2_2_2_2_2_2_4_3_2->setSuffix( tr( " %" ) ); + textLabel2_2_2_2_2_2_4_3_2->setText( tr( "with color:" ) ); + kColorButton1_2_2_2_2_2_4_3_2->setText( QString::null ); + textLabel3_3_2_2_2_2_4_3_2->setText( tr( "starts at:" ) ); + spinBox1_2_2_2_2_2_4_3_2->setSuffix( tr( " %" ) ); + spinBox1_2_2_2_2_2_4_3_2->setSpecialValueText( QString::null ); + textLabel1_4_2_2_2_2_4_3_2->setText( tr( "with color:" ) ); + kColorButton2_4_2_2_2_2_4_3_2->setText( QString::null ); + kColorButton27_2_2_2_3->setText( QString::null ); + textLabel1_2_2_2_3->setText( tr( "Background Color:" ) ); + groupBox10_2_2_2_2_4_3_2->setTitle( tr( "Preview" ) ); + radioButton2->setText( tr( "RadioButton" ) ); + checkBox2->setText( tr( "CheckBox" ) ); + groupBox9_2_2_2_2_4_3_2->setTitle( tr( "Second Gradient" ) ); + textLabel4_4_2_2_2_2_4_3_2->setText( tr( "ends at:" ) ); + spinBox2_3_2_2_2_2_4_3_2->setSuffix( tr( " %" ) ); + textLabel3_4_2_2_2_2_4_3_2->setText( tr( "starts at:" ) ); + spinBox1_3_2_2_2_2_4_3_2->setSuffix( tr( " %" ) ); + spinBox1_3_2_2_2_2_4_3_2->setSpecialValueText( QString::null ); + kColorButton1_3_2_2_2_2_4_3_2->setText( QString::null ); + kColorButton2_5_2_2_2_2_4_3_2->setText( QString::null ); + textLabel1_5_2_2_2_2_4_3_2->setText( tr( "with color:" ) ); + textLabel2_3_2_2_2_2_4_3_2->setText( tr( "with color:" ) ); + textLabel7_4_2_3_3_2->setText( tr( "Copy from:" ) ); + comboBox3_4_2_3_3_2->clear(); + comboBox3_4_2_3_3_2->insertItem( tr( "buttons" ) ); + comboBox3_4_2_3_3_2->insertItem( tr( "scrollbars" ) ); + comboBox3_4_2_3_3_2->insertItem( tr( "headers" ) ); + pushButton4_4_2_3_3_2->setText( tr( "OK" ) ); + + tabWidget2->changeTab( tab5, tr( "Radio/Checkboxes" ) ); + + ///////////////////////////////////////////////// + // tab 3 (load/save) + ///////////////////////////////////////////////// + groupBox_ls->setTitle( QString::null ); + listView_ls->header()->setLabel( 0, tr( "Name" ) ); + loadButton->setText( tr( "Load Config" ) ); + saveButton->setText( tr( "Save Config" ) ); + deleteButton->setText( tr( "Delete Config" ) ); + importButton->setText( tr( "Import Config" ) ); + + +} + + +DominoStyleConfig::~DominoStyleConfig() +{ + delete schemeList; +} + + +void DominoStyleConfig::save() +{ + bool settingsChanged; + + if( + (centerTabs->isChecked() == origCenterTabs) && + (animateProgressBar->isChecked() == origAnimProgressBar) && + (drawTriangularExpander->isChecked() == origDrawTriangularExpander) && + (highlightToolBtnIcons->isChecked() == origHighlightToolBtnIcons) && + (toolBtnAsBtn->isChecked() == origToolBtnAsBtn) && + (customCheckMarkColor->isChecked() == origCustomCheckMarkColor) && + (checkMarkColor->color() == origCheckMarkColor) && + (tintGroupBoxBackground->isChecked() == origTintGroupBoxBackground) && + (customGroupBoxBackgroundColor->isChecked() == origCustomGroupBoxBackgroundColor) && + (groupBoxBackgroundColor->color() == origGroupBoxBackgroundColor) && + (grSlider->value() == origGroupBoxBrightness) && + (customToolTipColor->isChecked() == origCustomToolTipColor) && + (toolTipColor->color() == origToolTipColor) && + (smoothScrolling->isChecked() == origSmoothScrolling) && + (buttonHeightAdjustment->value() == origButtonHeightAdjustment) && + + ((rubberBandType == origRubberBandType) || (!hasCompositeExtension && origRubberBandType == DominoStyle::ArgbRubber && rubberBandType == DominoStyle::DistRubber)) && + (argbRubberColor->color() == origArgbRubberColor) && + (argbRubberOpacity->value() == origArgbRubberOpacity) && + + (customPopupMenuColor->isChecked() == origCustomPopupMenuColor) && + (popupMenuColor->color() == origPopupMenuColor) && + (customSelMenuItemColor->isChecked() == origCustomSelMenuItemColor) && + (selMenuItemColor->color() == origSelMenuItemColor) && + (drawPopupMenuGradient->isChecked() == origDrawPopupMenuGradient) && + (indentPopupMenuItems->isChecked() == origIndentPopupMenuItems) && + + (indicateFocus->isChecked() == origIndicateFocus) && + (indicatorColor->color() == origIndicatorColor) && + (indicatorBtnColor->color() == origIndicatorBtnColor) && + (indicatorModeCombo->currentItem() == (int)origDrawUnderline) && + (indicatorOpacity->value() == origIndicatorOpacity) && + (indicatorBtnOpacity->value() == origIndicatorBtnOpacity) && + + (drawTextEffect->isChecked() == origDrawTextEffect) && + (textEffectModeCombo->currentItem() == origTextEffectMode) && + (textEffectColor->color() == origTextEffectColor) && + (textEffectButtonColor->color() == origTextEffectButtonColor) && + (textEffectOpacity->value() == origTextEffectOpacity) && + (textEffectButtonOpacity->value() == origTextEffectButtonOpacity) && + (textEffectPos->currentItem() == origTextEffectPos) && + (textEffectButtonPos->currentItem() == origTextEffectButtonPos) && + (drawButtonSunkenShadow->isChecked() == origDrawButtonSunkenShadow) && + + (buttonContourType->currentItem() == origButtonContourType) && + (buttonContourColor->color() == origButtonContourColor) && + (buttonDefaultButtonContourColor->color() == origButtonDefaultButtonContourColor) && + (buttonMouseOverContourColor->color() == origButtonMouseOverContourColor) && + (buttonPressedContourColor->color() == origButtonPressedContourColor) && + + (kColorButton2_4_2_2_2->color() == origBtnSurface.g1Color1) && + (kColorButton1_2_2_2_2->color() == origBtnSurface.g1Color2) && + (kColorButton2_5_2_2_2->color() == origBtnSurface.g2Color1) && + (kColorButton1_3_2_2_2->color() == origBtnSurface.g2Color2) && + (spinBox1_2_2_2_2->value() == origBtnSurface.g1Top) && + (spinBox2_2_2_2_2->value() == origBtnSurface.g1Bottom) && + (spinBox1_3_2_2_2->value() == origBtnSurface.g2Top) && + (spinBox2_3_2_2_2->value() == origBtnSurface.g2Bottom) && + (kColorButton27_2->color() == origBtnSurface.background) && + ((groupBox9_2_2_2->isChecked() ? 2 : groupBox8_2_2_2->isChecked() ? 1 : 0 ) == origBtnSurface.numGradients) && + + (kColorButton2_4_2_2_2_2_4_3->color() == origHeaderSurface.g1Color1) && + (kColorButton1_2_2_2_2_2_4_3->color() == origHeaderSurface.g1Color2) && + (kColorButton2_5_2_2_2_2_4_3->color() == origHeaderSurface.g2Color1) && + (kColorButton1_3_2_2_2_2_4_3->color() == origHeaderSurface.g2Color2) && + (spinBox1_2_2_2_2_2_4_3->value() == origHeaderSurface.g1Top) && + (spinBox2_2_2_2_2_2_4_3->value() == origHeaderSurface.g1Bottom) && + (spinBox1_3_2_2_2_2_4_3->value() == origHeaderSurface.g2Top) && + (spinBox2_3_2_2_2_2_4_3->value() == origHeaderSurface.g2Bottom) && + (kColorButton27_2_2_2_2->color() == origHeaderSurface.background) && + ((groupBox9_2_2_2_2_4_3->isChecked() ? 2 : groupBox8_2_2_2_2_4_3->isChecked() ? 1 : 0 ) == origHeaderSurface.numGradients) && + + (kColorButton2_4_2_2_2_2_4_3_2->color() == origCheckItemSurface.g1Color1) && + (kColorButton1_2_2_2_2_2_4_3_2->color() == origCheckItemSurface.g1Color2) && + (kColorButton2_5_2_2_2_2_4_3_2->color() == origCheckItemSurface.g2Color1) && + (kColorButton1_3_2_2_2_2_4_3_2->color() == origCheckItemSurface.g2Color2) && + (spinBox1_2_2_2_2_2_4_3_2->value() == origCheckItemSurface.g1Top) && + (spinBox2_2_2_2_2_2_4_3_2->value() == origCheckItemSurface.g1Bottom) && + (spinBox1_3_2_2_2_2_4_3_2->value() == origCheckItemSurface.g2Top) && + (spinBox2_3_2_2_2_2_4_3_2->value() == origCheckItemSurface.g2Bottom) && + (kColorButton27_2_2_2_3->color() == origCheckItemSurface.background) && + ((groupBox9_2_2_2_2_4_3_2->isChecked() ? 2 : groupBox8_2_2_2_2_4_3_2->isChecked() ? 1 : 0 ) == origCheckItemSurface.numGradients) && + + (previewStyle->scrollBarSurface.g1Color1 == origScrollBarSurface.g1Color1) && + (previewStyle->scrollBarSurface.g1Color2 == origScrollBarSurface.g1Color2) && + (previewStyle->scrollBarSurface.g2Color1 == origScrollBarSurface.g2Color1) && + (previewStyle->scrollBarSurface.g2Color2 == origScrollBarSurface.g2Color2) && + (previewStyle->scrollBarSurface.g1Top == origScrollBarSurface.g1Top) && + (previewStyle->scrollBarSurface.g1Bottom == origScrollBarSurface.g1Bottom) && + (previewStyle->scrollBarSurface.g2Top == origScrollBarSurface.g2Top) && + (previewStyle->scrollBarSurface.g2Bottom == origScrollBarSurface.g2Bottom) && + (previewStyle->scrollBarSurface.background == origScrollBarSurface.background) && + (previewStyle->scrollBarSurface.numGradients == origScrollBarSurface.numGradients) && + + (previewStyle->scrollBarGrooveSurface.g1Color1 == origScrollBarGrooveSurface.g1Color1) && + (previewStyle->scrollBarGrooveSurface.g1Color2 == origScrollBarGrooveSurface.g1Color2) && + (previewStyle->scrollBarGrooveSurface.g2Color1 == origScrollBarGrooveSurface.g2Color1) && + (previewStyle->scrollBarGrooveSurface.g2Color2 == origScrollBarGrooveSurface.g2Color2) && + (previewStyle->scrollBarGrooveSurface.g1Top == origScrollBarGrooveSurface.g1Top) && + (previewStyle->scrollBarGrooveSurface.g1Bottom == origScrollBarGrooveSurface.g1Bottom) && + (previewStyle->scrollBarGrooveSurface.g2Top == origScrollBarGrooveSurface.g2Top) && + (previewStyle->scrollBarGrooveSurface.g2Bottom == origScrollBarGrooveSurface.g2Bottom) && + (previewStyle->scrollBarGrooveSurface.background == origScrollBarGrooveSurface.background) && + (previewStyle->scrollBarGrooveSurface.numGradients == origScrollBarGrooveSurface.numGradients) && + + (previewStyle->activeTabTopSurface.g1Color1 == origActiveTabTopSurface.g1Color1) && + (previewStyle->activeTabTopSurface.g1Color2 == origActiveTabTopSurface.g1Color2) && + (previewStyle->activeTabTopSurface.g2Color1 == origActiveTabTopSurface.g2Color1) && + (previewStyle->activeTabTopSurface.g2Color2 == origActiveTabTopSurface.g2Color2) && + (previewStyle->activeTabTopSurface.background == origActiveTabTopSurface.background) && + (previewStyle->activeTabTopSurface.g1Top == origActiveTabTopSurface.g1Top) && + (previewStyle->activeTabTopSurface.g1Bottom == origActiveTabTopSurface.g1Bottom) && + (previewStyle->activeTabTopSurface.g2Top == origActiveTabTopSurface.g2Top) && + (previewStyle->activeTabTopSurface.g2Bottom == origActiveTabTopSurface.g2Bottom) && + (previewStyle->activeTabTopSurface.numGradients == origActiveTabTopSurface.numGradients) && + + (previewStyle->tabTopSurface.g1Color1 == origTabTopSurface.g1Color1) && + (previewStyle->tabTopSurface.g1Color2 == origTabTopSurface.g1Color2) && + (previewStyle->tabTopSurface.g2Color1 == origTabTopSurface.g2Color1) && + (previewStyle->tabTopSurface.g2Color2 == origTabTopSurface.g2Color2) && + (previewStyle->tabTopSurface.background == origTabTopSurface.background) && + (previewStyle->tabTopSurface.g1Top == origTabTopSurface.g1Top) && + (previewStyle->tabTopSurface.g1Bottom == origTabTopSurface.g1Bottom) && + (previewStyle->tabTopSurface.g2Top == origTabTopSurface.g2Top) && + (previewStyle->tabTopSurface.g2Bottom == origTabTopSurface.g2Bottom) && + (previewStyle->tabTopSurface.numGradients == origTabTopSurface.numGradients) && + + (previewStyle->activeTabBottomSurface.g1Color1 == origActiveTabBottomSurface.g1Color1) && + (previewStyle->activeTabBottomSurface.g1Color2 == origActiveTabBottomSurface.g1Color2) && + (previewStyle->activeTabBottomSurface.g2Color1 == origActiveTabBottomSurface.g2Color1) && + (previewStyle->activeTabBottomSurface.g2Color2 == origActiveTabBottomSurface.g2Color2) && + (previewStyle->activeTabBottomSurface.background == origActiveTabBottomSurface.background) && + (previewStyle->activeTabBottomSurface.g1Top == origActiveTabBottomSurface.g1Top) && + (previewStyle->activeTabBottomSurface.g1Bottom == origActiveTabBottomSurface.g1Bottom) && + (previewStyle->activeTabBottomSurface.g2Top == origActiveTabBottomSurface.g2Top) && + (previewStyle->activeTabBottomSurface.g2Bottom == origActiveTabBottomSurface.g2Bottom) && + (previewStyle->activeTabBottomSurface.numGradients == origActiveTabBottomSurface.numGradients) && + + (previewStyle->tabBottomSurface.g1Color1 == origTabBottomSurface.g1Color1) && + (previewStyle->tabBottomSurface.g1Color2 == origTabBottomSurface.g1Color2) && + (previewStyle->tabBottomSurface.g2Color1 == origTabBottomSurface.g2Color1) && + (previewStyle->tabBottomSurface.g2Color2 == origTabBottomSurface.g2Color2) && + (previewStyle->tabBottomSurface.background == origTabBottomSurface.background) && + (previewStyle->tabBottomSurface.g1Top == origTabBottomSurface.g1Top) && + (previewStyle->tabBottomSurface.g1Bottom == origTabBottomSurface.g1Bottom) && + (previewStyle->tabBottomSurface.g2Top == origTabBottomSurface.g2Top) && + (previewStyle->tabBottomSurface.g2Bottom == origTabBottomSurface.g2Bottom) && + (previewStyle->tabBottomSurface.numGradients == origTabBottomSurface.numGradients) + ) + settingsChanged = false; + else + settingsChanged = true; + + + if(settingsChanged) { + if(!QString(currentConfig).endsWith(" (" + i18n("modified") + ")")) { + currentConfig = QString(currentConfig).append(" (" + i18n("modified") + ")"); + } + } + + if(configLoaded) + settingsChanged = true; + if(settingsChanged) + emit changed(true); + else + emit changed(false); + + saveConfig("domino", currentConfig); +} + +void DominoStyleConfig::defaults() +{ + QColor background = qApp->palette().active().background(); + QColor button = qApp->palette().active().button(); + QColor highlight = qApp->palette().active().highlight(); + + animateProgressBar->setChecked(true); + centerTabs->setChecked(false); + drawTriangularExpander->setChecked(true); + toolBtnAsBtn->setChecked(true); + highlightToolBtnIcons->setChecked(false); + customCheckMarkColor->setChecked(false); + checkMarkColor->setColor(QColor(0,0,0)); + tintGroupBoxBackground->setChecked(true); + customGroupBoxBackgroundColor->setChecked(false); + groupBoxBackgroundColor->setColor(background.dark(110)); + grSlider->setValue(10); + customToolTipColor->setChecked(false); + toolTipColor->setColor(QColor(218,218,179)); + smoothScrolling->setChecked(true); + buttonHeightAdjustment->setValue(0); + + distRubber->setChecked(true); + argbRubberColor->setColor(highlight); + argbRubberOpacity->setValue(30); + + customPopupMenuColor->setChecked(false); + popupMenuColor->setColor(background.name()); + customSelMenuItemColor->setChecked(false); + selMenuItemColor->setColor(highlight.name()); + drawPopupMenuGradient->setChecked(true); + indentPopupMenuItems->setChecked(true); + + indicateFocus->setChecked(true); + indicatorColor->setColor(highlight.name()); + indicatorBtnColor->setColor(highlight.name()); + indicatorModeCombo->setCurrentItem(1); // underline + indicatorModeChanged(); + indicatorOpacity->setValue(60); + indicatorBtnOpacity->setValue(60); + + drawTextEffect->setChecked(true); + textEffectModeCombo->setCurrentItem(0); // only on buttons + textEffectColor->setColor(Qt::white.name()); + textEffectButtonColor->setColor(Qt::white.name()); + textEffectOpacity->setValue(60); + textEffectButtonOpacity->setValue(60); + textEffectPos->setCurrentItem(5); + textEffectButtonPos->setCurrentItem(5); + textEffectModeChanged(); + + drawButtonSunkenShadow->setChecked(true); + + buttonContourType->setCurrentItem(1); // raised + buttonContourColor->setColor(background.dark(250).name()); + buttonDefaultButtonContourColor->setColor(highlight.name()); + buttonMouseOverContourColor->setColor(background.dark(250).name()); + buttonPressedContourColor->setColor(background.dark(250).name()); + +// buttons / comboBoxes / spinBoxes + groupBox9_2_2_2->setChecked(true); + kColorButton2_5_2_2_2->setColor(button.dark(120).name()); + kColorButton1_3_2_2_2->setColor(button.dark(110).name()); + spinBox1_3_2_2_2->setValue(50); + spinBox2_3_2_2_2->setValue(100); + groupBox8_2_2_2->setChecked(true); + kColorButton2_4_2_2_2->setColor(button.name()); + kColorButton1_2_2_2_2->setColor(button.dark(120).name()); + spinBox1_2_2_2_2->setValue(0); + spinBox2_2_2_2_2->setValue(50); + kColorButton27_2->setColor(button.name()); + +// headers + groupBox9_2_2_2_2_4_3->setChecked(true); + kColorButton2_5_2_2_2_2_4_3->setColor(background.dark(120).name()); + kColorButton1_3_2_2_2_2_4_3->setColor(background.dark(110).name()); + spinBox1_3_2_2_2_2_4_3->setValue(50); + spinBox2_3_2_2_2_2_4_3->setValue(100); + groupBox8_2_2_2_2_4_3->setChecked(true); + kColorButton2_4_2_2_2_2_4_3->setColor(background.name()); + kColorButton1_2_2_2_2_2_4_3->setColor(background.dark(120).name()); + spinBox1_2_2_2_2_2_4_3->setValue(0); + spinBox2_2_2_2_2_2_4_3->setValue(50); + kColorButton27_2_2_2_2->setColor(background.name()); + +// radio / checkboxes + groupBox9_2_2_2_2_4_3_2->setChecked(true); + kColorButton2_5_2_2_2_2_4_3_2->setColor(button.dark(120).name()); + kColorButton1_3_2_2_2_2_4_3_2->setColor(button.dark(110).name()); + spinBox1_3_2_2_2_2_4_3_2->setValue(50); + spinBox2_3_2_2_2_2_4_3_2->setValue(100); + groupBox8_2_2_2_2_4_3_2->setChecked(true); + kColorButton2_4_2_2_2_2_4_3_2->setColor(button.name()); + kColorButton1_2_2_2_2_2_4_3_2->setColor(button.dark(120).name()); + spinBox1_2_2_2_2_2_4_3_2->setValue(0); + spinBox2_2_2_2_2_2_4_3_2->setValue(50); + kColorButton27_2_2_2_3->setColor(button.name()); + +// scrollBar Groove / Buttons + + previewStyle->scrollBarGrooveSurface.numGradients = 0; + previewStyle->scrollBarGrooveSurface.g1Color1 = background.name(); + previewStyle->scrollBarGrooveSurface.g1Color2 = background.dark(120).name(); + previewStyle->scrollBarGrooveSurface.g2Color1 = background.dark(120).name(); + previewStyle->scrollBarGrooveSurface.g2Color2 = background.dark(110).name(); + previewStyle->scrollBarGrooveSurface.g1Top = 0; + previewStyle->scrollBarGrooveSurface.g1Bottom = 50; + previewStyle->scrollBarGrooveSurface.g2Top = 50; + previewStyle->scrollBarGrooveSurface.g2Bottom = 100; + previewStyle->scrollBarGrooveSurface.background = background.dark(150).name(); + + previewStyle->scrollBarSurface.numGradients = 2; + previewStyle->scrollBarSurface.g1Color1 = button.name(); + previewStyle->scrollBarSurface.g1Color2 = button.dark(120).name(); + previewStyle->scrollBarSurface.g2Color1 = button.dark(120).name(); + previewStyle->scrollBarSurface.g2Color2 = button.dark(110).name(); + previewStyle->scrollBarSurface.g1Top = 0; + previewStyle->scrollBarSurface.g1Bottom = 50; + previewStyle->scrollBarSurface.g2Top = 50; + previewStyle->scrollBarSurface.g2Bottom = 100; + previewStyle->scrollBarSurface.background = button.name(); + + comboBox7->setCurrentItem(0); + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(true); + kColorButton2_5_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g2Color1); + kColorButton1_3_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g2Color2); + spinBox1_3_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g2Top); + spinBox2_3_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g2Bottom); + kColorButton2_4_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g1Color1); + kColorButton1_2_2_2_2_2_4->setColor(previewStyle->scrollBarSurface.g1Color2); + spinBox1_2_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g1Top); + spinBox2_2_2_2_2_2_4->setValue(previewStyle->scrollBarSurface.g1Bottom); + kColorButton27_2_2_2->setColor(previewStyle->scrollBarSurface.background); + + // tabs + previewStyle->activeTabTopSurface.numGradients = 2; + previewStyle->activeTabTopSurface.g1Color1 = background.light(110).name(); + previewStyle->activeTabTopSurface.g1Color2 = background.name(); + previewStyle->activeTabTopSurface.g2Color1 = background.name(); + previewStyle->activeTabTopSurface.g2Color2 = background.name(); + previewStyle->activeTabTopSurface.background = background.name(); + previewStyle->activeTabTopSurface.g1Top = 0; + previewStyle->activeTabTopSurface.g1Bottom = 50; + previewStyle->activeTabTopSurface.g2Top = 50; + previewStyle->activeTabTopSurface.g2Bottom = 100; + + previewStyle->tabTopSurface.numGradients = 2; + previewStyle->tabTopSurface.g1Color1 = background.light(110).name(); + previewStyle->tabTopSurface.g1Color2 = background.dark(110).name(); + previewStyle->tabTopSurface.g2Color1 = background.dark(110).name(); + previewStyle->tabTopSurface.g2Color2 = background.dark(110).name(); + previewStyle->tabTopSurface.background = background.dark(110).name(); + previewStyle->tabTopSurface.g1Top = 0; + previewStyle->tabTopSurface.g1Bottom = 50; + previewStyle->tabTopSurface.g2Top = 50; + previewStyle->tabTopSurface.g2Bottom = 100; + + previewStyle->activeTabBottomSurface.numGradients = 2; + previewStyle->activeTabBottomSurface.g1Color1 = background.name(); + previewStyle->activeTabBottomSurface.g1Color2 = background.name(); + previewStyle->activeTabBottomSurface.g2Color1 = background.name(); + previewStyle->activeTabBottomSurface.g2Color2 = background.dark(120).name(); + previewStyle->activeTabBottomSurface.background = background.name(); + previewStyle->activeTabBottomSurface.g1Top = 0; + previewStyle->activeTabBottomSurface.g1Bottom = 50; + previewStyle->activeTabBottomSurface.g2Top = 50; + previewStyle->activeTabBottomSurface.g2Bottom = 100; + + previewStyle->tabBottomSurface.numGradients = 2; + previewStyle->tabBottomSurface.g1Color1 = background.dark(110).name(); + previewStyle->tabBottomSurface.g1Color2 = background.dark(110).name(); + previewStyle->tabBottomSurface.g2Color1 = background.dark(110).name(); + previewStyle->tabBottomSurface.g2Color2 = background.dark(120).name(); + previewStyle->tabBottomSurface.background = background.dark(110).name(); + previewStyle->tabBottomSurface.g1Top = 0; + previewStyle->tabBottomSurface.g1Bottom = 50; + previewStyle->tabBottomSurface.g2Top = 50; + previewStyle->tabBottomSurface.g2Bottom = 100; + + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(true); + kColorButton2_4_2_2_2_2->setColor(background.light(110).name()); + kColorButton1_2_2_2_2_2->setColor(background.name()); + kColorButton2_5_2_2_2_2->setColor(background.name()); + kColorButton1_3_2_2_2_2->setColor(background.name()); + kColorButton27_2_2->setColor(background.name()); + spinBox1_2_2_2_2_2->setValue(0); + spinBox2_2_2_2_2_2->setValue(50); + spinBox1_3_2_2_2_2->setValue(50); + spinBox2_3_2_2_2_2->setValue(100); + + tabPosCombo->setCurrentItem(0); + tabStateCombo->setCurrentItem(0); +} + +void DominoStyleConfig::updateChanged() +{ + checkMarkColor->setEnabled(customCheckMarkColor->isChecked()); + toolTipColor->setEnabled(customToolTipColor->isChecked()); + popupMenuColor->setEnabled(customPopupMenuColor->isChecked()); + selMenuItemColor->setEnabled(customSelMenuItemColor->isChecked()); + groupBoxBackgroundColor->setEnabled(customGroupBoxBackgroundColor->isChecked()); + grFrame->setEnabled(tintGroupBoxBackground->isChecked()); + indicateFocusFrame->setEnabled(indicateFocus->isChecked()); + textEffectFrame->setEnabled(drawTextEffect->isChecked()); + indicatorModeChanged(); + textEffectModeChanged(); +} + +void DominoStyleConfig::copyColorsToButton() { + + const DSurface* ds; + switch(comboBox3_4->currentItem()) { + case 0: + ds = &previewStyle->scrollBarSurface; + break; + case 1: + ds = &previewStyle->headerSurface; + break; + case 2: + ds = &previewStyle->checkItemSurface; + break; + default: + return; + } + + kColorButton2_4_2_2_2->setColor(ds->g1Color1); + kColorButton1_2_2_2_2->setColor(ds->g1Color2); + kColorButton2_5_2_2_2->setColor(ds->g2Color1); + kColorButton1_3_2_2_2->setColor(ds->g2Color2); + kColorButton27_2->setColor(ds->background); + spinBox1_2_2_2_2->setValue(ds->g1Top); + spinBox2_2_2_2_2->setValue(ds->g1Bottom); + spinBox1_3_2_2_2->setValue(ds->g2Top); + spinBox2_3_2_2_2->setValue(ds->g2Bottom); + switch(ds->numGradients) { + case 2: + groupBox8_2_2_2->setChecked(true); + groupBox9_2_2_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2->setChecked(true); + groupBox9_2_2_2->setChecked(false); + break; + default: + groupBox8_2_2_2->setChecked(false); + groupBox9_2_2_2->setChecked(false); + } + btnNumGradientsChanged(); +} + +void DominoStyleConfig::copyColorsToTab() { + + const DSurface* ds; + switch(comboBox3_4_2->currentItem()) { + case 0: + ds = &previewStyle->activeTabTopSurface; + break; + case 1: + ds = &previewStyle->tabTopSurface; + break; + case 2: + ds = &previewStyle->activeTabBottomSurface; + break; + case 3: + ds = &previewStyle->tabBottomSurface; + break; + case 4: + ds = &previewStyle->btnSurface; + break; + case 5: + ds = &previewStyle->scrollBarSurface; + break; + case 6: + ds = &previewStyle->headerSurface; + break; + case 7: + ds = &previewStyle->checkItemSurface; + break; + default: + return; + } + + kColorButton2_4_2_2_2_2->setColor(ds->g1Color1); + kColorButton1_2_2_2_2_2->setColor(ds->g1Color2); + kColorButton2_5_2_2_2_2->setColor(ds->g2Color1); + kColorButton1_3_2_2_2_2->setColor(ds->g2Color2); + kColorButton27_2_2->setColor(ds->background); + spinBox1_2_2_2_2_2->setValue(ds->g1Top); + spinBox2_2_2_2_2_2->setValue(ds->g1Bottom); + spinBox1_3_2_2_2_2->setValue(ds->g2Top); + spinBox2_3_2_2_2_2->setValue(ds->g2Bottom); + switch(ds->numGradients) { + case 2: + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2->setChecked(true); + groupBox9_2_2_2_2->setChecked(false); + break; + default: + groupBox8_2_2_2_2->setChecked(false); + groupBox9_2_2_2_2->setChecked(false); + } + tabNumGradientsChanged(); +} + +void DominoStyleConfig::copyColorsToScrollBar() { + + const DSurface* ds; + switch(comboBox3_4_2_3->currentItem()) { + case 0: + ds = &previewStyle->btnSurface; + break; + case 1: + ds = &previewStyle->headerSurface; + break; + case 2: + ds = &previewStyle->checkItemSurface; + break; + default: + return; + } + + kColorButton2_4_2_2_2_2_4->setColor(ds->g1Color1); + kColorButton1_2_2_2_2_2_4->setColor(ds->g1Color2); + kColorButton2_5_2_2_2_2_4->setColor(ds->g2Color1); + kColorButton1_3_2_2_2_2_4->setColor(ds->g2Color2); + kColorButton27_2_2_2->setColor(ds->background); + spinBox1_2_2_2_2_2_4->setValue(ds->g1Top); + spinBox2_2_2_2_2_2_4->setValue(ds->g1Bottom); + spinBox1_3_2_2_2_2_4->setValue(ds->g2Top); + spinBox2_3_2_2_2_2_4->setValue(ds->g2Bottom); + switch(ds->numGradients) { + case 2: + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4->setChecked(true); + groupBox9_2_2_2_2_4->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4->setChecked(false); + groupBox9_2_2_2_2_4->setChecked(false); + } + scrollBarNumGradientsChanged(); +} + +void DominoStyleConfig::copyColorsToHeader() { + + const DSurface* ds; + switch(comboBox3_4_2_3_3->currentItem()) { + case 0: + ds = &previewStyle->btnSurface; + break; + case 1: + ds = &previewStyle->scrollBarSurface; + break; + case 2: + ds = &previewStyle->checkItemSurface; + break; + default: + return; + } + + kColorButton2_4_2_2_2_2_4_3->setColor(ds->g1Color1); + kColorButton1_2_2_2_2_2_4_3->setColor(ds->g1Color2); + kColorButton2_5_2_2_2_2_4_3->setColor(ds->g2Color1); + kColorButton1_3_2_2_2_2_4_3->setColor(ds->g2Color2); + kColorButton27_2_2_2_2->setColor(ds->background); + spinBox1_2_2_2_2_2_4_3->setValue(ds->g1Top); + spinBox2_2_2_2_2_2_4_3->setValue(ds->g1Bottom); + spinBox1_3_2_2_2_2_4_3->setValue(ds->g2Top); + spinBox2_3_2_2_2_2_4_3->setValue(ds->g2Bottom); + switch(ds->numGradients) { + case 2: + groupBox8_2_2_2_2_4_3->setChecked(true); + groupBox9_2_2_2_2_4_3->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4_3->setChecked(true); + groupBox9_2_2_2_2_4_3->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4_3->setChecked(false); + groupBox9_2_2_2_2_4_3->setChecked(false); + } + headerNumGradientsChanged(); +} + +void DominoStyleConfig::copyColorsToCheckItem() { + + const DSurface* ds; + switch(comboBox3_4_2_3_3_2->currentItem()) { + case 0: + ds = &previewStyle->btnSurface; + break; + case 1: + ds = &previewStyle->scrollBarSurface; + break; + case 2: + ds = &previewStyle->headerSurface; + break; + default: + return; + } + + kColorButton2_4_2_2_2_2_4_3_2->setColor(ds->g1Color1); + kColorButton1_2_2_2_2_2_4_3_2->setColor(ds->g1Color2); + kColorButton2_5_2_2_2_2_4_3_2->setColor(ds->g2Color1); + kColorButton1_3_2_2_2_2_4_3_2->setColor(ds->g2Color2); + kColorButton27_2_2_2_3->setColor(ds->background); + spinBox1_2_2_2_2_2_4_3_2->setValue(ds->g1Top); + spinBox2_2_2_2_2_2_4_3_2->setValue(ds->g1Bottom); + spinBox1_3_2_2_2_2_4_3_2->setValue(ds->g2Top); + spinBox2_3_2_2_2_2_4_3_2->setValue(ds->g2Bottom); + switch(ds->numGradients) { + case 2: + groupBox8_2_2_2_2_4_3_2->setChecked(true); + groupBox9_2_2_2_2_4_3_2->setChecked(true); + break; + case 1: + groupBox8_2_2_2_2_4_3_2->setChecked(true); + groupBox9_2_2_2_2_4_3_2->setChecked(false); + break; + default: + groupBox8_2_2_2_2_4_3_2->setChecked(false); + groupBox9_2_2_2_2_4_3_2->setChecked(false); + } + checkItemNumGradientsChanged(); +} + +void DominoStyleConfig::slotLoad() { + + QString sName; + if(listView_ls->selectedItem()) { + sName = listView_ls->currentItem()->text(0); + } + else + return; + + SchemeEntry * entry; + QString fName; + for (entry = schemeList->first(); entry; entry = schemeList->next()) { + if(!strcmp(entry->getSchemeName(), sName)) { + fName = entry->getFileName(); + break; + } + } + + loadConfig(fName.left(fName.length()-2)); + configLoaded = true; +} + +void DominoStyleConfig::slotSave() { + + bool ok; + QString cName; + if(listView_ls->selectedItem()) { + cName = listView_ls->currentItem()->text(0); + } + + cName = KInputDialog::getText(i18n("Save Config Scheme"), i18n("Enter a name for the config scheme:"), cName, &ok, this); + if (!ok) + return; + + if (!listView_ls->findItem(cName, 0)) { + new QListViewItem(listView_ls, cName); + schemeList->append( new SchemeEntry("domino_" + cName.simplifyWhiteSpace().lower() + "rc", cName, true )); + } + else { + int result = KMessageBox::warningContinueCancel(this, i18n("A config scheme with the name '%1' already exists.\n" + "Do you want to overwrite it?\n").arg(cName), + i18n("Save Config Scheme"), i18n("Overwrite")); + if (result == KMessageBox::Cancel) + return; + } + + cName = cName.simplifyWhiteSpace(); + saveConfig(cName, cName); + currentConfig = cName; + currentConfigLabel->setText(i18n("Currently loaded config: ")+currentConfig); + +} + +void DominoStyleConfig::slotDelete() { + + + QString sName; + if(listView_ls->selectedItem()) + sName = listView_ls->currentItem()->text(0); + else + return; + + SchemeEntry * entry; + QString fName; + for (entry = schemeList->first(); entry; entry = schemeList->next()) { + if(!strcmp(entry->getSchemeName(), sName)) { + fName = entry->getFileName(); + schemeList->remove(entry); + break; + } + } + + delete listView_ls->currentItem(); + QDir qDir(QDir::homeDirPath() + ".qt/"); + qDir.remove(fName); + qDir.remove("." + fName + ".lock"); +} + + +void DominoStyleConfig::getConfigSchemes() { + + // only local + QString qtHome(QDir::homeDirPath() + "/.qt"); + QSettings s; + s.insertSearchPath( QSettings::Unix, qtHome); + + QDir schemeFile(qtHome, "domino_*rc"); + for(uint i = 0; i < schemeFile.count(); i++) { + bool deletable = QFileInfo(qtHome, schemeFile[i]).isWritable(); + s.beginGroup("/" + schemeFile[i].left(schemeFile[i].length()-2) + "/Settings"); + QString origName = s.readEntry("/name", "unnamed"); + QString sName = origName; + if(listView_ls->findItem(sName, 0)) { + for(int i = 2; listView_ls->findItem(sName, 0); i++) { + QString num = QString().setNum(i); + sName = QString(origName).append(" (" + num + ")" ); + } + } + new QListViewItem(listView_ls, sName); + schemeList->append( new SchemeEntry(schemeFile[i], sName, deletable )); + + s.endGroup(); + } +} + +void DominoStyleConfig::slotDelPerm(QListViewItem* li) { + + if(!li) + return; + + SchemeEntry * entry; + QString selected = li->text(0); + + for ( entry = schemeList->first(); entry; entry = schemeList->next() ) { + if(!strcmp(entry->getSchemeName(), selected)) { + deleteButton->setEnabled(entry->isDeletable()); + return; + } + } +} + + +void DominoStyleConfig::slotImport() { + + KURL file ( KFileDialog::getOpenFileName(QString::null, QString::null, this) ); + if ( file.isEmpty() ) + return; + + QString sFile = file.fileName( false ); + + KSimpleConfig *config = new KSimpleConfig(file.directory(false)+sFile); + config->setGroup("Settings"); + QString cName = config->readEntry("name", i18n("unnamed")); + delete config; + + QString fName = "domino_" + cName.simplifyWhiteSpace().lower() + "rc"; + + if (!listView_ls->findItem(cName, 0)) { + new QListViewItem(listView_ls, cName); + schemeList->append( new SchemeEntry(fName, cName, true )); + } + else { + int result = KMessageBox::warningContinueCancel(this, i18n("A config scheme with the name '%1' already exists.\n" + "Do you want to overwrite it?\n").arg(cName), + i18n("Save Config Scheme"), i18n("Overwrite")); + if (result == KMessageBox::Cancel) + return; + } + + QString saveDir = QDir::homeDirPath() + "/.qt/"; + if (!KIO::NetAccess::file_copy(file, KURL( saveDir+fName ), -1, true ) ) + { + KMessageBox::error(this, KIO::NetAccess::lastErrorString(),i18n("Import failed.")); + return; + } +} + + + + + + +void DominoStyleConfig::scrollBar1GradientChanged() { + scrollBarNumGradientsChanged(1); +} + +void DominoStyleConfig::scrollBar2GradientChanged() { + scrollBarNumGradientsChanged(2); +} + +void DominoStyleConfig::scrollBarNumGradientsChanged(int g) { + + switch(g) { + case 2: + if(groupBox9_2_2_2_2_4->isChecked() && !groupBox8_2_2_2_2_4->isChecked()) + groupBox8_2_2_2_2_4->setChecked(true); + break; + case 1: + if(groupBox9_2_2_2_2_4->isChecked()) + groupBox9_2_2_2_2_4->setChecked(false); + default: + break; + } + + int c = groupBox9_2_2_2_2_4->isChecked() ? 2 : groupBox8_2_2_2_2_4->isChecked() ? 1 : 0; + currentScrollBarSurface->numGradients = c; + + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + scrollBar5->repaint(false); + scrollBar6->repaint(false); +} + +void DominoStyleConfig::btn1GradientChanged() { + btnNumGradientsChanged(1); +} + +void DominoStyleConfig::btn2GradientChanged() { + btnNumGradientsChanged(2); +} + +void DominoStyleConfig::btnNumGradientsChanged(int g) { + + switch(g) { + case 2: + if(groupBox9_2_2_2->isChecked() && !groupBox8_2_2_2->isChecked()) + groupBox8_2_2_2->setChecked(true); + break; + case 1: + if(groupBox9_2_2_2->isChecked()) + groupBox9_2_2_2->setChecked(false); + default: + break; + } + + int c = groupBox9_2_2_2->isChecked() ? 2 : groupBox8_2_2_2->isChecked() ? 1 : 0; + previewStyle->btnSurface.numGradients = c; + + spinBox44->spinWidget()->repaint(false); + comboBox17->repaint(false); + pushButton16->repaint(false); +} + +void DominoStyleConfig::header1GradientChanged() { + headerNumGradientsChanged(1); +} + +void DominoStyleConfig::header2GradientChanged() { + headerNumGradientsChanged(2); +} + +void DominoStyleConfig::headerNumGradientsChanged(int g) { + + switch(g) { + case 2: + if(groupBox9_2_2_2_2_4_3->isChecked() && !groupBox8_2_2_2_2_4_3->isChecked()) + groupBox8_2_2_2_2_4_3->setChecked(true); + break; + case 1: + if(groupBox9_2_2_2_2_4_3->isChecked()) + groupBox9_2_2_2_2_4_3->setChecked(false); + default: + break; + } + + int c = groupBox9_2_2_2_2_4_3->isChecked() ? 2 : groupBox8_2_2_2_2_4_3->isChecked() ? 1 : 0; + previewStyle->headerSurface.numGradients = c; + + header1->setBackgroundMode(Qt::PaletteBackground); + header1->repaint(false); +} + +void DominoStyleConfig::checkItem1GradientChanged() { + checkItemNumGradientsChanged(1); +} + +void DominoStyleConfig::checkItem2GradientChanged() { + checkItemNumGradientsChanged(2); +} + +void DominoStyleConfig::checkItemNumGradientsChanged(int g) { + + switch(g) { + case 2: + if(groupBox9_2_2_2_2_4_3_2->isChecked() && !groupBox8_2_2_2_2_4_3_2->isChecked()) + groupBox8_2_2_2_2_4_3_2->setChecked(true); + break; + case 1: + if(groupBox9_2_2_2_2_4_3_2->isChecked()) + groupBox9_2_2_2_2_4_3_2->setChecked(false); + default: + break; + } + + int c = groupBox9_2_2_2_2_4_3_2->isChecked() ? 2 : groupBox8_2_2_2_2_4_3_2->isChecked() ? 1 : 0; + previewStyle->checkItemSurface.numGradients = c; + + checkBox2->repaint(false); + radioButton2->repaint(false); +} + +void DominoStyleConfig::tab1GradientChanged() { + tabNumGradientsChanged(1); +} + +void DominoStyleConfig::tab2GradientChanged() { + tabNumGradientsChanged(2); +} + +void DominoStyleConfig::tabNumGradientsChanged(int g) { + + switch(g) { + case 2: + if(groupBox9_2_2_2_2->isChecked() && !groupBox8_2_2_2_2->isChecked()) + groupBox8_2_2_2_2->setChecked(true); + break; + case 1: + if(groupBox9_2_2_2_2->isChecked()) + groupBox9_2_2_2_2->setChecked(false); + default: + break; + } + int c = groupBox9_2_2_2_2->isChecked() ? 2 : groupBox8_2_2_2_2->isChecked() ? 1 : 0; + currentTabSurface->numGradients = c; + + tabBarTop->repaint(false); + tabBarBottom->repaint(false); +} + + +// Accept color drops on tabs. +void DominoStyleConfig::testCanDecode(const QDragMoveEvent * e, bool & accept) { + accept = e->provides("application/x-color"); +} + +void DominoStyleConfig::resetGroupBoxBackgroundColor() { + QColor bg = qApp->palette().active().background(); + gb1->setPaletteBackgroundColor(bg); + gb2->setPaletteBackgroundColor(bg); + gb3->setPaletteBackgroundColor(bg); +} + +void DominoStyleConfig::textEffectModeChanged() { + bool enable = (bool)textEffectModeCombo->currentItem(); + textEffectPrevWidget->setEnabled(enable); + textEffectColor->setEnabled(enable); + textEffectOpacity->setEnabled(enable); + textEffectPos->setEnabled(enable); + +} +void DominoStyleConfig::indicatorModeChanged() { + // bool 0=underline, 1=outline + bool enable = indicatorModeCombo->currentItem() ? false : true; + indicatorBtnColor->setEnabled(enable); + indicatorBtnOpacity->setEnabled(enable); + indicatorColor->setEnabled(enable); + indicatorOpacity->setEnabled(enable); + +} + + +void TabWidgetIndicator::paintEvent(QPaintEvent*) { + + // index: bottom = 1, top = 0 + bool topTabSelected = tabPosCombo->currentItem() == 0; + // index: inactive = 1, active = 0 + bool activeTabSelected = tabStateCombo->currentItem() == 0; + DominoKTabPrevWidget* tw = (DominoKTabPrevWidget*) (topTabSelected ? prevTopTabWidget : prevBottomTabWidget); + QWidget* w = tw->currentPage(); + QTabBar* tabBar = tw->tabBar(); + QRect pr = w->rect(); + QRect tr1; + QRect tr2; + + QPoint point = w->mapToParent(QPoint(0,0)); + + QPixmap arrow_tmp = tintImage( topTabSelected ? config_findImage("tabIndicatorArrow") : config_findImage("tabIndicatorArrow").mirror(), qApp->palette().active().foreground()); + QPixmap arrow(arrow_tmp.size()); + arrow.fill(paletteBackgroundColor()); + bitBlt(&arrow, 0, 0, &arrow_tmp); + + QPainter p(w); + if(activeTabSelected) { + tr1 = tabBar->tabAt(tw->currentPageIndex())->rect(); + tr1.moveBy(-point.x()+tabBar->geometry().x(), 0); + if(topTabSelected) { + p.drawPixmap(tr1.x()+tr1.width()/2-arrow.width()/2, tr1.y()+tr1.height()/2-arrow.height()/2, arrow); + } + else { + p.drawPixmap(tr1.x()+tr1.width()/2-arrow.width()/2, tr1.y()+tr1.height()/2-arrow.height()/2, arrow); + } + } + else { + switch(tabBar->currentTab()) { + case 0: + tr1 = tabBar->tabAt(1)->rect(); + tr2 = tabBar->tabAt(2)->rect(); + break; + case 1: + tr1 = tabBar->tabAt(0)->rect(); + tr2 = tabBar->tabAt(2)->rect(); + break; + case 2: + tr1 = tabBar->tabAt(0)->rect(); + tr2 = tabBar->tabAt(1)->rect(); + break; + default: + break; + } + + tr1.moveBy(-point.x()+tabBar->geometry().x(), 0); + tr2.moveBy(-point.x()+tabBar->geometry().x(), 0); + p.drawPixmap(tr1.x()+tr1.width()/2-arrow.width()/2, tr1.y()+tr1.height()/2-arrow.height()/2, arrow); + p.drawPixmap(tr2.x()+tr2.width()/2-arrow.width()/2, tr2.y()+tr2.height()/2-arrow.height()/2, arrow); + } + +} + +void DominoStyleConfig::grValueLabelNum(int num) { + grValueLabel->setNum(num <= 0 ? QABS(num) : -num); +} + + +void DominoStyleConfig::updateTextEffectSettings() { + + QPoint pos; + switch(textEffectPos->currentItem()) { + case 0: + pos = QPoint(-1,-1); + break; + case 1: + pos = QPoint(0,-1); + break; + case 2: + pos = QPoint(1,-1); + break; + case 3: + pos= QPoint(1,0); + break; + case 4: + pos = QPoint(1,1); + break; + case 5: + pos = QPoint(0,1); + break; + case 6: + pos = QPoint(-1,1); + break; + case 7: + pos = QPoint(-1,0); + break; + default: + pos = QPoint(0,1); + } + + previewStyle->textEffectSettings.pos = pos; + previewStyle->textEffectSettings.color = textEffectColor->color(); + previewStyle->textEffectSettings.opacity = textEffectOpacity->value()*255/100; + previewStyle->textEffectSettings.mode = (TextEffect)(textEffectModeCombo->currentItem()+1); + + + switch(textEffectButtonPos->currentItem()) { + case 0: + pos = QPoint(-1,-1); + break; + case 1: + pos = QPoint(0,-1); + break; + case 2: + pos = QPoint(1,-1); + break; + case 3: + pos= QPoint(1,0); + break; + case 4: + pos = QPoint(1,1); + break; + case 5: + pos = QPoint(0,1); + break; + case 6: + pos = QPoint(-1,1); + break; + case 7: + pos = QPoint(-1,0); + break; + default: + pos = QPoint(0,1); + } + + previewStyle->textEffectSettings.buttonPos = pos; + previewStyle->textEffectSettings.buttonColor = textEffectButtonColor->color(); + previewStyle->textEffectSettings.buttonOpacity = textEffectButtonOpacity->value()*255/100; + + textEffectPrevWidget->update(); + textEffectPrevButton->update(); + + indicatorPrevButton->update(); + indicatorPrevWidget->update(); + +} + +void DominoStyleConfig::updateFocusIndicatorSettings() { + + previewStyle->focusIndicatorSettings.color = indicatorColor->color(); + previewStyle->focusIndicatorSettings.opacity = indicatorOpacity->value()*255/100; + previewStyle->focusIndicatorSettings.buttonColor = indicatorBtnColor->color(); + previewStyle->focusIndicatorSettings.buttonOpacity = indicatorBtnOpacity->value()*255/100; + // 0=underline, 1=outline + previewStyle->focusIndicatorSettings.drawUnderline = indicatorModeCombo->currentItem() == 1; + previewStyle->focusIndicatorSettings.indicateFocus = indicateFocus->isChecked(); + + indicatorPrevButton->update(); + indicatorPrevWidget->update(); +} + + + + +void DominoStyleConfig::updateButtonContourSettings() { + + + delete previewStyle->buttonContour; + previewStyle->buttonContour = new ButtonContour(); + + previewStyle->buttonContour->setDefaultType((ContourType)buttonContourType->currentItem(), false); + previewStyle->buttonContour->setColor(Contour_Default, buttonContourColor->color()); + previewStyle->buttonContour->setColor(Contour_Pressed, buttonPressedContourColor->color()); + previewStyle->buttonContour->setColor(Contour_MouseOver, buttonMouseOverContourColor->color()); + previewStyle->buttonContour->setColor(Contour_DefaultButton, buttonDefaultButtonContourColor->color()); + previewStyle->buttonContour->drawButtonSunkenShadow = drawButtonSunkenShadow->isChecked(); + previewStyle->buttonContour->setDefaultType((ContourType)buttonContourType->currentItem(), true); + + // update all preview widgets with a button contour + textEffectPrevButton->update(); + indicatorPrevButton->update(); + buttonContourPrevButton->update(); + previewStyle->removeCachedSbPix(scrollBar5->palette().active().button()); + header1->setBackgroundMode(Qt::PaletteBackground); + + +} + +void DominoStyleConfig::updateCheckItemIndicators() { + + QColor color = customCheckMarkColor->isChecked() ? checkMarkColor->color() : qApp->palette().active().foreground(); + if(color == previewStyle->_checkMarkColor) + return; + + if(previewStyle->checkMark) + delete previewStyle->checkMark; + if(previewStyle->radioIndicator) + delete previewStyle->radioIndicator; + + previewStyle->_checkMarkColor = color; + previewStyle->checkMark = previewStyle->createCheckMark(color); + previewStyle->radioIndicator = previewStyle->createRadioIndicator(color); +} + +void DominoStyleConfig::updateGroupBoxSettings() { + + previewStyle->groupBoxSettings.customColor = customGroupBoxBackgroundColor->isChecked(); + previewStyle->groupBoxSettings.brightness = grSlider->value(); + previewStyle->groupBoxSettings.tintBackground = tintGroupBoxBackground->isChecked(); + previewStyle->groupBoxSettings.color = groupBoxBackgroundColor->color(); + + gb1->setPaletteBackgroundColor(previewStyle->getGroupBoxColor(gb1)); + gb1->update(); + if(customGroupBoxBackgroundColor->isChecked()) // gb1 has a static color + gb2->setPaletteBackgroundColor(previewStyle->getGroupBoxColor(gb2)); + gb2->update(); + gb3->update(); +} + + +void DominoStyleConfig::rubberSelChanged(int) { + rubberBandType = argbRubber->isChecked() ? 1 : lineRubber->isChecked() ? 2 : 3; +} + +void DominoStyleConfig::updateArgbRubberOptions(bool enabled) { + if(!hasCompositeExtension) + return; + + labelArgbRubberColor->setEnabled(enabled); + argbRubberColor->setEnabled(enabled); + labelArgbRubberOpacity->setEnabled(enabled); + argbRubberOpacity->setEnabled(enabled); +} + + +#include "dominoconf.moc" diff --git a/dominoConfig/dominoconf.h b/dominoConfig/dominoconf.h new file mode 100644 index 0000000..cac92b4 --- /dev/null +++ b/dominoConfig/dominoconf.h @@ -0,0 +1,730 @@ +/* +Copyright (C) 2006 Michael Lentner + +based on the Plastik configuration dialog: +Copyright (C) 2003 Sandro Giessl + +based on the Keramik configuration dialog: +Copyright (c) 2003 Maksim Orlovich + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef DOMINO_CONF_H +#define DOMINO_CONF_H + +#include <../domino/domino.h> +#include + + +class DSpinBox; +class PreviewCheckBox; +class PreviewRadioButton; +class PreviewTabBar; +class IndicatorPrevButton; +class IndicatorPrevWidget; +class DominoKTabWidget; +class TextEffectPrevWidget; +class TextEffectPrevButton; +class DominoKTabPrevWidget; +class TabWidgetIndicator; +class DominoStyleConfig; + +DominoStyleConfig* styleConfig; + +struct DSurface; + +class SchemeEntry { + public: + SchemeEntry(const QString &_fileName, const QString &_schemeName, const bool &_deletable) + : fileName(_fileName), schemeName(_schemeName), deletable(_deletable) { } + + QString getSchemeName() const { return schemeName; } + QString getFileName() const { return fileName; } + bool isDeletable() const { return deletable; } + + private: + QString fileName; + QString schemeName; + bool deletable; +}; + +class SchemeList : public QPtrList { + public: + SchemeList() + { setAutoDelete(true); } +}; + +class DominoStyleConfig: public QWidget +{ + Q_OBJECT +public: + DominoStyleConfig(QWidget* parent); + ~DominoStyleConfig(); + + QFrame* frame3; + QListBox* listBox1; + QHeader* header1; + + DominoKTabWidget* tabWidget2; + QWidget* tab1; + QGroupBox* groupBox22; + QLabel* textLabel1_2; + KColorButton* kColorButton27_2; + QGroupBox* groupBox10_2_2_2; + QPushButton* pushButton16; + QGroupBox* groupBox8_2_2_2; + QLabel* textLabel4_3_2_2_2; + DSpinBox* spinBox2_2_2_2_2; + QLabel* textLabel2_2_2_2_2; + KColorButton* kColorButton1_2_2_2_2; + QLabel* textLabel3_3_2_2_2; + DSpinBox* spinBox1_2_2_2_2; + QLabel* textLabel1_4_2_2_2; + KColorButton* kColorButton2_4_2_2_2; + QGroupBox* groupBox9_2_2_2; + QLabel* textLabel4_4_2_2_2; + DSpinBox* spinBox2_3_2_2_2; + QLabel* textLabel3_4_2_2_2; + DSpinBox* spinBox1_3_2_2_2; + KColorButton* kColorButton1_3_2_2_2; + KColorButton* kColorButton2_5_2_2_2; + QLabel* textLabel1_5_2_2_2; + QLabel* textLabel2_3_2_2_2; + QLabel* textLabel7_4; + QComboBox* comboBox3_4; + QPushButton* pushButton4_4; + QWidget* tab2; + QGroupBox* groupBox22_2; + QGroupBox* groupBox8_2_2_2_2; + QLabel* textLabel4_3_2_2_2_2; + DSpinBox* spinBox2_2_2_2_2_2; + QLabel* textLabel2_2_2_2_2_2; + KColorButton* kColorButton1_2_2_2_2_2; + QLabel* textLabel3_3_2_2_2_2; + DSpinBox* spinBox1_2_2_2_2_2; + QLabel* textLabel1_4_2_2_2_2; + KColorButton* kColorButton2_4_2_2_2_2; + QGroupBox* groupBox9_2_2_2_2; + QLabel* textLabel4_4_2_2_2_2; + DSpinBox* spinBox2_3_2_2_2_2; + QLabel* textLabel3_4_2_2_2_2; + DSpinBox* spinBox1_3_2_2_2_2; + KColorButton* kColorButton1_3_2_2_2_2; + KColorButton* kColorButton2_5_2_2_2_2; + QLabel* textLabel1_5_2_2_2_2; + QLabel* textLabel2_3_2_2_2_2; + QLabel* textLabel1_2_2; + KColorButton* kColorButton27_2_2; + QGroupBox* groupBox10_2_2_2_2; + QComboBox* comboBox17; + DSpinBox* spinBox44; + QLabel* textLabel7_4_2; + QComboBox* comboBox3_4_2; + QPushButton* pushButton4_4_2; + QWidget* tab3; + QGroupBox* groupBox22_2_2; + QGroupBox* groupBox8_2_2_2_2_4; + QLabel* textLabel4_3_2_2_2_2_4; + DSpinBox* spinBox2_2_2_2_2_2_4; + QLabel* textLabel2_2_2_2_2_2_4; + KColorButton* kColorButton1_2_2_2_2_2_4; + QLabel* textLabel3_3_2_2_2_2_4; + DSpinBox* spinBox1_2_2_2_2_2_4; + QLabel* textLabel1_4_2_2_2_2_4; + KColorButton* kColorButton2_4_2_2_2_2_4; + QGroupBox* groupBox9_2_2_2_2_4; + QLabel* textLabel4_4_2_2_2_2_4; + DSpinBox* spinBox2_3_2_2_2_2_4; + QLabel* textLabel3_4_2_2_2_2_4; + DSpinBox* spinBox1_3_2_2_2_2_4; + KColorButton* kColorButton1_3_2_2_2_2_4; + KColorButton* kColorButton2_5_2_2_2_2_4; + QLabel* textLabel1_5_2_2_2_2_4; + QLabel* textLabel2_3_2_2_2_2_4; + QGroupBox* groupBox10_2_2_2_2_4; + QScrollBar* scrollBar5; + QScrollBar* scrollBar6; + KColorButton* kColorButton27_2_2_2; + QLabel* textLabel1_2_2_2; + QComboBox* comboBox7; + QLabel* textLabel7_4_2_3; + QComboBox* comboBox3_4_2_3; + QPushButton* pushButton4_4_2_3; + QWidget* tab4; + QGroupBox* groupBox22_2_2_3; + KColorButton* kColorButton27_2_2_2_2; + QLabel* textLabel1_2_2_2_2; + QGroupBox* groupBox10_2_2_2_2_4_3; + QGroupBox* groupBox8_2_2_2_2_4_3; + QLabel* textLabel4_3_2_2_2_2_4_3; + DSpinBox* spinBox2_2_2_2_2_2_4_3; + QLabel* textLabel2_2_2_2_2_2_4_3; + KColorButton* kColorButton1_2_2_2_2_2_4_3; + QLabel* textLabel3_3_2_2_2_2_4_3; + DSpinBox* spinBox1_2_2_2_2_2_4_3; + QLabel* textLabel1_4_2_2_2_2_4_3; + KColorButton* kColorButton2_4_2_2_2_2_4_3; + QGroupBox* groupBox9_2_2_2_2_4_3; + QLabel* textLabel4_4_2_2_2_2_4_3; + DSpinBox* spinBox2_3_2_2_2_2_4_3; + QLabel* textLabel3_4_2_2_2_2_4_3; + DSpinBox* spinBox1_3_2_2_2_2_4_3; + KColorButton* kColorButton1_3_2_2_2_2_4_3; + KColorButton* kColorButton2_5_2_2_2_2_4_3; + QLabel* textLabel1_5_2_2_2_2_4_3; + QLabel* textLabel2_3_2_2_2_2_4_3; + QLabel* textLabel7_4_2_3_3; + QComboBox* comboBox3_4_2_3_3; + QPushButton* pushButton4_4_2_3_3; + QWidget* tab5; + QGroupBox* groupBox22_2_2_3_2; + QGroupBox* groupBox8_2_2_2_2_4_3_2; + QLabel* textLabel4_3_2_2_2_2_4_3_2; + DSpinBox* spinBox2_2_2_2_2_2_4_3_2; + QLabel* textLabel2_2_2_2_2_2_4_3_2; + KColorButton* kColorButton1_2_2_2_2_2_4_3_2; + QLabel* textLabel3_3_2_2_2_2_4_3_2; + DSpinBox* spinBox1_2_2_2_2_2_4_3_2; + QLabel* textLabel1_4_2_2_2_2_4_3_2; + KColorButton* kColorButton2_4_2_2_2_2_4_3_2; + KColorButton* kColorButton27_2_2_2_3; + QLabel* textLabel1_2_2_2_3; + QGroupBox* groupBox10_2_2_2_2_4_3_2; + PreviewRadioButton* radioButton2; + PreviewCheckBox* checkBox2; + QGroupBox* groupBox9_2_2_2_2_4_3_2; + QLabel* textLabel4_4_2_2_2_2_4_3_2; + DSpinBox* spinBox2_3_2_2_2_2_4_3_2; + QLabel* textLabel3_4_2_2_2_2_4_3_2; + DSpinBox* spinBox1_3_2_2_2_2_4_3_2; + KColorButton* kColorButton1_3_2_2_2_2_4_3_2; + KColorButton* kColorButton2_5_2_2_2_2_4_3_2; + QLabel* textLabel1_5_2_2_2_2_4_3_2; + QLabel* textLabel2_3_2_2_2_2_4_3_2; + QLabel* textLabel7_4_2_3_3_2; + QComboBox* comboBox3_4_2_3_3_2; + QPushButton* pushButton4_4_2_3_3_2; +// KTabWidget *prevTopTabWidget; +// KTabWidget *prevBottomTabWidget; + TabWidgetIndicator* prevBottomPage1; + TabWidgetIndicator* prevBottomPage2; + TabWidgetIndicator* prevBottomPage3; + TabWidgetIndicator* prevTopPage1; + TabWidgetIndicator* prevTopPage2; + TabWidgetIndicator* prevTopPage3; + PreviewTabBar* tabBarBottom; + PreviewTabBar* tabBarTop; + QHBoxLayout* tabComboLayout; + + + // tab 3 - load/save +// KTabWidget* tabWidget3; + QWidget* tab; + QGroupBox* groupBox_ls; + QListView* listView_ls; + QPushButton* loadButton; + QPushButton* saveButton; + QPushButton* deleteButton; + QPushButton* importButton; + QWidget* tab_2; + + // focusIndicator + QGroupBox* indicateFocusFrame; + QCheckBox* indicateFocus; + QLabel* labelIndicatorColor; + QLabel* labelIndicatorBtnColor; + IndicatorPrevWidget* indicatorPrevWidget; + IndicatorPrevButton* indicatorPrevButton; + QLabel* labelIndicatorColorOpacity; + QLabel* labelIndicatorBtnColorOpacity; + + QGroupBox* gb1; + QGroupBox* gb2; + QGroupBox* gb3; + + // text effect + QGroupBox* textEffectFrame; + QLabel* labelTextEffectColor; + QLabel* labelTextEffectButtonColor; + TextEffectPrevWidget* textEffectPrevWidget; + TextEffectPrevButton* textEffectPrevButton; + QLabel* labelTextEffectColorOpacity; + QLabel* labelTextEffectButtonColorOpacity; + QLabel* labelTextEffectPos; + QLabel* labelTextEffectButtonPos; + + QCheckBox* drawButtonSunkenShadow; + + QLabel* buttonTypLabel; + QLabel* labelButtonContourColors; + QPushButton* buttonContourPrevButton; + QLabel* labelPopupMenuOptions; + +signals: + void changed(bool); + +public slots: + void save(); + void defaults(); + void userLoadTabConfig(); + +protected slots: + void updateChanged(); + virtual void languageChange(); + void userLoadScrollBarConfig(); + void testCanDecode(const QDragMoveEvent * e, bool & accept); + +private slots: + void btnPv1(const QColor&); + void btnPv2(const QColor&); + void btnPv3(const QColor&); + void btnPv4(const QColor&); + void btnPv5(const QColor&); + void btnPv6(int); + void btnPv7(int); + void btnPv8(int); + void btnPv9(int); + + void hPv1(const QColor&); + void hPv2(const QColor&); + void hPv3(const QColor&); + void hPv4(const QColor&); + void hPv5(const QColor&); + void hPv6(int); + void hPv7(int); + void hPv8(int); + void hPv9(int); + + void chbPv1(const QColor&); + void chbPv2(const QColor&); + void chbPv3(const QColor&); + void chbPv4(const QColor&); + void chbPv5(const QColor&); + void chbPv6(int); + void chbPv7(int); + void chbPv8(int); + void chbPv9(int); + + void sbPv1(const QColor&); + void sbPv2(const QColor&); + void sbPv3(const QColor&); + void sbPv4(const QColor&); + void sbPv5(const QColor&); + void sbPv6(int); + void sbPv7(int); + void sbPv8(int); + void sbPv9(int); + + void tabPv1(const QColor&col); + void tabPv2(const QColor&col); + void tabPv3(const QColor&col); + void tabPv4(const QColor&col); + void tabPv5(const QColor&col); + void tabPv6(int); + void tabPv7(int); + void tabPv8(int); + void tabPv9(int); + + + void slotLoad(); + void slotSave(); + void slotDelete(); + void slotImport(); + void slotDelPerm(QListViewItem*); + void scrollBar1GradientChanged(); + void scrollBar2GradientChanged(); + void scrollBarNumGradientsChanged(int g=0); + void btn1GradientChanged(); + void btn2GradientChanged(); + void btnNumGradientsChanged(int g=0); + void header1GradientChanged(); + void header2GradientChanged(); + void headerNumGradientsChanged(int g=0); + void checkItem1GradientChanged(); + void checkItem2GradientChanged(); + void checkItemNumGradientsChanged(int g=0); + void tab1GradientChanged(); + void tab2GradientChanged(); + void tabNumGradientsChanged(int g=0); + + void copyColorsToButton(); + void copyColorsToTab(); + void copyColorsToScrollBar(); + void copyColorsToHeader(); + void copyColorsToCheckItem(); + + void resetGroupBoxBackgroundColor(); + + void textEffectModeChanged(); + void indicatorModeChanged(); + + void grValueLabelNum(int num); + void updateButtonContourSettings(); + void updateTextEffectSettings(); + void updateCheckItemIndicators(); + void updateFocusIndicatorSettings(); + void updateGroupBoxSettings(); + + void rubberSelChanged(int); + void updateArgbRubberOptions(bool); + +protected: + + bool hasCompositeExtension; + + QVBoxLayout* frame3Layout; + QVBoxLayout* layout1; + QGroupBox* grFrame; + QLabel* grValueLabel; + + //We store settings directly in widgets to + //avoid the hassle of sync'ing things + QCheckBox* animateProgressBar; + QCheckBox* drawTriangularExpander; + QCheckBox* customCheckMarkColor; + KColorButton* checkMarkColor; + QCheckBox* customToolTipColor; + KColorButton* toolTipColor; + QCheckBox* highlightToolBtnIcons; + QCheckBox* toolBtnAsBtn; + + QLabel* labelRubberOptions; + QRadioButton* argbRubber; + QRadioButton* lineRubber; + QRadioButton* distRubber; + int rubberBandType; + + QLabel* labelArgbRubberColor; + QLabel* labelArgbRubberOpacity; + KColorButton* argbRubberColor; + DSpinBox* argbRubberOpacity; + + QCheckBox* smoothScrolling; + DSpinBox* buttonHeightAdjustment; + QLabel* buttonHeightAdjustmentLabel; + QCheckBox* customPopupMenuColor; + KColorButton* popupMenuColor; + QCheckBox* centerTabs; + QCheckBox* customSelMenuItemColor; + KColorButton* selMenuItemColor; + QCheckBox* drawPopupMenuGradient; + QCheckBox* indentPopupMenuItems; + + //Original settings, for accurate dirtiness tracking + bool origAnimProgressBar; + bool origDrawTriangularExpander; + bool origToolBtnAsBtn; + bool origHighlightToolBtnIcons; + + bool origCustomCheckMarkColor; + QColor origCheckMarkColor; + bool origTintGroupBoxBackground; + int origGroupBoxBrightness; + bool origCustomGroupBoxBackgroundColor; + QColor origGroupBoxBackgroundColor; + + bool origCustomToolTipColor; + QColor origToolTipColor; + + int origRubberBandType; + QColor origArgbRubberColor; + int origArgbRubberOpacity; + + bool origSmoothScrolling; + int origButtonHeightAdjustment; + int origButtonContourType; + bool origCustomPopupMenuColor; + QColor origPopupMenuColor; + bool origCustomSelMenuItemColor; + QColor origSelMenuItemColor; + bool origDrawPopupMenuGradient; + bool origIndentPopupMenuItems; + + bool origCenterTabs; + bool origIndicateFocus; + QColor origIndicatorColor; + QColor origIndicatorBtnColor; + int origIndicatorOpacity; + int origIndicatorBtnOpacity; + + bool origDrawUnderline; + int origTextEffectMode; + QColor origTextEffectColor; + QColor origTextEffectButtonColor; + bool origDrawTextEffect; + int origTextEffectOpacity; + int origTextEffectButtonOpacity; + int origTextEffectPos; + int origTextEffectButtonPos; + + bool origDrawButtonSunkenShadow; + + QColor origButtonContourColor; + QColor origButtonDefaultButtonContourColor; + QColor origButtonMouseOverContourColor; + QColor origButtonPressedContourColor; + + + int konqTabBarContrast; + + QString currentConfig; + QLabel* currentConfigLabel; + + SchemeList* schemeList; + bool configLoaded; + DSurface* currentScrollBarSurface; + DSurface* currentTabSurface; + + void loadConfig(const char* name); + void saveConfig(const char* fileName, const char* schemeName); + void getConfigSchemes(); + + + + //////////////////////////////////////////////// form: + //protected: + QVBoxLayout* tab1Layout; + QGridLayout* groupBox22Layout; + QSpacerItem* spacer6; + QSpacerItem* spacer3; + QSpacerItem* spacer43; + QSpacerItem* spacer46; + QSpacerItem* spacer2; + QVBoxLayout* groupBox10_2_2_2Layout; + QGridLayout* groupBox8_2_2_2Layout; + QGridLayout* groupBox9_2_2_2Layout; + QHBoxLayout* layout9; + QSpacerItem* spacer7; + QVBoxLayout* tab2Layout; + QGridLayout* groupBox22_2Layout; + QSpacerItem* spacer46_2; + QSpacerItem* spacer43_2; + QSpacerItem* spacer6_2; + QSpacerItem* spacer2_2; + QSpacerItem* spacer3_2; + QGridLayout* groupBox8_2_2_2_2Layout; + QGridLayout* groupBox9_2_2_2_2Layout; + QVBoxLayout* groupBox10_2_2_2_2Layout; + QHBoxLayout* layout9_2; + QSpacerItem* spacer7_2; + QVBoxLayout* tab3Layout; + QGridLayout* groupBox22_2_2Layout; + QSpacerItem* spacer46_2_2; + QSpacerItem* spacer43_2_2; + QSpacerItem* spacer3_2_2; + QSpacerItem* spacer6_2_2; + QSpacerItem* spacer2_2_2; + QGridLayout* groupBox8_2_2_2_2_4Layout; + QGridLayout* groupBox9_2_2_2_2_4Layout; + QGridLayout* groupBox10_2_2_2_2_4Layout; + QSpacerItem* spacer35; + QHBoxLayout* layout6; + QSpacerItem* spacer7_2_3; + QVBoxLayout* tab4Layout; + QGridLayout* groupBox22_2_2_3Layout; + QSpacerItem* spacer3_2_2_2; + QSpacerItem* spacer6_2_2_2; + QSpacerItem* spacer2_2_2_2; + QSpacerItem* spacer46_2_2_2; + QSpacerItem* spacer43_2_2_2; + QVBoxLayout* groupBox10_2_2_2_2_4_3Layout; + QGridLayout* groupBox8_2_2_2_2_4_3Layout; + QGridLayout* groupBox9_2_2_2_2_4_3Layout; + QHBoxLayout* layout21; + QSpacerItem* spacer7_2_3_3; + QVBoxLayout* tab5Layout; + QGridLayout* groupBox22_2_2_3_2Layout; + QSpacerItem* spacer3_2_2_3; + QSpacerItem* spacer6_2_2_3; + QSpacerItem* spacer2_2_2_3; + QSpacerItem* spacer46_2_2_3; + QSpacerItem* spacer43_2_2_2_2; + QGridLayout* groupBox8_2_2_2_2_4_3_2Layout; + QVBoxLayout* groupBox10_2_2_2_2_4_3_2Layout; + QGridLayout* groupBox9_2_2_2_2_4_3_2Layout; + QHBoxLayout* layout22; + QSpacerItem* spacer7_2_3_3_2; + + // tab 3 - load/save + QVBoxLayout* tab_lsLayout; + QHBoxLayout* groupBox_lsLayout; + QVBoxLayout* layout8; + QSpacerItem* spacer32; + +}; + + + + +class DSpinBox : public QSpinBox +{ +public: + DSpinBox(QWidget *parent, const char* name=0): QSpinBox(parent, name){}; + DSpinBox( int minValue, int maxValue, int step = 1, QWidget* parent=0, const char* name=0 ): QSpinBox(minValue, maxValue, step, parent, name){}; + void setAlignRight() { + this->editor()->setAlignment(Qt::AlignRight); + } + QSpinWidget* spinWidget() { + return static_cast(editor()->parentWidget()); + } +}; + +class PreviewCheckBox : public QCheckBox +{ + public: + PreviewCheckBox(QWidget *parent, const char * name = 0 ): QCheckBox( parent, name){}; + void paintEvent(QPaintEvent *event); + void drawButton(QPainter *paint); +}; + +class PreviewRadioButton : public QRadioButton +{ + public: + PreviewRadioButton(QWidget *parent, const char * name = 0 ): QRadioButton( parent, name){}; + void paintEvent(QPaintEvent *event); + void drawButton(QPainter *paint); +}; + + +class PreviewTabBar : public QTabBar +{ + public: + PreviewTabBar(QWidget *parent, const char * name = 0 ): QTabBar( parent, name){}; + void mousePressEvent(QMouseEvent* event); + void paintEvent(QPaintEvent *event); +}; + +class IndicatorPrevButton : public QPushButton +{ + public: + IndicatorPrevButton(QWidget *parent, const char * name = 0 ): QPushButton( parent, name){}; + void paintEvent(QPaintEvent *event); +}; + +class IndicatorPrevWidget : public QPushButton /*QWidget*/ +{ + public: + IndicatorPrevWidget(QWidget *parent, const char * name = 0) : QPushButton( parent, name){}; + void paintEvent(QPaintEvent *event); +}; + +class DominoKTabWidget : public KTabWidget +{ + Q_OBJECT + friend class DominoStyleConfig; + public: + DominoKTabWidget( QWidget* parent=0, const char* name=0 ) : KTabWidget( parent, name ) {} + protected slots: + void wheelDelta( int ) {}; +}; + +class DominoKTabPrevWidget : public KTabWidget +{ + friend class DominoStyleConfig; + friend class TabWidgetIndicator; + public: + DominoKTabPrevWidget( QWidget* parent=0, const char* name=0 ) : KTabWidget( parent, name ) {} +}; + +class TabWidgetIndicator : public QWidget +{ + friend class DominoStyleConfig; + public: + TabWidgetIndicator( QWidget* parent=0, const char* name=0 ) : QWidget( parent, name ) {} + void paintEvent(QPaintEvent *event); +}; + +class TextEffectPrevButton : public QPushButton +{ + public: + TextEffectPrevButton(QWidget *parent, const char * name = 0 ): QPushButton( parent, name){}; + void paintEvent(QPaintEvent *event); +}; + +class TextEffectPrevWidget : public QWidget +{ + public: + TextEffectPrevWidget(QWidget *parent, const char * name = 0, uint flags = 0 ): QWidget( parent, name, flags){}; + void paintEvent(QPaintEvent *event); +}; + +class PreviewStyle : public DominoStyle +{ + friend class IndicatorPrevButton; + friend class DominoStyleConfig; + public: +}; +PreviewStyle* previewStyle; + +DSurface origBtnSurface; +DSurface origTabTopSurface; +DSurface origActiveTabTopSurface; +DSurface origTabBottomSurface; +DSurface origActiveTabBottomSurface; +DSurface origScrollBarSurface; +DSurface origScrollBarGrooveSurface; +DSurface origHeaderSurface; +DSurface origCheckItemSurface; + +// global +bool initialized; + +QComboBox* indicatorModeCombo; +KColorButton* indicatorBtnColor; +KColorButton* indicatorColor; +QString indicatorPreviewText; +QSpinBox* indicatorOpacity; +QSpinBox* indicatorBtnOpacity; + +QCheckBox* tintGroupBoxBackground; +QCheckBox* customGroupBoxBackgroundColor; +KColorButton* groupBoxBackgroundColor; +QSlider* grSlider; + +// text effect +QComboBox* textEffectModeCombo; +QCheckBox* drawTextEffect; +KColorButton* textEffectColor; +KColorButton* textEffectButtonColor; +QString textEffectPreviewText; +QSpinBox* textEffectOpacity; +QSpinBox* textEffectButtonOpacity; + +QComboBox* textEffectPos; +QComboBox* textEffectButtonPos; + +// button contour colors +QComboBox* buttonContourType; + +KColorButton* buttonContourColor; +KColorButton* buttonDefaultButtonContourColor; +KColorButton* buttonMouseOverContourColor; +KColorButton* buttonPressedContourColor; + +QComboBox* tabPosCombo; +QComboBox* tabStateCombo; +DominoKTabPrevWidget *prevTopTabWidget; +DominoKTabPrevWidget *prevBottomTabWidget; + +enum DominoStyleFlags { + Domino_noCache = 0x80000000 +}; +#endif diff --git a/getimages/getimages.cpp b/getimages/getimages.cpp new file mode 100644 index 0000000..8dc2496 --- /dev/null +++ b/getimages/getimages.cpp @@ -0,0 +1,66 @@ +/* + Copyright (C) 2006 Michael Lentner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ +#include +#include "../client/clientData.h" +namespace dembed { +#include "../domino/data.h" +} + + +int main ( int /*argc*/, char **/*argv*/ ) +{ + + QDir d; + d.mkdir("style_pixmaps"); + d.mkdir("client_pixmaps"); + + QImage * img; + + for ( int i = 0; embed_image_vec[i].data; i++ ) { + qDebug("ss"); + img = new QImage((uchar*)embed_image_vec[i].data, + embed_image_vec[i].width, + embed_image_vec[i].height, + embed_image_vec[i].depth, + (QRgb*)embed_image_vec[i].colorTable, + embed_image_vec[i].numColors, + QImage::BigEndian ); + + if ( embed_image_vec[i].alpha ) + img->setAlphaBuffer( TRUE ); + + img->save(QString("style_pixmaps/") + embed_image_vec[i].name + QString(".png"), "PNG"); + delete img; + } + + for ( int i = 0; dembed::embed_image_vec[i].data; i++ ) { + img = new QImage((uchar*)embed_image_vec[i].data, + dembed::embed_image_vec[i].width, + dembed::embed_image_vec[i].height, + dembed::embed_image_vec[i].depth, + (QRgb*)dembed::embed_image_vec[i].colorTable, + dembed::embed_image_vec[i].numColors, + QImage::BigEndian ); + + if ( dembed::embed_image_vec[i].alpha ) + img->setAlphaBuffer( TRUE ); + + img->save(QString("client_pixmaps/") + dembed::embed_image_vec[i].name + QString(".png"), "PNG"); + delete img; + } + return 0; +} diff --git a/getimages/getimages.pro b/getimages/getimages.pro new file mode 100644 index 0000000..86e32ee --- /dev/null +++ b/getimages/getimages.pro @@ -0,0 +1,10 @@ +###################################################################### +# Automatically generated by qmake (1.07a) Thu Jul 19 02:11:17 2007 +###################################################################### + +TEMPLATE = app +CONFIG -= moc +INCLUDEPATH += . + +# Input +SOURCES += getimages.cpp