[Mageia-sysadm] [459] Import cleaned ia ora kde4
root at mageia.org
root at mageia.org
Mon Feb 7 10:05:38 CET 2011
Revision: 459
Author: dmorgan
Date: 2011-02-07 10:04:25 +0100 (Mon, 07 Feb 2011)
Log Message:
-----------
Import cleaned ia ora kde4
Added Paths:
-----------
theme/ia_ora-kde4/
theme/ia_ora-kde4/AUTHORS
theme/ia_ora-kde4/BUGS
theme/ia_ora-kde4/CMakeLists.txt
theme/ia_ora-kde4/INSTALL
theme/ia_ora-kde4/LICENSE
theme/ia_ora-kde4/NEWS
theme/ia_ora-kde4/VERSION
theme/ia_ora-kde4/color-schemes/
theme/ia_ora-kde4/color-schemes/CMakeLists.txt
theme/ia_ora-kde4/color-schemes/IaOraArctic.colors
theme/ia_ora-kde4/color-schemes/IaOraBlue.colors
theme/ia_ora-kde4/color-schemes/IaOraGray.colors
theme/ia_ora-kde4/color-schemes/IaOraNight.colors
theme/ia_ora-kde4/color-schemes/IaOraOrange.colors
theme/ia_ora-kde4/color-schemes/IaOraSmooth.colors
theme/ia_ora-kde4/color-schemes/IaOraSteel.colors
theme/ia_ora-kde4/configure
theme/ia_ora-kde4/install.sh
theme/ia_ora-kde4/kwin-client/
theme/ia_ora-kde4/kwin-client/CMakeLists.txt
theme/ia_ora-kde4/kwin-client/config/
theme/ia_ora-kde4/kwin-client/config/CMakeLists.txt
theme/ia_ora-kde4/kwin-client/config/iaora_config.cpp
theme/ia_ora-kde4/kwin-client/config/iaora_config.h
theme/ia_ora-kde4/kwin-client/config/iaora_config.ui
theme/ia_ora-kde4/kwin-client/iaora.desktop
theme/ia_ora-kde4/kwin-client/kwin_iaora.cpp
theme/ia_ora-kde4/kwin-client/kwin_iaora.h
theme/ia_ora-kde4/src/
theme/ia_ora-kde4/src/.directory
theme/ia_ora-kde4/src/CMakeLists.txt
theme/ia_ora-kde4/src/config/
theme/ia_ora-kde4/src/config/CMakeLists.txt
theme/ia_ora-kde4/src/config/images/
theme/ia_ora-kde4/src/config/images/README
theme/ia_ora-kde4/src/config/sk_config.cpp
theme/ia_ora-kde4/src/config/sk_config.h
theme/ia_ora-kde4/src/config/sk_dialog.ui
theme/ia_ora-kde4/src/config/sk_preview1.ui
theme/ia_ora-kde4/src/config/sk_preview2.qrc
theme/ia_ora-kde4/src/config/sk_preview2.ui
theme/ia_ora-kde4/src/iaora-kde.cpp
theme/ia_ora-kde4/src/iaora-kde.h
theme/ia_ora-kde4/src/iaora-kde.themerc
theme/ia_ora-kde4/src/iaora-qt.cpp
theme/ia_ora-kde4/src/iaora-qt.h
theme/ia_ora-kde4/src/iaoracolors
theme/ia_ora-kde4/src/iaorastyle.cpp
theme/ia_ora-kde4/src/iaorastyle.h
theme/ia_ora-kde4/src/iaorastyle_button.cpp
theme/ia_ora-kde4/src/iaorastyle_combobox.cpp
theme/ia_ora-kde4/src/iaorastyle_dial.cpp
theme/ia_ora-kde4/src/iaorastyle_frame.cpp
theme/ia_ora-kde4/src/iaorastyle_icons.cpp
theme/ia_ora-kde4/src/iaorastyle_menu.cpp
theme/ia_ora-kde4/src/iaorastyle_progressbar.cpp
theme/ia_ora-kde4/src/iaorastyle_q3listview.cpp
theme/ia_ora-kde4/src/iaorastyle_scrollbar.cpp
theme/ia_ora-kde4/src/iaorastyle_slider.cpp
theme/ia_ora-kde4/src/iaorastyle_spinbox.cpp
theme/ia_ora-kde4/src/iaorastyle_symbols.cpp
theme/ia_ora-kde4/src/iaorastyle_tabbar.cpp
theme/ia_ora-kde4/src/iaorastyle_toolbutton.cpp
theme/ia_ora-kde4/src/iaorastyle_window.cpp
theme/ia_ora-kde4/test/
theme/ia_ora-kde4/test/CMakeLists.txt
theme/ia_ora-kde4/test/mainwindow.ui
theme/ia_ora-kde4/test/mywindow.cpp
theme/ia_ora-kde4/test/mywindow.h
theme/ia_ora-kde4/test/qttest.cpp
theme/ia_ora-kde4/uninstall.sh
Added: theme/ia_ora-kde4/AUTHORS
===================================================================
--- theme/ia_ora-kde4/AUTHORS (rev 0)
+++ theme/ia_ora-kde4/AUTHORS 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,4 @@
+Gustavo Pichorim Boiko <boiko at mandriva.com>
+Christoph Feck <christoph at maxiom.de> (original Skulpture author)
+Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+Nicolas Lécureuil <nlecureuil at mandriva.com>
Added: theme/ia_ora-kde4/BUGS
===================================================================
--- theme/ia_ora-kde4/BUGS (rev 0)
+++ theme/ia_ora-kde4/BUGS 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1 @@
+
Added: theme/ia_ora-kde4/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,26 @@
+project (iaora)
+cmake_minimum_required (VERSION 2.4)
+
+find_package (KDE4)
+
+if (KDE4_FOUND)
+ include (KDE4Defaults)
+ include (MacroLibrary)
+ add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} )
+ include_directories (${KDE4_INCLUDES})
+else (KDE4_FOUND)
+ message (STATUS "WARNING: *** KDE4 not found, building a Qt-only version of IaOra ***")
+ set (QT_MIN_VERSION "4.3.0")
+ find_package (Qt4 REQUIRED)
+ include (UseQt4)
+ set (CMAKE_INCLUDE_CURRENT_DIR ON)
+endif (KDE4_FOUND)
+
+add_subdirectory (src)
+add_subdirectory (color-schemes)
+add_subdirectory (test)
+
+if (KDE4_FOUND)
+ add_subdirectory (kwin-client)
+endif (KDE4_FOUND)
+
Property changes on: theme/ia_ora-kde4/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/INSTALL
===================================================================
--- theme/ia_ora-kde4/INSTALL (rev 0)
+++ theme/ia_ora-kde4/INSTALL 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,20 @@
+=== Installing IaOra ===
+
+*** Installation ***
+
+Installation from source requires CMake. To install, type the following at
+the shell prompt within the package directory.
+Note that you are prompted for the root password during installation.
+
+ sh install.sh
+
+
+*** Deinstallation ***
+
+To uninstall, type the following at the shell prompt within the directory
+from which you installed. If you deleted that directory, just install it
+again. Again, you are prompted for the root password.
+
+ sh uninstall.sh
+
+
Added: theme/ia_ora-kde4/LICENSE
===================================================================
--- theme/ia_ora-kde4/LICENSE (rev 0)
+++ theme/ia_ora-kde4/LICENSE 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,676 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. 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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. 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.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ 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.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ 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
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU 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 Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
Added: theme/ia_ora-kde4/NEWS
===================================================================
--- theme/ia_ora-kde4/NEWS (rev 0)
+++ theme/ia_ora-kde4/NEWS 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,109 @@
+01-06-2010 - Rodrigo
+- Changed alternate color to gray0 (according IaOra specs)
+
+27-05-2010 - Rodrigo
+- Removed border from a ScrollBar on a maximized window (#52903)
+- Fixed ProgressBar issue on Quassel (thanks ahmad78!)
+
+18-05-2010 - Rodrigo
+- Added division marks on the progress bar (#59284)
+- Removed left/right borders when in maximized mode
+
+15-04-2010 - Rodrigo
+- Wrong background colors on lists (#56883 and #57079)
+- Fix combobox width on kontact (#55699)
+- Drawing elided text on dockwidget titlebars
+
+** 12-04-2010 0.3.0 **
+09-04-2010 - Rodrigo
+- Fix TitleBar font size problem (#58582)
+- Added borders to comboboxes (#57664)
+- Properly aligned TitleBar buttons (#57784)
+- Rewritten the BorderSize configuration (this closes #47685 too)
+
+07-04-2010 - Rodrigo
+- Added window grouping function to IaOra (tabbing support)
+
+02-03-2010 - Rodrigo
+- Added a patch that fix OpenOffice problem (thanks to Rafael Cabral)
+
+12-02-2010 - Rodrigo
+- Rewritten IaOra Kwin configuration
+- Added option to change TitleBar text alignment (bug #57056)
+- Added option to enable window grouping (not enabled until finished)
+
+** 12 02 2010 0.2.5.6
+
+09-02-2010 - Rodrigo
+- Some components now are left colored when the window lost the focus
+
+** 05 02 2010 0.2.5.5
+
+04-02-2010 - Rodrigo
+- Now, the arrows look like real arrows
+- Added partial contributor patch (according bug #57263)
+- Disabled buttons now have the same color scheme as the enabled ones
+- Fixed separator size on combobox
+
+04-02-2010 - Boiko
+- Fix crash in drawComplexControl ( Bug #57400 )
+
+02-02-2010 - Rodrigo
+- Allow to resize the window from the top
+- TitleBar text now is painted in a bigger font with bold effect
+- Let the scrollbars colored when no focus
+
+13-01-2010 - Rodrigo
+- Fix the color painting on PanelItemViewRow (Bug # 56883)
+
+** 01 09 2009 0.2.5.4
+08-01-2010 - Rodrigo
+- Fix the highligh problem with ItemViewItems (Bug # 56883)
+- Now, the application name on the titlebar is centered
+
+** 01 05 2009 0.2.5.3
+01-05-2009 Nlecureuil
+- Fix crash in Quassel (Bug # 55641) ( the previous fix was only in iaora-kde )
+
+** 01-01-2010 2009 0.2.5.2**
+
+18-12-2009 - Nlecureuil
+- Fix minimum size for the scrollbar slider
+
+** ??? ?? 2009 0.2.5.1**
+
+07-12-2009 - Nlecureuil
+- Install iaoracolors in /etc
+
+04-12-2009 - Rodrigo
+- Change the way titlebar colors are handled
+TODO: choose where to install the config file
+
+23-11-2009 - Nlecureuil
+- Fix crash in Quassel (Bug # 55641)
+
+19-11-2009 - Rodrigo
+- Fixed title bar text alignment
+- Removed unused code
+
+17-11-2009 - Nlecureuil
+- Fix SymbolPlus and SymbolMinus in trees
+
+16-11-2009 - Rodrigo
+- Changed from gradient to flat colors on an ItemViewItem
+- Added code to handle an ItemViewRow
+
+27-10-2009 Rodrigo
+- Fixed IaOra color schemes
+- Added IaOraSteel color scheme
+- Added IaOraNight color scheme
+- Fixed kwin border
+- Fixed inactive TitleBar drawing
+- Fixed TitleBar buttons
+
+26-10-2009 Rodrigo
+- Fixed kwin border
+- Fixed submenu arrow drawing when mouse over
+- Fixed EditLine drawing on Amarok
+- Fixed text color on TabBars
+
Added: theme/ia_ora-kde4/VERSION
===================================================================
--- theme/ia_ora-kde4/VERSION (rev 0)
+++ theme/ia_ora-kde4/VERSION 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1 @@
+0.2.0
Added: theme/ia_ora-kde4/color-schemes/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/color-schemes/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/color-schemes/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,3 @@
+file (GLOB iaora_COLORSCHEMES *.colors)
+install (FILES ${iaora_COLORSCHEMES} DESTINATION ${DATA_INSTALL_DIR}/color-schemes)
+
Property changes on: theme/ia_ora-kde4/color-schemes/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/color-schemes/IaOraArctic.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraArctic.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraArctic.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=208,215,223
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=142,199,255
+BackgroundNormal=142,199,255
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=0,0,0
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Arctic
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=142,199,255
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/color-schemes/IaOraBlue.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraBlue.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraBlue.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=208,215,223
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=73,101,174
+BackgroundNormal=73,101,174
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=255,255,255
+ForegroundInactive=255,255,255
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=255,255,255
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Blue
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=73,102,174
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/color-schemes/IaOraGray.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraGray.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraGray.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=208,215,223
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=62,138,204
+BackgroundNormal=207,215,223
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=0,0,0
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Gray
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=207,215,223
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/color-schemes/IaOraNight.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraNight.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraNight.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=128,142,198
+DecorationHover=173,186,234
+ForegroundActive=1,1,1
+ForegroundInactive=208,215,223
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=1,1,1
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=9,52,83
+BackgroundNormal=93,101,142
+DecorationFocus=128,142,198
+DecorationHover=173,186,234
+ForegroundActive=255,255,255
+ForegroundInactive=255,255,255
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=255,255,255
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=128,142,198
+DecorationHover=173,186,234
+ForegroundActive=1,1,1
+ForegroundInactive=1,1,1
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=1,1,1
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=128,142,198
+DecorationHover=173,186,234
+ForegroundActive=1,1,1
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=1,1,1
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=128,142,198
+DecorationHover=173,186,234
+ForegroundActive=1,1,1
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=1,1,1
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Night
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=61,68,103
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/color-schemes/IaOraOrange.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraOrange.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraOrange.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=208,215,223
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=62,138,204
+BackgroundNormal=247,182,16
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=0,0,0
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Orange
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=247,182,16
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/color-schemes/IaOraSmooth.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraSmooth.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraSmooth.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=123,170,231
+BackgroundNormal=123,170,231
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=255,255,255
+ForegroundInactive=255,255,255
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=255,255,255
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=0,0,0
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=43,116,199
+DecorationHover=119,183,255
+ForegroundActive=0,0,0
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=0,0,0
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Smooth
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=123,170,231
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/color-schemes/IaOraSteel.colors
===================================================================
--- theme/ia_ora-kde4/color-schemes/IaOraSteel.colors (rev 0)
+++ theme/ia_ora-kde4/color-schemes/IaOraSteel.colors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,102 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=true
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=223,231,239
+BackgroundNormal=223,231,239
+DecorationFocus=58,192,207
+DecorationHover=162,220,227
+ForegroundActive=35,31,32
+ForegroundInactive=208,215,223
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=35,31,32
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Selection]
+BackgroundAlternate=9,52,83
+BackgroundNormal=20,141,205
+DecorationFocus=58,192,207
+DecorationHover=162,220,227
+ForegroundActive=255,255,255
+ForegroundInactive=255,255,255
+ForegroundLink=0,0,192
+ForegroundNegative=156,14,14
+ForegroundNeutral=255,221,0
+ForegroundNormal=255,255,255
+ForegroundPositive=128,255,128
+ForegroundVisited=128,0,128
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,148
+BackgroundNormal=255,255,148
+DecorationFocus=58,192,207
+DecorationHover=162,220,227
+ForegroundActive=35,31,32
+ForegroundInactive=35,31,32
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=35,31,32
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:View]
+BackgroundAlternate=239,242,247
+BackgroundNormal=255,255,255
+DecorationFocus=58,192,207
+DecorationHover=162,220,227
+ForegroundActive=35,31,32
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=35,31,32
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[Colors:Window]
+BackgroundAlternate=239,243,247
+BackgroundNormal=239,243,247
+DecorationFocus=58,192,207
+DecorationHover=162,220,227
+ForegroundActive=35,31,32
+ForegroundInactive=136,135,134
+ForegroundLink=0,0,192
+ForegroundNegative=191,3,3
+ForegroundNeutral=176,128,0
+ForegroundNormal=35,31,32
+ForegroundPositive=0,110,40
+ForegroundVisited=128,0,128
+
+[General]
+Name=Ia Ora Steel
+shadeSortColumn=true
+
+[KDE]
+contrast=7
+
+[WM]
+activeBackground=20,141,205
+activeForeground=255,255,255
+inactiveBackground=207,217,228
+inactiveForeground=255,255,255
Added: theme/ia_ora-kde4/configure
===================================================================
--- theme/ia_ora-kde4/configure (rev 0)
+++ theme/ia_ora-kde4/configure 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release .
Added: theme/ia_ora-kde4/install.sh
===================================================================
--- theme/ia_ora-kde4/install.sh (rev 0)
+++ theme/ia_ora-kde4/install.sh 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release . && make && sudo make install
Property changes on: theme/ia_ora-kde4/install.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/kwin-client/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/kwin-client/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/kwin-client/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,10 @@
+project (kwin-iaora)
+
+set (kwin_iaora_SOURCES kwin_iaora.cpp)
+kde4_add_plugin (kwin3_iaora ${kwin_iaora_SOURCES})
+target_link_libraries (kwin3_iaora ${KDE4_KDEUI_LIBS} kdecorations)
+install (TARGETS kwin3_iaora DESTINATION ${PLUGIN_INSTALL_DIR})
+install (FILES iaora.desktop DESTINATION ${DATA_INSTALL_DIR}/kwin)
+
+add_subdirectory (config)
+
Property changes on: theme/ia_ora-kde4/kwin-client/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/kwin-client/config/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/kwin-client/config/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/kwin-client/config/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,7 @@
+set (kwin_iaora_config_SOURCES iaora_config.cpp)
+kde4_add_ui_files(kwin_iaora_config_SOURCES iaora_config.ui)
+
+kde4_add_plugin (kwin_iaora_config ${kwin_iaora_config_SOURCES})
+
+target_link_libraries (kwin_iaora_config ${KDE4_KDEUI_LIBS})
+install (TARGETS kwin_iaora_config DESTINATION ${PLUGIN_INSTALL_DIR})
Property changes on: theme/ia_ora-kde4/kwin-client/config/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/kwin-client/config/iaora_config.cpp
===================================================================
--- theme/ia_ora-kde4/kwin-client/config/iaora_config.cpp (rev 0)
+++ theme/ia_ora-kde4/kwin-client/config/iaora_config.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <KDE/KVBox>
+#include <KDE/KGlobal>
+#include <KDE/KLocale>
+#include <KDE/KConfigGroup>
+
+#include "iaora_config.h"
+
+extern "C" KDE_EXPORT QObject *allocate_config(KConfig *conf, QWidget *parent)
+{
+ return new IaOraConfig(conf, parent);
+}
+
+IaOraConfig::IaOraConfig(KConfig *conf, QWidget *parent) : QObject(parent)
+{
+ Q_UNUSED(conf);
+
+ KGlobal::locale()->insertCatalog("kwin_clients");
+
+ iaoraConfig = new KConfig("iaorarc");
+ KConfigGroup configGroup(iaoraConfig, "Windeco");
+
+ m_ui = new IaOraConfigUI(parent);
+ connect(m_ui->cmbBorderSize, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
+ connect(m_ui->cmbAlign, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
+ connect(m_ui->chkGroup, SIGNAL(clicked()), SIGNAL(changed()));
+ connect(m_ui->chkCloseButtons, SIGNAL(clicked()), SIGNAL(changed()));
+
+ load(configGroup);
+ m_ui->show();
+}
+
+IaOraConfig::~IaOraConfig()
+{
+ delete m_ui;
+ delete iaoraConfig;
+}
+
+// loads the configuration
+void IaOraConfig::load(const KConfigGroup&)
+{
+ KConfigGroup configGroup(iaoraConfig, "Windeco");
+
+ int alignment;
+ int borderSize;
+ bool windowGrouping; // TABS
+ bool closeButtonsOnTabs; // TABS
+
+ // 1 is normal (0 = Tiny; 2 = Large; 3 = Very Large; 4 = Huge; 5 = Very Huge; 6 = Oversized)
+ borderSize = configGroup.readEntry("BorderSize", 1);
+ m_ui->cmbBorderSize->setCurrentIndex(borderSize);
+
+ // 1 is centered (0 = left; 2 = right)
+ alignment = configGroup.readEntry("TitleBarTextAlignment", 1);
+ m_ui->cmbAlign->setCurrentIndex(alignment);
+
+ // TABS
+ windowGrouping = configGroup.readEntry("UseWindowGrouping", false);
+ m_ui->chkGroup->setChecked(windowGrouping);
+ closeButtonsOnTabs = configGroup.readEntry("CloseButtonsOnTabs", true);
+ m_ui->chkCloseButtons->setChecked(closeButtonsOnTabs);
+}
+
+// we need to save the configurations
+void IaOraConfig::save(KConfigGroup&)
+{
+ KConfigGroup configGroup(iaoraConfig, "Windeco");
+
+ configGroup.writeEntry("BorderSize", m_ui->cmbBorderSize->currentIndex());
+ configGroup.writeEntry("TitleBarTextAlignment", m_ui->cmbAlign->currentIndex());
+ configGroup.writeEntry("UseWindowGrouping", m_ui->chkGroup->isChecked());
+ configGroup.writeEntry("CloseButtonsOnTabs", m_ui->chkCloseButtons->isChecked());
+
+ iaoraConfig->sync();
+}
+
+// simple the default configuration
+void IaOraConfig::defaults()
+{
+ m_ui->cmbBorderSize->setCurrentIndex(1);
+ m_ui->cmbAlign->setCurrentIndex(1);
+ m_ui->chkGroup->setChecked(false);
+ m_ui->chkCloseButtons->setChecked(true);
+}
+
+#include "iaora_config.moc"
+
Property changes on: theme/ia_ora-kde4/kwin-client/config/iaora_config.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/kwin-client/config/iaora_config.h
===================================================================
--- theme/ia_ora-kde4/kwin-client/config/iaora_config.h (rev 0)
+++ theme/ia_ora-kde4/kwin-client/config/iaora_config.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef IAORA_CONFIG_H
+#define IAORA_CONFIG_H
+
+#include <KConfig>
+#include <QtCore/QObject>
+
+#include "ui_iaora_config.h"
+
+class QWidget;
+class KConfig;
+class KConfigGroup;
+
+class IaOraConfigUI : public QWidget, public Ui_IaOraConfigDialog
+{
+ public:
+ IaOraConfigUI(QWidget *parent) : QWidget(parent){
+ setupUi(this);
+ }
+};
+
+class IaOraConfig : public QObject
+{
+ Q_OBJECT
+
+ public:
+ IaOraConfig(KConfig *conf, QWidget *parent);
+ virtual ~IaOraConfig();
+
+ signals:
+ void changed();
+
+ public slots:
+ void load(const KConfigGroup&);
+ void save(KConfigGroup&);
+ void defaults();
+
+ private:
+ IaOraConfigUI *m_ui;
+ KConfig *iaoraConfig;
+};
+
+#endif
+
Property changes on: theme/ia_ora-kde4/kwin-client/config/iaora_config.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/kwin-client/config/iaora_config.ui
===================================================================
--- theme/ia_ora-kde4/kwin-client/config/iaora_config.ui (rev 0)
+++ theme/ia_ora-kde4/kwin-client/config/iaora_config.ui 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>IaOraConfigDialog</class>
+ <widget class="QWidget" name="IaOraConfigDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>385</width>
+ <height>108</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string/>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Border size:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cmbBorderSize">
+ <item>
+ <property name="text">
+ <string>Tiny</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Normal</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Large</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Very Large</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Huge</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Very Huge</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Oversized</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>TitleBar text alignment:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cmbAlign">
+ <item>
+ <property name="text">
+ <string>Left</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Center</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Right</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="chkGroup">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Enable window grouping</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="chkCloseButtons">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Show close button on each tab</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>chkGroup</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>chkCloseButtons</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>192</x>
+ <y>41</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>192</x>
+ <y>62</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Added: theme/ia_ora-kde4/kwin-client/iaora.desktop
===================================================================
--- theme/ia_ora-kde4/kwin-client/iaora.desktop (rev 0)
+++ theme/ia_ora-kde4/kwin-client/iaora.desktop 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,3 @@
+[Desktop Entry]
+Name=IaOra
+X-KDE-Library=kwin3_iaora
Added: theme/ia_ora-kde4/kwin-client/kwin_iaora.cpp
===================================================================
--- theme/ia_ora-kde4/kwin-client/kwin_iaora.cpp (rev 0)
+++ theme/ia_ora-kde4/kwin-client/kwin_iaora.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,1248 @@
+/*
+ * kwin_iaora.cpp - IaOra window decoration for KDE
+ * based on the Skulpture window decoration
+ *
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Skulpture Copyright 2008 Christoph Feck
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ ** Window tabbing feature based on the original code from Tabstrip KWin window decoration
+ ** Copyright (C) 2009 Jorge Mata <matamax123 at gmail.com>
+ ** Copyright (C) 2009 Lucas Murray <lmurray at undefinedfire.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "kwin_iaora.h"
+#include <KDE/KLocale>
+#include <KDE/KConfig>
+#include <KDE/KConfigGroup>
+#include <QtGui/QStylePainter>
+#include <QtGui/QStyle>
+#include <QtGui/QStyleFactory>
+#include <QtGui/QStyleOption>
+#include <QtGui/QBitmap>
+#include <QtCore/QLibrary>
+#include <QtCore/QPluginLoader>
+#include <QtGui/QStylePlugin>
+#include <QSettings>
+#include <QPixmapCache>
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+#include <cstdio>
+
+
+/*-----------------------------------------------------------------------*/
+/**
+ * The IaOra window decoration for KDE actually is a wrapper.
+ * It uses Qt's MDI window decoration. As such, it is very lightweight.
+ *
+ */
+
+extern "C" KDE_EXPORT KDecorationFactory *create_factory()
+{
+ return new IaOraDecorationFactory();
+}
+
+inline QString hashPalette(const QPalette &pal)
+{
+ QString hash = pal.color(QPalette::Window).name();
+ hash += pal.color(QPalette::Highlight).name();
+ return hash;
+}
+
+ColorData *IaOraDecoration::lookupData(const QPalette &pal)
+{
+ QString hash = hashPalette(pal);
+
+ // if already cached, just return
+ //if (m_data.contains(hash))
+ // return m_data[hash];
+
+ ColorData *data = new ColorData();
+ QColor background = pal.color(QPalette::Window);
+ QColor highlight = pal.color(QPalette::Highlight);
+
+ //TODO: check whether black and white should not be black and white
+ data->black = Qt::black;
+ data->white = Qt::white;
+
+ QSettings conf("/etc/iaoracolors", QSettings::NativeFormat); // TODO: define where this file must go
+
+ if (background.name() == "#eff3f7")
+ {
+ conf.beginGroup("Default");
+ data->gray[0] = (conf.value("gray0", background)).value<QColor>();
+ data->gray[1] = (conf.value("gray1", background.dark(107))).value<QColor>();
+ data->gray[2] = (conf.value("gray2", background.dark(115))).value<QColor>();
+ data->gray[3] = (conf.value("gray3", background.dark(117))).value<QColor>();
+ data->gray[4] = (conf.value("gray4", background.dark(131))).value<QColor>();
+ data->gray[5] = (conf.value("gray5", background.dark(144))).value<QColor>();
+ data->gray[6] = (conf.value("gray6", background.dark(178))).value<QColor>();
+ conf.endGroup();
+ } else
+ {
+ data->gray[0] = background;
+ data->gray[1] = background.dark(107);
+ data->gray[2] = background.dark(115);
+ data->gray[3] = background.dark(117);
+ data->gray[4] = background.dark(131);
+ data->gray[5] = background.dark(144);
+ data->gray[6] = background.dark(178);
+ }
+
+ QString group = "";
+
+ if (highlight.name() == "#8ec7ff") group = "Arctic";
+ else if (highlight.name() == "#4965ae") group = "Blue";
+ else if (highlight.name() == "#cfd7df") group = "Gray";
+ else if (highlight.name() == "#5d658e") group = "Night";
+ else if (highlight.name() == "#f7b610") group = "Orange";
+ else if (highlight.name() == "#7baae7") group = "Smooth";
+ else if (highlight.name() == "#148dcd") group = "Steel";
+
+ if (!group.isEmpty())
+ {
+ conf.beginGroup(group);
+ data->color[0] = (conf.value("color0", highlight.light(150))).value<QColor>();
+ data->color[1] = (conf.value("color1", highlight.light(137))).value<QColor>();
+ data->color[2] = (conf.value("color2", highlight)).value<QColor>();
+ data->color[3] = (conf.value("color3", highlight.light(112))).value<QColor>();
+ data->color[4] = (conf.value("color4", highlight.light(130))).value<QColor>();
+ conf.endGroup();
+ } else
+ {
+ data->color[0] = highlight.light(150);
+ data->color[1] = highlight.light(137);
+ data->color[2] = highlight;
+ data->color[3] = highlight.dark(112);
+ data->color[4] = highlight.dark(130);
+ }
+
+ //m_data[hash] = data;
+ return data;
+}
+
+/*-----------------------------------------------------------------------*/
+/*
+ * When KWin is already running, it doesn't notice that
+ * a new style has been installed, and QStyleFactory will
+ * not find the new style.
+ *
+ * This function works around this Qt problem by manually
+ * loading the style.
+ *
+ */
+
+static void setIaOraStyle(QWidget *widget)
+{
+ static QStyle *iaoraStyle = 0;
+ QStyle *style = 0;
+
+ if (!style && iaoraStyle) {
+ style = iaoraStyle;
+ }
+ if (!style) {
+ bool loaded = false;
+ QStringList paths = QCoreApplication::libraryPaths();
+ QLibrary library;
+ foreach (QString path, paths) {
+ library.setFileName(path + QString::fromUtf8("/styles/iaora-qt"));
+ if (library.load()) {
+ loaded = true;
+ break;
+ }
+ }
+ if (loaded) {
+ QString libName = library.fileName();
+ library.unload();
+
+ QPluginLoader plugin(libName);
+ QObject *instance = plugin.instance();
+ if (instance) {
+ QStyleFactoryInterface *factory = qobject_cast<QStyleFactoryInterface*>(instance);
+ if (factory) {
+ style = factory->create(QString::fromUtf8("iaora-qt"));
+ if (style) {
+ iaoraStyle = style;
+ }
+ }
+ }
+ }
+ }
+ if (style) {
+ widget->setStyle(style);
+ }
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+IaOraDecorationButton::IaOraDecorationButton(ButtonType type, KCommonDecoration *parent)
+ : KCommonDecorationButton(type, parent)
+{
+ init();
+}
+
+
+void IaOraDecorationButton::init()
+{
+ setAttribute(Qt::WA_PaintOnScreen, false);
+ setAttribute(Qt::WA_NoSystemBackground, true);
+ setAutoFillBackground(false);
+ setFocusPolicy(Qt::NoFocus);
+ setAttribute(Qt::WA_OpaquePaintEvent, false);
+ setAttribute(Qt::WA_Hover, true);
+ setIaOraStyle(this);
+ m_isHover = false;
+}
+
+
+IaOraDecorationButton::~IaOraDecorationButton()
+{
+ /* */
+}
+
+
+void IaOraDecorationButton::reset(unsigned long /*changed*/)
+{
+ /* NOTE: must be implemented, because it is declared pure */
+}
+
+
+void IaOraDecorationButton::initStyleOption(QStyleOptionButton &opt)
+{
+ opt.init(this);
+ if (isDown()) {
+ opt.state |= QStyle::State_Selected;
+ } else {
+ opt.state &= ~QStyle::State_Selected;
+ }
+ if (decoration()->isActive()) {
+ opt.state |= QStyle::State_Active;
+ } else {
+ opt.state &= ~QStyle::State_Active;
+ }
+}
+
+
+void IaOraDecorationButton::paintEvent(QPaintEvent */* event */)
+{
+// TODO: must clear the cache when we change the color scheme (how???)
+ const KCommonDecoration *deco = decoration();
+ QPainter painter(this);
+ QStyleOptionButton opt;
+ initStyleOption(opt);
+
+ QStyle::StandardPixmap sp;
+ switch (type()) {
+ case OnAllDesktopsButton:
+ sp = QStyle::StandardPixmap(QStyle::SP_CustomBase + (deco->isOnAllDesktops() ? 2 : 1));
+ break;
+ case MenuButton:
+ sp = QStyle::StandardPixmap(QStyle::SP_CustomBase + 3);
+ break;
+ case AboveButton:
+ sp = QStyle::StandardPixmap(QStyle::SP_CustomBase + (deco->keepAbove() ? 6 : 4));
+ break;
+ case BelowButton:
+ sp = QStyle::StandardPixmap(QStyle::SP_CustomBase + (deco->keepBelow() ? 7 : 5));
+ break;
+ case HelpButton:
+ sp = QStyle::SP_TitleBarContextHelpButton;
+ break;
+ case MinButton:
+ sp = QStyle::SP_TitleBarMinButton;
+ break;
+ case MaxButton:
+ sp = deco->maximizeMode() == KDecoration::MaximizeFull ? QStyle::SP_TitleBarNormalButton : QStyle::SP_TitleBarMaxButton;
+ break;
+ case ShadeButton:
+ sp = deco->isShade() ? QStyle::SP_TitleBarUnshadeButton : QStyle::SP_TitleBarShadeButton;
+ break;
+ case ItemCloseButton:
+ case CloseButton:
+ sp = QStyle::SP_TitleBarCloseButton;
+ break;
+ default:
+ sp = QStyle::SP_CustomBase;
+ break;
+ }
+
+ QIcon icon;
+ int shift;
+
+ // paint shape
+ opt.rect = rect().adjusted(-1, 0, 0, 0);
+
+ opt.palette.setColor(QPalette::Text, deco->options()->color(KCommonDecoration::ColorFont, opt.state & QStyle::State_Active));
+
+ icon = sp == QStyle::SP_CustomBase + 3 ? deco->icon().pixmap(16, 16) : style()->standardIcon(sp, &opt, this);
+
+ if (type() == ItemCloseButton){ // special case for a tab close button
+ QPixmap pix;
+ QString key = QString("iaora_standard_pixmap_tab_%1_%2_%3").arg(QString::number(sp))
+ .arg(16)
+ .arg(16);
+ if (QPixmapCache::find(key, pix)){
+ icon = QIcon(pix);
+ } else{
+ pix = QPixmap(16, 16);
+ pix.fill(Qt::transparent);
+
+ QImage image(pix.size(), QImage::Format_ARGB32_Premultiplied);
+ image.fill(opt.palette.color(QPalette::WindowText).rgb());
+
+ QPainter p2(&pix);
+ p2.setCompositionMode(QPainter::CompositionMode_Source);
+ p2.fillRect(pix.rect(), Qt::transparent);
+ p2.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ p2.drawPixmap(0, 0, icon.pixmap(16, 16));
+
+ p2.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ p2.drawImage(0, 0, image);
+ p2.end();
+
+ QPixmapCache::insert(key, pix);
+ icon = QIcon(pix);
+ }
+ }
+
+ shift = opt.state & QStyle::State_Selected ? 1 : 0;
+
+ // when mouse is over, we apply a darker effect
+ QPixmap pix;
+ if (m_isHover){
+ pix = icon.pixmap(opt.rect.size());
+ QPainter p;
+ QPixmap temp(pix.size());
+
+ temp.fill(Qt::transparent);
+ p.begin(&temp);
+
+ QRect r(pix.rect());
+ p.drawPixmap(r, pix);
+
+ p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+
+ QColor color;
+ color.setAlpha(0.7 * 255);
+ p.fillRect(pix.rect(), color);
+
+ p.end();
+ pix = temp;
+ } else
+ pix = icon.pixmap(opt.rect.size());
+
+ painter.setRenderHint(QPainter::Antialiasing, false);
+ painter.drawPixmap(opt.rect.topLeft() + QPoint(shift, shift) + QPoint(0, (opt.rect.height() / 2) - (pix.height() / 2)), pix);
+ //painter.drawPixmap(opt.rect.topLeft() + QPoint(shift, shift), pix);
+ qDebug("Rect: %d %d %dx%d", rect().left(), rect().top(), rect().width(), rect().height());
+}
+
+void IaOraDecorationButton::enterEvent(QEvent *e)
+{
+ Q_UNUSED(e);
+
+ m_isHover = true;
+ update();
+}
+
+void IaOraDecorationButton::leaveEvent(QEvent *e)
+{
+ Q_UNUSED(e);
+
+ m_isHover = false;
+ update();
+}
+
+/*-----------------------------------------------------------------------*/
+
+IaOraDecoration::IaOraDecoration(KDecorationBridge *bridge, KDecorationFactory *factory)
+ : KCommonDecorationUnstable(bridge, factory) // TABS
+ //: KCommonDecoration(bridge, factory)
+{
+ /* */
+ clicking = dragging = false;
+ pressedButton = Qt::NoButton;
+
+ loadConfig();
+}
+
+
+IaOraDecoration::~IaOraDecoration()
+{
+ /* */
+}
+
+
+QString IaOraDecoration::visibleName() const
+{
+ return i18n("IaOra");
+}
+
+
+void IaOraDecoration::initStyleOption(QStyleOption &opt)
+{
+ opt.init(widget());
+ opt.fontMetrics = QFontMetrics(options()->font(isActive()));
+ if (isActive()) {
+ opt.state |= QStyle::State_Active;
+ } else {
+ opt.state &= ~QStyle::State_Active;
+ }
+}
+
+// Loads the configuration from theme settings
+void IaOraDecoration::loadConfig()
+{
+ KConfig *conf = new KConfig("iaorarc");
+ KConfigGroup configGroup(conf, "Windeco");
+
+ useWindowGrouping = configGroup.readEntry("UseWindowGrouping", false); // TABS
+ closeButtonsOnTabs = configGroup.readEntry("CloseButtonsOnTabs", true); // TABS
+
+ borderSize = configGroup.readEntry("BorderSize", 1);
+
+ int alignFlag = configGroup.readEntry("TitleBarTextAlignment", 1);
+
+ switch(alignFlag){
+ case 0:
+ titleBarTextAlign = Qt::AlignLeft | Qt::AlignVCenter;
+ break;
+ default:
+ case 1:
+ titleBarTextAlign = Qt::AlignCenter; // the default one
+ break;
+ case 2:
+ titleBarTextAlign = Qt::AlignRight | Qt::AlignVCenter;
+ break;
+ }
+
+ delete conf;
+}
+
+bool IaOraDecoration::decorationBehaviour(DecorationBehaviour behaviour) const
+{
+ switch (behaviour) {
+ case DB_MenuClose:
+ case DB_WindowMask:
+ case DB_ButtonHide:
+ return true;
+ default:
+ return KCommonDecoration::decorationBehaviour(behaviour);
+ }
+}
+
+
+void IaOraDecoration::updateWindowShape()
+{
+ QStyleOptionTitleBar option;
+ initStyleOption(option);
+ QStyleHintReturnMask mask;
+
+ if ((widget()->style())->styleHint(QStyle::SH_WindowFrame_Mask, &option, widget(), &mask)) {
+ setMask(mask.region);
+ } else if (maximizeMode() == MaximizeFull){ // we don't want mask when maximized
+ QRegion mask2(0, 0, widget()->width()+1, widget()->height()+1);
+ setMask(mask2);
+ } else {
+ int w = widget()->width();
+ int h = widget()->height();
+
+ QRegion mask2(1, 0, w-2, h);
+ mask2 += QRegion(0, 1, 1, h-2);
+ mask2 += QRegion(w-1, 1, 1, h-2);
+
+ setMask(mask2);
+ }
+}
+
+
+int IaOraDecoration::layoutMetric(LayoutMetric lm, bool respectWindowState, const KCommonDecorationButton *button) const
+{
+ bool border = !(maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows());
+
+ if (border) {
+ switch (lm) {
+ case LM_BorderLeft:
+ case LM_BorderRight:
+ case LM_BorderBottom:
+ return borderWidth;
+ case LM_TitleBorderLeft:
+ case LM_TitleBorderRight:
+ return 4;
+ case LM_TitleEdgeLeft:
+ case LM_TitleEdgeRight:
+ return 8;
+ case LM_TitleEdgeTop:
+ return borderWidth;
+ case LM_ButtonHeight:
+ return titleHeight;
+ default:
+ break;
+ }
+ } else {
+ switch (lm) {
+ case LM_BorderLeft:
+ case LM_BorderRight:
+ return 0;
+ case LM_BorderBottom:
+ case LM_TitleBorderLeft:
+ case LM_TitleBorderRight:
+ case LM_TitleEdgeLeft:
+ return 2;
+ case LM_TitleEdgeRight:
+ case LM_TitleEdgeTop:
+ return 0;
+ case LM_ButtonHeight:
+ return titleHeight;
+ default:
+ break;
+ }
+ }
+ switch (lm) {
+ case LM_TitleEdgeBottom:
+ return 1;
+ case LM_TitleHeight:
+ return titleHeight + 2;
+ case LM_ButtonWidth:
+ return titleHeight;
+ case LM_ButtonSpacing:
+ return 0;
+ case LM_ExplicitButtonSpacer:
+ return 2;
+ case LM_ButtonMarginTop:
+ return 0;
+ default:
+ return KCommonDecoration::layoutMetric(lm, respectWindowState, button);
+ }
+}
+
+
+KCommonDecorationButton *IaOraDecoration::createButton(ButtonType type)
+{
+ return new IaOraDecorationButton(type, this);
+}
+
+
+void IaOraDecoration::init()
+{
+ QWidget wid;
+ setIaOraStyle(&wid);
+ if (wid.style()) {
+ QStyleOptionTitleBar option;
+ option.init(&wid);
+ option.fontMetrics = QFontMetrics(options()->font(true));
+ borderWidth = wid.style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, &option, 0);
+ titleHeight = wid.style()->pixelMetric(QStyle::PM_TitleBarHeight, &option, 0);
+ noBorder = wid.style()->styleHint(QStyle::SH_TitleBar_NoBorder, &option, 0);
+ autoRaise = wid.style()->styleHint(QStyle::SH_TitleBar_AutoRaise, &option, 0);
+ } else {
+ borderWidth = 4;
+ titleHeight = 16;
+ noBorder = false;
+ autoRaise = false;
+ }
+ KConfig configFile(QString::fromAscii("kwiniaorarc"));
+ KConfigGroup conf(&configFile, "General");
+ coloredFrame = conf.readEntry("UseTitleBarBorderColors", false);
+ contrastFrame = conf.readEntry("UseExtraContrastBorder", false);
+
+
+ switch (borderSize) {
+ case 0: borderWidth = 2; break; // Tiny
+ default:
+ case 1: borderWidth = 3; break; // Normal
+ case 2: borderWidth = 4; break; // Large
+ case 3: borderWidth = 5; break; // VeryLarge
+ case 4: borderWidth = titleHeight / 2; break; // Huge
+ case 5: borderWidth = titleHeight * 3 / 4; break; // VeryHuge
+ case 6: borderWidth = titleHeight; break; // Oversized
+ }
+ /*switch (options()->preferredBorderSize(factory())) {
+ case BorderTiny: borderWidth = 2; break;
+ default:
+ case BorderNormal: borderWidth = 3; break;
+ case BorderLarge: borderWidth = 4; break;
+ case BorderVeryLarge: borderWidth = 5; break;
+ case BorderHuge: borderWidth = titleHeight / 2; break;
+ case BorderVeryHuge: borderWidth = titleHeight * 3 / 4; break;
+ case BorderOversized: borderWidth = titleHeight; break;
+ }*/
+ if (contrastFrame) {
+ borderWidth += 1;
+ }
+ KCommonDecoration::init();
+ if (wid.style()) widget()->setStyle(wid.style());
+ widget()->setAutoFillBackground(false);
+ widget()->setAttribute(Qt::WA_NoSystemBackground, true);
+ widget()->setAttribute(Qt::WA_OpaquePaintEvent, true);
+
+ if (useWindowGrouping)
+ widget()->setAcceptDrops(true); // TABS
+
+ if (static_cast<const KDecorationUnstable *>(decoration())->compositingActive())
+ widget()->setAttribute(Qt::WA_PaintOnScreen, false); // Kwin problem with composite
+}
+
+
+static inline QColor blend_color(const QColor &c0, const QColor &c1, qreal blend)
+{
+ int b = int(0.5 + 256.0 * blend);
+ b = qMin(256, qMax(0, b));
+ QRgb rgba0 = c0.rgba();
+ QRgb rgba1 = c1.rgba();
+ return QColor(
+ qRed(rgba0) + (((qRed(rgba1) - qRed(rgba0)) * b) >> 8),
+ qGreen(rgba0) + (((qGreen(rgba1) - qGreen(rgba0)) * b) >> 8),
+ qBlue(rgba0) + (((qBlue(rgba1) - qBlue(rgba0)) * b) >> 8),
+ qAlpha(rgba0) + (((qAlpha(rgba1) - qAlpha(rgba0)) * b) >> 8)
+ );
+}
+
+// Helper function to draw a tab on the TitleBar
+void IaOraDecoration::drawTab(QPainter &painter, const QRect &rect, ClientGroupItem &item, bool border, bool active, bool dragging)
+{ // TABS
+ QStyleOptionTab tab;
+ initStyleOption(tab);
+
+ if (dragging)
+ tab.rect = rect.adjusted(0, 0, 2, 0);
+ else
+ tab.rect = rect.adjusted(0, 2, 0, 0);
+
+ QPalette pal = tab.palette;
+ pal.setCurrentColorGroup(active ? QPalette::Active : QPalette::Inactive);
+
+ ColorData *data = lookupData(pal);
+
+ int top = tab.rect.top(), bottom = tab.rect.bottom(), left = tab.rect.left(), right = tab.rect.right();
+
+ if (active){
+ QRect contents = tab.rect;
+ QLine borders[3];
+ QLine lightBlue[2];
+ QLine darkBlue[2];
+
+ // Tab decoration
+ borders[0] = QLine(left, top + 4, left, bottom);
+ if (dragging){
+ borders[1] = QLine(right - 2, top + 4, right - 2, bottom);
+ borders[2] = QLine(left, bottom, right - 2, bottom);
+ } else
+ borders[1] = QLine(right - 1, top + 4, right - 1, bottom);
+
+ lightBlue[0] = QLine(left + 2, top, right - 3,top);
+ lightBlue[1] = QLine(left + 1, top + 1, right - 2 , top + 1);
+
+ darkBlue[0] = QLine(left, top + 2, right - 1, top + 2);
+ darkBlue[1] = QLine(left, top + 3, right - 1, top + 3);
+
+ // fill the contents
+ if (dragging){
+ painter.fillRect(contents, data->gray[0]);
+
+ } else
+ painter.fillRect(contents.adjusted(0, 4, -1, 0), data->gray[0]);
+
+ // draw the gray borders
+ painter.setPen(data->gray[4]);
+ if (dragging){
+ painter.drawLines(borders, 3);
+
+ QPoint points[2];
+
+ points[0] = QPoint(left + 1, bottom - 1);
+ points[1] = QPoint(right - 3, bottom - 1);
+ painter.drawPoints(points, 2);
+ } else
+ painter.drawLines(borders, 2);
+
+ // the blue lines
+ painter.setPen(data->color[2]);
+ painter.drawLines(lightBlue, 2);
+ painter.setPen(data->color[4]);
+ painter.drawLines(darkBlue, 2);
+ }
+ else // inactive tab
+ {
+ QRect contents = tab.rect;
+
+ QPoint points[2];
+ QLine lines[4];
+
+ // Tab decoration
+ if (!dragging)
+ top += 3;
+
+ contents.setTop(top + 1);
+ lines[0] = QLine(left + 2, top, right - 3, top); // top
+ lines[1] = QLine(left, top + 2, left, bottom); // left
+ lines[2] = QLine(right - 1, top + 2, right - 1, bottom); // right
+ points[0] = QPoint(left + 1, top + 1);
+ points[1] = QPoint(right - 2, top + 1);
+
+ // draw the contents
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(data->gray[1]);
+ painter.drawRect(contents.adjusted(1, 1, -1, 0));
+ painter.drawRect(contents.adjusted(2, 0, -2, 0));
+
+ // draw the lines
+ painter.setPen(data->gray[5]);
+ painter.drawLines(lines, 4);
+ painter.drawPoints(points, 2);
+ }
+
+ //--------------------------------------------------------
+
+ // text part
+ painter.save();
+ int borderSpace = borderWidth;
+
+ QRect labelRect(rect.adjusted(0, 4, 0, 0));
+ if (titleBarTextAlign & Qt::AlignLeft)
+ labelRect.adjust(3, 0, 0, 0);
+ else if (titleBarTextAlign & Qt::AlignRight)
+ labelRect.adjust(0, 0, -3, 0);
+
+ if (closeButtonsOnTabs)
+ labelRect.adjust(0, 0, -18, 0);
+
+ QFontMetrics metrics(painter.font());
+ QString string = metrics.elidedText(item.title(), Qt::ElideRight, labelRect.width());
+
+ painter.setPen(tab.palette.color(QPalette::WindowText));
+ painter.drawText(labelRect, titleBarTextAlign | Qt::TextSingleLine, string);
+ painter.restore();
+}
+
+void IaOraDecoration::paintEvent(QPaintEvent */*event */)
+{
+ bool border = !(maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows());
+ QStylePainter painter(widget());
+
+ // draw the title bar
+ QStyleOptionTitleBar option;
+ initStyleOption(option);
+ option.titleBarState = option.state;
+ option.subControls = QStyle::SC_TitleBarLabel;
+
+ QList<ClientGroupItem> tabList = clientGroupItems(); // TABS
+ int tabCount = tabList.count(); // TABS
+
+ int borderSpace = borderWidth;
+
+ if (noBorder) {
+ option.rect.setHeight(titleHeight);
+ } else {
+ option.rect.adjust(4, 4, -4, -4);
+ option.rect.setHeight(titleHeight);
+ }
+ if (!border) {
+ option.rect.adjust(-6, 0, 6, 0);
+ borderSpace = 0;
+ }
+
+ option.text = QString();
+ option.titleBarFlags = 0;
+ option.rect.adjust(0, 0, 0, borderSpace);
+
+ if (coloredFrame && border) {
+ painter.fillRect(widget()->rect(), options()->color(ColorTitleBar, isActive()));
+#if 0
+ QColor color0 = option.palette.color(QPalette::Window);
+ QColor color1 = options()->color(ColorTitleBar, isActive());
+ QRect r = widget()->rect();
+ for (int i = 0; i < borderWidth; ++i) {
+ painter.setPen(blend_color(color1, color0, i / (borderWidth - 1.0)));
+ painter.drawRect(r.adjusted(0, 0, -1, -1));
+ r.adjust(1, 1, -1, -1);
+ }
+#endif
+ } else {
+ painter.fillRect(widget()->rect(), option.palette.color(QPalette::Window));
+
+ painter.save();
+ painter.setPen(Qt::white);
+ painter.drawLine(widget()->rect().topLeft() + QPoint(0, titleHeight + borderSpace + 2), widget()->rect().topRight() + QPoint(0, titleHeight + borderSpace + 2));
+
+ painter.setPen(option.palette.color(QPalette::Window));
+ painter.drawLine(widget()->rect().topLeft() + QPoint(2, 0), widget()->rect().bottomLeft() + QPoint(2, 0));
+ painter.drawLine(widget()->rect().topRight() - QPoint(2, 0), widget()->rect().bottomRight() - QPoint(2, 0));
+ painter.drawLine(widget()->rect().bottomLeft() - QPoint(0, 2), widget()->rect().bottomRight() - QPoint(0, 2));
+
+ // inner lines
+ // #DFE7EF
+ painter.setPen(QColor(223, 231, 239));
+ painter.drawLine(widget()->rect().topLeft() + QPoint(1, 0), widget()->rect().bottomLeft() + QPoint(1, 0));
+ painter.drawLine(widget()->rect().topRight() - QPoint(1, 0), widget()->rect().bottomRight() - QPoint(1, 0));
+ painter.drawLine(widget()->rect().bottomLeft() - QPoint(0, 1), widget()->rect().bottomRight() - QPoint(0, 1));
+
+ // outer lines
+ // #CFD7DF
+ painter.setPen(QColor(207, 215, 223));
+ painter.drawLine(widget()->rect().topLeft() + QPoint(0, titleHeight + borderSpace + 1), widget()->rect().topRight() + QPoint(0, titleHeight + borderSpace + 1));
+ painter.drawLine(widget()->rect().topLeft(), widget()->rect().bottomLeft());
+ painter.drawLine(widget()->rect().topRight(), widget()->rect().bottomRight());
+ painter.drawLine(widget()->rect().bottomLeft(), widget()->rect().bottomRight());
+ painter.restore();
+ }
+
+ QFont font = options()->font(isActive());
+ // Maybe we can add a checkbox for config to use fixed window title text size
+ //font.setPointSize(10);
+ font.setBold(true);
+ painter.setFont(font);
+
+ //if (tabCount <= 1){
+ if (isActive()){
+ option.palette.setColor(QPalette::Highlight, options()->color(ColorTitleBar, true));
+ option.palette.setColor(QPalette::HighlightedText, options()->color(ColorFont, true));
+ option.palette.setColor(QPalette::Window, options()->color(ColorTitleBar, false));
+ option.palette.setColor(QPalette::WindowText, options()->color(ColorFont, false));
+ } else{
+ option.palette.setColor(QPalette::Inactive, QPalette::Highlight, options()->color(ColorTitleBar, false));
+ option.palette.setColor(QPalette::Inactive, QPalette::HighlightedText, options()->color(ColorFont, false));
+ option.palette.setColor(QPalette::Inactive, QPalette::Window, options()->color(ColorTitleBar, false));
+ option.palette.setColor(QPalette::Inactive, QPalette::WindowText, options()->color(ColorFont, false));
+ }
+ painter.drawComplexControl(QStyle::CC_TitleBar, option);
+ //}
+
+ int captionWidth = width() - buttonsLeftWidth() - buttonsRightWidth() - (border ? 16 : 4);
+ option.text = option.fontMetrics.elidedText(caption(), Qt::ElideMiddle, captionWidth);
+ QRect labelRect = QRect((border ? 8 : 2) + buttonsLeftWidth(), 0, captionWidth, titleHeight + borderSpace + 4);
+
+ labelRect.adjust(0, -2, 0, -2);
+ if (titleBarTextAlign & Qt::AlignLeft)
+ labelRect.adjust(3, 0, 0, 0);
+ else if (titleBarTextAlign & Qt::AlignRight)
+ labelRect.adjust(0, 0, -3, 0);
+
+ QFontMetrics metrics(font);
+ QString string = metrics.elidedText(option.text, Qt::ElideRight, labelRect.width());
+
+ // deleting unneeded close buttons
+ while ((tabCount < closeButtonsList.size()) || ((tabCount == 1) && (closeButtonsList.size() > 0))){
+ IaOraDecorationButton *button = closeButtonsList.takeFirst();
+
+ button->hide();
+ button->deleteLater();
+ }
+
+ if (tabCount > 1){ // TABS
+ //painter.fillRect(option.rect.adjusted(0, 0, 0, 2), option.palette.color(QPalette::Window));
+
+ QRect tabRect(labelRect);
+ tabRect.setWidth(tabRect.width() / tabCount + 1);
+ int i;
+
+ for (i = 0; i < tabCount; ++i){
+ if (i == tabCount - 1)
+ tabRect.adjust(0, 0, -3, 0);
+
+ drawTab(painter, tabRect, tabList[i], border, isActive() && visibleClientGroupItem() == i);
+ // create new close buttons
+ if (closeButtonsOnTabs){
+ if (i >= closeButtonsList.size())
+ closeButtonsList.append(new IaOraDecorationButton(ItemCloseButton, this));
+ //closeButtonsList.append(new IaOraDecorationButton(CloseButton, this));
+
+ //closeButtonsList[i]->setActive(isActive() && visibleClientGroupItm() == i);
+ closeButtonsList[i]->resize(16, 16);
+ closeButtonsList[i]->move(tabRect.right() - 18, tabRect.top() + (tabRect.height() / 2) - 5);
+ closeButtonsList[i]->installEventFilter(this);
+ closeButtonsList[i]->show();
+ }
+
+ tabRect.translate(tabRect.width() - 1, 0);
+ }
+ } else{ // NO TABBED WINDOW
+ // draw the title caption
+ // TODO use MDI code
+ painter.save();
+ qreal opacity = painter.opacity();
+
+ if (option.state & QStyle::State_Active){
+ painter.setOpacity(opacity * 0.9);
+ painter.setPen(Qt::black);
+ painter.drawText(labelRect.adjusted(1, 1, 1, 1), titleBarTextAlign | Qt::TextSingleLine, string);
+ painter.setOpacity(opacity);
+ }
+
+ painter.setPen(options()->color(ColorFont, isActive()));
+
+ painter.drawText(labelRect, titleBarTextAlign | Qt::TextSingleLine, string);
+ painter.restore();
+ }
+}
+
+bool IaOraDecoration::eventFilter(QObject *object, QEvent *event) // TABS
+{
+ if (!useWindowGrouping)
+ return KCommonDecorationUnstable::eventFilter(object, event);
+
+ // this 'if' is for the tab close buttons
+ if (IaOraDecorationButton *button = dynamic_cast<IaOraDecorationButton *>(object)){
+ if (event->type() == QEvent::MouseButtonPress)
+ return true;
+ else if (event->type() == QEvent::MouseButtonRelease){
+ const QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+
+ if ((mouseEvent->button() == Qt::LeftButton) && (button->rect().contains(mouseEvent->pos())))
+ closeClientGroupItem(closeButtonsList.indexOf(button));
+ }
+ }
+
+ bool state = false;
+ if (event->type() == QEvent::MouseButtonPress)
+ state = mouseButtonPressEvent(static_cast<QMouseEvent*>(event));
+ else if (event->type() == QEvent::MouseButtonRelease && widget() == object)
+ state = mouseButtonReleaseEvent( static_cast<QMouseEvent*>(event));
+ else if (event->type() == QEvent::MouseMove)
+ state = mouseMoveEvent(static_cast<QMouseEvent*>(event));
+ else if (event->type() == QEvent::DragEnter && widget() == object)
+ state = dragEnterEvent(static_cast<QDragEnterEvent*>(event));
+ else if (event->type() == QEvent::DragMove && widget() == object)
+ state = dragMoveEvent(static_cast<QDragMoveEvent*>(event));
+ else if (event->type() == QEvent::DragLeave && widget() == object)
+ state = dragLeaveEvent(static_cast<QDragLeaveEvent*>(event));
+ else if (event->type() == QEvent::Drop && widget() == object)
+ state = dropEvent(static_cast<QDropEvent*>(event));
+
+ return state || KCommonDecorationUnstable::eventFilter(object, event);
+}
+
+int IaOraDecoration::itemClicked(const QPoint &point, bool between) // TABS
+{
+ QRect frame = widget()->frameGeometry();
+ QList<ClientGroupItem> list = clientGroupItems();
+ int tabs = list.count();
+ int t_x = titleRect().x();
+ int t_y = frame.y();
+ int t_w = titleRect().width();
+ int t_h = layoutMetric(LM_TitleEdgeTop) + layoutMetric(LM_TitleHeight) + layoutMetric(LM_TitleEdgeBottom);
+ int tabWidth = t_w / tabs;
+
+ if (between) // inserting a new tab between two existing ones
+ t_x -= tabWidth / 2;
+
+ int rem = t_w % tabs;
+ int tab_x = t_x;
+
+ int i;
+ for (i = 0; i < tabs; ++i){
+ QRect tabRect(tab_x, t_y, (i < rem) ? tabWidth + 1 : tabWidth, t_h);
+
+ if (tabRect.contains(point))
+ return i;
+
+ tab_x += tabRect.width();
+ }
+
+ return -1;
+}
+
+bool IaOraDecoration::mouseButtonPressEvent(QMouseEvent *event) // TABS
+{
+ clickPos = widget()->mapToParent(event->pos());
+
+ int item = itemClicked(clickPos);
+
+ if (buttonToWindowOperation(event->button()) == OperationsOp){
+ displayClientMenu(item, widget()->mapToGlobal(clickPos));
+
+ return true;
+ }
+
+ if (item >= 0){
+ clicking = true;
+ pressedButton = event->button();
+
+ return true;
+ }
+
+ clicking = false;
+ return false;
+}
+
+bool IaOraDecoration::mouseButtonReleaseEvent(QMouseEvent *event) // TABS
+{
+ releasePos = event->pos();
+
+ int item = itemClicked(releasePos);
+
+ if ((clicking) && (item >= 0)){
+ clicking = false;
+ setVisibleClientGroupItem(item);
+
+ return true;
+ }
+
+ clicking = false;
+ return false;
+}
+
+bool IaOraDecoration::mouseMoveEvent(QMouseEvent *event) // TABS
+{
+ QPoint point = event->pos();
+ int item = itemClicked(point);
+
+ if ((item >= 0) && (clicking) &&
+ (buttonToWindowOperation(pressedButton) == ClientGroupDragOp) &&
+ ((point - clickPos).manhattanLength()) >= 4){
+ clicking = false;
+ dragging = true;
+
+ QDrag *drag = new QDrag(widget());
+ QMimeData *groupData = new QMimeData();
+
+ groupData->setData(clientGroupItemDragMimeType(), QString().setNum(itemId(item)).toAscii());
+ drag->setMimeData(groupData);
+
+ // Create draggable tab pixmap
+ QList<ClientGroupItem> tabList = clientGroupItems();
+ const int tabCount = tabList.count();
+ QRect frame(QPoint(0, 0), widget()->frameGeometry().size());
+ QRect titlebar(frame.topLeft(),
+ QSize(frame.width(), layoutMetric(LM_TitleEdgeTop) +
+ layoutMetric(LM_TitleHeight) +
+ layoutMetric(LM_TitleEdgeBottom) - 1));
+ QRect geom = titleRect().adjusted(-1, -layoutMetric(LM_TitleEdgeTop), 1, 0);
+
+ geom.setWidth((geom.width() / tabCount) + 1); // Split titlebar evenly
+ geom.translate((geom.width() * item) - item, 0);
+
+ QPixmap pix(geom.size());
+ QPainter painter(&pix);
+
+ drawTab(painter, QRect(QPoint(0, 0), geom.size()), tabList[item], true, isActive() && visibleClientGroupItem() == item, true);
+ painter.end();
+
+ QPixmap pix2(geom.size());
+ QPainter painter2(&pix2);
+
+ pix2.fill(Qt::transparent);
+ painter2.setPen(Qt::red);
+
+ int x = 0, y = 0, w = geom.width(), h = geom.height();
+ // top-left
+ painter2.drawLine(x, y, x + 1, y);
+ painter2.drawLine(x, y, x, y + 1);
+ // top-right
+ painter2.drawLine(w - 2, y, w, y);
+ painter2.drawLine(w - 1, y, w - 1, y + 1);
+ // bottom-left
+ painter2.drawLine(x, h - 2, x, h - 1);
+ painter2.drawLine(x, h - 1, x + 1, h - 1);
+ // bottom-right
+ painter2.drawLine(w - 2, h - 1, w, h - 1);
+ painter2.drawLine(w - 1, h - 2, w - 1, h - 1);
+
+ pix.setMask(pix2.createMaskFromColor(Qt::red));
+
+ drag->setPixmap(pix);
+
+ drag->setHotSpot(QPoint(point.x() - geom.x(), -1));
+
+ drag->exec(Qt::MoveAction);
+ dragging = false;
+
+ if ((drag->target() == 0) && (tabList.count() > 1)){
+ QPoint pos = QCursor::pos();
+
+ frame.moveTo(pos.x() - point.x(), pos.y() - point.y());
+ removeFromClientGroup(itemClicked(clickPos), frame);
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+bool IaOraDecoration::dragEnterEvent(QDragEnterEvent *event) // TABS
+{
+ if ((event->source() != 0) && (event->source()->objectName() == "decoration widget")){
+ dragging = true;
+ event->acceptProposedAction();
+
+ QPoint point = widget()->mapToParent(event->pos());
+ targetTab = itemClicked(point);
+ widget()->update();
+
+ return true;
+ }
+
+ return false;
+}
+
+bool IaOraDecoration::dragMoveEvent(QDragMoveEvent *event) // TABS
+{
+ Q_UNUSED(event)
+
+ return false;
+}
+
+bool IaOraDecoration::dragLeaveEvent(QDragLeaveEvent *event) // TABS
+{
+ Q_UNUSED(event)
+
+ return false;
+}
+
+bool IaOraDecoration::dropEvent(QDropEvent *event) // TABS
+{
+ QPoint point = widget()->mapToParent(event->pos());
+ dragging = false;
+ int tabClick = itemClicked(point);
+
+ if (tabClick >= 0){
+ const QMimeData *groupData = event->mimeData();
+
+ if (groupData->hasFormat(clientGroupItemDragMimeType())){
+ if (widget() == event->source()){
+ int from = itemClicked(clickPos);
+
+ moveItemInClientGroup(from, itemClicked(point, true));
+ } else{
+ long source = QString(groupData->data(clientGroupItemDragMimeType())).toLong();
+
+ moveItemToClientGroup(source, itemClicked(point, true));
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/*-----------------------------------------------------------------------*/
+
+IaOraDecorationFactory::IaOraDecorationFactory()
+{
+ loadConfig();
+}
+
+
+IaOraDecorationFactory::~IaOraDecorationFactory()
+{
+ /* */
+}
+
+bool IaOraDecorationFactory::loadConfig()
+{
+ bool changed = false; // if no changes, just return false
+ bool wGrouping, cboTabs;
+ int alignment, brdrSize;
+
+ KConfig *conf = new KConfig("iaorarc");
+ KConfigGroup configGroup(conf, "Windeco");
+
+ brdrSize = configGroup.readEntry("BorderSize", 1);
+ alignment = configGroup.readEntry("TitleBarTextAlignment", 1);
+ wGrouping = configGroup.readEntry("UseWindowGrouping", false); // TABS
+ cboTabs = configGroup.readEntry("CloseButtonsOnTabs", true); // TABS
+
+ if (brdrSize != borderSize){
+ borderSize = brdrSize;
+ changed = true;
+ }
+ if (alignment != alignFlag){
+ alignFlag = alignment;
+ changed = true;
+ }
+ if (wGrouping != useWindowGrouping){
+ useWindowGrouping = wGrouping;
+ changed = true;
+ }
+ if (cboTabs != closeButtonsOnTabs){
+ closeButtonsOnTabs = cboTabs;
+ changed = true;
+ }
+
+ delete conf;
+
+ return changed;
+}
+
+KDecoration *IaOraDecorationFactory::createDecoration(KDecorationBridge *bridge)
+{
+ return (new IaOraDecoration(bridge, this))->decoration();
+}
+
+
+bool IaOraDecorationFactory::reset(unsigned long changed)
+{
+ if (loadConfig())
+ return true;
+ else{
+ resetDecorations(changed);
+ return false;
+ }
+}
+
+
+/*QList<IaOraDecorationFactory::BorderSize> IaOraDecorationFactory::borderSizes() const
+{
+ return QList<BorderSize>()
+ << BorderTiny
+ << BorderNormal
+ << BorderLarge
+ << BorderVeryLarge
+ << BorderHuge
+ << BorderVeryHuge
+ << BorderOversized;
+}*/
+
+
+bool IaOraDecorationFactory::supports(Ability ability) const
+{
+ switch (ability)
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMenu:
+ case AbilityButtonHelp:
+ case AbilityButtonShade:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ case AbilityButtonSpacer:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonAboveOthers:
+ case AbilityButtonBelowOthers:
+ return true;
+ case AbilityAnnounceColors:
+ case AbilityColorTitleBack:
+ case AbilityColorTitleFore:
+ return true;
+ case AbilityClientGrouping: // TABS
+ return useWindowGrouping;
+ default:
+ return false;
+ }
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+#include "kwin_iaora.moc"
+
+
Property changes on: theme/ia_ora-kde4/kwin-client/kwin_iaora.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/kwin-client/kwin_iaora.h
===================================================================
--- theme/ia_ora-kde4/kwin-client/kwin_iaora.h (rev 0)
+++ theme/ia_ora-kde4/kwin-client/kwin_iaora.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,174 @@
+/*
+ * kwin_iaora.h
+ *
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Skulpture Copyright 2008 Christoph Feck
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ ** Window tabbing feature based on the original code from Tabstrip KWin window decoration
+ ** Copyright (C) 2009 Jorge Mata <matamax123 at gmail.com>
+ ** Copyright (C) 2009 Lucas Murray <lmurray at undefinedfire.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef KWIN_IAORA_H
+#define KWIN_IAORA_H 1
+
+#include <QColor>
+
+typedef struct
+{
+ QColor gray[7];
+ QColor color[5];
+ QColor black;
+ QColor white;
+} ColorData;
+
+/*-----------------------------------------------------------------------*/
+
+#include <kcommondecoration.h>
+class QStyleOptionButton;
+
+class IaOraDecorationButton : public KCommonDecorationButton
+{
+ Q_OBJECT
+
+ public:
+ IaOraDecorationButton(ButtonType type, KCommonDecoration *parent);
+ virtual ~IaOraDecorationButton();
+ virtual void reset(unsigned long changed);
+
+ protected:
+ virtual void paintEvent(QPaintEvent *event);
+
+ protected:
+ void initStyleOption(QStyleOptionButton &opt);
+
+ private:
+ void enterEvent(QEvent *e);
+ void leaveEvent(QEvent *e);
+ void init();
+ bool m_isHover;
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+class QStyleOption;
+
+class IaOraDecoration : public KCommonDecorationUnstable // TABS
+//class IaOraDecoration : public KCommonDecoration
+{
+ Q_OBJECT
+
+ public:
+ IaOraDecoration(KDecorationBridge *bridge, KDecorationFactory *factory);
+ virtual ~IaOraDecoration();
+
+ public:
+ virtual QString visibleName() const;
+ virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
+ virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton *button = 0) const;
+ virtual void updateWindowShape();
+
+ virtual void init();
+ virtual KCommonDecorationButton *createButton(ButtonType type);
+
+ virtual void paintEvent(QPaintEvent *event);
+
+ // tabbing related
+ virtual bool eventFilter(QObject *object, QEvent *event);
+ int itemClicked(const QPoint &point, bool between = false);
+ bool mouseButtonPressEvent(QMouseEvent *event);
+ bool mouseButtonReleaseEvent(QMouseEvent *event);
+ bool mouseMoveEvent(QMouseEvent *event);
+ bool dragEnterEvent(QDragEnterEvent *event);
+ bool dragMoveEvent(QDragMoveEvent *event);
+ bool dragLeaveEvent(QDragLeaveEvent *event);
+ bool dropEvent(QDropEvent *event);
+ //
+
+ protected:
+ void initStyleOption(QStyleOption &opt);
+
+ private:
+ static ColorData *lookupData(const QPalette &pal);
+
+ // load the configuration
+ void loadConfig();
+
+ // draw a tab for some application
+ void drawTab(QPainter &painter, const QRect &rect, ClientGroupItem &item, bool border, bool active, bool dragging = false); // TABS
+
+ // use tabbing feature?
+ bool useWindowGrouping; // TABS
+ bool closeButtonsOnTabs; // TABS
+ // what kind of border we're using
+ int borderSize;
+ // just the titlebar text alignment
+ int titleBarTextAlign;
+
+ /* cached style hints and pixel metrics */
+ bool coloredFrame;
+ bool contrastFrame;
+ bool noBorder;
+ bool autoRaise;
+ int titleHeight;
+ int borderWidth;
+
+ // tabbing related
+ QPoint clickPos, releasePos;
+ Qt::MouseButton pressedButton;
+ QList<IaOraDecorationButton*> closeButtonsList;
+ bool clicking, dragging;
+ int targetTab;
+ //
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+#include <kdecorationfactory.h>
+
+class IaOraDecorationFactory : public KDecorationFactoryUnstable // TABS
+//class IaOraDecorationFactory : public KDecorationFactory
+{
+ public:
+ IaOraDecorationFactory();
+ virtual ~IaOraDecorationFactory();
+
+ public:
+ bool loadConfig();
+ virtual KDecoration *createDecoration(KDecorationBridge *bridge);
+ virtual bool reset(unsigned long changed);
+ //virtual QList<BorderSize> borderSizes() const;
+ virtual bool supports(Ability ability) const;
+
+ private:
+ int borderSize;
+ int alignFlag;
+ bool useWindowGrouping; // TABS
+ bool closeButtonsOnTabs; // TABS
+
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+#endif
+
+
Property changes on: theme/ia_ora-kde4/kwin-client/kwin_iaora.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/.directory
===================================================================
--- theme/ia_ora-kde4/src/.directory (rev 0)
+++ theme/ia_ora-kde4/src/.directory 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,2 @@
+[Dolphin]
+Timestamp=2008,3,30,17,28,53
Added: theme/ia_ora-kde4/src/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/src/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/src/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,41 @@
+project (kstyle-iaora)
+
+set (STYLE_SOURCES iaorastyle.cpp
+ iaorastyle_button.cpp
+ iaorastyle_icons.cpp
+ iaorastyle_scrollbar.cpp
+ iaorastyle_tabbar.cpp
+ iaorastyle_dial.cpp
+ iaorastyle_menu.cpp
+ iaorastyle_slider.cpp
+ iaorastyle_window.cpp
+ iaorastyle_frame.cpp
+ iaorastyle_progressbar.cpp
+ iaorastyle_symbols.cpp
+ iaorastyle_combobox.cpp
+ iaorastyle_spinbox.cpp
+ iaorastyle_q3listview.cpp
+ iaorastyle_toolbutton.cpp )
+
+set (iaora-kde_SOURCES iaora-kde.cpp ${STYLE_SOURCES})
+set (iaora-qt_SOURCES iaora-qt.cpp ${STYLE_SOURCES})
+
+if (KDE4_FOUND)
+ kde4_add_plugin (iaora-kde ${iaora-kde_SOURCES})
+ target_link_libraries (iaora-kde ${KDE4_KDEUI_LIBS})
+ install (TARGETS iaora-kde DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles)
+endif (KDE4_FOUND)
+
+ qt4_automoc (${iaora-qt_SOURCES})
+ add_library (iaora-qt SHARED ${iaora-qt_SOURCES})
+ target_link_libraries (iaora-qt ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
+ install (TARGETS iaora-qt LIBRARY DESTINATION ${QT_PLUGINS_DIR}/styles)
+ #install (FILES qtiaorarc DESTINATION ${KCFG_INSTALL_DIR})
+ install (FILES iaoracolors DESTINATION /etc )
+
+if (KDE4_FOUND)
+ install (FILES iaora-kde.themerc DESTINATION ${DATA_INSTALL_DIR}/kstyle/themes)
+ #install (FILES qtiaorarc DESTINATION ${KCFG_INSTALL_DIR})
+ #add_subdirectory (config)
+endif (KDE4_FOUND)
+
Property changes on: theme/ia_ora-kde4/src/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/config/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/src/config/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/src/config/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,8 @@
+set (kstyle_skulpture_config_SOURCES sk_config.cpp)
+qt4_add_resources (kstyle_skulpture_config_SOURCES sk_preview2.qrc)
+kde4_add_ui_files (kstyle_skulpture_config_SOURCES sk_dialog.ui sk_preview1.ui sk_preview2.ui)
+
+kde4_add_plugin (kstyle_skulpture_config ${kstyle_skulpture_config_SOURCES})
+target_link_libraries (kstyle_skulpture_config ${KDE4_KDEUI_LIBS})
+install (TARGETS kstyle_skulpture_config DESTINATION ${PLUGIN_INSTALL_DIR})
+
Property changes on: theme/ia_ora-kde4/src/config/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/config/images/README
===================================================================
--- theme/ia_ora-kde4/src/config/images/README (rev 0)
+++ theme/ia_ora-kde4/src/config/images/README 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1 @@
+Images courtesy of Oxygen project
Added: theme/ia_ora-kde4/src/config/sk_config.cpp
===================================================================
--- theme/ia_ora-kde4/src/config/sk_config.cpp (rev 0)
+++ theme/ia_ora-kde4/src/config/sk_config.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,320 @@
+/*
+ * sk_config.cpp
+ *
+ */
+
+#include "sk_config.h"
+#include <QtCore/QSettings>
+#include <QtCore/QDir>
+#include <QtCore/QUuid>
+#include <QtGui/QMdiSubWindow>
+#include <QtGui/QCloseEvent>
+#include <QtGui/QStyleFactory>
+#include <QtGui/QApplication>
+#include <QtGui/QDialog>
+#include <QtCore/QDebug>
+#include <KDE/KGlobal>
+#include <cstdio>
+
+
+/*-----------------------------------------------------------------------*/
+
+extern "C" KDE_EXPORT QWidget* allocate_kstyle_config(QWidget* parent)
+{
+ return new SkulptureStyleConfig(parent);
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+#include "ui_sk_preview1.h"
+
+class Preview1Window : public QDialog, private Ui::SkulpturePreview1
+{
+ public:
+ explicit Preview1Window(QWidget *parent = 0);
+
+ public:
+ virtual void closeEvent(QCloseEvent *e);
+
+ private:
+ void init();
+};
+
+
+Preview1Window::Preview1Window(QWidget *parent)
+ : QDialog(parent)
+{
+ init();
+}
+
+
+void Preview1Window::closeEvent(QCloseEvent *e)
+{
+ e->ignore();
+}
+
+
+void Preview1Window::init()
+{
+ setWindowFlags(Qt::Widget);
+ setupUi(this);
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+#include "ui_sk_preview2.h"
+
+class Preview2Window : public QMainWindow, private Ui::SkulpturePreview2
+{
+ public:
+ explicit Preview2Window(QWidget *parent = 0);
+
+ public:
+ virtual void closeEvent(QCloseEvent *e);
+
+ private:
+ void init();
+};
+
+
+Preview2Window::Preview2Window(QWidget *parent)
+ : QMainWindow(parent)
+{
+ init();
+}
+
+
+void Preview2Window::closeEvent(QCloseEvent *e)
+{
+ e->ignore();
+}
+
+
+void Preview2Window::init()
+{
+ setWindowFlags(Qt::Widget);
+ setupUi(this);
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+class KThemePreview::Private
+{
+ public:
+ QWidget *q;
+ QMdiArea *area;
+
+ public:
+ void init();
+};
+
+
+KThemePreview::KThemePreview(QWidget *parent)
+ : QWidget(parent), d(new Private)
+{
+ d->q = this;
+}
+
+
+KThemePreview::~KThemePreview()
+{
+ delete d;
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+void SkulptureStyleConfig::subWindowActivated(QMdiSubWindow *window)
+{
+ if (window) {
+ QWidget *parent = window->parentWidget();
+ if (parent) {
+ const QList<QObject *> children = parent->children();
+ foreach (QObject *child, children) {
+ QWidget *widget = qobject_cast<QWidget *>(child);
+ if (widget) {
+ widget->setWindowTitle(QString::fromUtf8(child == window ? "Active Window" : "Inactive Window"));
+ }
+ }
+ }
+ }
+}
+
+
+void SkulptureStyleConfig::updatePreview()
+{
+ QStyle *style = QStyleFactory::create(QString::fromUtf8("skulpture"));
+ if (style) {
+ int index = style->metaObject()->indexOfMethod("skulpturePrivateMethod(SkulpturePrivateMethod,void*)");
+ if (index >= 0) {
+ QUuid uuid = QUuid::createUuid();
+ QDir tempDir = QDir::temp();
+ // ### we may add a way to avoid the file completely.
+ QString fileName = QString::fromUtf8("skulpture-temp-settings-") + uuid.toString() + QString::fromUtf8(".ini");
+ QString absFileName = tempDir.absoluteFilePath(fileName);
+ {
+ QSettings s(absFileName, QSettings::IniFormat);
+ saveSettings(s);
+ // make visible in other process
+ s.sync();
+ }
+ SkMethodDataSetSettingsFileName data;
+ data.version = 1;
+ data.fileName = absFileName;
+
+ int result;
+ int id = SkulptureStyle::SPM_SetSettingsFileName;
+ void *dat = &data;
+ void *param[] = {&result, &id, &dat};
+ style->qt_metacall(QMetaObject::InvokeMetaMethod, index, param);
+
+ tempDir.remove(fileName);
+
+ QList<QMdiSubWindow *> windows = mdiArea->findChildren<QMdiSubWindow *>();
+ foreach (QMdiSubWindow *window, windows) {
+ window->setFocusPolicy(Qt::ClickFocus);
+ QList<QWidget *> widgets = window->widget()->findChildren<QWidget *>();
+ foreach (QWidget *widget, widgets) {
+ // TODO: only update widgets that have changes in settings
+ widget->setStyle(style);
+ widget->setFocusPolicy(Qt::ClickFocus);
+ }
+ }
+ }
+ }
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+SkulptureStyleConfig::SkulptureStyleConfig(QWidget *parent)
+ : QWidget(parent)
+{
+ init();
+}
+
+
+void SkulptureStyleConfig::init()
+{
+ KGlobal::locale()->insertCatalog(QString::fromAscii("kstyle_skulpture_config"));
+ setupUi(this);
+ mdiArea->setMinimumSize(QSize(500, 290));
+ mdiArea->setBackground(QColor(120, 120, 150));
+ load();
+// KConfig wm(QString::fromAscii("kwinskulpturerc"), KConfig::FullConfig);
+// KConfigGroup group = wm.group("WM");
+// QColor activeBackground;
+// QString c = group.readEntry("activeBackground");
+// qDebug() << "activeBackground = " << c;
+ connect(this, SIGNAL(changed(bool)), this, SLOT(updatePreview()));
+ connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subWindowActivated(QMdiSubWindow *)));
+ connect(cbAnimateProgressBars, SIGNAL(toggled(bool)), this, SLOT(updateChanged()));
+ connect(cbAllowScrollBarSliderToCoverArrows, SIGNAL(toggled(bool)), this, SLOT(updateChanged()));
+ connect(cbHideShortcutUnderlines, SIGNAL(toggled(bool)), this, SLOT(updateChanged()));
+#if 1
+#if 1
+ QMdiSubWindow *previewwindow2 = new QMdiSubWindow(mdiArea);
+// previewwindow2->setObjectName(QString::fromAscii("SkulpturePreviewWindow"));
+// previewwindow2->setProperty("sk_kwin_activeBackground",
+ previewwindow2->setStyle(QStyleFactory::create(QString::fromUtf8("skulpture")));
+ previewwindow2->setWidget(new Preview2Window(previewwindow2));
+ previewwindow2->setGeometry(107, 7, 450, 245);
+#endif
+#if 1
+ QMdiSubWindow *previewwindow1 = new QMdiSubWindow(mdiArea);
+// previewwindow1->setObjectName(QString::fromAscii("SkulpturePreviewWindow"));
+ previewwindow1->setStyle(QStyleFactory::create(QString::fromUtf8("skulpture")));
+ previewwindow1->setWidget(new Preview1Window(previewwindow1));
+ previewwindow1->setGeometry(7, 35, 450, 245);
+#endif
+ updatePreview();
+#else
+ mdiArea->hide();
+#endif
+}
+
+
+QSize SkulptureStyleConfig::sizeHint() const
+{
+ return QSize(570, 0);
+}
+
+
+SkulptureStyleConfig::~SkulptureStyleConfig()
+{
+ KGlobal::locale()->removeCatalog(QString::fromAscii("kstyle_skulpture_config"));
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+void SkulptureStyleConfig::loadSettings(QSettings &s)
+{
+ savedAnimateProgressBars = s.value(QString::fromAscii("ProgressBar/AnimateProgressBars"), true).toBool();
+ savedAllowScrollBarSliderToCoverArrows = s.value(QString::fromAscii("ScrollBar/AllowScrollBarSliderToCoverArrows"), true).toBool();
+ savedHideShortcutUnderlines = s.value(QString::fromAscii("General/HideShortcutUnderlines"), true).toBool();
+ apply();
+}
+
+
+void SkulptureStyleConfig::saveSettings(QSettings &s)
+{
+ s.setValue(QString::fromAscii("ProgressBar/AnimateProgressBars"), cbAnimateProgressBars->isChecked());
+ s.setValue(QString::fromAscii("ScrollBar/AllowScrollBarSliderToCoverArrows"), cbAllowScrollBarSliderToCoverArrows->isChecked());
+ s.setValue(QString::fromAscii("General/HideShortcutUnderlines"), cbHideShortcutUnderlines->isChecked());
+}
+
+
+void SkulptureStyleConfig::load()
+{
+ QSettings s(QSettings::IniFormat, QSettings::UserScope, QString::fromUtf8("SkulptureStyle"), QString::fromUtf8(""));
+ loadSettings(s);
+}
+
+
+void SkulptureStyleConfig::save()
+{
+ QSettings s(QSettings::IniFormat, QSettings::UserScope, QString::fromUtf8("SkulptureStyle"), QString::fromUtf8(""));
+ saveSettings(s);
+}
+
+
+void SkulptureStyleConfig::defaults()
+{
+ cbAnimateProgressBars->setChecked(true);
+ cbAllowScrollBarSliderToCoverArrows->setChecked(true);
+ cbHideShortcutUnderlines->setChecked(true);
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+void SkulptureStyleConfig::apply()
+{
+ cbAnimateProgressBars->setChecked(savedAnimateProgressBars);
+ cbAllowScrollBarSliderToCoverArrows->setChecked(savedAllowScrollBarSliderToCoverArrows);
+ cbHideShortcutUnderlines->setChecked(savedHideShortcutUnderlines);
+}
+
+
+void SkulptureStyleConfig::updateChanged()
+{
+ if (cbAnimateProgressBars->isChecked() == savedAnimateProgressBars
+ && cbAllowScrollBarSliderToCoverArrows->isChecked() == savedAllowScrollBarSliderToCoverArrows
+ && cbHideShortcutUnderlines->isChecked() == savedHideShortcutUnderlines
+ ) {
+ emit changed(false);
+ } else {
+ emit changed(true);
+ }
+}
+
+
+/*-----------------------------------------------------------------------*/
+
+#include "sk_config.moc"
+
+
Property changes on: theme/ia_ora-kde4/src/config/sk_config.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/config/sk_config.h
===================================================================
--- theme/ia_ora-kde4/src/config/sk_config.h (rev 0)
+++ theme/ia_ora-kde4/src/config/sk_config.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,155 @@
+/*
+ * sk_config.h
+ *
+ */
+
+#ifndef SKULPTURE_CONFIG_H
+#define SKULPTURE_CONFIG_H 1
+
+
+/*-----------------------------------------------------------------------*/
+
+#include <QtGui/QWidget>
+#include "ui_sk_dialog.h"
+class QSettings;
+class QMdiSubWindow;
+
+class SkulptureStyleConfig : public QWidget, private Ui::SkulptureStyleDialog
+{
+ Q_OBJECT
+
+ public:
+ explicit SkulptureStyleConfig(QWidget* parent = 0);
+ virtual ~SkulptureStyleConfig();
+
+ virtual QSize sizeHint() const;
+
+ Q_SIGNALS:
+ void changed(bool);
+
+ public Q_SLOTS:
+ void save();
+ void defaults();
+
+ protected:
+ void load();
+ void apply();
+ void saveSettings(QSettings &settings);
+ void loadSettings(QSettings &settings);
+
+ protected Q_SLOTS:
+ void updateChanged();
+ void updatePreview();
+
+ private Q_SLOTS:
+ void subWindowActivated(QMdiSubWindow *window);
+
+ private:
+ void init();
+
+ private:
+ bool savedAnimateProgressBars;
+ bool savedAllowScrollBarSliderToCoverArrows;
+ bool savedHideShortcutUnderlines;
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+enum ThemeCategory {
+ Colors,
+ Fonts, // text attributes
+ Frames, // style of layout
+ Layout, // sizing, spacing
+ Decorations, // grips etc.
+ Gradients,
+ Accessibility,
+ Icons,
+ Effects, // animations, fading, light
+ Cursors,
+ Sounds,
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+class KThemePreview : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ enum ThemeRole { General, Fixed, Small, Toolbar, MainToolbar, Menu, Window, TaskBar, Desktop };
+
+ public:
+ explicit KThemePreview(QWidget *parent = 0);
+ virtual ~KThemePreview();
+
+ public:
+ using QWidget::setFont;
+ void setFont(ThemeRole role, const QFont &font);
+ // TODO font settings, such as antialiasing and hinting
+
+ void setIconSize(ThemeRole role, const QSize &size);
+ void setIconTheme(const QString &iconTheme);
+ // TODO icon effects, icon animation, double size
+
+ void setWindowDecoration(const QString &windowDecoration);
+ // TODO window buttons, window theme settings
+
+ // setStyle(QStyle *);
+ void setSkulpturePrivateSettings(QSettings &s);
+ // TODO style effects, toolbar options
+
+ protected:
+ void addWindow(QWidget *window);
+ void addPage(QWidget *widget);
+
+ void removeWindow(QWidget *window);
+ void removePage(QWidget *page);
+
+ private:
+ class Private;
+ Private * const d;
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+#include <QtGui/QStyle>
+
+struct SkMethodData
+{
+ int version;
+};
+
+
+struct SkMethodDataSetSettingsFileName : public SkMethodData
+{
+ // in version 1
+ QString fileName;
+};
+
+
+class SkulptureStyle : public QStyle
+{
+ Q_OBJECT
+
+ public:
+ // internal, reserved for future use
+ enum SkulpturePrivateMethod {
+ SPM_SupportedMethods = 0,
+ SPM_SetSettingsFileName = 1,
+ };
+
+ public Q_SLOTS:
+ int skulpturePrivateMethod(SkulpturePrivateMethod /*id*/, void */*data*/ = 0) {
+ return 0;
+ }
+};
+
+
+/*-----------------------------------------------------------------------*/
+
+#endif
+
+
Property changes on: theme/ia_ora-kde4/src/config/sk_config.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/config/sk_dialog.ui
===================================================================
--- theme/ia_ora-kde4/src/config/sk_dialog.ui (rev 0)
+++ theme/ia_ora-kde4/src/config/sk_dialog.ui 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,90 @@
+<ui version="4.0" >
+ <class>SkulptureStyleDialog</class>
+ <widget class="QWidget" name="SkulptureStyleDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>357</width>
+ <height>386</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QMdiArea" name="mdiArea" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Sunken</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>General</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="cbAnimateProgressBars" >
+ <property name="text" >
+ <string>Animate Progress Bars</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbAllowScrollBarSliderToCoverArrows" >
+ <property name="text" >
+ <string>Allow Scroll Bar Handle to Cover Arrows</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cbHideShortcutUnderlines" >
+ <property name="text" >
+ <string>Hide Shortcut Underlines</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ <zorder>groupBox</zorder>
+ <zorder>mdiArea</zorder>
+ <zorder>cbAnimateProgressBars</zorder>
+ </widget>
+ <resources/>
+ <connections/>
+ <designerdata>
+ <property name="gridDeltaX" >
+ <number>10</number>
+ </property>
+ <property name="gridDeltaY" >
+ <number>10</number>
+ </property>
+ <property name="gridSnapX" >
+ <bool>true</bool>
+ </property>
+ <property name="gridSnapY" >
+ <bool>true</bool>
+ </property>
+ <property name="gridVisible" >
+ <bool>false</bool>
+ </property>
+ </designerdata>
+</ui>
Added: theme/ia_ora-kde4/src/config/sk_preview1.ui
===================================================================
--- theme/ia_ora-kde4/src/config/sk_preview1.ui (rev 0)
+++ theme/ia_ora-kde4/src/config/sk_preview1.ui 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,671 @@
+<ui version="4.0" >
+ <class>SkulpturePreview1</class>
+ <widget class="QDialog" name="SkulpturePreview1" >
+ <layout class="QVBoxLayout" name="verticalLayout_9" >
+ <item>
+ <widget class="QSplitter" name="splitter" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QWidget" name="layoutWidget" >
+ <layout class="QVBoxLayout" name="verticalLayout_7" >
+ <item>
+ <widget class="QPushButton" name="pushButton_2" >
+ <property name="text" >
+ <string>Show Disabled</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Group</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="text" >
+ <string>Check Box</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton_2" >
+ <property name="text" >
+ <string>Radio Button</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton" >
+ <property name="text" >
+ <string>Radio Button</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton" >
+ <property name="text" >
+ <string>Push Button</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QTabWidget" name="Text" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>272</width>
+ <height>210</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Widgets</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_6" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="KLineEdit" name="klineedit" >
+ <property name="text" >
+ <string>Text Line Edit</string>
+ </property>
+ <property name="clickMessage" >
+ <string>LineEdit (empty)</string>
+ </property>
+ <property name="showClearButton" stdset="0" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBox" >
+ <item>
+ <property name="text" >
+ <string>Combo Box</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Element</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_5" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="maximum" >
+ <number>100</number>
+ </property>
+ <property name="value" >
+ <number>70</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLCDNumber" name="lcdNumber" >
+ <property name="intValue" stdset="0" >
+ <number>70</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QSlider" name="horizontalSlider" >
+ <property name="maximum" >
+ <number>100</number>
+ </property>
+ <property name="value" >
+ <number>70</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDial" name="dial" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="maximum" >
+ <number>100</number>
+ </property>
+ <property name="value" >
+ <number>70</number>
+ </property>
+ <property name="notchesVisible" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar" >
+ <property name="value" >
+ <number>70</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="Seite_2" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>272</width>
+ <height>210</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Text</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_8" >
+ <item>
+ <widget class="KTextEdit" name="ktextedit" >
+ <property name="html" >
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
+<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Skulpture</span></p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;"><span style=" font-weight:400;">Version 0.1.2</span></p>
+<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://skulpture.maxiom.de/"><span style=" text-decoration: underline; color:#0057ae;">http://skulpture.maxiom.de/</span></a></p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright © 2007, 2008 Christoph Feck</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></td></tr></table></body></html></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>272</width>
+ <height>210</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tree</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <widget class="QTreeWidget" name="treeWidget" >
+ <column>
+ <property name="text" >
+ <string>Column 1</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Column 2</string>
+ </property>
+ </column>
+ <item>
+ <property name="text" >
+ <string>Element</string>
+ </property>
+ <property name="text" >
+ <string>(expandable)</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Element</string>
+ </property>
+ <property name="text" >
+ <string>Line 1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Element</string>
+ </property>
+ <property name="text" >
+ <string>Line 2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Element</string>
+ </property>
+ <property name="text" >
+ <string>Line 3</string>
+ </property>
+ </item>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Element</string>
+ </property>
+ <property name="text" >
+ <string>(not expandable)</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="Seite" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>272</width>
+ <height>210</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Table</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QTableWidget" name="tableWidget" >
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <column>
+ <property name="text" >
+ <string>Column 1</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Column 2</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Column 3</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Column 4</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KTextEdit</class>
+ <extends>QTextEdit</extends>
+ <header>ktextedit.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>dial</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>progressBar</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>375</x>
+ <y>126</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>337</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>dial</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>lcdNumber</receiver>
+ <slot>display(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>374</x>
+ <y>131</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>287</x>
+ <y>133</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>dial</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>spinBox</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>375</x>
+ <y>111</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>302</x>
+ <y>106</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>spinBox</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>progressBar</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>245</x>
+ <y>110</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>308</x>
+ <y>220</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>spinBox</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>lcdNumber</receiver>
+ <slot>display(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>339</x>
+ <y>121</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>339</x>
+ <y>139</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>spinBox</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>dial</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>236</x>
+ <y>108</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>379</x>
+ <y>122</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>horizontalSlider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>progressBar</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>323</x>
+ <y>79</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>380</x>
+ <y>223</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>horizontalSlider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>lcdNumber</receiver>
+ <slot>display(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>359</x>
+ <y>82</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>256</x>
+ <y>136</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>horizontalSlider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>spinBox</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>285</x>
+ <y>78</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>260</x>
+ <y>107</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>horizontalSlider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>dial</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>300</x>
+ <y>80</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>380</x>
+ <y>123</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pushButton_2</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>groupBox</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>106</x>
+ <y>24</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>104</x>
+ <y>43</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pushButton_2</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Text</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>117</x>
+ <y>26</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>137</x>
+ <y>40</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pushButton_2</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboBox</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>83</x>
+ <y>25</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>93</x>
+ <y>191</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pushButton_2</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>pushButton</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>66</x>
+ <y>23</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>80</x>
+ <y>225</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>dial</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>horizontalSlider</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>376</x>
+ <y>135</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>374</x>
+ <y>83</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>spinBox</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>horizontalSlider</receiver>
+ <slot>setValue(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>216</x>
+ <y>108</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>225</x>
+ <y>83</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Added: theme/ia_ora-kde4/src/config/sk_preview2.qrc
===================================================================
--- theme/ia_ora-kde4/src/config/sk_preview2.qrc (rev 0)
+++ theme/ia_ora-kde4/src/config/sk_preview2.qrc 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,12 @@
+<RCC>
+ <qresource prefix="skpreview2" >
+ <file>images/view-refresh.png</file>
+ <file>images/go-previous.png</file>
+ <file>images/go-next.png</file>
+ <file>images/document-new.png</file>
+ <file>images/document-open.png</file>
+ <file>images/edit-copy.png</file>
+ <file>images/edit-cut.png</file>
+ <file>images/edit-paste.png</file>
+ </qresource>
+</RCC>
Added: theme/ia_ora-kde4/src/config/sk_preview2.ui
===================================================================
--- theme/ia_ora-kde4/src/config/sk_preview2.ui (rev 0)
+++ theme/ia_ora-kde4/src/config/sk_preview2.ui 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,274 @@
+<ui version="4.0" >
+ <class>SkulpturePreview2</class>
+ <widget class="QMainWindow" name="SkulpturePreview2" >
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTextBrowser" name="textBrowser" >
+ <property name="html" >
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
+<table border="0" style="-qt-table-type: root; margin-top:16px; margin-bottom:16px; margin-left:16px; margin-right:16px;">
+<tr>
+<td style="border: none;">
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Skulpture</span></p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;"><span style=" font-weight:400;">Version 0.1.2</span></p>
+<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://skulpture.maxiom.de/"><span style=" text-decoration: underline; color:#0057ae;">http://skulpture.maxiom.de/</span></a></p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright © 2007, 2008 Christoph Feck</span></p>
+<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><span style=" font-size:10pt;">This is a demonstration window only</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></td></tr></table></body></html></string>
+ </property>
+ <property name="openExternalLinks" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <widget class="QMenu" name="menu_File" >
+ <property name="title" >
+ <string>&File</string>
+ </property>
+ <addaction name="action_New" />
+ <addaction name="action_Open" />
+ <addaction name="separator" />
+ <addaction name="action_Reload" />
+ </widget>
+ <widget class="QMenu" name="menu_Edit" >
+ <property name="title" >
+ <string>&Edit</string>
+ </property>
+ <addaction name="action_Cut" />
+ <addaction name="action_Copy" />
+ <addaction name="action_Paste" />
+ </widget>
+ <widget class="QMenu" name="menu_Settings" >
+ <property name="title" >
+ <string>&Settings</string>
+ </property>
+ <addaction name="actionConfigure" />
+ </widget>
+ <widget class="QMenu" name="menu_Help" >
+ <property name="title" >
+ <string>&Help</string>
+ </property>
+ <addaction name="actionHelp_Contents" />
+ </widget>
+ <addaction name="menu_File" />
+ <addaction name="menu_Edit" />
+ <addaction name="menu_Settings" />
+ <addaction name="menu_Help" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>242</y>
+ <width>256</width>
+ <height>21</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QToolBar" name="toolBar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>23</y>
+ <width>146</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>toolBar</string>
+ </property>
+ <attribute name="toolBarArea" >
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionNew" />
+ <addaction name="actionOpen" />
+ <addaction name="separator" />
+ <addaction name="actionCut" />
+ <addaction name="actionCopy" />
+ <addaction name="actionPaste" />
+ </widget>
+ <widget class="QToolBar" name="toolBar_2" >
+ <property name="geometry" >
+ <rect>
+ <x>146</x>
+ <y>23</y>
+ <width>110</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>toolBar_2</string>
+ </property>
+ <attribute name="toolBarArea" >
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionPrevious" />
+ <addaction name="actionNext" />
+ <addaction name="actionReload" />
+ </widget>
+ <action name="actionNew" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/document-new.png</normaloff>:/skpreview2/images/document-new.png</iconset>
+ </property>
+ <property name="text" >
+ <string>New</string>
+ </property>
+ </action>
+ <action name="actionOpen" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/document-open.png</normaloff>:/skpreview2/images/document-open.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Open</string>
+ </property>
+ </action>
+ <action name="actionCut" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/edit-cut.png</normaloff>:/skpreview2/images/edit-cut.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Cut</string>
+ </property>
+ </action>
+ <action name="actionCopy" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/edit-copy.png</normaloff>:/skpreview2/images/edit-copy.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Copy</string>
+ </property>
+ </action>
+ <action name="actionPaste" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/edit-paste.png</normaloff>:/skpreview2/images/edit-paste.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Paste</string>
+ </property>
+ </action>
+ <action name="actionPrevious" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/go-previous.png</normaloff>:/skpreview2/images/go-previous.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Previous</string>
+ </property>
+ </action>
+ <action name="actionNext" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/go-next.png</normaloff>:/skpreview2/images/go-next.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Next</string>
+ </property>
+ </action>
+ <action name="actionReload" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/view-refresh.png</normaloff>:/skpreview2/images/view-refresh.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Reload</string>
+ </property>
+ </action>
+ <action name="action_New" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/document-new.png</normaloff>:/skpreview2/images/document-new.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&New</string>
+ </property>
+ </action>
+ <action name="action_Open" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/document-open.png</normaloff>:/skpreview2/images/document-open.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Open</string>
+ </property>
+ </action>
+ <action name="action_Reload" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/view-refresh.png</normaloff>:/skpreview2/images/view-refresh.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Reload</string>
+ </property>
+ </action>
+ <action name="action_Cut" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/edit-cut.png</normaloff>:/skpreview2/images/edit-cut.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Cut</string>
+ </property>
+ </action>
+ <action name="action_Copy" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/edit-copy.png</normaloff>:/skpreview2/images/edit-copy.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Copy</string>
+ </property>
+ </action>
+ <action name="action_Paste" >
+ <property name="icon" >
+ <iconset resource="sk_preview2.qrc" >
+ <normaloff>:/skpreview2/images/edit-paste.png</normaloff>:/skpreview2/images/edit-paste.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Paste</string>
+ </property>
+ </action>
+ <action name="actionConfigure" >
+ <property name="text" >
+ <string>Configure...</string>
+ </property>
+ </action>
+ <action name="actionHelp_Contents" >
+ <property name="text" >
+ <string>Help Contents</string>
+ </property>
+ </action>
+ </widget>
+ <resources>
+ <include location="sk_preview2.qrc" />
+ </resources>
+ <connections/>
+</ui>
Added: theme/ia_ora-kde4/src/iaora-kde.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaora-kde.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaora-kde.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,515 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaora-kde.h"
+#include "iaorastyle.h"
+
+#include <QStyleOption>
+#include <QStyleOptionSpinBox>
+#include <QPainter>
+#include <QComboBox>
+#include <QAbstractSpinBox>
+#include <QToolButton>
+#include <QDockWidget>
+#include <QDebug>
+#include <QToolBar>
+
+K_EXPORT_STYLE("IaOraKde", IaOraKde)
+
+IaOraKde::IaOraKde()
+{
+ // not use 2 buttons on ScrollBar bottom
+ setWidgetLayoutProp(WT_ScrollBar, ScrollBar::DoubleBotButton, 0);
+ // We set the minimum size to 21 for the scrollbar slider like in the GTK ia ora
+ setWidgetLayoutProp(WT_ScrollBar, ScrollBar::MinimumSliderHeight, 21);
+
+ // correct the CheckBox and RadioButton sizes, according IaOraQt
+ setWidgetLayoutProp(WT_CheckBox, CheckBox::Size, 12);
+ setWidgetLayoutProp(WT_RadioButton, RadioButton::Size, 12);
+
+ m_style = new IaOraStyle(this);
+}
+
+IaOraKde::~IaOraKde()
+{
+ delete m_style;
+}
+
+void IaOraKde::polish(QWidget *widget){
+ // here we change the appearence of some widget
+ if (qobject_cast<QToolButton *>(widget)){
+ widget->setAttribute(Qt::WA_Hover, true); // forcing the mouse enter and leave event
+ }
+}
+void IaOraKde::unpolish(QWidget *widget){
+ if (qobject_cast<QToolButton *>(widget)){
+ widget->setAttribute(Qt::WA_Hover, false);
+ }
+}
+
+void IaOraKde::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ switch (element)
+ {
+ case QStyle::PE_FrameFocusRect:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameFocus);
+ break;
+ case QStyle::PE_Frame:
+ QComboBox *cmb;
+
+ if (widget)
+ cmb = qobject_cast<QComboBox *>(widget->parentWidget());
+
+ m_style->drawFrame(option, painter, (cmb) ? IaOraStyle::FrameComboBox : IaOraStyle::FrameFrame);
+
+ break;
+ case QStyle::PE_FrameWindow:
+ m_style->drawFrame(option, painter);
+ break;
+ case QStyle::PE_FrameMenu:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenu);
+ break;
+ case QStyle::PE_FrameTabWidget:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameTabBar);
+ break;
+ case QStyle::PE_PanelLineEdit:
+ {
+ if (widget && widget->parentWidget() && !qstrcmp(widget->parentWidget()->metaObject()->className(), "KHBox")){
+ QRect r(option->rect.adjusted(0, 0, 0, -2));
+ m_style->drawFrame(option, painter, IaOraStyle::FrameLineEdit, r);
+ } else
+ m_style->drawFrame(option, painter, IaOraStyle::FrameLineEdit);
+ }
+ break;
+ case QStyle::PE_PanelToolBar:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameToolBar);
+ break;
+ case QStyle::PE_PanelMenuBar:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenuBar);
+ break;
+ case QStyle::PE_FrameGroupBox:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameGroupBox);
+ break;
+ case QStyle::PE_IndicatorToolBarSeparator:
+ m_style->drawSeparator(option, painter);
+ break;
+ case QStyle::PE_IndicatorToolBarHandle:
+ m_style->drawHandle(option, painter);
+ break;
+ case QStyle::PE_PanelButtonCommand:
+ m_style->drawButton(option, painter);
+ break;
+ case QStyle::PE_FrameDefaultButton:
+ m_style->drawButtonDefaultBorder(option, painter);
+ break;
+ case QStyle::PE_PanelButtonTool:
+ if (widget && !qstrcmp(widget->metaObject()->className(), "QDockWidgetTitleButton"))
+ break;
+ m_style->drawButton(option, painter);
+ break;
+ case QStyle::PE_IndicatorCheckBox:
+ m_style->drawCheckBox(option, painter);
+ break;
+ case QStyle::PE_IndicatorRadioButton:
+ m_style->drawRadioButton(option, painter);
+ break;
+ case QStyle::PE_PanelButtonBevel:
+ m_style->drawButton(option, painter, true /*simplified*/);
+ break;
+ case QStyle::PE_IndicatorArrowUp:
+ case QStyle::PE_IndicatorSpinUp:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowUp);
+ break;
+ case QStyle::PE_IndicatorArrowDown:
+ case QStyle::PE_IndicatorSpinDown:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowDown);
+ break;
+ case QStyle::PE_IndicatorArrowLeft:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowLeft);
+ break;
+ case QStyle::PE_IndicatorArrowRight:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowRight);
+ break;
+ case QStyle::PE_IndicatorSpinPlus:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolPlus);
+ break;
+ case QStyle::PE_IndicatorSpinMinus:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolMinus);
+ break;
+ case QStyle::PE_IndicatorBranch:
+ m_style->drawBranch(option, painter);
+ break;
+ case QStyle::PE_PanelItemViewItem:
+ m_style->drawPanelItemViewItem(option, painter);
+ break;
+ case QStyle::PE_IndicatorDockWidgetResizeHandle:
+ {
+ // the horizontal / vertical flags are inverted
+ QStyleOption copy = *option;
+ if (copy.state & QStyle::State_Horizontal)
+ copy.state &= ~QStyle::State_Horizontal;
+ else
+ copy.state |= QStyle::State_Horizontal;
+ m_style->drawHandle(©, painter);
+ break;
+ }
+ case QStyle::PE_IndicatorButtonDropDown:
+ //m_style->drawButton(option, painter);
+ break;
+ case QStyle::PE_PanelItemViewRow:
+ m_style->drawPanelItemViewRow(option, painter);
+ break;
+ default:
+ qDebug("Element: %d", element);
+ KStyle::drawPrimitive(element, option, painter, widget);
+ }
+}
+
+void IaOraKde::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ switch (element)
+ {
+ case QStyle::CE_ToolBar:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenuBar);
+ break;
+ case QStyle::CE_MenuBarEmptyArea:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenuBar);
+ break;
+ case QStyle::CE_ProgressBarGroove:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameProgressBar);
+ break;
+ case QStyle::CE_ProgressBarContents:
+ m_style->drawProgressBarContents(option, painter, true);
+ break;
+ case QStyle::CE_ScrollBarSubLine:
+ case QStyle::CE_ScrollBarAddLine:
+ {
+ const QStyleOptionSlider* scr = qstyleoption_cast<const QStyleOptionSlider*>(option);
+ bool vertical = (scr->orientation == Qt::Vertical);
+ bool addLine = (element == QStyle::CE_ScrollBarAddLine) ? true : false;
+ QRect scrRect = scr->rect;
+ QRect r;
+
+ if (addLine){
+ if (vertical)
+ r = QRect(0, scrRect.bottom() - 15, scrRect.width(), 16);
+ else
+ r = QRect(scrRect.right() - 15, scrRect.top(), 16, scrRect.height());
+ } else{
+ if (vertical)
+ r = QRect(scrRect.left(), scrRect.top(), scrRect.width(), 16);
+ else
+ r = QRect(0, scrRect.top(), 16, scrRect.height());
+ }
+
+ const_cast<QStyleOption*>(option)->rect = r;
+
+ m_style->drawScrollBarButton(option, painter, (addLine) ? IaOraStyle::SymbolArrowRight : IaOraStyle::SymbolArrowLeft);
+ }
+ break;
+ case QStyle::CE_ScrollBarAddPage:
+ case QStyle::CE_ScrollBarSubPage:
+ m_style->drawScrollBarEmptySpace(option, painter);
+ break;
+ case QStyle::CE_ScrollBarFirst:
+ painter->fillRect(option->rect, Qt::gray);
+ break;
+ case QStyle::CE_ScrollBarLast:
+ painter->fillRect(option->rect, Qt::gray);
+ break;
+ case QStyle::CE_ScrollBarSlider:
+ m_style->drawScrollBarHandle(option, painter);
+ break;
+ case QStyle::CE_HeaderSection:
+ case QStyle::CE_HeaderEmptyArea:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameHeader);
+ break;
+ case QStyle::CE_MenuEmptyArea:
+ break;
+ case QStyle::CE_MenuBarItem:
+ m_style->drawMenuItem(option, painter, false);
+ break;
+ case QStyle::CE_MenuItem:
+ m_style->drawMenuItem(option, painter);
+ break;
+ case QStyle::CE_Splitter:
+ m_style->drawHandle(option, painter);
+ break;
+ case QStyle::CE_DockWidgetTitle:
+ m_style->drawDockWindowTitle(option, painter);
+ break;
+ case QStyle::CE_TabBarTab:
+ m_style->drawTabBarTab(option, painter);
+ break;
+ case QStyle::CE_ComboBoxLabel:
+ m_style->drawComboBoxLabel(option, painter);
+ break;
+ case QStyle::CE_ItemViewItem:
+ m_style->drawPanelItemViewItem(option, painter, true);
+ break;
+ default:
+ qDebug("ControlElement: %d", element);
+ KStyle::drawControl(element, option, painter, widget);
+ }
+}
+
+int IaOraKde::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
+{
+ switch (metric)
+ {
+ case QStyle::PM_ButtonDefaultIndicator:
+ return 1;
+ break;
+ case QStyle::PM_ButtonShiftHorizontal:
+ case QStyle::PM_ButtonShiftVertical:
+ return 0;
+ case QStyle::PM_DefaultFrameWidth:
+ case QStyle::PM_ComboBoxFrameWidth:
+ return 1;
+ case QStyle::PM_SliderControlThickness:
+ return 8;
+ case QStyle::PM_SliderLength:
+ return 26;
+ case QStyle::PM_SliderTickmarkOffset:
+ return 5;
+ case QStyle::PM_SplitterWidth:
+ return 8;
+ case QStyle::PM_DockWidgetTitleBarButtonMargin:
+ case QStyle::PM_DockWidgetTitleMargin:
+ return 0;
+ case QStyle::PM_ToolBarIconSize:
+ return 24;
+ case QStyle::PM_MenuBarItemSpacing:
+ return 5;
+ case QStyle::PM_SliderSpaceAvailable:
+ if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option))
+ {
+ int size = 15;
+ if (slider->tickPosition & QSlider::TicksBelow)
+ ++size;
+ if (slider->tickPosition & QSlider::TicksAbove)
+ ++size;
+ return size;
+ }
+ case QStyle::PM_ScrollView_ScrollBarSpacing:
+ return -1;
+ // very strange issue
+ /*case QStyle::PM_ScrollBarSliderMin:
+ return 31;*/
+ default:
+ //qDebug(); // do not remove this for now (horrible hack)
+ return KStyle::pixelMetric(metric, option, widget);
+ }
+}
+
+int IaOraKde::styleHint(QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const
+{
+ switch (hint)
+ {
+ case QStyle::SH_TitleBar_NoBorder:
+ return true;
+ case SH_MenuBar_MouseTracking:
+ case SH_Menu_MouseTracking:
+ return true;
+ case SH_ScrollBar_MiddleClickAbsolutePosition:
+ return true;
+ case SH_ScrollView_FrameOnlyAroundContents:
+ return true;
+ default:
+ return KStyle::styleHint(hint, option, widget, returnData);
+ }
+}
+
+QSize IaOraKde::sizeFromContents (ContentsType type, const QStyleOption * option, const QSize & contentsSize, const QWidget *widget) const
+{
+ switch (type)
+ {
+ case QStyle::CT_MenuBarItem:
+ return contentsSize + QSize(8,4);
+ case CT_MenuItem:
+ {
+ const QStyleOptionMenuItem *menuOpt = qstyleoption_cast<const QStyleOptionMenuItem *>(option);
+ if (menuOpt)
+ return contentsSize + QSize(46, 4);
+ }
+ break;
+ case CT_ComboBox:
+ return contentsSize + QSize(32, 0);
+ default:
+ return KStyle::sizeFromContents(type, option, contentsSize, widget);
+ }
+ // just for the war
+}
+
+void IaOraKde::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
+ bool enabled, const QString& text, QPalette::ColorRole textRole) const
+{
+ m_style->drawItemText(painter, rect, alignment, pal, enabled, text, textRole);
+}
+
+void IaOraKde::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
+{
+ QRect r = option->rect;
+ switch(control)
+ {
+ case QStyle::CC_SpinBox:
+ {
+ m_style->drawSpinBox(option, painter);
+ break;
+ }
+ case CC_ComboBox:
+ {
+ m_style->drawComboBox(option, painter);
+ break;
+ }
+ case CC_Slider:
+ {
+ QRect grooveRegion = subControlRect(CC_Slider, option, SC_SliderGroove, widget);
+ QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget);
+ QRect ticks = subControlRect(CC_Slider, option, SC_SliderTickmarks, widget);
+
+ m_style->drawSlider(option, painter, grooveRegion, handle, ticks);
+ break;
+ }
+ case CC_Dial:
+ {
+ m_style->drawDial(option, painter);
+ break;
+ }
+ case CC_TitleBar:
+ {
+ m_style->drawTitleBar(option, painter, widget);
+ break;
+ }
+ case CC_Q3ListView:
+ {
+ m_style->drawQ3ListView(option, painter, widget);
+ break;
+ }
+ //case CC_ScrollBar: // this will not be drawed here
+ case CC_ToolButton:
+ {
+ QDockWidget *dockWidget;
+ QTabBar *tabBar;
+ if (widget)
+ {
+ dockWidget = qobject_cast<QDockWidget *>(widget->parentWidget());
+ tabBar = qobject_cast<QTabBar *>(widget->parentWidget());
+ }
+
+ if (dockWidget){ // the QDockWidget icons
+ const QStyleOptionToolButton *opt = qstyleoption_cast <const QStyleOptionToolButton *>(option);
+ bool sunken = (opt->state & QStyle::State_Sunken);
+ bool hover = (opt->state & QStyle::State_MouseOver);
+
+ QIcon::Mode mode = (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
+ if (hover){
+ mode = QIcon::Selected;
+ }
+
+ int shift = 0;
+ if (sunken) shift = 2;
+
+ QPixmap pix = opt->icon.pixmap(opt->iconSize, mode);
+ QRect iconRect(r);
+
+ iconRect = alignedRect(opt->direction, Qt::AlignCenter, iconRect.size(), r);
+ iconRect.setTopLeft(iconRect.topLeft() + QPoint(shift, shift));
+
+ drawItemPixmap(painter, iconRect, Qt::AlignCenter, pix);
+ } else if (tabBar){ // we have tab arrows indicators?
+ const QStyleOptionToolButton *opt = qstyleoption_cast <const QStyleOptionToolButton *>(option);
+ QRect toolButtonRect = opt->rect;
+
+ bool vertical = false;
+ if (opt->features && QStyleOptionToolButton::Arrow)
+ if ((opt->arrowType == Qt::LeftArrow) || (opt->arrowType == Qt::RightArrow)) vertical = true;
+
+ painter->save();
+ painter->setClipRect(toolButtonRect);
+ painter->fillRect(toolButtonRect, option->palette.brush(QPalette::Window));
+
+ m_style->drawToolButton(option, painter);
+ painter->restore();
+
+ if (vertical)
+ m_style->drawSymbol(option, painter, (opt->arrowType == Qt::LeftArrow) ? IaOraStyle::SymbolArrowLeft : IaOraStyle::SymbolArrowRight);
+ else
+ m_style->drawSymbol(option, painter, (opt->arrowType == Qt::UpArrow) ? IaOraStyle::SymbolArrowUp : IaOraStyle::SymbolArrowDown);
+ } else // if not...
+ m_style->drawToolButton(option, painter);
+ break;
+ }
+ default:
+ KStyle::drawComplexControl(control, option, painter, widget);
+ }
+}
+
+QIcon IaOraKde::standardIconImplementation(QStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
+{
+ if (m_style->hasIcon(standardIcon))
+ return m_style->standardIcon(standardIcon, option, widget);
+
+ return KStyle::standardIconImplementation(standardIcon, option, widget);
+}
+
+QRect IaOraKde::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const
+{
+ QRect r = KStyle::subControlRect(control, option, subControl, widget);
+
+ switch (control)
+ {
+ case QStyle::CC_SpinBox:
+ if (subControl == QStyle::SC_SpinBoxEditField)
+ r.adjust(-1,-1,1,1);
+ break;
+ case QStyle::CC_ComboBox:
+ if (subControl == QStyle::SC_ComboBoxEditField)
+ r.adjust(-1,-1,0,0);
+ break;
+ default:
+ break;
+ }
+
+ return r;
+}
+
+QRect IaOraKde::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
+{
+ QRect r = KStyle::subElementRect(element, option, widget);
+
+ switch (element)
+ {
+ case SE_LineEditContents:
+ if (widget->parentWidget()){
+ if (!qstrcmp(widget->parentWidget()->metaObject()->className(), "KHBox"))
+ r.adjust(0,-1,0,0);
+ else
+ r.adjust(3,1,-1,0);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return r;
+}
+
+#include "iaora-kde.moc"
Property changes on: theme/ia_ora-kde4/src/iaora-kde.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaora-kde.h
===================================================================
--- theme/ia_ora-kde4/src/iaora-kde.h (rev 0)
+++ theme/ia_ora-kde4/src/iaora-kde.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef IAORA_KDE_H
+#define IAORA_KDE_H
+
+#include <KStyle>
+
+class IaOraStyle;
+
+class IaOraKde : public KStyle
+{
+ Q_OBJECT
+public:
+ IaOraKde();
+ ~IaOraKde();
+
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0 ) const;
+
+ virtual void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
+ bool enabled, const QString& text, QPalette::ColorRole textRole) const;
+ virtual void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
+ virtual int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, QStyleHintReturn *returnData = 0 ) const;
+ virtual QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget = 0) const;
+
+ virtual QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget = 0) const;
+ virtual QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
+
+ void polish(QWidget *widget);
+ void unpolish(QWidget *widget);
+
+protected slots:
+ QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
+
+private:
+ IaOraStyle *m_style;
+};
+
+#endif
Property changes on: theme/ia_ora-kde4/src/iaora-kde.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaora-kde.themerc
===================================================================
--- theme/ia_ora-kde4/src/iaora-kde.themerc (rev 0)
+++ theme/ia_ora-kde4/src/iaora-kde.themerc 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,7 @@
+[Misc]
+Name=IaOra-Kde
+Comment=IaOra Kde style
+#ConfigPage=kstyle_iaora_config
+
+[KDE]
+WidgetStyle=IaOraKde
Added: theme/ia_ora-kde4/src/iaora-qt.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaora-qt.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaora-qt.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,512 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaora-qt.h"
+#include "iaorastyle.h"
+#include <QDebug>
+
+#include <QStyleOption>
+#include <QStyleOptionSpinBox>
+#include <QPainter>
+#include <QComboBox>
+#include <QAbstractSpinBox>
+#include <QToolButton>
+#include <QDockWidget>
+
+/*-----------------------------------------------------------------------*/
+
+#include <QtGui/QStylePlugin>
+
+class IaOraStylePlugin : public QStylePlugin
+{
+public:
+ QStringList keys() const
+ {
+ return QString::fromUtf8("IaOra-Qt").split(QChar(',', 0));
+ }
+
+ QStyle *create(const QString &key)
+ {
+ if (key.toLower() == QString::fromUtf8("iaora-qt"))
+ {
+ return new IaOraQt;
+ }
+ return 0;
+ }
+};
+
+
+Q_EXPORT_PLUGIN2(iaora-qt, IaOraStylePlugin)
+
+/*-----------------------------------------------------------------------*/
+
+IaOraQt::IaOraQt()
+{
+ m_style = new IaOraStyle(this);
+}
+
+IaOraQt::~IaOraQt()
+{
+ delete m_style;
+}
+
+void IaOraQt::polish(QWidget *widget){
+ // here we change the appearence of some widget
+ if (qobject_cast<QToolButton *>(widget)){
+ widget->setAttribute(Qt::WA_Hover, true); // forcing the mouse enter and leave event
+ }
+}
+void IaOraQt::unpolish(QWidget *widget){
+ if (qobject_cast<QToolButton *>(widget)){
+ widget->setAttribute(Qt::WA_Hover, false);
+ }
+}
+
+void IaOraQt::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ switch (element)
+ {
+ case QStyle::PE_FrameFocusRect:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameFocus);
+ break;
+ case QStyle::PE_Frame:
+ QComboBox *cmb;
+
+ if (widget)
+ cmb = qobject_cast<QComboBox *>(widget->parentWidget());
+
+ m_style->drawFrame(option, painter, (cmb) ? IaOraStyle::FrameComboBox : IaOraStyle::FrameFrame);
+
+ break;
+ case QStyle::PE_FrameWindow:
+ m_style->drawFrame(option, painter);
+ break;
+ case QStyle::PE_FrameMenu:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenu);
+ break;
+ case QStyle::PE_FrameTabWidget:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameTabBar);
+ break;
+ case QStyle::PE_PanelLineEdit:
+ {
+ if (widget && widget->parentWidget() && !qstrcmp(widget->parentWidget()->metaObject()->className(), "KHBox")){
+ QRect r(option->rect.adjusted(0, 0, 0, -2));
+ m_style->drawFrame(option, painter, IaOraStyle::FrameLineEdit, r);
+ } else
+ m_style->drawFrame(option, painter, IaOraStyle::FrameLineEdit);
+ }
+ break;
+ case QStyle::PE_PanelToolBar:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameToolBar);
+ break;
+ case QStyle::PE_PanelMenuBar:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenuBar);
+ break;
+ case QStyle::PE_FrameGroupBox:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameGroupBox);
+ break;
+ case QStyle::PE_IndicatorToolBarSeparator:
+ m_style->drawSeparator(option, painter);
+ break;
+ case QStyle::PE_IndicatorToolBarHandle:
+ m_style->drawHandle(option, painter);
+ break;
+ case QStyle::PE_PanelButtonCommand:
+ m_style->drawButton(option, painter);
+ break;
+ case QStyle::PE_FrameDefaultButton:
+ m_style->drawButtonDefaultBorder(option, painter);
+ break;
+ case QStyle::PE_PanelButtonTool:
+ if (widget && !qstrcmp(widget->metaObject()->className(), "QDockWidgetTitleButton"))
+ break;
+ m_style->drawButton(option, painter);
+ break;
+ case QStyle::PE_IndicatorCheckBox:
+ m_style->drawCheckBox(option, painter);
+ break;
+ case QStyle::PE_IndicatorRadioButton:
+ m_style->drawRadioButton(option, painter);
+ break;
+ case QStyle::PE_PanelButtonBevel:
+ m_style->drawButton(option, painter, true /*simplified*/);
+ break;
+ case QStyle::PE_IndicatorArrowUp:
+ case QStyle::PE_IndicatorSpinUp:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowUp);
+ break;
+ case QStyle::PE_IndicatorArrowDown:
+ case QStyle::PE_IndicatorSpinDown:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowDown);
+ break;
+ case QStyle::PE_IndicatorArrowLeft:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowLeft);
+ break;
+ case QStyle::PE_IndicatorArrowRight:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolArrowRight);
+ break;
+ case QStyle::PE_IndicatorSpinPlus:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolPlus);
+ break;
+ case QStyle::PE_IndicatorSpinMinus:
+ m_style->drawSymbol(option, painter, IaOraStyle::SymbolMinus);
+ break;
+ case QStyle::PE_IndicatorBranch:
+ m_style->drawBranch(option, painter);
+ break;
+ case QStyle::PE_PanelItemViewItem:
+ m_style->drawPanelItemViewItem(option, painter);
+ break;
+ // case QStyle::PE_PanelItemViewRow: // Do not use it, or setBackground() will not work on a QGrid
+ case QStyle::PE_IndicatorDockWidgetResizeHandle:
+ {
+ // the horizontal / vertical flags are inverted
+ QStyleOption copy = *option;
+ if (copy.state & QStyle::State_Horizontal)
+ copy.state &= ~QStyle::State_Horizontal;
+ else
+ copy.state |= QStyle::State_Horizontal;
+ m_style->drawHandle(©, painter);
+ break;
+ }
+ case QStyle::PE_IndicatorButtonDropDown:
+ //m_style->drawButton(option, painter);
+ break;
+ case QStyle::PE_PanelItemViewRow:
+ m_style->drawPanelItemViewRow(option, painter);
+ break;
+ default:
+ qDebug("Element: %d", element);
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+ }
+}
+
+void IaOraQt::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ switch (element)
+ {
+ case QStyle::CE_ToolBar:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenuBar);
+ break;
+ case QStyle::CE_MenuBarEmptyArea:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameMenuBar);
+ break;
+ case QStyle::CE_ProgressBarGroove:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameProgressBar);
+ break;
+ case QStyle::CE_ProgressBarContents:
+ m_style->drawProgressBarContents(option, painter);
+ break;
+ case QStyle::CE_ScrollBarSubLine:
+ m_style->drawScrollBarButton(option, painter, IaOraStyle::SymbolArrowLeft);
+ break;
+ case QStyle::CE_ScrollBarAddLine:
+ m_style->drawScrollBarButton(option, painter, IaOraStyle::SymbolArrowRight);
+ break;
+ case QStyle::CE_ScrollBarAddPage:
+ case QStyle::CE_ScrollBarSubPage:
+ m_style->drawScrollBarEmptySpace(option, painter);
+ break;
+ case QStyle::CE_ScrollBarFirst:
+ painter->fillRect(option->rect, Qt::gray);
+ break;
+ case QStyle::CE_ScrollBarLast:
+ painter->fillRect(option->rect, Qt::gray);
+ break;
+ case QStyle::CE_ScrollBarSlider:
+ m_style->drawScrollBarHandle(option, painter);
+ break;
+ case QStyle::CE_HeaderSection:
+ case QStyle::CE_HeaderEmptyArea:
+ m_style->drawFrame(option, painter, IaOraStyle::FrameHeader);
+ break;
+ case QStyle::CE_MenuEmptyArea:
+ break;
+ case QStyle::CE_MenuBarItem:
+ m_style->drawMenuItem(option, painter, false);
+ break;
+ case QStyle::CE_MenuItem:
+ m_style->drawMenuItem(option, painter);
+ break;
+ case QStyle::CE_Splitter:
+ m_style->drawHandle(option, painter);
+ break;
+ case QStyle::CE_DockWidgetTitle:
+ m_style->drawDockWindowTitle(option, painter);
+ break;
+ case QStyle::CE_TabBarTab:
+ m_style->drawTabBarTab(option, painter);
+ break;
+ case QStyle::CE_ComboBoxLabel:
+ m_style->drawComboBoxLabel(option, painter);
+ break;
+ case QStyle::CE_ItemViewItem:
+ m_style->drawPanelItemViewItem(option, painter, true);
+ break;
+ default:
+ qDebug("ControlElement: %d", element);
+ QCommonStyle::drawControl(element, option, painter, widget);
+ }
+}
+
+int IaOraQt::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
+{
+ switch (metric)
+ {
+ case QStyle::PM_ButtonDefaultIndicator:
+ return 1;
+ break;
+ case QStyle::PM_ButtonShiftHorizontal:
+ case QStyle::PM_ButtonShiftVertical:
+ return 0;
+ case QStyle::PM_DefaultFrameWidth:
+ case QStyle::PM_ComboBoxFrameWidth:
+ return 1;
+ case QStyle::PM_SliderControlThickness:
+ return 8;
+ case QStyle::PM_SliderLength:
+ return 26;
+ case QStyle::PM_SliderTickmarkOffset:
+ return 5;
+ case QStyle::PM_SplitterWidth:
+ return 8;
+ case QStyle::PM_DockWidgetTitleBarButtonMargin:
+ case QStyle::PM_DockWidgetTitleMargin:
+ return 0;
+ case QStyle::PM_ToolBarIconSize:
+ return 24;
+ case QStyle::PM_MenuBarItemSpacing:
+ return 5;
+ case QStyle::PM_SliderSpaceAvailable:
+ if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option))
+ {
+ int size = 15;
+ if (slider->tickPosition & QSlider::TicksBelow)
+ ++size;
+ if (slider->tickPosition & QSlider::TicksAbove)
+ ++size;
+ return size;
+ }
+ break;
+ case QStyle::PM_ScrollView_ScrollBarSpacing:
+ return -1;
+ // very strange issue // HERE
+ /*case QStyle::PM_ScrollBarSliderMin: // HERE
+ break;*/ // HERE
+ default:
+ //qDebug(); // do not remove this for now (horrible hack) // HERE
+ return QCommonStyle::pixelMetric(metric, option, widget);
+ }
+}
+
+int IaOraQt::styleHint(QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const
+{
+ switch (hint)
+ {
+ case QStyle::SH_TitleBar_NoBorder:
+ return true;
+ case SH_MenuBar_MouseTracking:
+ case SH_Menu_MouseTracking:
+ return true;
+ case SH_ScrollBar_MiddleClickAbsolutePosition:
+ return true;
+ case SH_ScrollView_FrameOnlyAroundContents:
+ return true;
+ default:
+ return QCommonStyle::styleHint(hint, option, widget, returnData);
+ }
+}
+
+QSize IaOraQt::sizeFromContents (ContentsType type, const QStyleOption * option, const QSize & contentsSize, const QWidget *widget) const
+{
+ switch (type)
+ {
+ case QStyle::CT_MenuBarItem:
+ return contentsSize + QSize(8,4);
+ case CT_MenuItem:
+ {
+ const QStyleOptionMenuItem *menuOpt = qstyleoption_cast<const QStyleOptionMenuItem *>(option);
+ if (menuOpt)
+ return contentsSize + QSize(46, 4);
+ }
+ //break; // HERE
+ default:
+ return QCommonStyle::sizeFromContents(type, option, contentsSize, widget);
+ }
+ // just for the war
+}
+
+void IaOraQt::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
+ bool enabled, const QString& text, QPalette::ColorRole textRole) const
+{
+ m_style->drawItemText(painter, rect, alignment, pal, enabled, text, textRole);
+}
+
+void IaOraQt::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
+{
+ QRect r = option->rect;
+ switch(control)
+ {
+ case QStyle::CC_SpinBox:
+ {
+ m_style->drawSpinBox(option, painter);
+ break;
+ }
+ case CC_ComboBox:
+ {
+ m_style->drawComboBox(option, painter);
+ break;
+ }
+ case CC_Slider:
+ {
+ QRect grooveRegion = subControlRect(CC_Slider, option, SC_SliderGroove, widget);
+ QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget);
+ QRect ticks = subControlRect(CC_Slider, option, SC_SliderTickmarks, widget);
+
+ m_style->drawSlider(option, painter, grooveRegion, handle, ticks);
+ break;
+ }
+ case CC_Dial:
+ {
+ m_style->drawDial(option, painter);
+ break;
+ }
+ case CC_TitleBar:
+ {
+ m_style->drawTitleBar(option, painter, widget);
+ break;
+ }
+ case CC_Q3ListView:
+ {
+ m_style->drawQ3ListView(option, painter, widget);
+ break;
+ }
+ //case CC_ScrollBar: // this will not be drawed here
+ case CC_ToolButton:
+ {
+ QDockWidget *dockWidget;
+ QTabBar *tabBar;
+ if (widget)
+ {
+ dockWidget = qobject_cast<QDockWidget *>(widget->parentWidget());
+ tabBar = qobject_cast<QTabBar *>(widget->parentWidget());
+ }
+
+ if (dockWidget){ // the QDockWidget icons
+ const QStyleOptionToolButton *opt = qstyleoption_cast <const QStyleOptionToolButton *>(option);
+ bool sunken = (opt->state & QStyle::State_Sunken);
+ bool hover = (opt->state & QStyle::State_MouseOver);
+
+ QIcon::Mode mode = (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
+ if (hover){
+ mode = QIcon::Selected;
+ }
+
+ int shift = 0;
+ if (sunken) shift = 2;
+
+ QPixmap pix = opt->icon.pixmap(opt->iconSize, mode);
+ QRect iconRect(r);
+
+ iconRect = alignedRect(opt->direction, Qt::AlignCenter, iconRect.size(), r);
+ iconRect.setTopLeft(iconRect.topLeft() + QPoint(shift, shift));
+
+ drawItemPixmap(painter, iconRect, Qt::AlignCenter, pix);
+ } else if (tabBar){ // we have tab arrows indicators?
+ const QStyleOptionToolButton *opt = qstyleoption_cast <const QStyleOptionToolButton *>(option);
+ QRect toolButtonRect = opt->rect;
+
+ bool vertical = false;
+ if (opt->features && QStyleOptionToolButton::Arrow)
+ if ((opt->arrowType == Qt::LeftArrow) || (opt->arrowType == Qt::RightArrow)) vertical = true;
+
+ painter->save();
+ painter->setClipRect(toolButtonRect);
+ painter->fillRect(toolButtonRect, option->palette.brush(QPalette::Window));
+
+ m_style->drawToolButton(option, painter);
+ painter->restore();
+
+ if (vertical)
+ m_style->drawSymbol(option, painter, (opt->arrowType == Qt::LeftArrow) ? IaOraStyle::SymbolArrowLeft : IaOraStyle::SymbolArrowRight);
+ else
+ m_style->drawSymbol(option, painter, (opt->arrowType == Qt::UpArrow) ? IaOraStyle::SymbolArrowUp : IaOraStyle::SymbolArrowDown);
+ } else // if not...
+ m_style->drawToolButton(option, painter);
+ break;
+ }
+ default:
+ QCommonStyle::drawComplexControl(control, option, painter, widget);
+ }
+}
+
+QIcon IaOraQt::standardIconImplementation(QStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
+{
+ if (m_style->hasIcon(standardIcon))
+ return m_style->standardIcon(standardIcon, option, widget);
+
+ return QCommonStyle::standardIconImplementation(standardIcon, option, widget);
+}
+
+QRect IaOraQt::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const
+{
+ QRect r = QCommonStyle::subControlRect(control, option, subControl, widget);
+
+ switch (control)
+ {
+ case QStyle::CC_SpinBox:
+ if (subControl == QStyle::SC_SpinBoxEditField)
+ r.adjust(-1,-1,1,1);
+ break;
+ case QStyle::CC_ComboBox:
+ if (subControl == QStyle::SC_ComboBoxEditField)
+ r.adjust(-3,-3,1,2);
+ else if (subControl == QStyle::SC_ComboBoxArrow)
+ r.adjust(0,-1,1,1);
+ break;
+ default:
+ break;
+ }
+
+ return r;
+}
+
+QRect IaOraQt::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
+{
+ QRect r = QCommonStyle::subElementRect(element, option, widget);
+
+ switch (element)
+ {
+ case SE_LineEditContents:
+ if (widget->parentWidget()){
+ if (!qstrcmp(widget->parentWidget()->metaObject()->className(), "KHBox"))
+ r.adjust(0,-1,0,0);
+ else
+ r.adjust(3,1,-1,0);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return r;
+}
+
+#include "iaora-qt.moc"
Property changes on: theme/ia_ora-kde4/src/iaora-qt.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaora-qt.h
===================================================================
--- theme/ia_ora-kde4/src/iaora-qt.h (rev 0)
+++ theme/ia_ora-kde4/src/iaora-qt.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef IAORA_QT_H
+#define IAORA_QT_H
+
+#include <QCommonStyle>
+
+class IaOraStyle;
+
+class Q_DECL_EXPORT IaOraQt : public QCommonStyle
+{
+ Q_OBJECT
+public:
+ IaOraQt();
+ ~IaOraQt();
+
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0 ) const;
+
+ virtual void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
+ bool enabled, const QString& text, QPalette::ColorRole textRole) const;
+ virtual void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
+ virtual int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, QStyleHintReturn *returnData = 0 ) const;
+ virtual QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget = 0) const;
+
+ virtual QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget = 0) const;
+ virtual QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
+
+ void polish(QWidget *widget);
+ void unpolish(QWidget *widget);
+
+protected slots:
+ QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
+
+private:
+ IaOraStyle *m_style;
+};
+
+#endif
Property changes on: theme/ia_ora-kde4/src/iaora-qt.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaoracolors
===================================================================
--- theme/ia_ora-kde4/src/iaoracolors (rev 0)
+++ theme/ia_ora-kde4/src/iaoracolors 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,58 @@
+[Default]
+gray0=#EFF3F7
+gray1=#DFE7EF
+gray2=#CFD7DF
+gray3=#C7D3DF
+gray4=#B6C3CF
+gray5=#A6B2C7
+gray6=#8692A6
+
+[Arctic]
+color0=#EFF7FF
+color1=#C7DFFF
+color2=#8EC7FF
+color3=#79BEFF
+color4=#69B6FF
+
+[Blue]
+color0=#A6B6E7
+color1=#8EA2CF
+color2=#4965AE
+color3=#415DA6
+color4=#21459C
+
+[Gray]
+color0=#DFE7EF
+color1=#CFD7DF
+color2=#C7D3DF
+color3=#B6C3CF
+color4=#A6B2C7
+
+[Night]
+color0=#ACB9EA
+color1=#808DC6
+color2=#5D658E
+color3=#3D4467
+color4=#272F4F
+
+[Orange]
+color0=#FFDF10
+color1=#FFCB10
+color2=#F7B610
+color3=#FFA208
+color4=#F79600
+
+[Smooth]
+color0=#CEE3FF
+color1=#ADCFFF
+color2=#7BAAE7
+color3=#5A8AD6
+color4=#427DC6
+
+[Steel]
+color0=#A2DBE3
+color1=#3BBECF
+color2=#158CCD
+color3=#056EA3
+color4=#0A3453
+
Added: theme/ia_ora-kde4/src/iaorastyle.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,328 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+#include <QSettings>
+#include <QDebug>
+
+QHash<QString, ColorData*> IaOraStyle::m_data;
+
+IaOraStyle::IaOraStyle(QStyle *parent)
+{
+ m_parent = parent;
+}
+
+IaOraStyle::~IaOraStyle()
+{
+}
+
+// helper function to create the hash
+inline QString hashPalette(const QPalette &pal)
+{
+ QString hash = pal.color(QPalette::Window).name();
+ hash += pal.color(QPalette::Highlight).name();
+ return hash;
+}
+
+ColorData *IaOraStyle::lookupData(const QPalette &pal)
+{
+ QString hash = hashPalette(pal);
+
+ // if already cached, just return
+ if (m_data.contains(hash))
+ return m_data[hash];
+
+ ColorData *data = new ColorData();
+ QColor background = pal.color(QPalette::Window);
+ QColor highlight = pal.color(QPalette::Highlight);
+
+ //TODO: check whether black and white should not be black and white
+ data->black = Qt::black;
+ data->white = Qt::white;
+
+ QSettings conf("/etc/iaoracolors", QSettings::NativeFormat); // TODO: define where this file must go
+
+ if (background.name() == "#eff3f7")
+ {
+ conf.beginGroup("Default");
+ data->gray[0] = (conf.value("gray0", background)).value<QColor>();
+ data->gray[1] = (conf.value("gray1", background.dark(107))).value<QColor>();
+ data->gray[2] = (conf.value("gray2", background.dark(115))).value<QColor>();
+ data->gray[3] = (conf.value("gray3", background.dark(117))).value<QColor>();
+ data->gray[4] = (conf.value("gray4", background.dark(131))).value<QColor>();
+ data->gray[5] = (conf.value("gray5", background.dark(144))).value<QColor>();
+ data->gray[6] = (conf.value("gray6", background.dark(178))).value<QColor>();
+ conf.endGroup();
+ } else
+ {
+ data->gray[0] = background;
+ data->gray[1] = background.dark(107);
+ data->gray[2] = background.dark(115);
+ data->gray[3] = background.dark(117);
+ data->gray[4] = background.dark(131);
+ data->gray[5] = background.dark(144);
+ data->gray[6] = background.dark(178);
+ }
+
+ QString group = "";
+
+ if (highlight.name() == "#8ec7ff") group = "Arctic";
+ else if (highlight.name() == "#4965ae") group = "Blue";
+ else if (highlight.name() == "#cfd7df") group = "Gray";
+ else if (highlight.name() == "#5d658e") group = "Night";
+ else if (highlight.name() == "#f7b610") group = "Orange";
+ else if (highlight.name() == "#7baae7") group = "Smooth";
+ else if (highlight.name() == "#148dcd") group = "Steel";
+
+ if (!group.isEmpty())
+ {
+ conf.beginGroup(group);
+ data->color[0] = (conf.value("color0", highlight.light(150))).value<QColor>();
+ data->color[1] = (conf.value("color1", highlight.light(137))).value<QColor>();
+ data->color[2] = (conf.value("color2", highlight)).value<QColor>();
+ data->color[3] = (conf.value("color3", highlight.light(112))).value<QColor>();
+ data->color[4] = (conf.value("color4", highlight.light(130))).value<QColor>();
+ conf.endGroup();
+ } else
+ {
+ data->color[0] = highlight.light(150);
+ data->color[1] = highlight.light(137);
+ data->color[2] = highlight;
+ data->color[3] = highlight.dark(112);
+ data->color[4] = highlight.dark(130);
+ }
+
+ m_data[hash] = data;
+ return data;
+}
+
+void IaOraStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
+ bool enabled, const QString& text, QPalette::ColorRole textRole) const
+{
+ ColorData *data = lookupData(pal);
+ QPen oldPen = painter->pen();
+
+ QPen pen = oldPen;
+
+ if (!enabled)
+ pen.setColor(data->gray[4]);
+ else if (textRole != QPalette::NoRole)
+ pen.setColor(pal.color(textRole));
+
+ painter->setPen(pen);
+ painter->drawText(rect, alignment, text);
+
+ painter->setPen(oldPen);
+}
+
+void IaOraStyle::drawBranch(const QStyleOption *option, QPainter *painter)
+{
+ ColorData *data = lookupData(option->palette);
+ painter->save();
+ QPointF center = option->rect.center();
+ QColor lineColor = option->palette.color(QPalette::Text);
+ QPen pen = painter->pen();
+ pen.setStyle(Qt::DotLine);
+ pen.setColor(lineColor);
+ painter->setPen(pen);
+
+ if (option->state & (QStyle::State_Item | QStyle::State_Sibling))
+ {
+ if (option->state & QStyle::State_Sibling)
+ {
+ painter->drawLine(center.x(), center.y(), center.x(), option->rect.bottom());
+ painter->drawLine(center.x(), option->rect.y() + 1, center.x(), center.y());
+ }
+ else
+ painter->drawLine(center.x(), option->rect.y(), center.x(), center.y());
+
+ if (option->state & QStyle::State_Item){
+ if (option->direction == Qt::LeftToRight)
+ painter->drawLine(m_parent->visualPos(option->direction, option->rect, QPoint(center.x() + 1, center.y())),
+ m_parent->visualPos(option->direction, option->rect, QPoint(option->rect.right(), center.y())));
+ else{
+ painter->drawLine(center.x(), center.y(), center.x() + 1, center.y());
+ painter->drawLine(center.x(), center.y(), option->rect.left(), center.y());
+ }
+ }
+ }
+ if (option->state & QStyle::State_Children)
+ {
+ painter->setBrush(data->white);
+ painter->setPen(Qt::NoPen);
+ QRect r(0,0,9,9);
+ r.moveCenter(option->rect.center());
+ painter->drawRect(r.adjusted(1,1,-1,-1));
+ drawFrameCuttingOne(painter, r, lineColor);
+ drawSymbol(option, painter, (option->state & QStyle::State_Open) ? SymbolMinus : SymbolPlus);
+ }
+ painter->restore();
+}
+
+void IaOraStyle::drawPanelItemViewItem(const QStyleOption *opt, QPainter *p, bool itemViewItem)
+{
+ const QStyleOptionViewItemV4 *pvi = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt);
+ if (!pvi)
+ return;
+ else
+ p->fillRect(opt->rect, pvi->backgroundBrush);
+
+ ColorData *data = lookupData(opt->palette);
+
+ p->save();
+ p->setRenderHint(QPainter::Antialiasing);
+ QRect r = pvi->rect;
+
+ //if (pvi->state & QStyle::State_HasFocus)
+ // in case of the need to use the HasFocus state, remove the commented lines and commend the above line
+ /*if (( pvi->state & QStyle::State_HasFocus ) || ( pvi->state & QStyle::State_Selected))
+ {
+ p->setBrush(data->color[2]);
+ p->setPen(Qt::NoPen);
+ p->drawRoundedRect(r, 3.0, 3.0);
+ }*/
+ /*else*/ if (pvi->state & QStyle::State_Selected)
+ {
+ p->setBrush(data->color[2]);
+ p->setPen(Qt::NoPen);
+ p->drawRoundedRect(r, 3.0, 3.0);
+ }/**/
+ p->restore();
+
+ if (itemViewItem){
+ QRect checkRect;
+ QRect iconRect;
+ QSize iconSize = pvi->decorationSize;
+ bool hasCheck = pvi->features & QStyleOptionViewItemV2::HasCheckIndicator;
+ bool hasIcon = pvi->features & QStyleOptionViewItemV2::HasDecoration;
+ bool hasText = pvi->features & QStyleOptionViewItemV2::HasDisplay;
+ bool leftToRight = (pvi->direction == Qt::LeftToRight) ? true : false;
+
+ // the checkbox on the item
+ if (hasCheck){
+ QStyleOptionButton button;
+
+
+ checkRect = QRect(r.left(), r.center().y() - 6, 13, 13);
+ if (!hasText) checkRect.adjust(6, 0, 6, 0); // TEMPORARY HACK
+ //if (!hasText) checkRect.moveCenter(r.center());
+
+ checkRect = QStyle::visualRect(pvi->direction, pvi->rect, checkRect);
+
+ button.rect = checkRect;
+ button.state = pvi->state;
+
+ switch (pvi->checkState){
+ case Qt::Unchecked:
+ button.state |= QStyle::State_Off;
+
+ break;
+ case Qt::PartiallyChecked:
+ button.state |= QStyle::State_NoChange;
+
+ break;
+ case Qt::Checked:
+ button.state |= QStyle::State_On;
+
+ break;
+ }
+
+ drawCheckBox(&button, p);
+ }
+
+ int shiftx = 0, shifty = 0, shiftw = 0;
+
+ // some icon
+ if (hasIcon){
+ switch (pvi->decorationPosition){
+ case QStyleOptionViewItem::Left:
+ if (hasCheck)
+ iconRect = QRect(r.topLeft() + QPoint(checkRect.width() + 2, 0), iconSize);
+ else
+ iconRect = QRect(r.topLeft(), iconSize);
+
+ if (leftToRight) shiftx = 3 + iconSize.width();
+ else shiftw = -(3 + iconSize.width());
+
+ break;
+ case QStyleOptionViewItem::Right:
+ iconRect = QRect(r.topRight() - QPoint(iconSize.width(), 0), iconSize);
+ shiftw = -(3 + iconSize.width());
+
+ break;
+ case QStyleOptionViewItem::Top:
+ iconRect = QRect(r.left(), r.top(), r.width(), iconSize.height());
+ shifty = iconRect.height();
+
+ break;
+ case QStyleOptionViewItem::Bottom:
+ iconRect = QRect(r.left(), r.bottom() - iconSize.height(), r.width(), r.bottom());
+
+ break;
+ }
+
+ iconRect = QStyle::visualRect(pvi->direction, pvi->rect, iconRect);
+
+ QIcon::Mode mode = pvi->state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled;
+ QPixmap pix = pvi->icon.pixmap(iconSize, mode);
+
+ m_parent->drawItemPixmap(p, iconRect, pvi->displayAlignment, pix);
+ } else shiftx = 3;
+
+ // and the text
+ p->save();
+ QFont font = pvi->font;
+ if (font.bold()) p->setFont(font);
+
+ if (hasCheck){
+ if (leftToRight) shiftx += iconSize.width();
+ else shiftw -= iconSize.width();
+ }
+
+ drawItemText(p, r.adjusted(shiftx, shifty, shiftw, 0), pvi->displayAlignment, pvi->palette, true,
+ pvi->text, (pvi->state & QStyle::State_Selected) ? QPalette::HighlightedText : QPalette::Text);
+ p->restore();
+ }
+}
+
+void IaOraStyle::drawPanelItemViewRow(const QStyleOption *opt, QPainter *p){
+ const QStyleOptionViewItemV4 *row = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt);
+
+ if (!row)
+ return;
+
+ ColorData *data = lookupData(opt->palette);
+ bool alternateColor = row->features & QStyleOptionViewItemV2::Alternate;
+
+ p->save();
+ p->setRenderHint(QPainter::Antialiasing);
+
+ QPalette::ColorGroup colorGroup(opt->state & QStyle::State_Enabled
+ ? opt->state & QStyle::State_Active
+ ? QPalette::Normal
+ : QPalette::Inactive
+ : QPalette::Disabled);
+ if (alternateColor)
+ p->fillRect(opt->rect, opt->palette.brush(colorGroup, QPalette::AlternateBase));
+
+ p->restore();
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle.h
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle.h (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef IAORASTYLE_H
+#define IAORASTYLE_H
+
+#include <QColor>
+#include <QRect>
+#include <QPalette>
+#include <QIcon>
+#include <QStyle>
+#include <QPainter>
+#include <QStyleOption>
+#include <QStyle>
+#include <QHash>
+
+typedef struct
+{
+ QColor gray[7];
+ QColor color[5];
+ QColor black;
+ QColor white;
+} ColorData;
+
+class IaOraStyle
+{
+public:
+ enum FrameType
+ {
+ FrameFocus,
+ FrameGeneric,
+ FrameMenuBar,
+ FrameToolBar,
+ FrameProgressBar,
+ FrameLineEdit,
+ FrameHeader,
+ FrameComboBox,
+ FrameMenu,
+ FrameTabBar,
+ FrameGroupBox,
+ FrameFrame
+ };
+ enum Border
+ {
+ BorderNone = 0,
+ BorderTop = 1,
+ BorderLeft = 2,
+ BorderBottom = 4,
+ BorderRight = 8,
+ BorderAll = 15
+ };
+
+ enum Symbol
+ {
+ SymbolArrowLeft,
+ SymbolArrowRight,
+ SymbolArrowUp,
+ SymbolArrowDown,
+ SymbolPlus,
+ SymbolMinus
+ };
+ IaOraStyle(QStyle *parent);
+ ~IaOraStyle();
+
+ void drawFrame(const QStyleOption *opt, QPainter *p, FrameType f = FrameGeneric, QRect optRect = QRect());
+ //void drawFrame(const QStyleOption *opt, QPainter *p, FrameType f = FrameGeneric);
+ void drawBorder(QPainter *painter, const QStyleOption *opt, const QRect &rect, bool active, int border = BorderAll);
+ void drawSeparator(const QStyleOption *opt, QPainter *p, int margin = 5);
+ void drawHandle(const QStyleOption *opt, QPainter *p);
+ void drawButton(const QStyleOption *opt, QPainter *p, bool simplified = false, bool vertical = false);
+ void drawButtonDefaultBorder(const QStyleOption *opt, QPainter *p);
+ void drawToolButton(const QStyleOption *opt, QPainter *p/*, bool simplified = false, bool vertical = false*/);
+ void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
+ bool enabled, const QString& text, QPalette::ColorRole textRole) const;
+ void drawProgressBarContents(const QStyleOption *opt, QPainter *p, bool kde = false);
+ void drawCheckBox(const QStyleOption *opt, QPainter *p);
+ void drawRadioButton(const QStyleOption *opt, QPainter *p);
+ void drawSymbol(const QStyleOption *opt, QPainter *p, Symbol s);
+ void drawScrollBarEmptySpace(const QStyleOption *opt, QPainter *p);
+ void drawScrollBarButton(const QStyleOption *opt, QPainter *p, Symbol s);
+ void drawScrollBarHandle(const QStyleOption *opt, QPainter *p);
+ void drawSlider(const QStyleOption *opt, QPainter *p,
+ const QRect &grooveRegion, const QRect &handle, const QRect &ticks);
+ void drawComboBox(const QStyleOptionComplex *opt, QPainter *p);
+ void drawComboBoxLabel(const QStyleOption *opt, QPainter *p);
+ void drawSpinBox(const QStyleOptionComplex *opt, QPainter *p);
+ void drawDial(const QStyleOption *opt, QPainter *p);
+ void drawQ3ListView(const QStyleOption *opt, QPainter *p, const QWidget *w);
+ void drawMenuItem(const QStyleOption *opt, QPainter *p, bool saveSpaceForIcon = true);
+ void drawDockWindowTitle(const QStyleOption *opt, QPainter *p);
+ void drawTabBarTab(const QStyleOption *opt, QPainter *p);
+ void drawTitleBarButton(const QStyleOptionComplex *opt, QPainter *p, const QWidget *w, QStyle::SubControl control, QStyle::StandardPixmap icon);
+ void drawTitleBar(const QStyleOptionComplex *opt, QPainter *p, const QWidget *w = 0);
+ void drawBranch(const QStyleOption *opt, QPainter *p);
+ void drawPanelItemViewItem(const QStyleOption *opt, QPainter *p, bool itemText = false);
+ void drawPanelItemViewRow(const QStyleOption *opt, QPainter *p);
+ QIcon standardIcon(QStyle::StandardPixmap icon, const QStyleOption *option, const QWidget *widget);
+
+ bool hasIcon(QStyle::StandardPixmap icon);
+protected:
+ static ColorData *lookupData(const QPalette &pal);
+
+private:
+ static QHash<QString, ColorData*> m_data;
+ QStyle *m_parent;
+};
+
+inline void drawFrameCuttingOne(QPainter *p, const QRect &r, const QColor &c)
+{
+ int top = r.top(), left = r.left(), bottom = r.bottom(), right = r.right();
+ p->setPen(QPen(c,1));
+ p->drawLine(left+1, top, right-1, top); //top
+ p->drawLine(left, top+1, left, bottom-1); //left
+ p->drawLine(left+1, bottom, right-1, bottom); //bottom
+ p->drawLine(right, top+1, right, bottom-1); // right*/
+}
+
+inline void fillRectCuttingOne(QPainter *p, const QRect &r, const QBrush &b)
+{
+ p->fillRect(r.adjusted(1,0,-1,0), b);
+ p->setPen(QPen(b, 1));
+
+ int top = r.top(), bottom = r.bottom(), left = r.left(), right = r.right();
+ p->drawLine(left, top+1, left, bottom-1);
+ p->drawLine(right, top+1, right, bottom-1);
+}
+
+#endif
Property changes on: theme/ia_ora-kde4/src/iaorastyle.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_button.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_button.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_button.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawButton(const QStyleOption *opt, QPainter *p, bool simplified, bool vertical)
+{
+ bool enabled = (opt->state & QStyle::State_Enabled);
+
+ QPalette pal = opt->palette;
+ if (!enabled)
+ pal.setCurrentColorGroup(QPalette::Active); // when the button is disabled, use the same palette as if enabled
+
+ ColorData *data = lookupData(pal);
+
+ // TODO: cache the gradients so that it is more efficient
+ bool sunken = (opt->state & QStyle::State_Sunken);
+ bool on = (opt->state & QStyle::State_On);
+ QRect r = opt->rect;
+ int top = r.top(), left = r.left(), bottom = r.bottom(), right = r.right();
+
+ QPen oldPen = p->pen();
+
+ QLinearGradient g;
+ if (vertical)
+ {
+ g.setStart(left, 0);
+ g.setFinalStop(right, 0);
+ }
+ else
+ {
+ g.setStart(0, top);
+ g.setFinalStop(0, bottom);
+ }
+
+ if (sunken || on)
+ { g.setColorAt(0., data->gray[2]);
+ g.setColorAt(1., data->gray[1]);
+ }
+ else
+ {
+ g.setColorAt(0., data->gray[0]);
+ g.setColorAt(1., data->gray[2]);
+ }
+
+ QRect contents = r;
+ if (!simplified)
+ contents.adjust(2,2,-2,-2);
+ p->fillRect(contents, g);
+
+ if (!simplified)
+ {
+ //draw the lines around
+ if (!sunken && !on)
+ p->setPen(data->white);
+ else
+ p->setPen(enabled ? data->gray[1] : data->gray[2]);
+ p->drawLine(left + 2, top + 1, right - 2, top + 1);
+ p->drawLine(left + 1, top + 2, left + 1, bottom - 2);
+
+ if (enabled)
+ p->setPen(data->gray[1]);
+ else
+ p->setPen((sunken || on) ? data->white : data->gray[1]);
+ p->drawLine(left + 2, bottom - 1, right - 2, bottom - 1);
+ p->drawLine(right - 1, top + 2, right - 1, bottom - 2);
+
+ // the outter line
+ if (enabled)
+ p->setPen(data->gray[5]);
+ else
+ p->setPen(data->gray[4]);
+ p->drawLine(left + 2, top, right - 2, top); // top
+ p->drawLine(left, top + 2, left, bottom - 2); // left
+ p->setPen(data->gray[4]);
+ p->drawLine(left + 2, bottom, right - 2, bottom); // bottom
+ p->drawLine(right, top + 2, right, bottom - 2); // right
+
+ // and finally the four points
+ QPoint points[4];
+ points[0] = QPoint(left + 1, top + 1);
+ points[1] = QPoint(right - 1, top + 1);
+ points[2] = QPoint(right - 1, bottom - 1);
+ points[3] = QPoint(left + 1, bottom - 1);
+ p->drawPoints(points, 4);
+
+ // if selected, draw the selection frame
+ if (opt->state & QStyle::State_HasFocus)
+ {
+ QStyleOption copy = *opt;
+ copy.rect = r.adjusted(2, 2, -2, -2);
+ drawFrame(©, p, FrameFocus);
+ }
+ }
+
+ p->setPen(oldPen);
+}
+
+void IaOraStyle::drawButtonDefaultBorder(const QStyleOption *opt, QPainter *p)
+{
+ ColorData *data = lookupData(opt->palette);
+ QRect r = opt->rect;
+ int top = r.top(), left = r.left(), bottom = r.bottom(), right = r.right();
+
+ QPen oldPen = p->pen();
+
+ p->setPen(data->color[4]);
+ p->drawLine(left+3, top, right-3, top); //top
+ p->drawLine(left+3, bottom, right-3, bottom); //bottom
+ p->drawLine(left, top+3, left, bottom-3); //left
+ p->drawLine(right, top+3, right, bottom-3); //right
+
+ //the points
+ QPoint points[8];
+ points[0] = QPoint(left+1,top+2);
+ points[1] = QPoint(left+2,top+1);
+ points[2] = QPoint(right-1,top+2);
+ points[3] = QPoint(right-2,top+1);
+ points[4] = QPoint(left+1,bottom-2);
+ points[5] = QPoint(left+2,bottom-1);
+ points[6] = QPoint(right-1,bottom-2);
+ points[7] = QPoint(right-2,bottom-1);
+ p->drawPoints(points, 8);
+
+ p->setPen(oldPen);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_button.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_combobox.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_combobox.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_combobox.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawComboBox(const QStyleOptionComplex *opt, QPainter *p)
+{
+ /* TODO: check why Qt is not respecting PM_ComboBoxFrame */
+ const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt);
+ bool sunken = cmb->state & QStyle::State_On; // play dead if combobox has no items
+ QRect r = opt->rect;
+
+ QStyleOptionComboBox copy = *cmb;
+ if (!cmb)
+ return;
+
+ if (!cmb->editable)
+ {
+ QStyleOptionButton buttonOption;
+ buttonOption.QStyleOption::operator=(*cmb);
+ if (!sunken)
+ buttonOption.state &= ~QStyle::State_Sunken;
+
+ m_parent->drawPrimitive(QStyle::PE_PanelButtonCommand, &buttonOption, p);
+ }
+ else
+ {
+ if (cmb->frame && (cmb->subControls & QStyle::SC_ComboBoxFrame))
+ {
+ QRect r = m_parent->subControlRect(QStyle::CC_ComboBox, cmb, QStyle::SC_ComboBoxFrame);
+
+ copy.rect = r;
+ drawFrame(©, p);
+ }
+ }
+
+ if (cmb->subControls & QStyle::SC_ComboBoxArrow)
+ {
+ copy.rect = m_parent->subControlRect(QStyle::CC_ComboBox, opt, QStyle::SC_ComboBoxArrow);
+
+ if (cmb->editable)
+ {
+ // draw the button background
+ drawButton(©, p, true);
+ drawBorder(p, opt, copy.rect, (cmb->state & QStyle::State_Enabled), BorderLeft);
+
+ }
+ copy.rect.adjust(2,1,0,0);
+ drawSymbol(©, p, IaOraStyle::SymbolArrowDown);
+ if (!cmb->editable)
+ {
+ // draw also the separator
+ copy.rect = QRect(copy.rect.left() - 2, r.top() + 4, 2, r.height() - 8);
+ copy.state = QStyle::State_Horizontal;
+ drawSeparator(©, p, 4);
+ }
+ }
+}
+
+void IaOraStyle::drawComboBoxLabel(const QStyleOption *opt, QPainter *p)
+{
+ const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox*>(opt);
+ if (!cb)
+ return;
+
+ QRect r = m_parent->subControlRect(QStyle::CC_ComboBox, cb, QStyle::SC_ComboBoxEditField);
+ r.adjust(3,1,-1,0);
+
+ if (!cb->currentIcon.isNull())
+ {
+ QIcon::Mode mode = cb->state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled;
+ QPixmap pix = cb->currentIcon.pixmap(cb->iconSize, mode);
+ QRect iconRect(r);
+ iconRect.setWidth(cb->iconSize.width() + 4);
+ iconRect = m_parent->alignedRect(cb->direction, Qt::AlignLeft | Qt::AlignVCenter, iconRect.size(), r);
+
+ if (cb->editable)
+ p->fillRect(iconRect, opt->palette.brush(QPalette::Base));
+ m_parent->drawItemPixmap(p, iconRect, Qt::AlignCenter, pix);
+
+ if (cb->direction == Qt::RightToLeft)
+ r.translate(-4 - cb->iconSize.width(), 0);
+ else
+ r.translate(cb->iconSize.width() + 4, 0);
+ }
+
+ if (!cb->currentText.isEmpty() && !cb->editable)
+ {
+ m_parent->drawItemText(p, r.adjusted(1, 0, -1, 0),
+ m_parent->visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter),
+ cb->palette, cb->state & QStyle::State_Enabled, cb->currentText);
+ }
+}
Property changes on: theme/ia_ora-kde4/src/iaorastyle_combobox.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_dial.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_dial.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_dial.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+#include <cmath>
+
+void IaOraStyle::drawDial(const QStyleOption *opt, QPainter *p)
+{
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(opt);
+ if (!dial)
+ return;
+
+ // use a square
+ QRect r = QRect(0,0, qMin(opt->rect.width(), opt->rect.height()), qMin(opt->rect.width(), opt->rect.height()));
+ r.moveCenter(opt->rect.center());
+ r.adjust(3,3,-3,-3);
+
+ QPen oldPen = p->pen();
+ QBrush oldBrush = p->brush();
+ bool aa = p->renderHints() & QPainter::Antialiasing;
+
+ QLinearGradient g1(r.bottomLeft(), r.topLeft());
+ g1.setColorAt(0., data->gray[0]);
+ g1.setColorAt(1., data->gray[2]);
+
+ QLinearGradient g2(r.topLeft(), r.bottomRight());
+ g2.setColorAt(0., data->white);
+ g2.setColorAt(0.5, data->gray[4]);
+ g2.setColorAt(1., data->gray[5]);
+
+ p->setBrush(g1);
+ p->setPen(QPen(g2, 2));
+ p->setRenderHint(QPainter::Antialiasing, true);
+ p->drawEllipse(r);
+
+ // draw the indicator
+ int gripSize = opt->fontMetrics.height() * 0.5;
+
+ QRect grip(0,0,gripSize,gripSize);
+ grip.moveCenter(r.center());
+
+ // angle calculation from qcommonstyle.cpp (c) Trolltech 1992-2007, ASA.
+ qreal angle;
+ int sliderPosition = dial->upsideDown ? dial->sliderPosition : (dial->maximum - dial->sliderPosition);
+ int range = dial->maximum - dial->minimum;
+ if (!range)
+ {
+ angle = M_PI / 2;
+ }
+ else if (dial->dialWrapping)
+ {
+ angle = M_PI * 1.5 - (sliderPosition - dial->minimum) * 2 * M_PI / range;
+ }
+ else
+ {
+ angle = (M_PI * 8 - (sliderPosition - dial->minimum) * 10 * M_PI / range) / 6;
+ }
+ int d = r.width() - 10;
+ qreal rr = d / 2.0 - gripSize - 2;
+ grip.translate(int(0.5 + rr * cos(angle)), int(0.5 - rr * sin(angle)));
+
+ QRadialGradient g3(grip.left() + (grip.width() * 0.7), grip.top() + (grip.height() * 0.7), grip.height());
+ g3.setColorAt(0., data->color[1]);
+ g3.setColorAt(0.3, data->color[2]);
+ g3.setColorAt(1., data->color[4]);
+ p->setPen(Qt::NoPen);
+ p->setBrush(g3);
+ p->drawEllipse(grip);
+
+ p->setPen(oldPen);
+ p->setBrush(oldBrush);
+ p->setRenderHint(QPainter::Antialiasing, aa);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_dial.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_frame.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_frame.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_frame.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,391 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawFrame(const QStyleOption *option, QPainter *p, FrameType type, QRect optRect)
+//void IaOraStyle::drawFrame(const QStyleOption *option, QPainter *p, FrameType type)
+{
+ ColorData *data = lookupData(option->palette);
+
+ bool enabled = (option->state & QStyle::State_Enabled);
+
+ QRect r;
+ if (optRect.isValid())
+ r = optRect;
+ else
+ r = option->rect;
+ //QRect r = option->rect;
+
+ int top = r.top(), left = r.left(), bottom = r.bottom(), right = r.right();
+ QPen oldPen = p->pen();
+ QBrush oldBrush = p->brush();
+
+ switch(type)
+ {
+ case FrameFocus:
+ {
+ QPen pen = p->pen();
+ pen.setStyle(Qt::DotLine);
+ pen.setColor(option->palette.color(QPalette::ButtonText));
+ p->setPen(pen);
+ p->setBrush(Qt::NoBrush);
+ p->drawRect(option->rect.adjusted(1,1,-1,-1));
+ break;
+ }
+ case FrameToolBar:
+ case FrameMenuBar:
+ {
+ // fill the rect using the specified graytone
+ QColor c;
+ if (type == FrameToolBar)
+ c = data->gray[1];
+ else if (type == FrameMenuBar)
+ c = data->gray[0];
+ else
+ c = data->gray[0];
+
+ p->fillRect(r, c);
+
+ // now the lines around
+ p->setPen(data->gray[2]);
+
+ // we assume that the top was already drawn, or that the toolbar is the topmost
+ // widget from the window, and in this case it does not need the top line
+ p->drawLine(left, bottom-1, right, bottom-1);
+ p->setPen(data->white);
+ p->drawLine(left, bottom, right, bottom);
+ break;
+ }
+ case FrameProgressBar:
+ {
+ // fill the internal rect
+ QRect contents = r.adjusted(1,1,-1,-1);
+ p->fillRect(contents, data->gray[0]);
+
+ // draw the round frame
+ drawFrameCuttingOne(p, r, data->gray[5]);
+ break;
+ }
+ case FrameLineEdit:
+ {
+ const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option);
+ QRect contents = r;
+ contents.adjust(1,1,-1,-1);
+
+ if (panel && panel->lineWidth > 0)
+ {
+ drawFrameCuttingOne(p, r, data->gray[4]);
+ }
+
+ p->fillRect(contents, (option->state & QStyle::State_Enabled) ? panel->palette.base().color(): data->gray[0]);
+
+ if (option->state & QStyle::State_HasFocus)
+ {
+ p->setPen(data->color[3]);
+ p->setBrush(Qt::NoBrush);
+ p->drawRect(contents);
+ }
+ break;
+ }
+ case FrameComboBox:
+ {
+ p->save();
+
+ QRect tabRect = r.adjusted(0,0,-1,-1);
+ p->setPen(data->gray[2]);
+ p->setBrush(data->gray[0]);
+
+ p->drawLine(left, top + 1, left, bottom - 1);
+ p->drawLine(right, top + 1, right, bottom - 1);
+ p->drawLine(left + 1, top, right - 1, top);
+ p->drawLine(left + 1, bottom, right - 1, bottom);
+
+ p->restore();
+ break;
+ }
+ case FrameHeader:
+ {
+ const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option);
+
+ // draw the button appearance
+ drawButton(option, p, true);
+
+ if (!header)
+ break;
+
+ bool vertical = (header->orientation == Qt::Vertical);
+ QRect r = option->rect;
+
+ QLine outterLine, innerLine, previousLine, nextLine;
+ if (vertical)
+ {
+ outterLine = QLine(r.topLeft(), r.bottomLeft());
+ innerLine = QLine(r.topRight(), r.bottomRight());
+ previousLine = QLine(r.topLeft(), r.topRight());
+ nextLine = QLine(r.bottomLeft(), r.bottomRight());
+ }
+ else
+ {
+ outterLine = QLine(r.topLeft(), r.topRight());
+ innerLine = QLine(r.bottomLeft(), r.bottomRight());
+ previousLine = QLine(r.topLeft(), r.bottomLeft());
+ nextLine = QLine(r.topRight(), r.bottomRight());
+ }
+
+ p->setPen(data->gray[5]);
+ p->drawLine(innerLine);
+
+ if (header->position != QStyleOptionHeader::Beginning)
+ {
+ p->setPen(Qt::white);
+ p->drawLine(previousLine);
+ }
+ p->setPen(data->gray[2]);
+ p->drawLine(nextLine);
+
+ break;
+ }
+ case FrameMenu:
+ {
+ drawFrameCuttingOne(p, r, enabled ? data->gray[5] : data->gray[4]);
+ break;
+ }
+ case FrameTabBar:
+ {
+ p->save();
+
+ QRect tabRect = r.adjusted(0,0,-1,-1);
+ p->setPen(data->gray[4]);
+ p->setBrush(data->gray[0]);
+ p->drawRect(tabRect);
+
+ p->restore();
+ break;
+ }
+ case FrameGroupBox:
+ case FrameFrame:
+ {
+ p->save();
+
+ const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option);
+ const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(option);
+
+ if (!frame)
+ return;
+
+ bool flat = false;
+ if (frame2)
+ flat = (frame2->features & QStyleOptionFrameV2::Flat);
+
+ bool sunken = (frame->state & QStyle::State_Sunken);
+ bool raised = (frame->state & QStyle::State_Raised);
+
+ if (flat && type == FrameGroupBox)
+ {
+ QRect rect(left, top, r.width(), 4);
+ QStyleOption option;
+ option.state &= ~QStyle::State_Horizontal;
+ option.rect = rect;
+ drawSeparator(&option, p, 0);
+ }
+ else
+ {
+ if (sunken || raised)
+ {
+ drawFrameCuttingOne(p, r, data->gray[2]);
+
+ QLine lines[2];
+ lines[0] = QLine(left+1,top+1,right-1,top+1);
+ lines[1] = QLine(left+1,top+1,left+1,bottom-2);
+ p->setPen(sunken ? data->gray[1] : data->white);
+ p->drawLines(lines, 2);
+
+ lines[0] = QLine(right-1,top+1,right-1,bottom-1);
+ lines[1] = QLine(left+1,bottom-1,right-1,bottom-1);
+ p->setPen(sunken ? data->white : data->gray[1]);
+ p->drawLines(lines, 2);
+ }
+ else
+ {
+ QLine lines[4];
+ // the white lines
+ lines[0] = QLine(left+1,top+1,right,top+1); // top
+ lines[1] = QLine(right,top+1,right,bottom-1); // right
+ lines[2] = QLine(left+1,bottom,right-1,bottom); // bottom
+ lines[3] = QLine(left+1,top+1,left+1,bottom); // left
+ p->setPen(data->white);
+ p->drawLines(lines, 4);
+
+ lines[0] = QLine(left+1,top,right-1,top); // top
+ lines[1] = QLine(right-1,top+1,right-1,bottom-1); // right
+ lines[2] = QLine(left,bottom-1,right-1,bottom-1); // bottom
+ lines[3] = QLine(left,top+1,left,bottom-1); // left
+ p->setPen(data->gray[3]);
+ p->drawLines(lines, 4);
+ }
+ }
+ p->restore();
+ break;
+ }
+ case FrameGeneric:
+ default:
+ drawFrameCuttingOne(p, r, enabled ? data->gray[5] : data->gray[4]);
+ }
+
+ p->setPen(oldPen);
+ p->setBrush(oldBrush);
+}
+
+void IaOraStyle::drawBorder(QPainter *painter, const QStyleOption *opt, const QRect &r, bool active, int border)
+{
+ QPen oldPen = painter->pen();
+ ColorData *data = lookupData(opt->palette);
+
+ int top = r.top(), left = r.left(), bottom = r.bottom(), right = r.right();
+ painter->setPen(active ? data->gray[5] : data->gray[4]);
+ if (border & BorderTop)
+ painter->drawLine(left,top,right,top);
+ if (border & BorderLeft)
+ painter->drawLine(left,top,left,bottom);
+ if (border & BorderBottom)
+ painter->drawLine(left,bottom,right,bottom);
+ if (border & BorderRight)
+ painter->drawLine(right,top,right,bottom);
+
+ painter->setPen(oldPen);
+}
+
+void IaOraStyle::drawSeparator(const QStyleOption *opt, QPainter *p, int margin)
+{
+ ColorData *data = lookupData(opt->palette);
+ bool toolBarHorizontal = (opt->state & QStyle::State_Horizontal);
+ QRect r = opt->rect;
+ QLine line1, line2;
+
+ QPen oldPen = p->pen();
+ QBrush oldBrush = p->brush();
+
+ if (toolBarHorizontal)
+ {
+ int middle = (r.left() + r.right()) / 2;
+ line1 = QLine(middle, r.top(), middle, r.bottom());
+ if (r.height() >= 20)
+ {
+ line1.setP1(QPoint(line1.x1(), line1.y1() + margin));
+ line1.setP2(QPoint(line1.x2(), line1.y2() - margin));
+ }
+ line2 = line1.translated(1,0);
+ }
+ else
+ {
+ int middle = (r.top() + r.bottom()) / 2;
+ line1 = QLine(r.left(), middle, r.right(), middle);
+ // remove some points from the edges
+ if (r.width() >= 20)
+ {
+ line1.setP1(QPoint(line1.x1()+margin, line1.y1()));
+ line1.setP2(QPoint(line1.x2()-margin, line1.y1()));
+ }
+ line2 = line1.translated(0,1);
+ }
+
+ p->setPen(data->gray[2]);
+ p->drawLine(line1);
+ p->setPen(data->white);
+ p->drawLine(line2);
+
+ p->setPen(oldPen);
+}
+
+void IaOraStyle::drawHandle(const QStyleOption *opt, QPainter *p)
+{
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ bool toolBarHorizontal = (opt->state & QStyle::State_Horizontal);
+ QRect r = opt->rect;
+ QList<QPoint> dots;
+
+ QPen oldPen = p->pen();
+
+ // assume the space between the dots is of 4 pixels (TODO: check if it is not more)
+ // each dot has height of 4 (*3 = 12)
+ // the space is assumed to be 4 (*2 = 8)
+ // --> the total height is then 20
+ if (toolBarHorizontal)
+ {
+ if (r.height() > 30)
+ {
+ int start = (r.top() + r.bottom()) / 2 - 10; // 10 is half the size of the dot block
+ int middle = (r.left() + r.right()) / 2 - 2;
+
+ for (int i = 0; i< 3; ++i)
+ {
+ dots.append(QPoint(middle, start));
+ start += 8; // 4 from the size and 4 from the spacing
+ }
+ }
+ else // only a single dot in the middle
+ dots.append(QPoint((r.left() + r.right()) / 2 - 2, (r.top() + r.bottom()) / 2 - 2));
+ }
+ else
+ {
+ if (r.width() > 30)
+ {
+ int start = (r.left() + r.right()) / 2 - 10; // 10 is half the size of the dot block
+ int middle = (r.top() + r.bottom()) / 2 - 2;
+
+ for (int i = 0; i< 3; ++i)
+ {
+ dots.append(QPoint(start, middle));
+ start += 8; // 4 from the size and 4 from the spacing
+ }
+ }
+ else // only a single dot in the middle
+ dots.append(QPoint((r.left() + r.right()) / 2 - 2, (r.top() + r.bottom()) / 2 - 2));
+ }
+
+ // draw all dots
+ foreach(QPoint dot, dots)
+ {
+ int x = dot.x(), y = dot.y();
+
+ // draw the first color
+ p->setPen(data->color[4]);
+ p->drawLine(x+1, y, x+2, y);
+ p->drawLine(x, y+1, x+3, y+1);
+
+ // the second color
+ p->setPen(data->color[2]);
+ p->drawLine(x, y+2, x+1, y+2);
+ p->drawPoint(x+1, y+3);
+
+ // the third color
+ p->setPen(data->color[1]);
+ p->drawLine(x+2, y+2, x+3, y+2);
+ p->drawPoint(x+2, y+3);
+ }
+
+ // restore pen
+ p->setPen(oldPen);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_frame.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_icons.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_icons.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_icons.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+#include <QPixmapCache>
+#include <QApplication>
+
+bool IaOraStyle::hasIcon(QStyle::StandardPixmap icon)
+{
+ switch (icon)
+ {
+ case QStyle::SP_DockWidgetCloseButton:
+ case QStyle::SP_TitleBarCloseButton:
+ case QStyle::SP_TitleBarMaxButton:
+ case QStyle::SP_TitleBarMinButton:
+ case QStyle::SP_TitleBarContextHelpButton:
+ case QStyle::SP_TitleBarNormalButton:
+ case QStyle::SP_TitleBarShadeButton:
+ case QStyle::SP_TitleBarUnshadeButton:
+ case QStyle::SP_TitleBarMenuButton:
+ return true;
+ default:
+ return false;
+ }
+}
+
+QIcon IaOraStyle::standardIcon(QStyle::StandardPixmap icon, const QStyleOption *option, const QWidget *widget)
+{
+ // do some caching
+ QPixmap pix;
+ QImage img;
+ QSize s(64,64);
+ QPalette pal = QApplication::palette();
+ if (option)
+ {
+ pal = option->palette;
+ s = option->rect.size();
+
+ // handling the TitleBar icons
+ switch (icon){
+ case QStyle::SP_TitleBarMinButton:
+ case QStyle::SP_TitleBarMenuButton:
+ case QStyle::SP_TitleBarMaxButton:
+ case QStyle::SP_TitleBarCloseButton:
+ case QStyle::SP_TitleBarNormalButton:
+ case QStyle::SP_TitleBarShadeButton:
+ case QStyle::SP_TitleBarUnshadeButton:
+ case QStyle::SP_TitleBarContextHelpButton:
+ s.scale(16, 16, Qt::IgnoreAspectRatio);
+ break;
+ default:
+ (s.width() > s.height()) ? s.setHeight(s.width()) : s.setWidth(s.height()); // the icon was getting the wrong size of subtitles
+ }
+ }
+ QString key = QString("iaora_standard_pixmap_%1_%2_%3").arg(QString::number(icon))
+ .arg(QString::number(s.width()))
+ .arg(QString::number(s.height()));
+ if (QPixmapCache::find(key, pix))
+ return pix;
+
+ ColorData *data = lookupData(pal);
+
+ int margin = s.height() * 0.20;
+
+ qDebug("Returning a pixmap of size %dx%d", s.width(), s.height());
+ img = QImage(s, QImage::Format_ARGB32_Premultiplied);
+ img.fill(Qt::black); // it removes the blue ghost behind the icon
+ //img.fill(Qt::transparent);
+ QPainter p(&img);
+ QRect r = img.rect();
+ r.adjust(margin,margin,-margin,-margin);
+ int top = r.top(), bottom = r.bottom(), left = r.left(), right = r.right(), centerY = r.center().y();
+ int width = r.width(), height = r.height();
+
+ p.setRenderHint(QPainter::Antialiasing, true);
+
+ QLinearGradient g(left, top, left, bottom);
+ g.setColorAt(0., data->white);
+ g.setColorAt(0.3, data->white);
+ g.setColorAt(0.7, data->gray[2]);
+ g.setColorAt(1., data->gray[2]);
+ QBrush b(g);
+ QPen pen(b, 2);
+ pen.setCapStyle(Qt::RoundCap);
+ p.setPen(pen);
+
+ switch (icon)
+ {
+ case QStyle::SP_DockWidgetCloseButton:
+ case QStyle::SP_TitleBarCloseButton:
+ {
+ p.drawLine(left,top+1,right,bottom); /* \ */
+ p.drawLine(right,top+1,left,bottom); /* / */
+ break;
+ }
+
+ case QStyle::SP_TitleBarMaxButton:
+ {
+ p.setRenderHint(QPainter::Antialiasing, false);
+ p.setPen(QPen(b, 1));
+ p.setBrush(Qt::NoBrush);
+ p.drawRect(r);
+
+ // draw one more line in the top
+ p.drawLine(left, top+1,right,top+1);
+ break;
+ }
+ case QStyle::SP_TitleBarMinButton:
+ {
+ pen.setWidth(3);
+ p.setPen(pen);
+ p.drawLine(left,centerY+1,right,centerY+1);
+ break;
+ }
+ case QStyle::SP_TitleBarNormalButton:
+ {
+ pen.setWidth(1);
+ p.setPen(pen);
+
+ // for the Normal button, use a bit bigger rect
+ r.adjust(-2,-2,2,2);
+ QRect firstSquare(left + width * 0.35, top, width * 0.7, height * 0.6);
+ QRect secondSquare(left, top + height * 0.35, width * 0.7, height * 0.6);
+
+ p.setBrush(Qt::NoBrush);
+ p.setRenderHint(QPainter::Antialiasing, false);
+ p.setBackground(Qt::transparent);
+
+ p.drawRect(firstSquare);
+
+ // TODO: this is a hack, please use a better method for drawing the button
+ QPainter::CompositionMode mode = p.compositionMode();
+ p.setCompositionMode(QPainter::CompositionMode_Clear);
+ p.fillRect(secondSquare, data->white);
+ p.setCompositionMode(mode);
+
+
+ p.drawRect(secondSquare);
+
+ // and some extra-lines
+ p.drawLine(firstSquare.topLeft() + QPoint(0,1), firstSquare.topRight() + QPoint(0,1));
+ p.drawLine(secondSquare.topLeft() + QPoint(0,1), secondSquare.topRight() +QPoint(0,1));
+ break;
+ }
+ case QStyle::SP_TitleBarContextHelpButton:
+ {
+ // just to identify cases where it appears
+ QFont f = p.font();
+ f.setPixelSize(r.height());
+ p.setFont(f);
+ p.drawText(r, Qt::AlignCenter, "?");
+ break;
+ }
+ case QStyle::SP_TitleBarMenuButton:
+ {
+ p.drawLine(left, top + (height * .45), centerY, bottom);
+ p.drawLine(centerY, bottom, right, top + (height * 0.3));
+ break;
+ }
+ case QStyle::SP_TitleBarShadeButton:
+ case QStyle::SP_TitleBarUnshadeButton:
+ {
+ // just to identify cases where it appears
+ p.fillRect(r, Qt::magenta);
+ break;
+ }
+ default:
+ break;
+
+ }
+ pix = QPixmap::fromImage(img);
+ QPixmapCache::insert(key, pix);
+ return QIcon(pix);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_icons.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_menu.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_menu.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_menu.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawMenuItem(const QStyleOption *opt, QPainter *p, bool saveSpaceForIcon)
+{
+ const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt);
+
+ if (!menuItem)
+ return;
+
+ ColorData *data = lookupData(opt->palette);
+ QRect r = opt->rect;
+ bool selected = menuItem->state & QStyle::State_Selected;
+ bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable;
+ bool checked = menuItem->checked;
+ bool enabled = menuItem->state & QStyle::State_Enabled;
+
+
+ p->save();
+ QBrush textBrush;
+ if (opt->palette.resolve() & (1 << QPalette::ButtonText))
+ textBrush = opt->palette.buttonText();
+ else
+ textBrush = opt->palette.windowText(); // KDE uses windowText rather than buttonText for menus
+
+ switch(menuItem->menuItemType)
+ {
+ case QStyleOptionMenuItem::Separator:
+ {
+ drawSeparator(opt, p, 10);
+ break;
+ }
+ case QStyleOptionMenuItem::TearOff:
+ {
+ drawHandle(opt, p);
+ break;
+ }
+
+ case QStyleOptionMenuItem::Normal:
+ case QStyleOptionMenuItem::DefaultItem:
+ case QStyleOptionMenuItem::SubMenu:
+ {
+ if (selected && enabled)
+ {
+ QLinearGradient g(r.topLeft(), r.bottomLeft());
+ g.setColorAt(0., data->color[1]);
+ g.setColorAt(0.5, data->color[3]);
+ g.setColorAt(0.51, data->color[4]);
+ g.setColorAt(1., data->color[2]);
+ fillRectCuttingOne(p, r.adjusted(0, 0, -1, 0), g);
+ }
+
+ /* from QPlastiqueStyle */
+ //TODO: add CopyRight
+ QRect checkRect(r.left() + 7, r.center().y() - 6, 13, 13);
+ checkRect = QStyle::visualRect(menuItem->direction, menuItem->rect, checkRect);
+ if (checkable)
+ {
+ if ((menuItem->checkType & QStyleOptionMenuItem::Exclusive) && menuItem->icon.isNull())
+ {
+ QStyleOptionButton button;
+ button.rect = checkRect;
+ button.state = menuItem->state;
+ if (checked)
+ button.state |= QStyle::State_On;
+ button.palette = menuItem->palette;
+ drawRadioButton(&button, p);
+ }
+ else
+ {
+ QStyleOptionButton button;
+ button.rect = checkRect;
+ button.state = menuItem->state;
+ if (checked)
+ button.state |= QStyle::State_On;
+ button.palette = menuItem->palette;
+
+ if (menuItem->icon.isNull())
+ drawCheckBox(&button, p);
+ else if (checked)
+ {
+ int size = r.height() - 4;
+ QRect buttonRect(0, 0, size, size);
+ buttonRect.moveCenter(checkRect.center());
+ button.rect = buttonRect;
+ drawButton(&button, p);
+ }
+ }
+ }
+
+ if (!menuItem->icon.isNull() && saveSpaceForIcon)
+ {
+ QIcon::Mode mode = !enabled ? QIcon::Disabled : QIcon::Normal;
+ if (selected && enabled)
+ mode = QIcon::Active;
+ QPixmap pixmap;
+ if (checked)
+ pixmap = menuItem->icon.pixmap(m_parent->pixelMetric(QStyle::PM_SmallIconSize, opt), mode, QIcon::On);
+ else
+ pixmap = menuItem->icon.pixmap(m_parent->pixelMetric(QStyle::PM_SmallIconSize, opt), mode);
+
+ QRect pmr = pixmap.rect();
+ pmr.moveCenter(checkRect.center());
+ p->setPen(textBrush.color());
+ p->drawPixmap(pmr.topLeft(), pixmap);
+ }
+
+ // Text
+ bool leftToRight = (menuItem->direction == Qt::LeftToRight) ? true : false;
+ int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine | Qt::AlignLeft;
+
+ if (!m_parent->styleHint(QStyle::SH_UnderlineShortcut, menuItem))
+ text_flags |= Qt::TextHideMnemonic;
+
+ QRect subMenuRect(r.right()-10,r.top(),10,r.height());
+ if (!menuItem->text.isEmpty())
+ {
+ QRect textRect;
+ int tab = menuItem->tabWidth;
+ if (saveSpaceForIcon && leftToRight)
+ textRect.setLeft(checkRect.right() + 8);
+ else if (!leftToRight)
+ textRect.setLeft(tab);
+ else
+ textRect.setLeft(r.left() + 4);
+
+ textRect.setTop(r.top() + 4);
+
+ if (leftToRight) textRect.setRight(r.right() - 4 - tab);
+ else{
+ if (saveSpaceForIcon) textRect.setRight(checkRect.left() - 8);
+ else textRect.setRight(r.right() - 4);
+ }
+
+ textRect.setBottom(r.bottom() - 4);
+
+ if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu)
+ textRect.adjust(0,0,-subMenuRect.width(),0);
+ else if (menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem)
+ {
+ QFont f = p->font();
+ f.setBold(true);
+ p->setFont(f);
+ }
+
+ QStringList textList = menuItem->text.split(QRegExp("\t"));
+
+ // draw the shortcut
+ if (textList.first() != textList.last()){
+ QRect shortcutRect(textRect);
+
+ if (leftToRight)
+ shortcutRect.setLeft(textRect.right());
+ else
+ shortcutRect.setRight(textRect.left() + 4);
+
+ drawItemText(p, shortcutRect, text_flags, menuItem->palette, enabled, textList.last(), selected ? QPalette::HighlightedText : QPalette::Text);
+ }
+
+ // and the text
+ drawItemText(p, textRect, text_flags, menuItem->palette, enabled, textList.first(), selected ? QPalette::HighlightedText : QPalette::Text);
+ }
+
+ if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu)
+ {
+ QStyleOption copy = *opt;
+ copy.rect = subMenuRect;
+
+ if (leftToRight)
+ drawSymbol(©, p, SymbolArrowRight);
+ else{
+ copy.rect = QStyle::visualRect(menuItem->direction, menuItem->rect, copy.rect);
+ drawSymbol(©, p, SymbolArrowLeft);
+ }
+ }
+ break;
+ }
+ case QStyleOptionMenuItem::Scroller:
+ default:
+ break;
+ }
+
+ p->restore();
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_menu.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_progressbar.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_progressbar.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_progressbar.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <QVarLengthArray>
+#include <QDebug>
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawProgressBarContents(const QStyleOption *opt, QPainter *p, bool kde)
+{
+ const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt);
+ if (!pb)
+ return;
+
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ p->save();
+ QRect r = pb->rect;
+ bool vertical = false;
+ bool inverted = false;
+ qint64 minimum = qint64(pb->minimum);
+ qint64 maximum = qint64(pb->maximum);
+ qint64 progress = qint64(pb->progress);
+ qint64 range = maximum - minimum;
+ if (range < 0)
+ return;
+
+ if (maximum == minimum || progress <= minimum) // indeterminate state
+ return;
+
+ // Get extra style options if version 2
+ const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt);
+ if (pb2)
+ {
+ vertical = (pb2->orientation == Qt::Vertical);
+ inverted = pb2->invertedAppearance;
+ }
+
+ // If the orientation is vertical, we use a transform to rotate
+ // the progress bar 90 degrees clockwise. This way we can use the
+ // same rendering code for both orientations.
+ if (vertical)
+ {
+ if (kde)
+ r = QRect(r.left() + 2, r.top() - 4, r.height(), r.width()); // flip width and height
+ else
+ r = QRect(r.left(), r.top(), r.height(), r.width()); // flip width and height
+ QTransform m;
+ m.translate(r.height(), 0);
+ m.rotate(90.0);
+ p->setTransform(m);
+ }
+
+ QRect progressRect;
+ if (kde)
+ progressRect = r.adjusted(-1, -1, 1, 1);
+ else
+ progressRect = r.adjusted(1,1,-1,-1);
+
+ QLinearGradient g(0, progressRect.top(), 0, progressRect.bottom());
+ g.setColorAt(0., data->color[1]);
+ g.setColorAt(0.5, data->color[3]);
+ g.setColorAt(0.51, data->color[4]);
+ g.setColorAt(1., data->color[2]);
+
+ if (progress == maximum)
+ {
+ p->fillRect(progressRect, g);
+ }
+ else
+ {
+ progress -= minimum;
+ progressRect.setWidth((progressRect.width() * progress) / range - 1);
+ QRect endRect = QRect(progressRect.right() + 1, progressRect.top()+1, 1, progressRect.height()-2);
+
+ bool reverse = (!vertical && (pb->direction == Qt::RightToLeft)) || vertical;
+ if (inverted)
+ reverse = !reverse;
+
+ if (reverse)
+ {
+ progressRect.moveRight(r.right()-1);
+ endRect.moveLeft(progressRect.left()-1);
+ }
+ p->fillRect(progressRect, g);
+ p->fillRect(endRect, g);
+ }
+
+ // draw the division lines
+ QVarLengthArray<QLine, 32> lines1;
+ QVarLengthArray<QLine, 32> lines2;
+
+ int interval = maximum / 8;
+ int pos = 0;
+ int maxSize = r.width() + (kde ? 3 : -1);
+ progress = progressRect.width();
+ int spacer = (kde) ? -1 : 1;
+
+ if (interval != 0)
+ do{
+ pos += interval;
+
+ if (pos >= maxSize) break;
+
+ if (!vertical){
+ if (pos <= progress)
+ lines1.append(QLine(progressRect.left() + pos, r.top() + spacer, progressRect.left() + pos, r.bottom() - spacer));
+ else
+ lines2.append(QLine(progressRect.left() + pos, r.top() + spacer, progressRect.left() + pos, r.bottom() - spacer));
+ } else{
+ if (pos <= progress)
+ lines2.append(QLine(progressRect.left() + pos, r.top() + spacer + 1, progressRect.left() + pos, r.bottom() + (kde ? 2 : 0)));
+ else
+ lines1.append(QLine(progressRect.left() + pos, r.top() + spacer + 1, progressRect.left() + pos, r.bottom() + (kde ? 2 : 0)));
+ }
+ } while (pos < maxSize);
+
+ p->setPen(data->color[2]);
+ p->drawLines(lines1.constData(), lines1.size());
+ p->setPen(data->gray[1]);
+ p->drawLines(lines2.constData(), lines2.size());
+ //
+
+ p->restore();
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_progressbar.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_q3listview.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_q3listview.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_q3listview.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 of the License, or
+ * (at your opt) 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ ** Q3ListView code based on KStyle for KDE4
+ * Copyright (C) 2004-2005 Maksim Orlovich <maksim at kde.org>
+ * Copyright (C) 2005,2006 Sandro Giessl <giessl at kde.org>
+ *
+ * Based in part on the following software:
+ * KStyle for KDE3
+ * Copyright (C) 2001-2002 Karol Szwed <gallium at kde.org>
+ * Portions (C) 1998-2000 TrollTech AS
+ * Keramik for KDE3,
+ * Copyright (C) 2002 Malte Starostik <malte at kde.org>
+ * (C) 2002-2003 Maksim Orlovich <maksim at kde.org>
+ * Portions (C) 2001-2002 Karol Szwed <gallium at kde.org>
+ * (C) 2001-2002 Fredrik Höglund <fredrik at kde.org>
+ * (C) 2000 Daniel M. Duley <mosfet at kde.org>
+ * (C) 2000 Dirk Mueller <mueller at kde.org>
+ * (C) 2001 Martijn Klingens <klingens at kde.org>
+ * (C) 2003 Sandro Giessl <sandro at giessl.com>
+ *
+ */
+
+#include "iaorastyle.h"
+#include <QPainter>
+#include <QStyle>
+
+void IaOraStyle::drawQ3ListView(const QStyleOption *opt, QPainter *p, const QWidget *w)
+{
+ QRect r = opt->rect;
+ // This code is based on the implementation of KStyle for KDE4;
+ // check the copyright on the top of this file
+ const QStyleOptionQ3ListView* lvOpt = qstyleoption_cast<const QStyleOptionQ3ListView*>(opt);
+
+ if (!lvOpt)
+ return;
+
+ // If we have a branch or are expanded...
+ if (lvOpt->subControls & (QStyle::SC_Q3ListViewBranch | QStyle::SC_Q3ListViewExpand))
+ {
+ QStyleOptionQ3ListViewItem item = lvOpt->items.at(0);
+
+ int y = r.y();
+
+ QStyleOption opt; //For painting
+ opt.palette = lvOpt->palette;
+ opt.direction = Qt::LeftToRight;
+
+ //Remap the p so (0,0) corresponds to the origin
+ //of the w, to help out the line align code.
+ //Extract the paint offset. Here be dragons
+ //(and not the cute green Patron of the project, either)
+ int cX = w ? w->property("contentsX").toInt() : 0;
+ int cY = w ? w->property("contentsY").toInt() : 0;
+
+ QPoint adjustCoords = p->matrix().map(QPoint(0,0)) + QPoint(cX, cY);
+ p->translate(-adjustCoords);
+
+ if (lvOpt->activeSubControls & QStyle::SC_All && (lvOpt->subControls & QStyle::SC_Q3ListViewExpand))
+ {
+ //### CHECKME: this is from KStyle3, and needs to be re-checked/tested
+ // We only need to draw a vertical line
+ //Route through the Qt4 style-call.
+ QStyleOption opt;
+ opt.rect = QRect(r.topLeft() + adjustCoords, r.size());
+ opt.state = QStyle::State_Sibling;
+ drawBranch(&opt, p);
+ }
+ else
+ {
+ int childPos = 1;
+
+ // Draw all the expand/close boxes, and nearby branches
+ while (childPos < lvOpt->items.size() && y < r.height())
+ {
+ const QStyleOptionQ3ListViewItem& child = lvOpt->items.at(childPos);
+
+ if (!(child.features & QStyleOptionQ3ListViewItem::Visible))
+ {
+ childPos++;
+ continue;
+ }
+
+ //Route through the Qt4 style-call.
+ opt.rect = QRect(r.x() + adjustCoords.x(), y + adjustCoords.y(),
+ r.width(), child.height);
+ opt.state = QStyle::State_Item;
+
+ if (child.features & QStyleOptionQ3ListViewItem::Expandable
+ || child.childCount)
+ {
+ opt.state |= QStyle::State_Children;
+ opt.state |= (child.state & QStyle::State_Open);
+ opt.state |= (child.state & QStyle::State_Enabled);
+ }
+
+ //See if we have a visible sibling
+ int siblingPos = 0;
+ for (siblingPos = childPos + 1; siblingPos < lvOpt->items.size();
+ ++siblingPos)
+ {
+ if (lvOpt->items.at(siblingPos).features
+ & QStyleOptionQ3ListViewItem::Visible)
+ {
+ opt.state |= QStyle::State_Sibling;
+ break;
+ }
+ }
+
+ //If on screen, paint it
+ if (y + child.height > 0)
+ drawBranch(&opt, p);
+
+ if (!siblingPos)
+ break;
+
+ //If we have a sibling, and an expander, also have to draw
+ //a line for below the immediate area
+ if ((opt.state & QStyle::State_Children) && (opt.state & QStyle::State_Sibling))
+ {
+ opt.state = QStyle::State_Sibling;
+ opt.rect = QRect(r.x() + adjustCoords.x(),
+ y + adjustCoords.y() + child.height,
+ r.width(), child.totalHeight - child.height);
+ if (opt.rect.height())
+ drawBranch(&opt, p);
+ }
+
+ y += child.totalHeight;
+ childPos = siblingPos;
+ } //loop through items
+ } //complex case
+ }
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_q3listview.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_scrollbar.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_scrollbar.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_scrollbar.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawScrollBarEmptySpace(const QStyleOption *opt, QPainter *p)
+{
+ const QStyleOptionSlider *scr = qstyleoption_cast<const QStyleOptionSlider *>(opt);
+ if (!scr)
+ return;
+
+ ColorData *data = lookupData(opt->palette);
+ QRect r = opt->rect;
+ p->fillRect(r, data->gray[0]);
+ int border;
+ if (scr->orientation == Qt::Horizontal)
+ border = (BorderTop | BorderBottom);
+ else
+ border = (BorderLeft | BorderRight);
+ drawBorder(p, opt, r, (opt->state & QStyle::State_Enabled), border);
+}
+
+void IaOraStyle::drawScrollBarButton(const QStyleOption *opt, QPainter *p, Symbol s)
+{
+ const QStyleOptionSlider *scr = qstyleoption_cast<const QStyleOptionSlider *>(opt);
+ if (!scr)
+ return;
+
+ ColorData *data = lookupData(opt->palette);
+
+ bool vertical = (scr->orientation == Qt::Vertical);
+ bool active = (opt->state & QStyle::State_Enabled);
+ QRect r = opt->rect;
+ QStyleOption copy = *opt;
+
+ p->save();
+
+ /* FIXME: figure out why the scrollbar area is being filled as white at the very beginning */
+ p->fillRect(r, opt->palette.brush(QPalette::Window));
+
+ QRect arrowRect = r;
+
+ drawFrameCuttingOne(p, r, active ? data->gray[5] : data->gray[4]);
+ if (vertical)
+ {
+ arrowRect.adjust(1,2,0,0);
+ drawBorder(p, opt, r, active, (s == SymbolArrowRight) ? BorderTop : BorderBottom);
+ }
+ else
+ {
+ arrowRect.adjust(2,1,0,0);
+ drawBorder(p, opt, r, active, (s == SymbolArrowRight) ? BorderLeft : BorderRight);
+ }
+
+ copy.rect = r.adjusted(1,1,-1,-1);
+ drawButton(©, p, true, true);
+
+ // only set the right arrows in vertical mode
+ if (vertical)
+ s = (s == SymbolArrowRight) ? SymbolArrowDown : SymbolArrowUp;
+ else if (scr->direction == Qt::RightToLeft) // if direction != Qt::LeftToRight, we change the symbol orientation
+ s = (s == SymbolArrowRight) ? SymbolArrowLeft : SymbolArrowRight;
+ copy.rect = arrowRect;
+ drawSymbol(©, p, s);
+
+ p->restore();
+}
+
+void IaOraStyle::drawScrollBarHandle(const QStyleOption *opt, QPainter *p)
+{
+ const QStyleOptionSlider *scr = qstyleoption_cast<const QStyleOptionSlider *>(opt);
+ if (!scr)
+ return;
+
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active); // let the scrollbars colored when no focus
+ ColorData *data = lookupData(pal);
+
+ QPen oldPen = p->pen();
+
+ bool vertical = (scr->orientation == Qt::Vertical);
+ bool max = (scr->sliderValue == scr->maximum), min = (scr->sliderValue == scr->minimum);
+ QRect r = opt->rect;
+ QLine maxLine, minLine;
+
+ // fill the empty spaces and the border
+ drawScrollBarEmptySpace(opt, p);
+
+
+ QRect handleRect = r;
+
+ QLinearGradient g;
+ if (vertical)
+ {
+ handleRect.adjust(1, min ? 0 : 1, -1, max ? 0 : -1);
+ g = QLinearGradient(handleRect.left(), 0, handleRect.right(), 0);
+ minLine = QLine(handleRect.left()+1, r.top(), handleRect.right()-1, r.top());
+ maxLine = QLine(handleRect.left()+1, r.bottom(), handleRect.right()-1, r.bottom());
+ }
+ else
+ {
+ handleRect.adjust(min ? 0 : 1, 1, max ? 0 : -1, -1);
+ g = QLinearGradient(0, handleRect.top(), 0, handleRect.bottom());
+ minLine = QLine(r.left(), handleRect.top()+1, r.left(), handleRect.bottom()-1);
+ maxLine = QLine(r.right(), handleRect.top()+1, r.right(), handleRect.bottom()-1);
+ }
+ g.setColorAt(0., data->color[1]);
+ g.setColorAt(0.5, data->color[3]);
+ g.setColorAt(0.51, data->color[4]);
+ g.setColorAt(1., data->color[2]);
+
+ p->fillRect(handleRect, g);
+
+ p->setPen(QPen(QBrush(g), 1));
+ if (!min)
+ p->drawLine(minLine);
+ if (!max)
+ p->drawLine(maxLine);
+
+ p->setPen(oldPen);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_scrollbar.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_slider.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_slider.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_slider.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ ** SC_SliderTickmarks code based on QtCurve style fom KDE4
+ * Copyright C( 2007-2008 Craig Drummond <Craig.Drummond at lycos.co.uk>
+ *
+ */
+
+#include <QVarLengthArray>
+#include "iaorastyle.h"
+
+void IaOraStyle::drawSlider(const QStyleOption *opt, QPainter *p,
+ const QRect &grooveRegion, const QRect &handle, const QRect &ticks)
+{
+ const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt);
+ if (!slider)
+ return;
+
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ QPen oldPen = p->pen();
+
+ bool active = (opt->state & QStyle::State_Enabled);
+ bool vertical = slider->orientation == Qt::Vertical;
+
+ if (slider->subControls & QStyle::SC_SliderGroove)
+ {
+ QRect filled = grooveRegion.adjusted(1, 1, -1, -1);
+ p->fillRect(filled, data->gray[0]);
+
+ if (slider->orientation == Qt::Horizontal){
+ if (slider->upsideDown) filled.setLeft(handle.right() - 2);
+ else filled.setRight(handle.left() + 2);
+ } else{
+ if (slider->upsideDown) filled.setTop(handle.bottom() - 2);
+ else filled.setBottom(handle.top() + 2);
+ }
+
+ p->fillRect(filled, data->gray[3]);
+
+ drawFrameCuttingOne(p, grooveRegion, active ? data->gray[5] : data->gray[4]);
+ }
+
+ // The code for SC_SliderTickmarks is based on the implementation of QtCurve style for KDE4;
+ // check the copyright on the top of this file
+ if (slider->subControls & QStyle::SC_SliderTickmarks){
+ QVarLengthArray<QLine, 32> lines;
+
+ int sliderLen = m_parent->pixelMetric(QStyle::PM_SliderLength, opt);
+ int tickSize = m_parent->pixelMetric(QStyle::PM_SliderTickmarkOffset, opt);
+ int availableSpace = m_parent->pixelMetric(QStyle::PM_SliderSpaceAvailable, opt);
+
+ int value = slider->minimum;
+ int tickInterval = slider->tickInterval;
+ int pos = 0;
+
+ if (tickInterval <= 0){
+ tickInterval = slider->singleStep;
+ if (QStyle::sliderPositionFromValue(slider->minimum, slider->maximum,
+ tickInterval, availableSpace) -
+ QStyle::sliderPositionFromValue(slider->minimum,
+ slider->maximum, 0, availableSpace) < 3)
+ tickInterval = slider->pageStep;
+ }
+ if (tickInterval <= 0) tickInterval = 1;
+
+ while (value <= slider->maximum){
+ if (slider->orientation == Qt::Horizontal){
+ pos = QStyle::sliderPositionFromValue(slider->minimum,
+ slider->maximum, value, slider->rect.width() + sliderLen,
+ slider->upsideDown) + 12;
+
+ lines.append(QLine(pos, slider->rect.top() + 11, pos,
+ slider->rect.top() + tickSize + 1));
+ } else{
+ pos = QStyle::sliderPositionFromValue(slider->minimum,
+ slider->maximum, value, slider->rect.height() - sliderLen,
+ slider->upsideDown) + 4;
+
+ lines.append(QLine(slider->rect.left() + 11, pos,
+ slider->rect.left() + tickSize + 1, pos));
+ }
+
+ if (value + tickInterval < value) break;
+ value = value + tickInterval;
+ }
+
+ p->setPen(data->gray[1]);
+ p->drawLines(lines.constData(), lines.size());
+ }
+
+ if (slider->subControls & QStyle::SC_SliderHandle)
+ {
+ QRect circle(0,0,4,4);
+ QRect handleCpy;
+ circle.moveCenter(handle.center());
+ QLinearGradient g1, g2;
+ if (vertical)
+ {
+ handleCpy = handle.adjusted(-1, 0, 1, 0);
+ g1 = QLinearGradient(handleCpy.left(), 0, handleCpy.right(), 0);
+ g2 = QLinearGradient(circle.left(), 0, circle.right(), 0);
+ }
+ else
+ {
+ handleCpy = handle.adjusted(0, -1, 0, 1);
+ g1 = QLinearGradient(0, handleCpy.top(), 0, handleCpy.bottom());
+ g2 = QLinearGradient(0, circle.top(), 0, circle.bottom());
+ }
+
+ g1.setColorAt(0., data->color[2]);
+ g1.setColorAt(1., data->color[4]);
+ g2.setColorAt(0., data->color[4]);
+ g2.setColorAt(1., data->color[2]);
+
+ fillRectCuttingOne(p, handleCpy, g1);
+
+ p->setPen(Qt::NoPen);
+ p->setBrush(g2);
+ p->drawEllipse(circle);
+
+ }
+
+ p->setPen(oldPen);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_slider.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_spinbox.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_spinbox.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_spinbox.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawSpinBox(const QStyleOptionComplex *opt, QPainter *p)
+{
+ const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt);
+ QStyleOptionSpinBox copy = *sb;
+ QRect r = opt->rect;
+
+ if (!sb)
+ return;
+
+ QStyle::PrimitiveElement pe;
+
+ if (sb->frame && (sb->subControls & QStyle::SC_SpinBoxFrame))
+ {
+ QRect r = m_parent->subControlRect(QStyle::CC_SpinBox, sb, QStyle::SC_SpinBoxFrame);
+
+ copy.rect = r;
+ drawFrame(©, p);
+ }
+
+ /* SPIN-UP */
+ if (sb->subControls & QStyle::SC_SpinBoxUp)
+ {
+ copy.subControls = QStyle::SC_SpinBoxUp;
+ QPalette pal2 = sb->palette;
+ if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled))
+ {
+ pal2.setCurrentColorGroup(QPalette::Disabled);
+ copy.state &= ~QStyle::State_Enabled;
+ }
+
+ copy.palette = pal2;
+
+ if (sb->activeSubControls == QStyle::SC_SpinBoxUp && (sb->state & QStyle::State_Sunken))
+ {
+ copy.state |= QStyle::State_On;
+ copy.state |= QStyle::State_Sunken;
+ }
+ else
+ {
+ copy.state |= QStyle::State_Raised;
+ copy.state &= ~QStyle::State_Sunken;
+ }
+ pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? QStyle::PE_IndicatorSpinPlus : QStyle::PE_IndicatorSpinUp);
+ copy.rect = m_parent->subControlRect(QStyle::CC_SpinBox, sb, QStyle::SC_SpinBoxUp);
+ m_parent->drawPrimitive(QStyle::PE_PanelButtonBevel, ©, p);
+ drawBorder(p, opt, copy.rect, sb->state & QStyle::State_Enabled, IaOraStyle::BorderLeft);
+ /* FIXME: don't really know why the rect is not right at this point, but anyway... */
+ copy.rect.adjust(1, 2, 0, 0);
+ m_parent->drawPrimitive(pe, ©, p);
+
+ }
+ /* SPIN-DOWN */
+ if (sb->subControls & QStyle::SC_SpinBoxDown)
+ {
+ copy.subControls = QStyle::SC_SpinBoxDown;
+ copy.state = sb->state;
+ QPalette pal2 = sb->palette;
+ if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled))
+ {
+ pal2.setCurrentColorGroup(QPalette::Disabled);
+ copy.state &= ~QStyle::State_Enabled;
+ }
+
+ copy.palette = pal2;
+
+ if (sb->activeSubControls == QStyle::SC_SpinBoxDown && (sb->state & QStyle::State_Sunken))
+ {
+ copy.state |= QStyle::State_On;
+ copy.state |= QStyle::State_Sunken;
+ }
+ else
+ {
+ copy.state |= QStyle::State_Raised;
+ copy.state &= ~QStyle::State_Sunken;
+ }
+ pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? QStyle::PE_IndicatorSpinMinus : QStyle::PE_IndicatorSpinDown);
+ copy.rect = m_parent->subControlRect(QStyle::CC_SpinBox, sb, QStyle::SC_SpinBoxDown);
+ m_parent->drawPrimitive(QStyle::PE_PanelButtonBevel, ©, p);
+ drawBorder(p, opt, copy.rect, sb->state & QStyle::State_Enabled, IaOraStyle::BorderLeft | IaOraStyle::BorderTop);
+ /* FIXME: don't really know why the rect is not right at this point, but anyway... */
+ copy.rect.adjust(1, 2, 0, 0);
+ m_parent->drawPrimitive(pe, ©, p);
+
+ }
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_spinbox.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_symbols.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_symbols.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_symbols.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawCheckBox(const QStyleOption *opt, QPainter *p)
+{
+ QPen oldPen = p->pen();
+ bool enabled = (opt->state & QStyle::State_Enabled);
+
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ QRect r = opt->rect;
+ QRect contents = r.adjusted(1,1,-1,-1);
+ p->fillRect(contents, enabled ? data->white : data->gray[0]);
+ drawFrameCuttingOne(p, r, enabled ? data->gray[5] : data->gray[4]);
+
+ if (opt->state & QStyle::State_NoChange) // tristate
+ {
+ QRect linesRect = QRect(contents.left() + 2, 0, contents.width() - 4, 3);
+ linesRect.moveCenter(contents.center());
+ int top = linesRect.top(), left = linesRect.left(), bottom = linesRect.bottom(), right = linesRect.right();
+ p->setPen(enabled ? data->color[2] : data->gray[3]);
+ p->drawLine(left+1,top,right-1,top);
+ p->drawLine(left,top+1,right,top+1);
+ p->setPen(enabled ? data->color[4] : data->gray[5]);
+ p->drawLine(left+1,bottom,right-1,bottom);
+ }
+ else if (opt->state & QStyle::State_On)
+ {
+ contents.adjust(1,1,-1,-1);
+ QLinearGradient g(contents.topLeft(), contents.bottomLeft());
+ g.setColorAt(0., enabled ? data->color[2] : data->gray[3]);
+ g.setColorAt(1., enabled ? data->color[4] : data->gray[5]);
+ QPen pen(QBrush(g), 2);
+ pen.setCapStyle(Qt::RoundCap);
+ p->setPen(pen);
+ p->drawLine(contents.topLeft(), contents.bottomRight());
+ p->drawLine(contents.bottomLeft(), contents.topRight());
+ }
+
+ p->setPen(oldPen);
+}
+
+void IaOraStyle::drawRadioButton(const QStyleOption *opt, QPainter *p)
+{
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ QPen oldPen = p->pen();
+ QBrush oldBrush = p->brush();
+ bool aa = (p->renderHints() & QPainter::Antialiasing);
+ bool enabled = (opt->state & QStyle::State_Enabled);
+
+ QRect r = opt->rect;
+
+ p->setRenderHint(QPainter::Antialiasing, true);
+ p->setPen(data->gray[4]);
+ p->setBrush(enabled ? Qt::white : data->gray[0]);
+ p->drawEllipse(r);
+
+ if (opt->state & (QStyle::State_Sunken | QStyle::State_On))
+ {
+ QRect contents = r.adjusted(3,3,-3,-3);
+ QLinearGradient g(contents.topLeft(), contents.bottomLeft());
+ g.setColorAt(0., enabled ? data->color[2] : data->gray[3]);
+ g.setColorAt(1., enabled ? data->color[4] : data->gray[5]);
+ p->setPen(Qt::NoPen);
+ p->setBrush(g);
+ p->drawEllipse(contents);
+ }
+
+ p->setPen(oldPen);
+ p->setBrush(oldBrush);
+ p->setRenderHint(QPainter::Antialiasing, aa);
+}
+
+
+void IaOraStyle::drawSymbol(const QStyleOption *opt, QPainter *p, Symbol s)
+{
+ QRect r = opt->rect;
+
+ QPoint center = r.center();
+ bool enabled = (opt->state & QStyle::State_Enabled);
+ ColorData *data = lookupData(opt->palette);
+ bool selected = (opt->state & QStyle::State_Selected);
+ QColor c;
+ if (enabled){
+ if (selected && ( opt->palette.highlightedText().color() != Qt::white ) )
+ c = opt->palette.highlightedText().color();
+ else
+ c = opt->palette.text().color();
+ } else
+ c = data->gray[4];
+ //QColor c = enabled ? data->black : data->gray[4];
+
+ bool aa = (p->renderHints() & QPainter::Antialiasing);
+ QPen oldPen = p->pen();
+ QBrush oldBrush = p->brush();
+
+ //p->setRenderHint(QPainter::Antialiasing, true); // with antialiasing, the arrows doesn't look like arrow :S
+ switch(s)
+ {
+ case SymbolArrowUp:
+ {
+ QPoint points[3];
+ points[0] = center + QPoint(0, -3);
+ points[1] = points[0] + QPoint(-4, 5);
+ points[2] = points[0] + QPoint(4, 4);
+
+ p->setPen(Qt::NoPen);
+ p->setBrush(c);
+ p->drawConvexPolygon(points, 3);
+ break;
+ }
+ case SymbolArrowDown:
+ {
+ QPoint points[3];
+ points[0] = center + QPoint(0, 3);
+ points[1] = points[0] + QPoint(-3, -4);
+ points[2] = points[0] + QPoint(4, -4);
+
+ p->setPen(Qt::NoPen);
+ p->setBrush(c);
+ p->drawConvexPolygon(points, 3);
+ break;
+ }
+ case SymbolArrowLeft:
+ {
+ QPoint points[3];
+ points[0] = center + QPoint(-3, 0);
+ points[1] = points[0] + QPoint(4, -4);
+ points[2] = points[0] + QPoint(4, 4);
+
+ p->setPen(Qt::NoPen);
+ p->setBrush(c);
+ p->drawConvexPolygon(points, 3);
+ break;
+ }
+ case SymbolArrowRight:
+ {
+ QPoint center = r.center();
+ QPoint points[3];
+ points[0] = center + QPoint(3, 0);
+ points[1] = points[0] + QPoint(-4, -4);
+ points[2] = points[0] + QPoint(-4, 4);
+
+ p->setPen(Qt::NoPen);
+ p->setBrush(c);
+ p->drawConvexPolygon(points, 3);
+ break;
+ }
+ case SymbolPlus:
+ {
+ QPoint center = r.center();
+ p->setPen(c);
+ p->setRenderHint(QPainter::Antialiasing, false);
+ p->drawLine(center - QPoint(2,0), center + QPoint(2,0));
+ p->drawLine(center - QPoint(0,2), center + QPoint(0,2));
+ break;
+ }
+ case SymbolMinus:
+ {
+ QPoint center = r.center();
+ p->setPen(c);
+ p->setRenderHint(QPainter::Antialiasing, false);
+ p->drawLine(center - QPoint(2,0), center + QPoint(2,0));
+ break;
+ }
+ }
+
+ p->setRenderHint(QPainter::Antialiasing, aa);
+ p->setPen(oldPen);
+ p->setBrush(oldBrush);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_symbols.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_tabbar.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_tabbar.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_tabbar.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,239 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ ** ** QTabBarLabel code based on QCommonStyle
+ * Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawTabBarTab(const QStyleOption *opt, QPainter *p)
+{
+ const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt);
+ QRect r = opt->rect;
+
+ if (!tab)
+ return;
+
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ bool selected = (tab->state & QStyle::State_Selected);
+ int top = r.top(), bottom = r.bottom(), left = r.left(), right = r.right();
+
+ p->save();
+
+ if (selected) // active tab
+ {
+ QRect contents = opt->rect.adjusted(1,1,-1,-1);
+ QLine borders[2];
+ QLine lightBlue[2];
+ QLine darkBlue[2];
+
+ if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::TriangularNorth)
+ {
+ contents.adjust(0,3,0,1);
+ borders[0] = QLine(left, top+4, left, bottom);
+ borders[1] = QLine(right, top+4, right, bottom);
+ lightBlue[0] = QLine(left+2,top,right-2,top);
+ lightBlue[1] = QLine(left+1,top+1,right-1,top+1);
+ darkBlue[0] = QLine(left,top+2,right,top+2);
+ darkBlue[1] = QLine(left,top+3,right,top+3);
+ }
+ else if (tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::TriangularSouth)
+ {
+ contents.adjust(0,-1,0,-3);
+ borders[0] = QLine(left,top,left,bottom-4);
+ borders[1] = QLine(right,top,right,bottom-4);
+ lightBlue[0] = QLine(left, bottom-3, right, bottom-3);
+ lightBlue[1] = QLine(left, bottom-2, right, bottom-2);
+ darkBlue[0] = QLine(left+1, bottom-1, right-1, bottom-1);
+ darkBlue[1] = QLine(left+2, bottom, right-2, bottom);
+ }
+ else if (tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::TriangularEast) // right
+ {
+ contents.adjust(-1,0,-3,0);
+ borders[0] = QLine(left, top, right-4, top);
+ borders[1] = QLine(left, bottom, right-4, bottom);
+ lightBlue[0] = QLine(right-3, top, right-3, bottom);
+ lightBlue[1] = QLine(right-2, top, right-2, bottom);
+ darkBlue[0] = QLine(right-1, top+1, right-1, bottom-1);
+ darkBlue[1] = QLine(right, top+2, right, bottom-2);
+ }
+ else // left
+ {
+ contents.adjust(3,0,1,0);
+ borders[0] = QLine(left+4, top, right, top);
+ borders[1] = QLine(left+4, bottom, right, bottom);
+ lightBlue[0] = QLine(left, top+2, left, bottom-2);
+ lightBlue[1] = QLine(left+1, top+1, left+1, bottom-1);
+ darkBlue[0] = QLine(left+2, top, left+2, bottom);
+ darkBlue[1] = QLine(left+3, top, left+3, bottom);
+ }
+
+ // fill the contents
+ p->fillRect(contents, data->gray[0]);
+
+ // draw the gray borders
+ p->setPen(data->gray[4]);
+ p->drawLines(borders, 2);
+
+ // the blue lines
+ p->setPen(data->color[2]);
+ p->drawLines(lightBlue, 2);
+ p->setPen(data->color[4]);
+ p->drawLines(darkBlue, 2);
+ }
+ else // inactive tab
+ {
+ QRect contents = opt->rect.adjusted(1,1,-1,-1);
+
+ QPoint points[2];
+ QLine lines[4];
+ if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::TriangularNorth)
+ {
+ top+=3;
+ contents.setTop(top+1);
+ lines[0] = QLine(left+2,top,right-2,top); // top
+ lines[1] = QLine(left, top+2, left, bottom); // left
+ lines[2] = QLine(right, top+2, right, bottom); // right
+ lines[3] = QLine(left, bottom, right, bottom); // bottom
+ points[0] = QPoint(left+1, top+1);
+ points[1] = QPoint(right-1, top+1);
+ }
+ else if (tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::TriangularSouth)
+ {
+ bottom-=3;
+ contents.setBottom(bottom-1);
+ lines[0] = QLine(left,top,right,top); // top
+ lines[1] = QLine(left, top, left, bottom-2); // left
+ lines[2] = QLine(right, top, right, bottom-2); // right
+ lines[3] = QLine(left+2, bottom, right-2, bottom); // bottom
+ points[0] = QPoint(left+1, bottom-1);
+ points[1] = QPoint(right-1, bottom-1);
+ }
+ else if (tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::TriangularEast) // right
+ {
+ right-=3;
+ contents.setRight(right-1);
+ lines[0] = QLine(left,top,right-2,top); // top
+ lines[1] = QLine(left,top,left,bottom); // left
+ lines[2] = QLine(right,top+2,right,bottom-2); // right
+ lines[3] = QLine(left,bottom,right-2,bottom); // bottom
+ points[0] = QPoint(right-1,top+1);
+ points[1] = QPoint(right-1,bottom-1);
+ }
+ else // left
+ {
+ left+=3;
+ contents.setLeft(left+1);
+ lines[0] = QLine(left+2,top,right,top); // top
+ lines[1] = QLine(left,top+1,left,bottom-2); // left
+ lines[2] = QLine(right,top,right,bottom); // right
+ lines[3] = QLine(left+2,bottom,right,bottom); // bottom
+ points[0] = QPoint(left+1,top+1);
+ points[1] = QPoint(left+1,bottom-1);
+ }
+
+ // draw the contents
+ p->setPen(Qt::NoPen);
+ p->setBrush(data->gray[1]);
+ p->drawRect(contents);
+
+ // draw the lines
+ p->setPen(data->gray[5]);
+ p->drawLines(lines, 4);
+ p->drawPoints(points, 2);
+ }
+
+ p->restore();
+
+ // The code below is based on the implementation of QCommonStyle;
+ // check the copyright on the top of this file
+ QStyleOptionTabV2 tabV2(*tab);
+ QRect tabRect = tabV2.rect;
+
+ // we have the vertical tab text
+ bool verticalTabs = tabV2.shape == QTabBar::RoundedEast
+ || tabV2.shape == QTabBar::RoundedWest
+ || tabV2.shape == QTabBar::TriangularEast
+ || tabV2.shape == QTabBar::TriangularWest;
+ if (verticalTabs) {
+ p->save();
+
+ int newX, newY, newRot;
+ if (tabV2.shape == QTabBar::RoundedEast || tabV2.shape == QTabBar::TriangularEast){
+ newX = tabRect.width();
+ newY = tabRect.y();
+ newRot = 90;
+ }else {
+ newX = 0;
+ newY = tabRect.y() + tabRect.height();
+ newRot = -90;
+ }
+ tabRect.setRect(0, 0, tabRect.height(), tabRect.width());
+
+ QTransform trans;
+
+ trans.translate(newX, newY);
+ trans.rotate(newRot);
+ p->setTransform(trans, true);
+ }
+
+ // and the icon
+ QSize iconSize = tabV2.iconSize;
+
+ if (!tabV2.icon.isNull()){
+ if (!iconSize.isValid()) {
+ int iconExtent = m_parent->pixelMetric(QStyle::PM_SmallIconSize);
+ iconSize = QSize(iconExtent, iconExtent);
+ }
+
+ QPixmap tabIcon = tabV2.icon.pixmap(iconSize, (tabV2.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled);
+
+ QRect iconRect = QRect(tabRect.left() + 6, tabRect.center().y() - tabIcon.height() / 2, iconSize.width(), iconSize.height());
+
+ if (tabV2.direction != Qt::LeftToRight){
+ iconRect = QStyle::visualRect(tabV2.direction, tabV2.rect, iconRect);
+ tabRect.setRight(tabRect.right() - iconSize.width() - 4);
+ } else
+ tabRect.setLeft(tabRect.left() + iconSize.width() + 4);
+
+ p->drawPixmap(iconRect, tabIcon);
+ }
+
+ // finally draw the text
+ QRect textRect = tabRect;
+ QFontMetrics fontMetrics = tabV2.fontMetrics;
+
+ QSize textSize = fontMetrics.size(Qt::TextSingleLine, tab->text);
+
+ // we must adjust the textRect if we have a close button on the tabbar
+ if ((!tabV2.icon.isNull()) && (tabRect.width() - (textSize.width() + iconSize.width()) > 8)){
+ if (tabV2.direction == Qt::LeftToRight)
+ textRect.adjust(-10, 0, -10, 0);
+ else
+ textRect.adjust(+10, 0, +10, 0);
+ }
+
+ drawItemText(p, textRect, Qt::AlignCenter | Qt::TextShowMnemonic, tab->palette, true, tab->text, QPalette::WindowText);
+ //drawItemText(p, textRect, Qt::AlignCenter | Qt::TextShowMnemonic, tab->palette, true, tab->text, QPalette::Text);
+ if (verticalTabs) p->restore();
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_tabbar.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_toolbutton.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_toolbutton.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_toolbutton.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2009 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawToolButton(const QStyleOption *opt, QPainter *p)
+{
+ const QStyleOptionToolButton *tlBtn = qstyleoption_cast <const QStyleOptionToolButton *>(opt);
+
+ if (!tlBtn)
+ return;
+
+ QStyleOptionToolButton copy = *tlBtn;
+ // TODO: cache the gradients so that it is more efficient
+ bool sunken = (opt->state & QStyle::State_Sunken);
+ bool enabled = (opt->state & QStyle::State_Enabled);
+ bool hover = (opt->state & QStyle::State_MouseOver);
+ bool selected = (opt->state & QStyle::State_On);
+
+ QRect r = opt->rect;
+ QPen oldPen = p->pen();
+
+ if (sunken || selected)
+ drawButton(©, p, false);
+ else if (hover && enabled)
+ {
+ copy.state |= QStyle::State_Enabled;
+ drawButton(©, p, false);
+ }
+
+ // Here we draw the icon (if exists)...
+ if (tlBtn->toolButtonStyle != Qt::ToolButtonTextOnly)
+ {
+ QIcon::Mode mode = (tlBtn->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
+ if (hover && enabled)
+ mode = QIcon::Active;
+
+ QRect iconRect(r);
+ QSize s;
+
+ if (tlBtn->iconSize.width() > r.width()) s = QSize(r.width(), r.width());
+ else if (tlBtn->iconSize.height() > r.height()) s = QSize(r.height(), r.height());
+ else s = tlBtn->iconSize;
+
+ QPixmap pix = tlBtn->icon.pixmap(s, mode);
+
+ int align = 0 ;
+ if (tlBtn->toolButtonStyle == Qt::ToolButtonTextBesideIcon)
+ {
+ align |= Qt::AlignLeft;
+ iconRect.adjust(-8, 0, -(r.width() - s.width()), 0);
+ }
+ else if (tlBtn->toolButtonStyle == Qt::ToolButtonTextUnderIcon)
+ {
+ align |= Qt::AlignHCenter;
+ iconRect.adjust(0, 12, 0, 0);
+ }
+ else if (tlBtn->toolButtonStyle == Qt::ToolButtonIconOnly)
+ align |= Qt::AlignHCenter;
+
+ iconRect = m_parent->alignedRect(tlBtn->direction, Qt::Alignment(align), iconRect.size(), r);
+ m_parent->drawItemPixmap(p, iconRect, Qt::AlignCenter, pix);
+ }
+
+ // ... and here the text (if exists too)
+ if (tlBtn->toolButtonStyle != Qt::ToolButtonIconOnly)
+ {
+ int text_flags = m_parent->visualAlignment(tlBtn->direction, Qt::AlignVCenter | Qt::AlignCenter) | Qt::TextShowMnemonic;
+
+ QRect textRect = r;
+ if (tlBtn->toolButtonStyle == Qt::ToolButtonTextBesideIcon)
+ {
+ if (tlBtn->direction == Qt::LeftToRight)
+ textRect.adjust(tlBtn->iconSize.height() + 4, 0, 0, 0);
+ else
+ textRect.adjust(0, 0, -(tlBtn->iconSize.height() + 0), 0);
+ }
+ else if (tlBtn->toolButtonStyle == Qt::ToolButtonTextUnderIcon)
+ textRect.adjust(0, tlBtn->iconSize.width() + 8, 0, 0);
+
+
+ drawItemText(p, textRect, text_flags, tlBtn->palette, enabled, tlBtn->text, QPalette::Text);
+ }
+
+ // it has a menu?
+ if (tlBtn->features & QStyleOptionToolButton::HasMenu)
+ {
+ copy.rect = m_parent->subControlRect(QStyle::CC_ToolButton, tlBtn, QStyle::SC_ToolButtonMenu);
+
+ copy.state = QStyle::State_Horizontal;
+
+ if (enabled)
+ copy.state |= QStyle::State_Enabled;
+ if (sunken)
+ copy.state |= QStyle::State_Sunken;
+
+ if (copy.rect != opt->rect){
+ copy.rect.adjust(2, 1, 0, 0);
+ drawSymbol(©, p, IaOraStyle::SymbolArrowDown);
+
+ if (hover && enabled){
+ copy.rect = QRect(copy.rect.left() - 2, r.top(), 2, r.height());
+ drawSeparator(©, p, 4);
+ }
+ }
+ else // I don't know why some toolbuttons don't have a correct place to their arrows...
+ {
+ copy.rect = QRect(0, 0, 8, 8);
+ copy.rect.moveLeft(r.right() - 8);
+ copy.rect.moveBottom(r.bottom());
+ drawSymbol(©, p, IaOraStyle::SymbolArrowDown);
+ }
+ }
+
+ p->setPen(oldPen);
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_toolbutton.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/src/iaorastyle_window.cpp
===================================================================
--- theme/ia_ora-kde4/src/iaorastyle_window.cpp (rev 0)
+++ theme/ia_ora-kde4/src/iaorastyle_window.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2008 Gustavo Pichorim Boiko <boiko at mandriva.com>
+ * Copyright 2008-2010 Rodrigo Gonçalves de Oliveira <rodrigo at mandriva.com>
+ *
+ * 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "iaorastyle.h"
+
+void IaOraStyle::drawDockWindowTitle(const QStyleOption *opt, QPainter *p)
+{
+ const QStyleOptionDockWidget *dock = qstyleoption_cast<const QStyleOptionDockWidget *>(opt);
+
+ if (!dock)
+ return;
+
+ QPalette pal = opt->palette;
+ pal.setCurrentColorGroup(QPalette::Active);
+ ColorData *data = lookupData(pal);
+
+ p->save();
+
+ QLinearGradient g(opt->rect.topLeft(), opt->rect.bottomLeft());
+ g.setColorAt(0., data->color[1]);
+ g.setColorAt(0.4, data->color[3]);
+ g.setColorAt(0.41, data->color[4]);
+ g.setColorAt(1., data->color[2]);
+ p->fillRect(opt->rect, g);
+
+ int text_flags = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine;
+
+ QFont font = p->font();
+ font.setBold(true);
+ font.setPointSizeF(font.pointSizeF() / 1.19);
+ p->setFont(font);
+ p->setPen(data->white);
+
+ int icons_width = 30; // for the close and float buttons
+
+ QString text = dock->fontMetrics.elidedText(dock->title, Qt::ElideRight, dock->rect.width() - icons_width);
+ p->drawText(dock->rect.adjusted(-icons_width, 0, 0, 0), text_flags, text);
+ //p->drawText(dock->rect, text_flags, dock->title);
+
+ p->restore();
+}
+
+void IaOraStyle::drawTitleBarButton(const QStyleOptionComplex *opt, QPainter *p, const QWidget *w, QStyle::SubControl control, QStyle::StandardPixmap icon)
+{
+ QRect buttonRect = m_parent->subControlRect(QStyle::CC_TitleBar, opt, control);
+ QPixmap pm = m_parent->standardIcon(icon, opt, w).pixmap(14, 14);
+
+ QRect pixRect = pm.rect();
+ pixRect.moveCenter(buttonRect.center());
+ p->drawPixmap(pixRect, pm);
+}
+
+void IaOraStyle::drawTitleBar(const QStyleOptionComplex *opt, QPainter *p, const QWidget *w)
+{
+ const QStyleOptionTitleBar *title = qstyleoption_cast<const QStyleOptionTitleBar *>(opt);
+ if (!title)
+ return;
+
+ //QPalette pal = opt->palette;
+ //pal.setCurrentColorGroup(QPalette::Active);
+ //ColorData *data = lookupData(pal);
+ ColorData *data = lookupData(opt->palette); // REGRESSION
+
+ p->save();
+
+ // dunno why the right border needs to be adjusted, but anyway...
+ QRect contents = opt->rect.adjusted(0,0,-1,0);
+ p->setPen(data->color[2]);
+ p->setBrush(Qt::NoBrush);
+ p->drawRect(contents);
+
+ contents.adjust(1,1,0,0);
+ QLinearGradient g(opt->rect.topLeft(), opt->rect.bottomLeft());
+ g.setColorAt(0., data->color[1]);
+ g.setColorAt(0.5, data->color[3]);
+ g.setColorAt(0.51, data->color[4]);
+ g.setColorAt(1., data->color[2]);
+
+ p->fillRect(contents, g);
+
+ // do we have a label?
+ if (title->subControls & QStyle::SC_TitleBarLabel)
+ {
+ QRect labelRect = m_parent->subControlRect(QStyle::CC_TitleBar, opt, QStyle::SC_TitleBarLabel);
+ int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine | Qt::AlignLeft;
+ QFont font = p->font();
+ font.setBold(true);
+ font.setPointSizeF(font.pointSizeF() / 1.19);
+ p->setFont(font);
+ p->setPen(data->white);
+ p->drawText(labelRect, text_flags, title->text);
+ }
+
+ // the buttons
+ if (title->subControls & QStyle::SC_TitleBarMaxButton
+ && (title->titleBarFlags & Qt::WindowMaximizeButtonHint)
+ && !(title->titleBarState & Qt::WindowMaximized))
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarMaxButton, QStyle::SP_TitleBarMaxButton);
+ if (title->subControls & QStyle::SC_TitleBarMinButton
+ && (title->titleBarFlags & Qt::WindowMinimizeButtonHint)
+ && !(title->titleBarState & Qt::WindowMinimized))
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarMinButton, QStyle::SP_TitleBarMinButton);
+ if (title->subControls & QStyle::SC_TitleBarNormalButton &&
+ (((title->titleBarFlags & Qt::WindowMinimizeButtonHint) &&
+ (title->titleBarState & Qt::WindowMinimized)) ||
+ ((title->titleBarFlags & Qt::WindowMaximizeButtonHint) &&
+ (title->titleBarState & Qt::WindowMaximized))))
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarNormalButton, QStyle::SP_TitleBarNormalButton);
+ if (title->subControls & QStyle::SC_TitleBarShadeButton
+ && title->titleBarFlags & Qt::WindowShadeButtonHint)
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarShadeButton, QStyle::SP_TitleBarShadeButton);
+ if (title->subControls & QStyle::SC_TitleBarSysMenu)
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarSysMenu, QStyle::SP_TitleBarMenuButton);
+ if (title->subControls & QStyle::SC_TitleBarUnshadeButton
+ && title->titleBarFlags & Qt::WindowShadeButtonHint)
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarUnshadeButton, QStyle::SP_TitleBarUnshadeButton);
+ if (title->subControls & QStyle::SC_TitleBarCloseButton)
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarCloseButton, QStyle::SP_TitleBarCloseButton);
+ if (title->subControls & QStyle::SC_TitleBarContextHelpButton
+ && (title->titleBarFlags & Qt::WindowContextHelpButtonHint))
+ drawTitleBarButton(opt, p, w, QStyle::SC_TitleBarContextHelpButton, QStyle::SP_TitleBarContextHelpButton);
+
+ p->restore();
+}
+
Property changes on: theme/ia_ora-kde4/src/iaorastyle_window.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/test/CMakeLists.txt
===================================================================
--- theme/ia_ora-kde4/test/CMakeLists.txt (rev 0)
+++ theme/ia_ora-kde4/test/CMakeLists.txt 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,9 @@
+set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
+include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../src/ ${KDE4_INCLUDES} )
+
+set( qttest_SRCS
+ qttest.cpp
+ mywindow.cpp )
+kde4_add_ui_files(qttest_SRCS mainwindow.ui)
+kde4_add_executable(qttest ${qttest_SRCS})
+target_link_libraries(qttest iaora-qt ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBRARY} ${KDE4_KDEUI_LIBRARY})
Property changes on: theme/ia_ora-kde4/test/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/test/mainwindow.ui
===================================================================
--- theme/ia_ora-kde4/test/mainwindow.ui (rev 0)
+++ theme/ia_ora-kde4/test/mainwindow.ui 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,917 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>785</width>
+ <height>823</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <property name="geometry" >
+ <rect>
+ <x>365</x>
+ <y>35</y>
+ <width>278</width>
+ <height>766</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <widget class="QComboBox" name="stylesCombo" />
+ </item>
+ <item>
+ <widget class="QMdiArea" name="mdiArea" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::DefaultContextMenu</enum>
+ </property>
+ <widget class="QWidget" name="subwindow" >
+ <property name="windowTitle" >
+ <string>Subwindow</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5" >
+ <item row="0" column="0" >
+ <widget class="QSplitter" name="splitter" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>GroupBox</string>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="pushButton_4" >
+ <property name="text" >
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QRadioButton" name="radioButton_5" >
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QCheckBox" name="checkBox_3" >
+ <property name="text" >
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>294</width>
+ <height>220</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4" >
+ <item row="0" column="0" >
+ <widget class="QTreeWidget" name="treeWidget" >
+ <column>
+ <property name="text" >
+ <string>FIrst Column</string>
+ </property>
+ </column>
+ <item>
+ <property name="text" >
+ <string>Foo</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Bar</string>
+ </property>
+ </item>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Another item</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>SubItem</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>SubSubItem</string>
+ </property>
+ </item>
+ </item>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_13" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>294</width>
+ <height>220</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_14" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>294</width>
+ <height>220</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>294</width>
+ <height>220</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 2</string>
+ </attribute>
+ </widget>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>785</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuOne_Menu" >
+ <property name="title" >
+ <string>One Menu</string>
+ </property>
+ <addaction name="actionOne_Entry" />
+ <addaction name="separator" />
+ <addaction name="actionAnother_Entry" />
+ </widget>
+ <widget class="QMenu" name="menuOne_More_Menu" >
+ <property name="title" >
+ <string>One More Menu</string>
+ </property>
+ <addaction name="actionFoobar" />
+ </widget>
+ <addaction name="menuOne_Menu" />
+ <addaction name="menuOne_More_Menu" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>801</y>
+ <width>785</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QToolBar" name="toolBar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>22</y>
+ <width>785</width>
+ <height>13</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>toolBar</string>
+ </property>
+ <attribute name="toolBarArea" >
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ <widget class="QToolBar" name="smallToolBar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>35</y>
+ <width>13</width>
+ <height>766</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>toolBar_2</string>
+ </property>
+ <attribute name="toolBarArea" >
+ <enum>LeftToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ <widget class="QDockWidget" name="dockWidget_2" >
+ <property name="geometry" >
+ <rect>
+ <x>649</x>
+ <y>35</y>
+ <width>136</width>
+ <height>399</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Boxes and Horizontal Sliders</string>
+ </property>
+ <attribute name="dockWidgetArea" >
+ <number>2</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetContents_2" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>26</y>
+ <width>136</width>
+ <height>373</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_6" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QLineEdit" name="lineEdit" />
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBox" >
+ <property name="editable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="notEditableCombo" />
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBox" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QScrollBar" name="horizontalScrollBar" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="horizontalSlider" >
+ <property name="value" >
+ <number>30</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar" >
+ <property name="value" >
+ <number>50</number>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="textVisible" >
+ <bool>true</bool>
+ </property>
+ <property name="invertedAppearance" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QDockWidget" name="dockWidget_3" >
+ <property name="geometry" >
+ <rect>
+ <x>649</x>
+ <y>440</y>
+ <width>136</width>
+ <height>361</height>
+ </rect>
+ </property>
+ <property name="floating" >
+ <bool>false</bool>
+ </property>
+ <property name="windowTitle" >
+ <string>Grid View</string>
+ </property>
+ <attribute name="dockWidgetArea" >
+ <number>2</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetContents_3" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>26</y>
+ <width>136</width>
+ <height>335</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QTableWidget" name="tableWidget" >
+ <property name="rowCount" >
+ <number>5</number>
+ </property>
+ <property name="columnCount" >
+ <number>3</number>
+ </property>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <row/>
+ <column/>
+ <column/>
+ <column/>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QDockWidget" name="dockWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>13</x>
+ <y>35</y>
+ <width>346</width>
+ <height>198</height>
+ </rect>
+ </property>
+ <property name="focusPolicy" >
+ <enum>Qt::TabFocus</enum>
+ </property>
+ <property name="floating" >
+ <bool>false</bool>
+ </property>
+ <property name="windowTitle" >
+ <string>Radio && Checks</string>
+ </property>
+ <attribute name="dockWidgetArea" >
+ <number>1</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetContents" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>26</y>
+ <width>346</width>
+ <height>172</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_7" >
+ <item>
+ <widget class="QTabWidget" name="tabWidget_4" >
+ <property name="tabPosition" >
+ <enum>QTabWidget::South</enum>
+ </property>
+ <property name="tabShape" >
+ <enum>QTabWidget::Rounded</enum>
+ </property>
+ <widget class="QWidget" name="tab_7" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>316</width>
+ <height>119</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout_6" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QRadioButton" name="radioButton" >
+ <property name="text" >
+ <string>Enabled</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ <property name="autoExclusive" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="text" >
+ <string>Enabled</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ <property name="tristate" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QRadioButton" name="radioButton_2" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Disabled</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ <property name="autoExclusive" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBox_2" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Disabled</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QRadioButton" name="radioButton_3" >
+ <property name="text" >
+ <string>Enabled</string>
+ </property>
+ <property name="autoExclusive" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QCheckBox" name="tristateCheck" >
+ <property name="text" >
+ <string>Tristate</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ <property name="tristate" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QRadioButton" name="radioButton_4" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Disabled</string>
+ </property>
+ <property name="autoExclusive" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QCheckBox" name="tristateDisable" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Tristate Disabled</string>
+ </property>
+ <property name="tristate" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_11" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>316</width>
+ <height>119</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_12" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>316</width>
+ <height>119</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_8" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>316</width>
+ <height>119</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 2</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QDockWidget" name="dockWidget_5" >
+ <property name="geometry" >
+ <rect>
+ <x>13</x>
+ <y>239</y>
+ <width>346</width>
+ <height>278</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Vertical Sliders</string>
+ </property>
+ <attribute name="dockWidgetArea" >
+ <number>1</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetContents_5" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>26</y>
+ <width>346</width>
+ <height>252</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <widget class="QTabWidget" name="tabWidget_2" >
+ <property name="tabPosition" >
+ <enum>QTabWidget::West</enum>
+ </property>
+ <property name="tabShape" >
+ <enum>QTabWidget::Rounded</enum>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab_3" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_8" >
+ <item>
+ <widget class="QDial" name="dial" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QScrollBar" name="verticalScrollBar" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="verticalSlider" >
+ <property name="value" >
+ <number>50</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksAbove</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar_2" >
+ <property name="value" >
+ <number>50</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ <zorder></zorder>
+ </widget>
+ <widget class="QWidget" name="tab_10" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_9" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_4" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 2</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QDockWidget" name="dockWidget_4" >
+ <property name="geometry" >
+ <rect>
+ <x>13</x>
+ <y>523</y>
+ <width>346</width>
+ <height>278</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Buttons</string>
+ </property>
+ <attribute name="dockWidgetArea" >
+ <number>1</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetContents_4" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>26</y>
+ <width>346</width>
+ <height>252</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_5" >
+ <item>
+ <widget class="QTabWidget" name="tabWidget_3" >
+ <property name="tabPosition" >
+ <enum>QTabWidget::East</enum>
+ </property>
+ <property name="currentIndex" >
+ <number>3</number>
+ </property>
+ <widget class="QWidget" name="tab_5" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 1</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_15" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_16" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Page</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_6" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Tab 2</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="pushButton" >
+ <property name="text" >
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QPushButton" name="pushButton_2" >
+ <property name="text" >
+ <string>Toggle</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QPushButton" name="disabledPushButton" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Disabled</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="pushButton_3" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Toggle Disabled</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QPushButton" name="defaultPushButton" >
+ <property name="text" >
+ <string>Default</string>
+ </property>
+ <property name="default" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QToolButton" name="toolButton" >
+ <property name="text" >
+ <string>ToolButton</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <action name="actionOne_Entry" >
+ <property name="text" >
+ <string>One Entry</string>
+ </property>
+ </action>
+ <action name="actionAnother_Entry" >
+ <property name="text" >
+ <string>Another Entry</string>
+ </property>
+ </action>
+ <action name="actionFoobar" >
+ <property name="text" >
+ <string>Foobar</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Added: theme/ia_ora-kde4/test/mywindow.cpp
===================================================================
--- theme/ia_ora-kde4/test/mywindow.cpp (rev 0)
+++ theme/ia_ora-kde4/test/mywindow.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,83 @@
+#include "mywindow.h"
+#include "iaora-qt.h"
+#include <KApplication>
+#include <QStyleFactory>
+#include <QMenu>
+#include <KIcon>
+
+MyWindow::MyWindow()
+: QMainWindow()
+{
+ setContextMenuPolicy(Qt::CustomContextMenu);
+ connect( this, SIGNAL(customContextMenuRequested(const QPoint &)),
+ this, SLOT(slotContextMenu(const QPoint&)));
+}
+
+MyWindow::~MyWindow()
+{
+ // do nothing for now
+}
+
+void MyWindow::slotSetStyle(const QString &style)
+{
+ if (style == "IaOraQt")
+ KApplication::setStyle(new IaOraQt());
+ else
+ KApplication::setStyle(QStyleFactory::create(style));
+ update();
+}
+
+void MyWindow::slotContextMenu(const QPoint &pos)
+{
+ QMenu *menu = new QMenu(this);
+ QAction *action;
+ menu->setTearOffEnabled(true);
+
+ menu->addAction(KIcon("digikam"), "Take snapshot");
+ action = menu->addAction(KIcon("kde"), "Make KDE4 work");
+ action->setEnabled(false);
+ menu->addSeparator();
+
+ action = new QAction(KIcon("kchart"), "Checked icon item", this);
+ action->setCheckable(true);
+ action->setChecked(true);
+ menu->addAction(action);
+
+ action = new QAction(KIcon("ktip"), "Unchecked icon item", this);
+ action->setCheckable(true);
+ menu->addAction(action);
+
+ action = new QAction("Checked item", this);
+ action->setCheckable(true);
+ action->setChecked(true);
+ menu->addAction(action);
+
+ action = new QAction("Unchecked item", this);
+ action->setCheckable(true);
+ menu->addAction(action);
+
+ QActionGroup group(this);
+ group.setExclusive(true);
+ action = new QAction("Unique checked item", this);
+ action->setCheckable(true);
+ action->setChecked(true);
+ group.addAction(action);
+ menu->addAction(action);
+
+ action = new QAction("Unique unchecked item", this);
+ action->setCheckable(true);
+ group.addAction(action);
+ menu->addAction(action);
+
+ menu->addSeparator();
+ action = new QAction(KIcon("kbugbuster"), "Kill some bugs", this);
+ menu->addAction(action);
+ menu->setDefaultAction(action);
+
+ QMenu *subMenu = new QMenu("A SubMenu", this);
+ subMenu->setIcon(KIcon("konqueror"));
+ subMenu->addAction(new QAction(KIcon("dolphin"), "A SubItem", this));
+ menu->addMenu(subMenu);
+ menu->exec(QCursor::pos());
+ delete menu;
+}
Property changes on: theme/ia_ora-kde4/test/mywindow.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/test/mywindow.h
===================================================================
--- theme/ia_ora-kde4/test/mywindow.h (rev 0)
+++ theme/ia_ora-kde4/test/mywindow.h 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,18 @@
+#ifndef MYWINDOW_H
+#define MYWINDOW_H
+
+#include <QMainWindow>
+
+class MyWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MyWindow();
+ ~MyWindow();
+
+public slots:
+ void slotSetStyle(const QString &style);
+ void slotContextMenu(const QPoint &pos);
+};
+
+#endif
Property changes on: theme/ia_ora-kde4/test/mywindow.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/test/qttest.cpp
===================================================================
--- theme/ia_ora-kde4/test/qttest.cpp (rev 0)
+++ theme/ia_ora-kde4/test/qttest.cpp 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,134 @@
+#include <KApplication>
+#include <KAboutData>
+#include <KCmdLineArgs>
+
+#include <QAction>
+#include <QString>
+#include <QToolBar>
+#include <QStyleFactory>
+
+#include <KIcon>
+#include "mywindow.h"
+#include "ui_mainwindow.h"
+
+int main(int argc, char **argv)
+{
+ KAboutData aboutData(
+ // The program name used internally.
+ "qttest",
+ // The message catalog name
+ // If null, program name is used instead.
+ 0,
+ // A displayable program name string.
+ ki18n("Qt Style Test"),
+ // The program version string.
+ "1.0",
+ // Short description of what the app does.
+ ki18n("A testbed for trying out Qt styles"),
+ // The license this code is released under
+ KAboutData::License_GPL,
+ // Copyright Statement
+ ki18n("(c) 2007"),
+ // Optional text shown in the About box.
+ // Can contain any information desired.
+ ki18n("Some text..."),
+ // The program homepage string.
+ "http://tutorial.com/",
+ // The bug report email address
+ "submit at bugs.kde.org");
+
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KApplication app;
+
+ MyWindow win;
+ Ui::MainWindow win_ui;
+
+ win_ui.setupUi(&win);
+
+ // the styles toolbar
+ win_ui.stylesCombo->addItem("IaOraQt");
+ win_ui.stylesCombo->addItems(QStyleFactory::keys());
+ QObject::connect(win_ui.stylesCombo, SIGNAL(activated(const QString &)),
+ &win, SLOT(slotSetStyle(const QString &)));
+
+ // the big toolbar
+ win_ui.toolBar->addAction(KIcon("akonadi"), "Foobar");
+ win_ui.toolBar->addSeparator();
+ win_ui.toolBar->addAction(KIcon("konqueror"), "Web Browser");
+ win_ui.toolBar->setIconSize(QSize(32,32));
+
+ win_ui.notEditableCombo->addItem("Foobar");
+ win_ui.notEditableCombo->addItem("Foobar2");
+ win_ui.notEditableCombo->addItem("Foobar3");
+ win_ui.notEditableCombo->addItem("Foobar4");
+ win_ui.notEditableCombo->addItem("Foobar5");
+
+ win_ui.comboBox->addItem("Foobar");
+ win_ui.comboBox->addItem("Foobar2");
+ win_ui.comboBox->addItem("Foobar3");
+ win_ui.comboBox->addItem("Foobar4");
+ win_ui.comboBox->addItem("Foobar5");
+
+ win_ui.tristateCheck->setCheckState(Qt::PartiallyChecked);
+ win_ui.tristateDisable->setCheckState(Qt::PartiallyChecked);
+
+ //the small toolbar
+ win_ui.smallToolBar->addAction(KIcon("plasma"), "Desktop");
+ win_ui.smallToolBar->addSeparator();
+ win_ui.smallToolBar->addAction(KIcon("kopete"), "Instant Message");
+ win.slotSetStyle("IaOraQt");
+ win.show();
+
+ QMenuBar *menubar = new QMenuBar(win_ui.subwindow);
+ QMenu *menu = new QMenu(win_ui.subwindow);
+ QAction *action;
+ menu->setTearOffEnabled(true);
+
+ menu->addAction(KIcon("digikam"), "Take snapshot");
+ action = menu->addAction(KIcon("kde"), "Make KDE4 work");
+ action->setEnabled(false);
+ menu->addSeparator();
+
+ action = new QAction(KIcon("kchart"), "Checked icon item", win_ui.subwindow);
+ action->setCheckable(true);
+ action->setChecked(true);
+ menu->addAction(action);
+
+ action = new QAction(KIcon("ktip"), "Unchecked icon item", win_ui.subwindow);
+ action->setCheckable(true);
+ menu->addAction(action);
+
+ action = new QAction("Checked item", win_ui.subwindow);
+ action->setCheckable(true);
+ action->setChecked(true);
+ menu->addAction(action);
+
+ action = new QAction("Unchecked item", win_ui.subwindow);
+ action->setCheckable(true);
+ menu->addAction(action);
+
+ QActionGroup group(win_ui.subwindow);
+ group.setExclusive(true);
+ action = new QAction("Unique checked item", win_ui.subwindow);
+ action->setCheckable(true);
+ action->setChecked(true);
+ group.addAction(action);
+ menu->addAction(action);
+
+ action = new QAction("Unique unchecked item", win_ui.subwindow);
+ action->setCheckable(true);
+ group.addAction(action);
+ menu->addAction(action);
+
+ menu->addSeparator();
+ menu->addAction(KIcon("kbugbuster"), "Kill some bugs");
+ menu->setTitle("A menu");
+ menubar->addMenu(menu);
+ menubar->addMenu(KIcon("kde"), "Foobar");
+ menubar->addSeparator();
+ menubar->addMenu("Another menu");
+
+ menubar->show();
+ win_ui.subwindow->layout()->addWidget(menubar);
+ return app.exec();
+}
Property changes on: theme/ia_ora-kde4/test/qttest.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: theme/ia_ora-kde4/uninstall.sh
===================================================================
--- theme/ia_ora-kde4/uninstall.sh (rev 0)
+++ theme/ia_ora-kde4/uninstall.sh 2011-02-07 09:04:25 UTC (rev 459)
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+if [ -f install_manifest.txt ] ; then
+ echo "The following files will be removed:"
+ cat install_manifest.txt
+ echo "Press RETURN to abort, or enter root's password to remove them."
+ su -c "xargs rm -v < install_manifest.txt" && rm -f install_manifest.txt
+else
+ echo "Cannot find install_manifest.txt, maybe not yet installed?"
+fi
Property changes on: theme/ia_ora-kde4/uninstall.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110207/67d1f0e8/attachment-0001.html>
More information about the Mageia-sysadm
mailing list