Commit a1960f6e authored by Alessandro Portale's avatar Alessandro Portale

Utils: Make crumblepath graphics themable and high-DPI-able

This change replaces the outdated CrumblePathButton graphics with new,
themable and high-DPI-able variants.

The new graphics need to be drawn in a different way, which reduces the
required code in CrumblePath a bit.

Change-Id: Ie006199c7f307ae7528b5c951c95cfa2a1c4308d
Reviewed-by: Thomas Hartmann's avatarThomas Hartmann <thomas.hartmann@qt.io>
parent 95564edf
This diff is collapsed.
......@@ -27,8 +27,8 @@
#include "utils_global.h"
#include <QWidget>
#include <QVariant>
#include <QWidget>
namespace Utils {
......@@ -39,14 +39,12 @@ class QTCREATOR_UTILS_EXPORT CrumblePath : public QWidget
Q_OBJECT
public:
explicit CrumblePath(QWidget *parent = 0);
explicit CrumblePath(QWidget *parent = nullptr);
~CrumblePath();
void selectIndex(int index);
QVariant dataForIndex(int index) const;
QVariant dataForLastIndex() const;
int length() const;
void sortChildren(Qt::SortOrder order = Qt::AscendingOrder);
public slots:
void pushElement(const QString &title, const QVariant &data = QVariant());
......@@ -57,16 +55,13 @@ public slots:
signals:
void elementClicked(const QVariant &data);
protected:
void resizeEvent(QResizeEvent *);
private:
void emitElementClicked();
void resizeButtons();
void setBackgroundStyle();
private:
QList<CrumblePathButton*> m_buttons;
QLayout *m_buttonsLayout = nullptr;
};
} // namespace Utils
<RCC>
<qresource prefix="/utils">
<file>images/arrow.png</file>
<file>images/crumblepath-segment.png</file>
<file>images/crumblepath-segment-end.png</file>
<file>images/crumblepath-segment-hover-end.png</file>
<file>images/crumblepath-segment-hover.png</file>
<file>images/crumblepath-segment-selected-end.png</file>
<file>images/crumblepath-segment-selected.png</file>
<file>images/crumblepath-segment-first.png</file>
<file>images/crumblepath-segment-first-hover.png</file>
<file>images/crumblepath-segment-first@2x.png</file>
<file>images/crumblepath-segment-first-hover@2x.png</file>
<file>images/crumblepath-segment-middle.png</file>
<file>images/crumblepath-segment-middle-hover.png</file>
<file>images/crumblepath-segment-middle@2x.png</file>
<file>images/crumblepath-segment-middle-hover@2x.png</file>
<file>images/crumblepath-segment-last.png</file>
<file>images/crumblepath-segment-last-hover.png</file>
<file>images/crumblepath-segment-last@2x.png</file>
<file>images/crumblepath-segment-last-hover@2x.png</file>
<file>images/crumblepath-segment-single.png</file>
<file>images/crumblepath-segment-single-hover.png</file>
<file>images/crumblepath-segment-single@2x.png</file>
<file>images/crumblepath-segment-single-hover@2x.png</file>
<file>images/progressindicator_big.png</file>
<file>images/progressindicator_big@2x.png</file>
<file>images/progressindicator_medium.png</file>
<file>images/progressindicator_medium@2x.png</file>
<file>images/progressindicator_small.png</file>
<file>images/progressindicator_small@2x.png</file>
<file>images/triangle_vert.png</file>
<file>images/next.png</file>
<file>images/next@2x.png</file>
<file>images/prev.png</file>
......
......@@ -476,6 +476,26 @@
y1="73.5"
x2="510.75"
y2="75.5" />
<inkscape:path-effect
is_visible="true"
effect="fill_between_many"
linkedpaths="#path2259-2-0-1,0"
id="path-effect2403-9" />
<inkscape:path-effect
is_visible="true"
effect="fill_between_many"
linkedpaths="#path2259-2,0"
id="path-effect2425-7" />
<inkscape:path-effect
is_visible="true"
effect="fill_between_many"
linkedpaths="#path2259-2-0,0"
id="path-effect2447-8" />
<inkscape:path-effect
is_visible="true"
effect="fill_between_many"
linkedpaths="#path2259-2-0-6,0"
id="path-effect2469-8" />
</defs>
<sodipodi:namedview
id="base"
......@@ -6991,6 +7011,170 @@
width="800"
height="600" />
</g>
<g
style="display:inline"
transform="translate(-4)"
id="src/libs/utils/images/crumblepath-segment-first">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269"
transform="matrix(1.0625,0,0,1.375,246,-101.5)"
width="100%"
height="100%"
style="stroke-width:0.8273403" />
<path
id="path2259-2-0-1"
style="fill:#e6e6e6;stroke:#000000"
d="m 240.5,518.5 4,-9.5 -4,-9.5 h -10 v 19 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
</g>
<g
id="src/libs/utils/images/crumblepath-segment-middle"
style="display:inline;opacity:1"
transform="translate(7)">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-5"
transform="matrix(1.0625,0,0,1.375,252,-101.5)"
width="100%"
height="100%"
style="display:inline;stroke-width:0.8273403" />
<path
sodipodi:nodetypes="ccccccc"
inkscape:connector-curvature="0"
id="path2259-2"
d="m 246.5,499.5 h -10 l 4,9.5 -4,9.5 h 10 l 4,-9.5 z"
style="fill:#e6e6e6;stroke:#000000" />
</g>
<g
id="src/libs/utils/images/crumblepath-segment-last"
style="display:inline;opacity:1"
transform="translate(24)">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-3"
transform="matrix(1.0625,0,0,1.375,252,-101.5)"
width="100%"
height="100%"
style="display:inline;stroke-width:0.8273403" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="path2259-2-0"
d="m 250.5,499.5 h -14 l 4,9.5 -4,9.5 h 14 z"
style="fill:#e6e6e6;stroke:#000000" />
</g>
<g
id="src/libs/utils/images/crumblepath-segment-single"
style="display:inline;opacity:1"
transform="translate(41)">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-0"
transform="matrix(1.0625,0,0,1.375,252,-101.5)"
width="100%"
height="100%"
style="display:inline;stroke-width:0.8273403" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path2259-2-0-6"
d="m 250.5,499.5 h -14 v 19 h 14 z"
style="fill:#e6e6e6;stroke:#000000" />
</g>
<g
style="display:inline"
transform="translate(64)"
id="src/libs/utils/images/crumblepath-segment-first-hover">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-4"
transform="matrix(1.0625,0,0,1.375,246,-101.5)"
width="100%"
height="100%"
style="stroke-width:0.8273403" />
<path
inkscape:connector-curvature="0"
style="fill:#bfbfbf;stroke:#000000"
d="m 240.5,518.5 4,-9.5 -4,-9.5 h -10 v 19 z"
id="path2405"
inkscape:path-effect="#path-effect2403-9"
inkscape:original-d="M -64,0" />
</g>
<g
id="src/libs/utils/images/crumblepath-segment-middle-hover"
style="display:inline;opacity:1"
transform="translate(75)">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-5-1"
transform="matrix(1.0625,0,0,1.375,252,-101.5)"
width="100%"
height="100%"
style="display:inline;stroke-width:0.8273403" />
<path
inkscape:connector-curvature="0"
style="fill:#bfbfbf;stroke:#000000"
d="m 246.5,499.5 h -10 l 4,9.5 -4,9.5 h 10 l 4,-9.5 z"
id="path2427"
inkscape:path-effect="#path-effect2425-7"
inkscape:original-d="M -75,-2" />
</g>
<g
id="src/libs/utils/images/crumblepath-segment-last-hover"
style="display:inline;opacity:1"
transform="translate(92)">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-3-7"
transform="matrix(1.0625,0,0,1.375,252,-101.5)"
width="100%"
height="100%"
style="display:inline;stroke-width:0.8273403" />
<path
inkscape:connector-curvature="0"
style="fill:#bfbfbf;stroke:#000000"
d="m 250.5,499.5 h -14 l 4,9.5 -4,9.5 h 14 z"
id="path2449"
inkscape:path-effect="#path-effect2447-8"
inkscape:original-d="M -94,-1" />
</g>
<g
id="src/libs/utils/images/crumblepath-segment-single-hover"
style="display:inline;opacity:1"
transform="translate(109)">
<use
x="0"
y="0"
xlink:href="#backgroundRect"
id="use2269-0-5"
transform="matrix(1.0625,0,0,1.375,252,-101.5)"
width="100%"
height="100%"
style="display:inline;stroke-width:0.8273403" />
<path
inkscape:connector-curvature="0"
style="fill:#bfbfbf;stroke:#000000"
d="m 250.5,499.5 h -14 v 19 h 14 z"
id="path2471"
inkscape:path-effect="#path-effect2469-8"
inkscape:original-d="M -111,0" />
</g>
</g>
<g
inkscape:groupmode="layer"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment