Merge with feature.
--HG-- branch : develop
|
@ -66,5 +66,13 @@
|
||||||
<file>icon/16x16/forbid_detail@2x.png</file>
|
<file>icon/16x16/forbid_detail@2x.png</file>
|
||||||
<file>icon/16x16/toolsectionelarc.png</file>
|
<file>icon/16x16/toolsectionelarc.png</file>
|
||||||
<file>icon/16x16/toolsectionelarc@2x.png</file>
|
<file>icon/16x16/toolsectionelarc@2x.png</file>
|
||||||
|
<file>icon/32x32/grainline.png</file>
|
||||||
|
<file>icon/32x32/grainline@2x.png</file>
|
||||||
|
<file>icon/32x32/labels.png</file>
|
||||||
|
<file>icon/32x32/labels@2x.png</file>
|
||||||
|
<file>icon/32x32/paths.png</file>
|
||||||
|
<file>icon/32x32/paths@2x.png</file>
|
||||||
|
<file>icon/32x32/pins.png</file>
|
||||||
|
<file>icon/32x32/pins@2x.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
BIN
src/libs/vmisc/share/resources/icon/32x32/grainline.png
Normal file
After Width: | Height: | Size: 451 B |
BIN
src/libs/vmisc/share/resources/icon/32x32/grainline@2x.png
Normal file
After Width: | Height: | Size: 868 B |
BIN
src/libs/vmisc/share/resources/icon/32x32/labels.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/libs/vmisc/share/resources/icon/32x32/labels@2x.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
src/libs/vmisc/share/resources/icon/32x32/paths.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
src/libs/vmisc/share/resources/icon/32x32/paths@2x.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
src/libs/vmisc/share/resources/icon/32x32/pins.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/libs/vmisc/share/resources/icon/32x32/pins@2x.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
70
src/libs/vmisc/share/resources/icon/svg/labels.svg
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 348.1 348.1"
|
||||||
|
style="enable-background:new 0 0 348.1 348.1;"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="labels.svg"
|
||||||
|
inkscape:export-filename="/home/dismine/CAD/Valentina_tab/valentina/src/libs/vmisc/share/resources/icon/svg/labels@2x.png"
|
||||||
|
inkscape:export-xdpi="17.650101"
|
||||||
|
inkscape:export-ydpi="17.650101"
|
||||||
|
inkscape:version="0.92.1 unknown"><metadata
|
||||||
|
id="metadata43"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs41" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1500"
|
||||||
|
inkscape:window-height="941"
|
||||||
|
id="namedview39"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.67796609"
|
||||||
|
inkscape:cx="174.05"
|
||||||
|
inkscape:cy="174.05"
|
||||||
|
inkscape:window-x="75"
|
||||||
|
inkscape:window-y="34"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="Layer_1" /><path
|
||||||
|
style="fill:#FFE53C;"
|
||||||
|
d="M308.1,8.85h-108c-8.4,0-16.4,3.2-22.4,9.2L17.3,177.65c-12.4,12.4-12.4,32.8,0,45.2l107.2,107.2 c12.4,12.4,32.8,12.4,45.2,0l160.8-160.4c6-6,9.6-14,9.6-22.8v-106C340.1,23.25,325.7,8.85,308.1,8.85z M260.1,120.85 c-17.6,0-32-14.4-32-32s14.4-32,32-32s32,14.4,32,32S277.7,120.85,260.1,120.85z"
|
||||||
|
id="path2" /><path
|
||||||
|
style="fill:#F2CB2C;"
|
||||||
|
d="M334.1,22.05v64.8c0,9.6-4,18.8-10.4,25.6l-181.6,180.8c-14,14-36.8,14-50.8,0l-81.2-81.2 c1.6,4,4,8,7.2,11.2l107.2,107.2c12.4,12.4,32.8,12.4,45.2,0l160.8-160.4c6-6,9.6-14,9.6-22.8V40.85 C340.1,34.05,337.7,27.65,334.1,22.05z"
|
||||||
|
id="path4" /><path
|
||||||
|
style="fill:#C39215;"
|
||||||
|
d="M147.3,347.25c-10.8,0-20.8-4-28.4-11.6L11.7,228.45c-15.6-15.6-15.6-40.8,0-56.4l160.4-159.6 c7.6-7.6,17.2-11.6,28-11.6h108c22,0,40,18,40,40v106c0,10.8-4.4,20.8-12,28.4l-160.8,160.4C167.7,343.25,157.7,347.25,147.3,347.25 z M200.1,16.85c-6.4,0-12.4,2.4-16.8,6.8L22.9,183.25c-9.2,9.2-9.2,24.4,0,34l107.2,107.2c4.4,4.4,10.4,6.8,16.8,6.8 s12.4-2.4,16.8-6.8l160.8-160.4c4.8-4.8,7.2-10.8,7.2-17.2v-106c0-13.2-10.8-24-24-24H200.1z M260.1,128.85c-22,0-40-18-40-40 s18-40,40-40s40,18,40,40S282.1,128.85,260.1,128.85z M260.1,64.85c-13.2,0-24,10.8-24,24s10.8,24,24,24s24-10.8,24-24 S273.3,64.85,260.1,64.85z"
|
||||||
|
id="path6" /><g
|
||||||
|
id="g8" /><g
|
||||||
|
id="g10" /><g
|
||||||
|
id="g12" /><g
|
||||||
|
id="g14" /><g
|
||||||
|
id="g16" /><g
|
||||||
|
id="g18" /><g
|
||||||
|
id="g20" /><g
|
||||||
|
id="g22" /><g
|
||||||
|
id="g24" /><g
|
||||||
|
id="g26" /><g
|
||||||
|
id="g28" /><g
|
||||||
|
id="g30" /><g
|
||||||
|
id="g32" /><g
|
||||||
|
id="g34" /><g
|
||||||
|
id="g36" /></svg>
|
After Width: | Height: | Size: 3.2 KiB |
122
src/libs/vmisc/share/resources/icon/svg/paths.svg
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
id="svg1"
|
||||||
|
sodipodi:docname="paths.svg"
|
||||||
|
viewBox="0 0 60 60"
|
||||||
|
sodipodi:version="0.32"
|
||||||
|
_SVGFile__filename="oldscale/actions/circle.svg"
|
||||||
|
version="1.0"
|
||||||
|
y="0"
|
||||||
|
x="0"
|
||||||
|
inkscape:version="0.92.1 unknown"
|
||||||
|
width="64"
|
||||||
|
height="64"
|
||||||
|
inkscape:export-filename="/home/dismine/CAD/Valentina_tab/valentina/src/libs/vmisc/share/resources/icon/svg/paths@2x.png"
|
||||||
|
inkscape:export-xdpi="96"
|
||||||
|
inkscape:export-ydpi="96">
|
||||||
|
<defs
|
||||||
|
id="defs16" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
bordercolor="#666666"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-y="34"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
inkscape:window-height="883"
|
||||||
|
inkscape:zoom="4.6034679"
|
||||||
|
inkscape:window-x="75"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:current-layer="svg1"
|
||||||
|
inkscape:cx="15.54976"
|
||||||
|
inkscape:cy="26.322299"
|
||||||
|
inkscape:window-width="1411"
|
||||||
|
inkscape:pageopacity="0.0000000"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-maximized="0" />
|
||||||
|
<path
|
||||||
|
id="path1345"
|
||||||
|
sodipodi:nodetypes="ccccc"
|
||||||
|
style="color:#000000;fill:none;stroke:#ffffff;stroke-width:10;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 14.377,23.115 28.246,-13 8,30.246 -41.246,10 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path1321"
|
||||||
|
style="color:#000000;display:block;fill:none;stroke:#ffffff;stroke-width:8.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 20.773,23.483 c 0,3.276 -2.658,5.935 -5.934,5.935 -3.276,0 -5.9349,-2.659 -5.9349,-5.935 0,-3.276 2.6589,-5.934 5.9349,-5.934 3.276,0 5.934,2.658 5.934,5.934 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path2085"
|
||||||
|
style="color:#000000;display:block;fill:none;stroke:#ffffff;stroke-width:8.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 55.313,39.992 c 0,3.276 -2.659,5.935 -5.935,5.935 -3.276,0 -5.935,-2.659 -5.935,-5.935 0,-3.275 2.659,-5.934 5.935,-5.934 3.276,0 5.935,2.659 5.935,5.934 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path1318"
|
||||||
|
style="color:#000000;display:block;fill:none;stroke:#ffffff;stroke-width:8.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 16.557,49.116 c 0,3.276 -2.659,5.935 -5.935,5.935 -3.2758,0 -5.9345,-2.659 -5.9345,-5.935 0,-3.276 2.6587,-5.935 5.9345,-5.935 3.276,0 5.935,2.659 5.935,5.935 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path1317"
|
||||||
|
style="color:#000000;display:block;fill:none;stroke:#ffffff;stroke-width:8.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 48.361,10.884 c 0,3.276 -2.658,5.935 -5.934,5.935 -3.276,0 -5.935,-2.659 -5.935,-5.935 0,-3.2759 2.659,-5.9346 5.935,-5.9346 3.276,0 5.934,2.6587 5.934,5.9346 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="rect2089"
|
||||||
|
sodipodi:nodetypes="ccccc"
|
||||||
|
style="color:#000000;fill:#c5d8ef;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 14.377,23.115 28.246,-13 8,30.246 -41.246,10 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path1319"
|
||||||
|
style="color:#000000;display:block;fill:#ffe940;stroke:#000000;stroke-width:3.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 48.361,10.884 c 0,3.276 -2.658,5.935 -5.934,5.935 -3.276,0 -5.935,-2.659 -5.935,-5.935 0,-3.2759 2.659,-5.9346 5.935,-5.9346 3.276,0 5.934,2.6587 5.934,5.9346 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path1320"
|
||||||
|
style="color:#000000;display:block;fill:#ffe940;stroke:#000000;stroke-width:3.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 16.557,49.116 c 0,3.276 -2.659,5.935 -5.935,5.935 -3.2758,0 -5.9345,-2.659 -5.9345,-5.935 0,-3.276 2.6587,-5.935 5.9345,-5.935 3.276,0 5.935,2.659 5.935,5.935 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path2087"
|
||||||
|
style="color:#000000;display:block;fill:#ffe940;stroke:#000000;stroke-width:3.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 55.313,39.992 c 0,3.276 -2.659,5.935 -5.935,5.935 -3.276,0 -5.935,-2.659 -5.935,-5.935 0,-3.275 2.659,-5.934 5.935,-5.934 3.276,0 5.935,2.659 5.935,5.934 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
id="path1323"
|
||||||
|
style="color:#000000;display:block;fill:#ffe940;stroke:#000000;stroke-width:3.125;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
d="m 20.773,23.483 c 0,3.276 -2.658,5.935 -5.934,5.935 -3.276,0 -5.9349,-2.659 -5.9349,-5.935 0,-3.276 2.6589,-5.934 5.9349,-5.934 3.276,0 5.934,2.658 5.934,5.934 z"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<metadata
|
||||||
|
id="metadata13">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work>
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
|
||||||
|
<dc:publisher>
|
||||||
|
<cc:Agent
|
||||||
|
rdf:about="http://openclipart.org/">
|
||||||
|
<dc:title>Openclipart</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:publisher>
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.6 KiB |
|
@ -42,7 +42,7 @@ HEADERS += \
|
||||||
$$PWD/tools/dialogflippingbyaxis.h \
|
$$PWD/tools/dialogflippingbyaxis.h \
|
||||||
$$PWD/tools/dialogmove.h \
|
$$PWD/tools/dialogmove.h \
|
||||||
$$PWD/tools/dialogellipticalarc.h \
|
$$PWD/tools/dialogellipticalarc.h \
|
||||||
$$PWD/tools/dialogseamallowance.h \
|
$$PWD/tools/piece/dialogseamallowance.h \
|
||||||
$$PWD/tools/dialogpiecepath.h \
|
$$PWD/tools/dialogpiecepath.h \
|
||||||
$$PWD/tools/dialogpin.h
|
$$PWD/tools/dialogpin.h
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ SOURCES += \
|
||||||
$$PWD/tools/dialogflippingbyaxis.cpp \
|
$$PWD/tools/dialogflippingbyaxis.cpp \
|
||||||
$$PWD/tools/dialogmove.cpp \
|
$$PWD/tools/dialogmove.cpp \
|
||||||
$$PWD/tools/dialogellipticalarc.cpp \
|
$$PWD/tools/dialogellipticalarc.cpp \
|
||||||
$$PWD/tools/dialogseamallowance.cpp \
|
$$PWD/tools/piece/dialogseamallowance.cpp \
|
||||||
$$PWD/tools/dialogpiecepath.cpp \
|
$$PWD/tools/dialogpiecepath.cpp \
|
||||||
$$PWD/tools/dialogpin.cpp
|
$$PWD/tools/dialogpin.cpp
|
||||||
|
|
||||||
|
@ -129,6 +129,10 @@ FORMS += \
|
||||||
$$PWD/tools/dialogflippingbyaxis.ui \
|
$$PWD/tools/dialogflippingbyaxis.ui \
|
||||||
$$PWD/tools/dialogmove.ui \
|
$$PWD/tools/dialogmove.ui \
|
||||||
$$PWD/tools/dialogellipticalarc.ui \
|
$$PWD/tools/dialogellipticalarc.ui \
|
||||||
$$PWD/tools/dialogseamallowance.ui \
|
$$PWD/tools/piece/dialogseamallowance.ui \
|
||||||
$$PWD/tools/dialogpiecepath.ui \
|
$$PWD/tools/dialogpiecepath.ui \
|
||||||
$$PWD/tools/dialogpin.ui
|
$$PWD/tools/dialogpin.ui \
|
||||||
|
$$PWD/tools/piece/tabs/tabpaths.ui \
|
||||||
|
$$PWD/tools/piece/tabs/tablabels.ui \
|
||||||
|
$$PWD/tools/piece/tabs/tabgrainline.ui \
|
||||||
|
$$PWD/tools/piece/tabs/tabpins.ui
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "tools/dialogarc.h"
|
#include "tools/dialogarc.h"
|
||||||
#include "tools/dialogarcwithlength.h"
|
#include "tools/dialogarcwithlength.h"
|
||||||
#include "tools/dialogbisector.h"
|
#include "tools/dialogbisector.h"
|
||||||
#include "tools/dialogseamallowance.h"
|
#include "tools/piece/dialogseamallowance.h"
|
||||||
#include "tools/dialogendline.h"
|
#include "tools/dialogendline.h"
|
||||||
#include "tools/dialogline.h"
|
#include "tools/dialogline.h"
|
||||||
#include "tools/dialoglineintersect.h"
|
#include "tools/dialoglineintersect.h"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#ifndef DIALOGSEAMALLOWANCE_H
|
#ifndef DIALOGSEAMALLOWANCE_H
|
||||||
#define DIALOGSEAMALLOWANCE_H
|
#define DIALOGSEAMALLOWANCE_H
|
||||||
|
|
||||||
#include "dialogtool.h"
|
#include "../dialogtool.h"
|
||||||
#include "../vpatterndb/vpiece.h"
|
#include "../vpatterndb/vpiece.h"
|
||||||
#include "../vpatterndb/floatItemData/vpatternlabeldata.h"
|
#include "../vpatterndb/floatItemData/vpatternlabeldata.h"
|
||||||
#include "../vpatterndb/floatItemData/vpiecelabeldata.h"
|
#include "../vpatterndb/floatItemData/vpiecelabeldata.h"
|
||||||
|
@ -38,9 +38,14 @@
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class DialogSeamAllowance;
|
class DialogSeamAllowance;
|
||||||
|
class TabPaths;
|
||||||
|
class TabLabels;
|
||||||
|
class TabGrainline;
|
||||||
|
class TabPins;
|
||||||
}
|
}
|
||||||
|
|
||||||
class VisPiecePins;
|
class VisPiecePins;
|
||||||
|
class FancyTabBar;
|
||||||
|
|
||||||
class DialogSeamAllowance : public DialogTool
|
class DialogSeamAllowance : public DialogTool
|
||||||
{
|
{
|
||||||
|
@ -66,6 +71,7 @@ protected:
|
||||||
virtual void SaveData() Q_DECL_OVERRIDE;
|
virtual void SaveData() Q_DECL_OVERRIDE;
|
||||||
virtual void CheckState() Q_DECL_OVERRIDE;
|
virtual void CheckState() Q_DECL_OVERRIDE;
|
||||||
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void UpdateList();
|
void UpdateList();
|
||||||
|
@ -92,6 +98,7 @@ private slots:
|
||||||
void ReturnDefAfter();
|
void ReturnDefAfter();
|
||||||
void CustomSAChanged(int row);
|
void CustomSAChanged(int row);
|
||||||
void PathDialogClosed(int result);
|
void PathDialogClosed(int result);
|
||||||
|
void FancyTabChanged(int index);
|
||||||
void TabChanged(int index);
|
void TabChanged(int index);
|
||||||
|
|
||||||
void UpdateGrainlineValues();
|
void UpdateGrainlineValues();
|
||||||
|
@ -147,6 +154,19 @@ private:
|
||||||
Q_DISABLE_COPY(DialogSeamAllowance)
|
Q_DISABLE_COPY(DialogSeamAllowance)
|
||||||
|
|
||||||
Ui::DialogSeamAllowance *ui;
|
Ui::DialogSeamAllowance *ui;
|
||||||
|
Ui::TabPaths *uiTabPaths;
|
||||||
|
Ui::TabLabels *uiTabLabels;
|
||||||
|
Ui::TabGrainline *uiTabGrainline;
|
||||||
|
Ui::TabPins *uiTabPins;
|
||||||
|
|
||||||
|
QWidget *m_tabPaths;
|
||||||
|
QWidget *m_tabLabels;
|
||||||
|
QWidget *m_tabGrainline;
|
||||||
|
QWidget *m_tabPins;
|
||||||
|
|
||||||
|
FancyTabBar* m_ftb;
|
||||||
|
|
||||||
|
bool dialogIsInitialized;
|
||||||
bool applyAllowed;
|
bool applyAllowed;
|
||||||
bool flagGPin;
|
bool flagGPin;
|
||||||
bool flagDPin;
|
bool flagDPin;
|
||||||
|
@ -212,6 +232,7 @@ private:
|
||||||
void UpdateNodeSABefore(const QString &formula);
|
void UpdateNodeSABefore(const QString &formula);
|
||||||
void UpdateNodeSAAfter(const QString &formula);
|
void UpdateNodeSAAfter(const QString &formula);
|
||||||
|
|
||||||
|
void InitFancyTabBar();
|
||||||
void InitMainPathTab();
|
void InitMainPathTab();
|
||||||
void InitSeamAllowanceTab();
|
void InitSeamAllowanceTab();
|
||||||
void InitNodesList();
|
void InitNodesList();
|
||||||
|
@ -240,6 +261,8 @@ private:
|
||||||
void SetPLWidth(QString widthFormula);
|
void SetPLWidth(QString widthFormula);
|
||||||
void SetPLHeight(QString heightFormula);
|
void SetPLHeight(QString heightFormula);
|
||||||
void SetPLAngle(QString angleFormula);
|
void SetPLAngle(QString angleFormula);
|
||||||
|
|
||||||
|
void ShowPins();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGSEAMALLOWANCE_H
|
#endif // DIALOGSEAMALLOWANCE_H
|
73
src/libs/vtools/dialogs/tools/piece/dialogseamallowance.ui
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DialogSeamAllowance</class>
|
||||||
|
<widget class="QDialog" name="DialogSeamAllowance">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>659</width>
|
||||||
|
<height>574</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Seam allowance tool</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../vmisc/share/resources/icon.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>DialogSeamAllowance</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>DialogSeamAllowance</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
514
src/libs/vtools/dialogs/tools/piece/tabs/tabgrainline.ui
Normal file
|
@ -0,0 +1,514 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabGrainline</class>
|
||||||
|
<widget class="QWidget" name="TabGrainline">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>275</width>
|
||||||
|
<height>362</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBoxGrainline">
|
||||||
|
<property name="title">
|
||||||
|
<string>Grainline visible</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QLabel" name="labelEditRot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>159</red>
|
||||||
|
<green>158</green>
|
||||||
|
<blue>158</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rotation:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="pushButtonRot">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Formula wizard</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelEqual">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelRot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>87</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">_</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="lineEditRotFormula">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>28</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Calculation</string>
|
||||||
|
</property>
|
||||||
|
<property name="tabChangesFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="plainText">
|
||||||
|
<string notr="true">1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonShowRot">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Show full calculation in message box</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-down">
|
||||||
|
<normaloff>../</normaloff>../</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QLabel" name="labelEditLen">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>159</red>
|
||||||
|
<green>158</green>
|
||||||
|
<blue>158</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Length:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="pushButtonLen">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Formula wizard</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelEqual_2">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelLen">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>87</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">_</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="lineEditLenFormula">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>28</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Calculation</string>
|
||||||
|
</property>
|
||||||
|
<property name="tabChangesFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="plainText">
|
||||||
|
<string notr="true">90</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonShowLen">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Show full calculation in message box</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-down">
|
||||||
|
<normaloff>../</normaloff>../</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout_8">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelCenter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Center pin:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxGrainlineCenterPin"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout_7">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelGrainlineTopPin">
|
||||||
|
<property name="text">
|
||||||
|
<string>Top pin:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxGrainlineTopPin"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelGrainlineBottomPin">
|
||||||
|
<property name="text">
|
||||||
|
<string>Bottom pin:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxGrainlineBottomPin"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelEditLen_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Arrows:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxArrow"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../../vmisc/share/resources/icon.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
894
src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui
Normal file
|
@ -0,0 +1,894 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabPaths</class>
|
||||||
|
<widget class="QWidget" name="TabPaths">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>401</width>
|
||||||
|
<height>572</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tabMainPath">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Main path</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../../../../vmisc/share/resources/icon.qrc">:/icon/32x32/clockwise.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>All objects in path should follow in clockwise direction.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxForbidFlipping">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Forbid piece be mirrored in a layout.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Forbid flipping</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="listWidgetMainPath">
|
||||||
|
<property name="dragDropMode">
|
||||||
|
<enum>QAbstractItemView::InternalMove</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="helpLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ready!</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabSeamAllowance">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Seam allowance</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxSeams">
|
||||||
|
<property name="text">
|
||||||
|
<string>Seam allowance</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBoxAutomatic">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Automatic</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QLabel" name="labelEditWidth">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>159</red>
|
||||||
|
<green>158</green>
|
||||||
|
<blue>158</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Width:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="toolButtonExprWidth">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Formula wizard</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelResultWidth">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>87</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">_</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidth">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>28</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Calculation</string>
|
||||||
|
</property>
|
||||||
|
<property name="tabChangesFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonGrowWidth">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Show full calculation in message box</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-down">
|
||||||
|
<normaloff>../</normaloff>../</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Nodes</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelNode">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Node:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxNodes">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QLabel" name="labelEditBefore">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>159</red>
|
||||||
|
<green>158</green>
|
||||||
|
<blue>158</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Before:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonDefBefore">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Return to default width</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="toolButtonExprBefore">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Formula wizard</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelResultBefore">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>87</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">_</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidthBefore">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>28</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Calculation</string>
|
||||||
|
</property>
|
||||||
|
<property name="tabChangesFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonGrowWidthBefore">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Show full calculation in message box</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-down">
|
||||||
|
<normaloff>../</normaloff>../</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QLabel" name="labelEditAfter">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>159</red>
|
||||||
|
<green>158</green>
|
||||||
|
<blue>158</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>After:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_6">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonDefAfter">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Return to default width</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="toolButtonExprAfter">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Formula wizard</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="label_10">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QLabel" name="labelResultAfter">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>87</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">_</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidthAfter">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>28</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Calculation</string>
|
||||||
|
</property>
|
||||||
|
<property name="tabChangesFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonGrowWidthAfter">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Show full calculation in message box</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-down">
|
||||||
|
<normaloff>../</normaloff>../</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelAngle">
|
||||||
|
<property name="text">
|
||||||
|
<string>Angle:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxAngle">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBoxCustom">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Custom</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QSplitter" name="splitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="opaqueResize">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="layoutWidget_2">
|
||||||
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelStartPoint">
|
||||||
|
<property name="text">
|
||||||
|
<string>Start point:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxStartPoint"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelEndPoint">
|
||||||
|
<property name="text">
|
||||||
|
<string>End point:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxEndPoint"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelIncludeType">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include as:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxIncludeType">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QListWidget" name="listWidgetCustomSA">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabInternalPaths">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Internal paths</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="listWidgetInternalPaths">
|
||||||
|
<property name="dragDropMode">
|
||||||
|
<enum>QAbstractItemView::InternalMove</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../../vmisc/share/resources/icon.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
34
src/libs/vtools/dialogs/tools/piece/tabs/tabpins.ui
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabPins</class>
|
||||||
|
<widget class="QWidget" name="TabPins">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>296</width>
|
||||||
|
<height>255</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../../../../vmisc/share/resources/icon.qrc">
|
||||||
|
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="listWidgetPins">
|
||||||
|
<property name="dragDropMode">
|
||||||
|
<enum>QAbstractItemView::InternalMove</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../../vmisc/share/resources/icon.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -27,7 +27,7 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vtoolseamallowance.h"
|
#include "vtoolseamallowance.h"
|
||||||
#include "../dialogs/tools/dialogseamallowance.h"
|
#include "../dialogs/tools/piece/dialogseamallowance.h"
|
||||||
#include "../vpatterndb/vpiecenode.h"
|
#include "../vpatterndb/vpiecenode.h"
|
||||||
#include "../vpatterndb/vpiecepath.h"
|
#include "../vpatterndb/vpiecepath.h"
|
||||||
#include "../vpatterndb/calculator.h"
|
#include "../vpatterndb/calculator.h"
|
||||||
|
|
77
src/libs/vwidgets/fancytabbar/fancytab.cpp
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "fancytab.h"
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
FancyTab::FancyTab(QWidget *tabbar)
|
||||||
|
: m_icon(),
|
||||||
|
m_text(),
|
||||||
|
m_toolTip(),
|
||||||
|
m_enabled(false),
|
||||||
|
m_Animator(),
|
||||||
|
m_TabBar(tabbar),
|
||||||
|
m_Fader(0)
|
||||||
|
{
|
||||||
|
m_Animator.setPropertyName("fader");
|
||||||
|
m_Animator.setTargetObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
float FancyTab::fader()
|
||||||
|
{
|
||||||
|
return m_Fader;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTab::fadeIn()
|
||||||
|
{
|
||||||
|
m_Animator.stop();
|
||||||
|
m_Animator.setDuration(80);
|
||||||
|
m_Animator.setEndValue(40);
|
||||||
|
m_Animator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTab::fadeOut()
|
||||||
|
{
|
||||||
|
m_Animator.stop();
|
||||||
|
m_Animator.setDuration(160);
|
||||||
|
m_Animator.setEndValue(0);
|
||||||
|
m_Animator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTab::setFader(float value)
|
||||||
|
{
|
||||||
|
m_Fader = value;
|
||||||
|
m_TabBar->update();
|
||||||
|
}
|
62
src/libs/vwidgets/fancytabbar/fancytab.h
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef FANCYTAB_H
|
||||||
|
#define FANCYTAB_H
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QPropertyAnimation>
|
||||||
|
|
||||||
|
class FancyTab : public QObject
|
||||||
|
{
|
||||||
|
friend class FancyTabBar;
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(float fader READ fader WRITE setFader)
|
||||||
|
public:
|
||||||
|
explicit FancyTab(QWidget *tabbar);
|
||||||
|
|
||||||
|
float fader();
|
||||||
|
void setFader(float value);
|
||||||
|
|
||||||
|
void fadeIn();
|
||||||
|
void fadeOut();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(FancyTab)
|
||||||
|
QIcon m_icon;
|
||||||
|
QString m_text;
|
||||||
|
QString m_toolTip;
|
||||||
|
bool m_enabled;
|
||||||
|
QPropertyAnimation m_Animator;
|
||||||
|
QWidget *m_TabBar;
|
||||||
|
float m_Fader;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FANCYTAB_H
|
658
src/libs/vwidgets/fancytabbar/fancytabbar.cpp
Normal file
|
@ -0,0 +1,658 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "fancytabbar.h"
|
||||||
|
#include "stylehelper.h"
|
||||||
|
|
||||||
|
#include <QMouseEvent>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QColor>
|
||||||
|
#include <QStackedLayout>
|
||||||
|
#include <QToolTip>
|
||||||
|
|
||||||
|
const int FancyTabBar::m_rounding = 22;
|
||||||
|
const int FancyTabBar::m_textPadding = 4;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
FancyTabBar::FancyTabBar(const TabBarPosition position, QWidget *parent)
|
||||||
|
: QWidget(parent),
|
||||||
|
m_position(position),
|
||||||
|
m_hoverRect(),
|
||||||
|
m_hoverIndex(-1),
|
||||||
|
m_currentIndex(-1),
|
||||||
|
m_attachedTabs(),
|
||||||
|
m_timerTriggerChangedSignal()
|
||||||
|
{
|
||||||
|
if (m_position == FancyTabBar::Above || m_position == FancyTabBar::Below)
|
||||||
|
{
|
||||||
|
setMinimumHeight(qMax(2 * m_rounding, 40));
|
||||||
|
setMaximumHeight(TabSizeHint(false).height());
|
||||||
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setMinimumWidth(qMax(2 * m_rounding, 40));
|
||||||
|
setMaximumWidth(TabSizeHint(false).width());
|
||||||
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
||||||
|
}
|
||||||
|
|
||||||
|
setAttribute(Qt::WA_Hover, true);
|
||||||
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
setMouseTracking(true); // Needed for hover events
|
||||||
|
m_timerTriggerChangedSignal.setSingleShot(true);
|
||||||
|
|
||||||
|
// We use a zerotimer to keep the sidebar responsive
|
||||||
|
connect(&m_timerTriggerChangedSignal, &QTimer::timeout, this, &FancyTabBar::EmitCurrentIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
FancyTabBar::~FancyTabBar()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QSize FancyTabBar::TabSizeHint(bool minimum) const
|
||||||
|
{
|
||||||
|
QFont boldFont(font());
|
||||||
|
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
|
||||||
|
boldFont.setBold(true);
|
||||||
|
QFontMetrics fm(boldFont);
|
||||||
|
int spacing = 8;
|
||||||
|
int width = 60 + spacing + 2;
|
||||||
|
int maxLabelwidth = 0;
|
||||||
|
for (int tab=0 ; tab<Count() ;++tab)
|
||||||
|
{
|
||||||
|
int width = fm.width(TabText(tab));
|
||||||
|
if (width > maxLabelwidth)
|
||||||
|
{
|
||||||
|
maxLabelwidth = width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int iconHeight = minimum ? 0 : 32;
|
||||||
|
|
||||||
|
return QSize(qMax(width, maxLabelwidth + 4), iconHeight + spacing + fm.height());
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QPoint FancyTabBar::GetCorner(const QRect& rect, const Corner corner) const
|
||||||
|
{
|
||||||
|
switch(m_position)
|
||||||
|
{
|
||||||
|
case Above:
|
||||||
|
switch(corner)
|
||||||
|
{
|
||||||
|
case OutsideBeginning:
|
||||||
|
return rect.topLeft();
|
||||||
|
case OutsideEnd:
|
||||||
|
return rect.topRight();
|
||||||
|
case InsideBeginning:
|
||||||
|
return rect.bottomLeft();
|
||||||
|
case InsideEnd:
|
||||||
|
return rect.bottomRight();
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Below:
|
||||||
|
switch(corner)
|
||||||
|
{
|
||||||
|
case OutsideBeginning:
|
||||||
|
return rect.bottomLeft();
|
||||||
|
case OutsideEnd:
|
||||||
|
return rect.bottomRight();
|
||||||
|
case InsideBeginning:
|
||||||
|
return rect.topLeft();
|
||||||
|
case InsideEnd:
|
||||||
|
return rect.topRight();
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Left:
|
||||||
|
switch(corner)
|
||||||
|
{
|
||||||
|
case OutsideBeginning:
|
||||||
|
return rect.topLeft();
|
||||||
|
case OutsideEnd:
|
||||||
|
return rect.bottomLeft();
|
||||||
|
case InsideBeginning:
|
||||||
|
return rect.topRight();
|
||||||
|
case InsideEnd:
|
||||||
|
return rect.bottomRight();
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Right:
|
||||||
|
switch(corner)
|
||||||
|
{
|
||||||
|
case OutsideBeginning:
|
||||||
|
return rect.topRight();
|
||||||
|
case OutsideEnd:
|
||||||
|
return rect.bottomRight();
|
||||||
|
case InsideBeginning:
|
||||||
|
return rect.topLeft();
|
||||||
|
case InsideEnd:
|
||||||
|
return rect.bottomLeft();
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_ASSERT("that's impossible!");
|
||||||
|
|
||||||
|
return QPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// You can pass this method a QRect and tell it to move its edges to the outside (+)
|
||||||
|
// or inside (-) of the rect. For example, with a TabBar at the Above,
|
||||||
|
//
|
||||||
|
// adjustRect(QRect(0,0,10,10), 1, 2, 3, -4) // thats a 10 by 10 QRect, starting at 0/0
|
||||||
|
//
|
||||||
|
// gives
|
||||||
|
//
|
||||||
|
// QRect(-3, -1, 9, 13) // 9 by 13 rect, starting at -3/-1.
|
||||||
|
QRect FancyTabBar::AdjustRect(const QRect& rect, const qint8 offsetOutside, const qint8 offsetInside,
|
||||||
|
const qint8 offsetBeginning, const qint8 offsetEnd) const
|
||||||
|
{
|
||||||
|
switch(m_position)
|
||||||
|
{
|
||||||
|
case Above:
|
||||||
|
return rect.adjusted(-offsetBeginning, -offsetOutside, offsetEnd, offsetInside);
|
||||||
|
case Below:
|
||||||
|
return rect.adjusted(-offsetBeginning, -offsetInside, -offsetBeginning, offsetOutside);
|
||||||
|
case Left:
|
||||||
|
return rect.adjusted(-offsetOutside, -offsetBeginning, offsetInside, offsetEnd);
|
||||||
|
case Right:
|
||||||
|
return rect.adjusted(-offsetInside, -offsetBeginning, offsetOutside, offsetEnd);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_ASSERT("that's impossible!");
|
||||||
|
return QRect();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Same with a point: + means towards Outside/End, - means towards Inside/Beginning
|
||||||
|
QPoint FancyTabBar::AdjustPoint(const QPoint& point, const qint8 offsetInsideOutside,
|
||||||
|
const qint8 offsetBeginningEnd) const
|
||||||
|
{
|
||||||
|
switch(m_position)
|
||||||
|
{
|
||||||
|
case Above:
|
||||||
|
return point + QPoint(offsetBeginningEnd, -offsetInsideOutside);
|
||||||
|
case Below:
|
||||||
|
return point + QPoint(offsetBeginningEnd, offsetInsideOutside);
|
||||||
|
case Left:
|
||||||
|
return point + QPoint(-offsetInsideOutside, offsetBeginningEnd);
|
||||||
|
case Right:
|
||||||
|
return point + QPoint(offsetInsideOutside, offsetBeginningEnd);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_ASSERT("that's impossible!");
|
||||||
|
return QPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event)
|
||||||
|
QPainter painter(this);
|
||||||
|
|
||||||
|
// paint background
|
||||||
|
QRect rectangle = AdjustRect(rect(), 0, -1, 0, 0);
|
||||||
|
QLinearGradient lg;
|
||||||
|
|
||||||
|
lg.setStart(GetCorner(rectangle, OutsideBeginning));
|
||||||
|
lg.setFinalStop(GetCorner(rectangle, InsideBeginning));
|
||||||
|
lg.setColorAt(0.0, QColor(64, 64, 64, 255));
|
||||||
|
lg.setColorAt(1.0, QColor(130, 130, 130, 255));
|
||||||
|
painter.fillRect(rectangle, lg);
|
||||||
|
|
||||||
|
// draw dark widget bordert on inner inside (e.g. bottom if the widget position is top)
|
||||||
|
painter.setPen(StyleHelper::borderColor());
|
||||||
|
painter.drawLine(AdjustPoint(GetCorner(rectangle, InsideBeginning), -1, 0),
|
||||||
|
AdjustPoint(GetCorner(rectangle, InsideEnd), -1, 0));
|
||||||
|
|
||||||
|
// draw bright widget border on outer inside (e.g. bottom if the widget position is top)
|
||||||
|
painter.setPen(StyleHelper::sidebarHighlight());
|
||||||
|
painter.drawLine(GetCorner(rectangle, InsideBeginning), GetCorner(rectangle, InsideEnd));
|
||||||
|
|
||||||
|
// paint inactive tabs
|
||||||
|
for (int i = 0; i < Count(); ++i)
|
||||||
|
{
|
||||||
|
if (i != CurrentIndex())
|
||||||
|
{
|
||||||
|
PaintTab(&painter, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// paint active tab last, since it overlaps the neighbors
|
||||||
|
if (CurrentIndex() != -1)
|
||||||
|
{
|
||||||
|
PaintTab(&painter, CurrentIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Handle hover events for mouse fade ins
|
||||||
|
void FancyTabBar::mouseMoveEvent(QMouseEvent *e)
|
||||||
|
{
|
||||||
|
int newHover = -1;
|
||||||
|
for (int i = 0; i < Count(); ++i)
|
||||||
|
{
|
||||||
|
QRect area = TabRect(i);
|
||||||
|
if (area.contains(e->pos()))
|
||||||
|
{
|
||||||
|
newHover = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newHover == m_hoverIndex)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ValidIndex(m_hoverIndex))
|
||||||
|
{
|
||||||
|
m_attachedTabs[m_hoverIndex]->fadeOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hoverIndex = newHover;
|
||||||
|
|
||||||
|
if (ValidIndex(m_hoverIndex))
|
||||||
|
{
|
||||||
|
m_attachedTabs[m_hoverIndex]->fadeIn();
|
||||||
|
m_hoverRect = TabRect(m_hoverIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool FancyTabBar::event(QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::ToolTip)
|
||||||
|
{
|
||||||
|
if (ValidIndex(m_hoverIndex))
|
||||||
|
{
|
||||||
|
QString tt = TabToolTip(m_hoverIndex);
|
||||||
|
if (!tt.isEmpty())
|
||||||
|
{
|
||||||
|
QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), tt, this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QWidget::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Resets hover animation on mouse enter
|
||||||
|
void FancyTabBar::enterEvent(QEvent *e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
m_hoverRect = QRect();
|
||||||
|
m_hoverIndex = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Resets hover animation on mouse leave
|
||||||
|
void FancyTabBar::leaveEvent(QEvent *e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
m_hoverIndex = -1;
|
||||||
|
m_hoverRect = QRect();
|
||||||
|
for (int i = 0 ; i < m_attachedTabs.count() ; ++i)
|
||||||
|
{
|
||||||
|
m_attachedTabs[i]->fadeOut();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool FancyTabBar::ValidIndex(int index) const
|
||||||
|
{
|
||||||
|
return index >= 0 && index < m_attachedTabs.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::SetOrientation(const FancyTabBar::TabBarPosition p)
|
||||||
|
{
|
||||||
|
m_position = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QSize FancyTabBar::sizeHint() const
|
||||||
|
{
|
||||||
|
QSize sh = TabSizeHint();
|
||||||
|
// return QSize(sh.width(), sh.height() * mAttachedTabs.count());
|
||||||
|
|
||||||
|
if (m_position == Above || m_position == Below)
|
||||||
|
{
|
||||||
|
return QSize(sh.width() * m_attachedTabs.count(), sh.height());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return QSize(sh.width(), sh.height() * m_attachedTabs.count());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QSize FancyTabBar::minimumSizeHint() const
|
||||||
|
{
|
||||||
|
const QSize sh = TabSizeHint(true);
|
||||||
|
// return QSize(sh.width(), sh.height() * mAttachedTabs.count());
|
||||||
|
|
||||||
|
if(m_position == Above || m_position == Below)
|
||||||
|
{
|
||||||
|
return QSize(sh.width() * m_attachedTabs.count(), sh.height());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return QSize(sh.width(), sh.height() * m_attachedTabs.count());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QRect FancyTabBar::TabRect(int index) const
|
||||||
|
{
|
||||||
|
QSize sh = TabSizeHint();
|
||||||
|
|
||||||
|
if(m_position == Above || m_position == Below)
|
||||||
|
{
|
||||||
|
if (sh.width() * m_attachedTabs.count() > width())
|
||||||
|
{
|
||||||
|
sh.setWidth(width() / m_attachedTabs.count());
|
||||||
|
}
|
||||||
|
|
||||||
|
return QRect(index * sh.width(), 0, sh.width(), sh.height());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sh.height() * m_attachedTabs.count() > height())
|
||||||
|
{
|
||||||
|
sh.setHeight(height() / m_attachedTabs.count());
|
||||||
|
}
|
||||||
|
|
||||||
|
return QRect(0, index * sh.height(), sh.width(), sh.height());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// This keeps the sidebar responsive since
|
||||||
|
// we get a repaint before loading the
|
||||||
|
// mode itself
|
||||||
|
void FancyTabBar::EmitCurrentIndex()
|
||||||
|
{
|
||||||
|
emit CurrentChanged(m_currentIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::mousePressEvent(QMouseEvent *e)
|
||||||
|
{
|
||||||
|
e->accept();
|
||||||
|
for (int index = 0; index < m_attachedTabs.count(); ++index)
|
||||||
|
{
|
||||||
|
if (TabRect(index).contains(e->pos()))
|
||||||
|
{
|
||||||
|
if (IsTabEnabled(index))
|
||||||
|
{
|
||||||
|
m_currentIndex = index;
|
||||||
|
update();
|
||||||
|
m_timerTriggerChangedSignal.start(0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::PaintTab(QPainter *painter, int tabIndex) const
|
||||||
|
{
|
||||||
|
if (!ValidIndex(tabIndex))
|
||||||
|
{
|
||||||
|
qWarning("invalid index");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
painter->save();
|
||||||
|
|
||||||
|
QRect rect = TabRect(tabIndex);
|
||||||
|
bool selected = (tabIndex == m_currentIndex);
|
||||||
|
bool enabled = IsTabEnabled(tabIndex);
|
||||||
|
|
||||||
|
if(selected)
|
||||||
|
{
|
||||||
|
// background
|
||||||
|
painter->save();
|
||||||
|
QLinearGradient grad(GetCorner(rect, OutsideBeginning), GetCorner(rect, InsideBeginning));
|
||||||
|
grad.setColorAt(0, QColor(255, 255, 255, 140));
|
||||||
|
grad.setColorAt(1, QColor(255, 255, 255, 210));
|
||||||
|
painter->fillRect(AdjustRect(rect, 0, 0, 0, -1), grad);
|
||||||
|
painter->restore();
|
||||||
|
|
||||||
|
// shadows (the black lines immediately before/after (active && selected)-backgrounds)
|
||||||
|
painter->setPen(QColor(0, 0, 0, 110));
|
||||||
|
painter->drawLine(AdjustPoint(GetCorner(rect, OutsideBeginning), 0, -1),
|
||||||
|
AdjustPoint(GetCorner(rect, InsideBeginning), 0, -1));
|
||||||
|
painter->drawLine(GetCorner(rect, OutsideEnd), GetCorner(rect, InsideEnd));
|
||||||
|
|
||||||
|
// thin shadow on the outside of active tab
|
||||||
|
painter->setPen(QColor(0, 0, 0, 40));
|
||||||
|
painter->drawLine(GetCorner(rect, OutsideBeginning), GetCorner(rect, OutsideEnd));
|
||||||
|
|
||||||
|
// highlights
|
||||||
|
painter->setPen(QColor(255, 255, 255, 50));
|
||||||
|
painter->drawLine(AdjustPoint(GetCorner(rect, OutsideBeginning), 0, -2),
|
||||||
|
AdjustPoint(GetCorner(rect, InsideBeginning), 0, -2));
|
||||||
|
painter->drawLine(AdjustPoint(GetCorner(rect, OutsideEnd), 0, 1),
|
||||||
|
AdjustPoint(GetCorner(rect, InsideEnd), 0, 1));
|
||||||
|
|
||||||
|
painter->setPen(QColor(255, 255, 255, 40));
|
||||||
|
// thin white line towards beginning
|
||||||
|
painter->drawLine(AdjustPoint(GetCorner(rect, OutsideBeginning), 0, 0),
|
||||||
|
AdjustPoint(GetCorner(rect, InsideBeginning), 0, 0));
|
||||||
|
// thin white line on inside border
|
||||||
|
painter->drawLine(AdjustPoint(GetCorner(rect, InsideBeginning), 0, 1),
|
||||||
|
AdjustPoint(GetCorner(rect, InsideEnd), 0, -1));
|
||||||
|
// thin white line towards end
|
||||||
|
painter->drawLine(AdjustPoint(GetCorner(rect, OutsideEnd), 0, -1),
|
||||||
|
AdjustPoint(GetCorner(rect, InsideEnd), 0, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString tabText(this->TabText(tabIndex));
|
||||||
|
QRect tabTextRect(rect);
|
||||||
|
const bool drawIcon = rect.height() > 36;
|
||||||
|
QRect tabIconRect(tabTextRect);
|
||||||
|
tabTextRect.translate(0, drawIcon ? -2 : 1);
|
||||||
|
QFont boldFont(painter->font());
|
||||||
|
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
|
||||||
|
boldFont.setBold(true);
|
||||||
|
painter->setFont(boldFont);
|
||||||
|
painter->setPen(selected ? QColor(255, 255, 255, 160) : QColor(0, 0, 0, 110));
|
||||||
|
const int textFlags = Qt::AlignCenter | (drawIcon ? Qt::AlignBottom : Qt::AlignVCenter) | Qt::TextWordWrap;
|
||||||
|
if (enabled)
|
||||||
|
{
|
||||||
|
painter->drawText(tabTextRect, textFlags, tabText);
|
||||||
|
painter->setPen(selected ? QColor(60, 60, 60) : StyleHelper::panelTextColor());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
painter->setPen(selected ? StyleHelper::panelTextColor() : QColor(255, 255, 255, 120));
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(Q_OS_MAC)
|
||||||
|
bool isMac=true;
|
||||||
|
#else
|
||||||
|
bool isMac = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// hover
|
||||||
|
if(!isMac && !selected && enabled)
|
||||||
|
{
|
||||||
|
painter->save();
|
||||||
|
int fader = int(m_attachedTabs[tabIndex]->fader());
|
||||||
|
QLinearGradient grad(GetCorner(rect, OutsideBeginning), GetCorner(rect, InsideBeginning));
|
||||||
|
|
||||||
|
grad.setColorAt(0, Qt::transparent);
|
||||||
|
grad.setColorAt(0.5, QColor(255, 255, 255, fader));
|
||||||
|
grad.setColorAt(1, Qt::transparent);
|
||||||
|
painter->fillRect(rect, grad);
|
||||||
|
painter->setPen(QPen(grad, 1.0));
|
||||||
|
|
||||||
|
if(m_position == Above || m_position == Below)
|
||||||
|
{
|
||||||
|
painter->drawLine(rect.topLeft(), rect.bottomLeft());
|
||||||
|
painter->drawLine(rect.topRight(), rect.bottomRight());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
painter->drawLine(rect.topLeft(), rect.topRight());
|
||||||
|
painter->drawLine(rect.bottomLeft(), rect.bottomRight());
|
||||||
|
}
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!enabled)
|
||||||
|
{
|
||||||
|
painter->setOpacity(0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (drawIcon)
|
||||||
|
{
|
||||||
|
int textHeight = painter->fontMetrics().boundingRect(QRect(0, 0, width(), height()), Qt::TextWordWrap,
|
||||||
|
tabText).height();
|
||||||
|
tabIconRect.adjust(0, 4, 0, -textHeight);
|
||||||
|
StyleHelper::drawIconWithShadow(TabIcon(tabIndex), tabIconRect, painter,
|
||||||
|
enabled ? QIcon::Normal : QIcon::Disabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
painter->translate(0, -1);
|
||||||
|
painter->drawText(tabTextRect, textFlags, tabText);
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::SetCurrentIndex(int index)
|
||||||
|
{
|
||||||
|
if (IsTabEnabled(index))
|
||||||
|
{
|
||||||
|
m_currentIndex = index;
|
||||||
|
update();
|
||||||
|
emit CurrentChanged(m_currentIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
int FancyTabBar::CurrentIndex() const
|
||||||
|
{
|
||||||
|
return m_currentIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::SetTabToolTip(int index, QString toolTip)
|
||||||
|
{
|
||||||
|
m_attachedTabs[index]->m_toolTip = toolTip;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString FancyTabBar::TabToolTip(int index) const
|
||||||
|
{
|
||||||
|
return m_attachedTabs.at(index)->m_toolTip;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QIcon FancyTabBar::TabIcon(int index) const
|
||||||
|
{
|
||||||
|
return m_attachedTabs.at(index)->m_icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString FancyTabBar::TabText(int index) const
|
||||||
|
{
|
||||||
|
return m_attachedTabs.at(index)->m_text;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::SetTabText(int index, QString text)
|
||||||
|
{
|
||||||
|
m_attachedTabs.at(index)->m_text=text;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
int FancyTabBar::Count() const
|
||||||
|
{
|
||||||
|
return m_attachedTabs.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::SetTabEnabled(int index, bool enable)
|
||||||
|
{
|
||||||
|
Q_ASSERT(index < m_attachedTabs.size());
|
||||||
|
Q_ASSERT(index >= 0);
|
||||||
|
|
||||||
|
if (index < m_attachedTabs.size() && index >= 0)
|
||||||
|
{
|
||||||
|
m_attachedTabs[index]->m_enabled = enable;
|
||||||
|
update(TabRect(index));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool FancyTabBar::IsTabEnabled(int index) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(index < m_attachedTabs.size());
|
||||||
|
Q_ASSERT(index >= 0);
|
||||||
|
|
||||||
|
if (index < m_attachedTabs.size() && index >= 0)
|
||||||
|
{
|
||||||
|
return m_attachedTabs[index]->m_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::InsertTab(int index, const QIcon &icon, const QString &label)
|
||||||
|
{
|
||||||
|
FancyTab *tab = new FancyTab(this);
|
||||||
|
tab->m_icon = icon;
|
||||||
|
tab->m_text = label;
|
||||||
|
m_attachedTabs.insert(index, tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FancyTabBar::RemoveTab(int index)
|
||||||
|
{
|
||||||
|
FancyTab *tab = m_attachedTabs.takeAt(index);
|
||||||
|
delete tab;
|
||||||
|
}
|
125
src/libs/vwidgets/fancytabbar/fancytabbar.h
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef FANCYTABWIDGET_H
|
||||||
|
#define FANCYTABWIDGET_H
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QPropertyAnimation>
|
||||||
|
|
||||||
|
class QPainter;
|
||||||
|
|
||||||
|
#include "fancytab.h"
|
||||||
|
|
||||||
|
class FancyTabBar : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum TabBarPosition
|
||||||
|
{
|
||||||
|
Above,
|
||||||
|
Below,
|
||||||
|
Left,
|
||||||
|
Right
|
||||||
|
};
|
||||||
|
|
||||||
|
FancyTabBar(const TabBarPosition position, QWidget *parent = nullptr);
|
||||||
|
virtual ~FancyTabBar();
|
||||||
|
|
||||||
|
virtual QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||||
|
virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
void SetOrientation(const TabBarPosition p);
|
||||||
|
|
||||||
|
void SetTabEnabled(int index, bool enable);
|
||||||
|
bool IsTabEnabled(int index) const;
|
||||||
|
|
||||||
|
void InsertTab(int index, const QIcon &icon, const QString &label);
|
||||||
|
void RemoveTab(int index);
|
||||||
|
|
||||||
|
void SetCurrentIndex(int index);
|
||||||
|
int CurrentIndex() const;
|
||||||
|
|
||||||
|
void SetTabToolTip(int index, QString toolTip);
|
||||||
|
QString TabToolTip(int index) const;
|
||||||
|
|
||||||
|
QIcon TabIcon(int index) const;
|
||||||
|
|
||||||
|
QString TabText(int index) const;
|
||||||
|
void SetTabText(int index, QString text);
|
||||||
|
|
||||||
|
int Count() const;
|
||||||
|
QRect TabRect(int index) const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void CurrentChanged(int);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual bool event(QEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
virtual void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
virtual void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
|
||||||
|
virtual void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
|
||||||
|
virtual void enterEvent(QEvent *) Q_DECL_OVERRIDE;
|
||||||
|
virtual void leaveEvent(QEvent *) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void EmitCurrentIndex();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(FancyTabBar)
|
||||||
|
|
||||||
|
enum Corner { OutsideBeginning, OutsideEnd, InsideBeginning, InsideEnd };
|
||||||
|
|
||||||
|
static const int m_rounding;
|
||||||
|
static const int m_textPadding;
|
||||||
|
|
||||||
|
TabBarPosition m_position;
|
||||||
|
QRect m_hoverRect;
|
||||||
|
int m_hoverIndex;
|
||||||
|
int m_currentIndex;
|
||||||
|
QList<FancyTab*> m_attachedTabs;
|
||||||
|
QTimer m_timerTriggerChangedSignal;
|
||||||
|
|
||||||
|
QPoint GetCorner(const QRect& rect, const Corner corner) const;
|
||||||
|
|
||||||
|
QRect AdjustRect(const QRect& rect, const qint8 offsetOutside, const qint8 offsetInside, const qint8 offsetStart,
|
||||||
|
const qint8 offsetEnd) const;
|
||||||
|
|
||||||
|
// Same with a point. + means towards Outside/End, - means towards Inside/Beginning
|
||||||
|
QPoint AdjustPoint(const QPoint& point, const qint8 offsetInsideOutside, const qint8 offsetBeginningEnd) const;
|
||||||
|
|
||||||
|
QSize TabSizeHint(bool minimum = false) const;
|
||||||
|
void PaintTab(QPainter *painter, int tabIndex) const;
|
||||||
|
bool ValidIndex(int index) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FANCYTABWIDGET_H
|
194
src/libs/vwidgets/fancytabbar/stylehelper.cpp
Normal file
|
@ -0,0 +1,194 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "stylehelper.h"
|
||||||
|
|
||||||
|
#include <QPixmapCache>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QPalette>
|
||||||
|
#include <QStyleOption>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
qreal StyleHelper::sidebarFontSize()
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_MAC)
|
||||||
|
return 10;
|
||||||
|
#else
|
||||||
|
return 7.5;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QColor StyleHelper::panelTextColor(bool lightColored)
|
||||||
|
{
|
||||||
|
//qApp->palette().highlightedText().color();
|
||||||
|
if (!lightColored)
|
||||||
|
{
|
||||||
|
return Qt::white;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Qt::black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Invalid by default, setBaseColor needs to be called at least once
|
||||||
|
QColor StyleHelper::m_baseColor;
|
||||||
|
QColor StyleHelper::m_requestedBaseColor;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QColor StyleHelper::baseColor(bool lightColored)
|
||||||
|
{
|
||||||
|
if (!lightColored)
|
||||||
|
{
|
||||||
|
return m_baseColor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return m_baseColor.lighter(230);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QColor StyleHelper::borderColor(bool lightColored)
|
||||||
|
{
|
||||||
|
QColor result = baseColor(lightColored);
|
||||||
|
result.setHsv(result.hue(),
|
||||||
|
result.saturation(),
|
||||||
|
result.value() / 2);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QColor StyleHelper::sidebarHighlight()
|
||||||
|
{
|
||||||
|
return QColor(255, 255, 255, 40);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// We try to ensure that the actual color used are within
|
||||||
|
// reasonalbe bounds while generating the actual baseColor
|
||||||
|
// from the users request.
|
||||||
|
void StyleHelper::setBaseColor(const QColor &newcolor)
|
||||||
|
{
|
||||||
|
m_requestedBaseColor = newcolor;
|
||||||
|
|
||||||
|
QColor color;
|
||||||
|
color.setHsv(newcolor.hue(),
|
||||||
|
static_cast<int>(newcolor.saturation() * 0.7),
|
||||||
|
64 + newcolor.value() / 3);
|
||||||
|
|
||||||
|
if (color.isValid() && color != m_baseColor)
|
||||||
|
{
|
||||||
|
m_baseColor = color;
|
||||||
|
foreach (QWidget *w, QApplication::topLevelWidgets())
|
||||||
|
{
|
||||||
|
w->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Draws a cached pixmap with shadow
|
||||||
|
void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect, QPainter *p, QIcon::Mode iconMode,
|
||||||
|
int radius, const QColor &color, const QPoint &offset)
|
||||||
|
{
|
||||||
|
QPixmap cache;
|
||||||
|
QString pixmapName = QString::fromLatin1("icon %0 %1 %2").arg(icon.cacheKey()).arg(iconMode).arg(rect.height());
|
||||||
|
|
||||||
|
if (!QPixmapCache::find(pixmapName, cache))
|
||||||
|
{
|
||||||
|
QPixmap px = icon.pixmap(rect.size());
|
||||||
|
cache = QPixmap(px.size() + QSize(radius * 2, radius * 2));
|
||||||
|
cache.fill(Qt::transparent);
|
||||||
|
|
||||||
|
QPainter cachePainter(&cache);
|
||||||
|
if (iconMode == QIcon::Disabled)
|
||||||
|
{
|
||||||
|
QImage im = px.toImage().convertToFormat(QImage::Format_ARGB32);
|
||||||
|
for (int y=0; y<im.height(); ++y)
|
||||||
|
{
|
||||||
|
QRgb *scanLine = reinterpret_cast<QRgb *>(im.scanLine(y));
|
||||||
|
for (int x=0; x<im.width(); ++x)
|
||||||
|
{
|
||||||
|
QRgb pixel = *scanLine;
|
||||||
|
char intensity = static_cast<char>(qGray(pixel));
|
||||||
|
*scanLine = qRgba(intensity, intensity, intensity, qAlpha(pixel));
|
||||||
|
++scanLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
px = QPixmap::fromImage(im);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw shadow
|
||||||
|
QImage tmp(px.size() + QSize(radius * 2, radius * 2 + 1), QImage::Format_ARGB32_Premultiplied);
|
||||||
|
tmp.fill(Qt::transparent);
|
||||||
|
|
||||||
|
QPainter tmpPainter(&tmp);
|
||||||
|
tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
|
tmpPainter.drawPixmap(QPoint(radius, radius), px);
|
||||||
|
tmpPainter.end();
|
||||||
|
|
||||||
|
// blur the alpha channel
|
||||||
|
QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
|
blurred.fill(Qt::transparent);
|
||||||
|
QPainter blurPainter(&blurred);
|
||||||
|
qt_blurImage(&blurPainter, tmp, radius, false, true);
|
||||||
|
blurPainter.end();
|
||||||
|
|
||||||
|
tmp = blurred;
|
||||||
|
|
||||||
|
// blacken the image...
|
||||||
|
tmpPainter.begin(&tmp);
|
||||||
|
tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||||
|
tmpPainter.fillRect(tmp.rect(), color);
|
||||||
|
tmpPainter.end();
|
||||||
|
|
||||||
|
tmpPainter.begin(&tmp);
|
||||||
|
tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||||
|
tmpPainter.fillRect(tmp.rect(), color);
|
||||||
|
tmpPainter.end();
|
||||||
|
|
||||||
|
// draw the blurred drop shadow...
|
||||||
|
cachePainter.drawImage(QRect(0, 0, cache.rect().width(), cache.rect().height()), tmp);
|
||||||
|
|
||||||
|
// Draw the actual pixmap...
|
||||||
|
cachePainter.drawPixmap(QPoint(radius, radius) + offset, px);
|
||||||
|
QPixmapCache::insert(pixmapName, cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
QRect targetRect = cache.rect();
|
||||||
|
targetRect.moveCenter(rect.center());
|
||||||
|
p->drawPixmap(targetRect.topLeft() - offset, cache);
|
||||||
|
}
|
68
src/libs/vwidgets/fancytabbar/stylehelper.h
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef STYLEHELPER_H
|
||||||
|
#define STYLEHELPER_H
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QStyle>
|
||||||
|
|
||||||
|
class QPalette;
|
||||||
|
class QPainter;
|
||||||
|
class QRect;
|
||||||
|
|
||||||
|
// Note, this is exported but in a private header as qtopengl depends on it.
|
||||||
|
// We should consider adding this as a public helper function.
|
||||||
|
void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0);
|
||||||
|
|
||||||
|
// Helper class holding all custom color values
|
||||||
|
class StyleHelper
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const unsigned int DEFAULT_BASE_COLOR = 0x666666;
|
||||||
|
|
||||||
|
static qreal sidebarFontSize();
|
||||||
|
// This is our color table, all colors derive from baseColor
|
||||||
|
static QColor baseColor(bool lightColored = false);
|
||||||
|
static QColor panelTextColor(bool lightColored = false);
|
||||||
|
static QColor borderColor(bool lightColored = false);
|
||||||
|
static QColor sidebarHighlight();
|
||||||
|
|
||||||
|
// Sets the base color and makes sure all top level widgets are updated
|
||||||
|
static void setBaseColor(const QColor &color);
|
||||||
|
static void drawIconWithShadow(const QIcon &icon, const QRect &rect, QPainter *p, QIcon::Mode iconMode,
|
||||||
|
int radius = 3, const QColor &color = QColor(0, 0, 0, 130),
|
||||||
|
const QPoint &offset = QPoint(1, -2));
|
||||||
|
|
||||||
|
private:
|
||||||
|
static QColor m_baseColor;
|
||||||
|
static QColor m_requestedBaseColor;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // STYLEHELPER_H
|
|
@ -14,7 +14,10 @@ SOURCES += \
|
||||||
$$PWD/vabstractmainwindow.cpp \
|
$$PWD/vabstractmainwindow.cpp \
|
||||||
$$PWD/vtextgraphicsitem.cpp \
|
$$PWD/vtextgraphicsitem.cpp \
|
||||||
$$PWD/vgrainlineitem.cpp \
|
$$PWD/vgrainlineitem.cpp \
|
||||||
$$PWD/vpieceitem.cpp
|
$$PWD/vpieceitem.cpp \
|
||||||
|
$$PWD/fancytabbar/fancytab.cpp \
|
||||||
|
$$PWD/fancytabbar/fancytabbar.cpp \
|
||||||
|
$$PWD/fancytabbar/stylehelper.cpp
|
||||||
|
|
||||||
win32-msvc*:SOURCES += $$PWD/stable.cpp
|
win32-msvc*:SOURCES += $$PWD/stable.cpp
|
||||||
|
|
||||||
|
@ -32,4 +35,7 @@ HEADERS += \
|
||||||
$$PWD/vabstractmainwindow.h \
|
$$PWD/vabstractmainwindow.h \
|
||||||
$$PWD/vtextgraphicsitem.h \
|
$$PWD/vtextgraphicsitem.h \
|
||||||
$$PWD/vgrainlineitem.h \
|
$$PWD/vgrainlineitem.h \
|
||||||
$$PWD/vpieceitem.h
|
$$PWD/vpieceitem.h \
|
||||||
|
$$PWD/fancytabbar/fancytab.h \
|
||||||
|
$$PWD/fancytabbar/fancytabbar.h \
|
||||||
|
$$PWD/fancytabbar/stylehelper.h
|
||||||
|
|