Merged in nauck/valentina/feature (pull request #89)

HiDPI toolbox and cursor resources

--HG--
branch : develop
This commit is contained in:
Roman Telezhinskyi 2016-01-03 00:42:09 +02:00
commit 4666fcf7cc
132 changed files with 1824 additions and 1 deletions

22
scripts/generate_tool_cursor.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# usage:
# $ ./generate_tool_cursor.sh
PATTERN=*@2x.png
TOOLICONPATH=../src/app/valentina/share/resources/toolicon/32x32/
TOOLICONS=`ls $TOOLICONPATH$PATTERN`
OUTPATH=../src/app/valentina/share/resources/cursor/svg
for var in $TOOLICONS
do
basename=${var##*/}
basename=${basename%.png}
basename=${basename%@2x} # remove optional @2x suffix
if [ ! -f $basename@2x.png ]; then # always prefere hidpi version
sed "s/<<basename>>/$basename@2x/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg
else
sed "s/<<basename>>/$basename/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg
fi
done

View File

@ -560,7 +560,17 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur
CancelTool();
emit EnableItemMove(false);
currentTool = lastUsedTool = t;
QPixmap pixmap(cursor);
auto cursorResource = cursor;
if (qApp->devicePixelRatio() >= 2)
{
// Try to load HiDPI versions of the cursors if availible
auto cursorHidpiResource = QString(cursor).replace(".png", "@2x.png");
if (QFileInfo(cursorResource).exists())
{
cursorResource = cursorHidpiResource;
}
}
QPixmap pixmap(cursorResource);
QCursor cur(pixmap, 2, 3);
ui->view->setCursor(cur);
ui->view->setShowToolOptions(false);

View File

@ -30,5 +30,33 @@
<file>cursor/point_from_arc_and_tangent_cursor.png</file>
<file>cursor/arc_with_length_cursor.png</file>
<file>cursor/true_darts_cursor.png</file>
<file>cursor/alongline_cursor@2x.png</file>
<file>cursor/arc_cursor@2x.png</file>
<file>cursor/arc_cut_cursor@2x.png</file>
<file>cursor/arc_intersect_axis_cursor@2x.png</file>
<file>cursor/arc_with_length_cursor@2x.png</file>
<file>cursor/bisector_cursor@2x.png</file>
<file>cursor/curve_intersect_axis_cursor@2x.png</file>
<file>cursor/endline_cursor@2x.png</file>
<file>cursor/height_cursor@2x.png</file>
<file>cursor/intersect_cursor@2x.png</file>
<file>cursor/line_cursor@2x.png</file>
<file>cursor/line_intersect_axis_cursor@2x.png</file>
<file>cursor/new_detail_cursor@2x.png</file>
<file>cursor/normal_cursor@2x.png</file>
<file>cursor/point_from_arc_and_tangent_cursor@2x.png</file>
<file>cursor/point_from_circle_and_tangent_cursor@2x.png</file>
<file>cursor/point_of_intersection_circles@2x.png</file>
<file>cursor/pointcontact_cursor@2x.png</file>
<file>cursor/pointofintersect_cursor@2x.png</file>
<file>cursor/shoulder_cursor@2x.png</file>
<file>cursor/spline_cursor@2x.png</file>
<file>cursor/spline_cut_point_cursor@2x.png</file>
<file>cursor/splinepath_cursor@2x.png</file>
<file>cursor/splinepath_cut_point_cursor@2x.png</file>
<file>cursor/true_darts_cursor@2x.png</file>
<file>cursor/union_cursor@2x.png</file>
<file>cursor/triangle_cursor@2x.png</file>
<file>cursor/point_of_intersection_arcs@2x.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 31.999999 32.000001"
id="svg4749"
version="1.1"
inkscape:version="0.91 r13725"
inkscape:export-xdpi="180"
inkscape:export-ydpi="180">
<defs
id="defs4751" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="24.96875"
inkscape:cx="15.439298"
inkscape:cy="10.15269"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1680"
inkscape:window-height="1001"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata4754">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<image
xlink:href="../../toolicon/32x32/<<basename>>.png"
width="15"
height="15"
preserveAspectRatio="none"
id="image4213"
x="16.5"
y="17" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
d="m 2.4999987,2.5 0.063,24 6.937,-6 11,0 z"
id="path4873"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

View File

@ -28,5 +28,35 @@
<file>toolicon/32x32/new_detail.png</file>
<file>toolicon/32x32/arc_with_length.png</file>
<file>toolicon/32x32/true_darts.png</file>
<file>toolicon/32x32/along_line@2x.png</file>
<file>toolicon/32x32/arc_cut@2x.png</file>
<file>toolicon/32x32/arc_intersect_axis@2x.png</file>
<file>toolicon/32x32/arc_with_length@2x.png</file>
<file>toolicon/32x32/arc@2x.png</file>
<file>toolicon/32x32/bisector@2x.png</file>
<file>toolicon/32x32/curve_intersect_axis@2x.png</file>
<file>toolicon/32x32/height@2x.png</file>
<file>toolicon/32x32/intersect@2x.png</file>
<file>toolicon/32x32/line_intersect_axis@2x.png</file>
<file>toolicon/32x32/line@2x.png</file>
<file>toolicon/32x32/new_detail@2x.png</file>
<file>toolicon/32x32/normal@2x.png</file>
<file>toolicon/32x32/point_from_arc_and_tangent@2x.png</file>
<file>toolicon/32x32/point_from_circle_and_tangent@2x.png</file>
<file>toolicon/32x32/point_of_contact@2x.png</file>
<file>toolicon/32x32/point_of_intersection_arcs@2x.png</file>
<file>toolicon/32x32/point_of_intersection_circles@2x.png</file>
<file>toolicon/32x32/point_of_intersection@2x.png</file>
<file>toolicon/32x32/segment@2x.png</file>
<file>toolicon/32x32/shoulder@2x.png</file>
<file>toolicon/32x32/spline_cut_point@2x.png</file>
<file>toolicon/32x32/spline@2x.png</file>
<file>toolicon/32x32/splinePath_cut_point 2.png</file>
<file>toolicon/32x32/splinePath_cut_point copy.png</file>
<file>toolicon/32x32/splinePath_cut_point@2x.png</file>
<file>toolicon/32x32/splinePath@2x.png</file>
<file>toolicon/32x32/true_darts@2x.png</file>
<file>toolicon/32x32/union@2x.png</file>
<file>toolicon/32x32/triangle@2x.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 B

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 964 B

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 797 B

Some files were not shown because too many files have changed in this diff Show More