Commit 3e4cbdb6 authored by Alessandro Portale's avatar Alessandro Portale Committed by Thomas Hartmann

QmlDesigner: Themable text alignment icons

Change-Id: If499c4e131a0c56d24afb6ae355d1b8bd6338435
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@theqtcompany.com>
parent b496ac88
......@@ -92,21 +92,21 @@ Row {
ButtonRowButton {
roundLeftButton: false
iconSource: blueHighlight ? "images/alignmentleft-h-icon.png" : "images/alignmentleft-icon.png"
iconSource: "image://icons/alignment-left" + (blueHighlight ? "-h" : "")
onClicked: {
if (checked)
backendValue.setEnumeration("Text", "AlignLeft")
}
}
ButtonRowButton {
iconSource: blueHighlight ? "images/alignmentcenterh-h-icon.png" : "images/alignmentcenterh-icon.png"
iconSource: "image://icons/alignment-center" + (blueHighlight ? "-h" : "")
onClicked: {
if (checked)
backendValue.setEnumeration("Text", "AlignHCenter")
}
}
ButtonRowButton {
iconSource: blueHighlight ? "images/alignmentright-h-icon.png" : "images/alignmentright-icon.png"
iconSource: "image://icons/alignment-right" + (blueHighlight ? "-h" : "")
onClicked: {
if (checked)
backendValue.setEnumeration("Text", "AlignRight")
......
......@@ -93,21 +93,21 @@ Row {
ButtonRowButton {
roundLeftButton: false
iconSource: blueHighlight ? "images/alignmenttop-h-icon.png" : "images/alignmenttop-icon.png"
iconSource: "image://icons/alignment-top" + (blueHighlight ? "-h" : "")
onClicked: {
if (checked)
backendValue.setEnumeration("Text", "AlignTop")
}
}
ButtonRowButton {
iconSource: blueHighlight ? "images/alignmentmiddle-h-icon.png" : "images/alignmentmiddle-icon.png"
iconSource: "image://icons/alignment-middle" + (blueHighlight ? "-h" : "")
onClicked: {
if (checked)
backendValue.setEnumeration("Text", "AlignVCenter")
}
}
ButtonRowButton {
iconSource: blueHighlight ? "images/alignmentbottom-h-icon.png" : "images/alignmentbottom-icon.png"
iconSource: "image://icons/alignment-bottom" + (blueHighlight ? "-h" : "")
onClicked: {
if (checked)
backendValue.setEnumeration("Text", "AlignBottom")
......
......@@ -86,6 +86,7 @@ Item {
id: image
width: 16
height: 16
smooth: false
anchors.centerIn: parent
}
......
......@@ -55,5 +55,11 @@
<file>images/anchor_vertical@2x.png</file>
<file>images/anchoreditem.png</file>
<file>images/anchoreditem@2x.png</file>
<file>images/alignment_center.png</file>
<file>images/alignment_left.png</file>
<file>images/alignment_right.png</file>
<file>images/alignment_bottom.png</file>
<file>images/alignment_middle.png</file>
<file>images/alignment_top.png</file>
</qresource>
</RCC>
......@@ -111,6 +111,42 @@ QPixmap QmlDesignerIconProvider::requestPixmap(const QString &id, QSize *size, c
else if (id == "anchor-fill")
result = Icon({
{ ":/qmldesigner/images/anchor_fill.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-left")
result = Icon({
{ ":/qmldesigner/images/alignment_left.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-left-h")
result = Icon({
{ ":/qmldesigner/images/alignment_left.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
else if (id == "alignment-center")
result = Icon({
{ ":/qmldesigner/images/alignment_center.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-center-h")
result = Icon({
{ ":/qmldesigner/images/alignment_center.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
else if (id == "alignment-right")
result = Icon({
{ ":/qmldesigner/images/alignment_right.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-right-h")
result = Icon({
{ ":/qmldesigner/images/alignment_right.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
else if (id == "alignment-top")
result = Icon({
{ ":/qmldesigner/images/alignment_top.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-top-h")
result = Icon({
{ ":/qmldesigner/images/alignment_top.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
else if (id == "alignment-middle")
result = Icon({
{ ":/qmldesigner/images/alignment_middle.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-middle-h")
result = Icon({
{ ":/qmldesigner/images/alignment_middle.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
else if (id == "alignment-bottom")
result = Icon({
{ ":/qmldesigner/images/alignment_bottom.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
else if (id == "alignment-bottom-h")
result = Icon({
{ ":/qmldesigner/images/alignment_bottom.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
else
qWarning() << Q_FUNC_INFO << "Image not found:" << id;
......
......@@ -1795,6 +1795,105 @@
width="100%"
height="100%" />
</g>
<g
id="src/libs/qmleditorwidgets/images/alignment_left"
transform="translate(-39,0)">
<rect
transform="matrix(0,1,-1,0,0,0)"
id="rect5140-5-1"
height="16"
width="16"
y="-757"
x="584"
style="display:inline;fill:#ffffff" />
<path
style="color:#000000"
d="m 702,584 0,1 12,0 0,-1 -12,0 z m 0,3 0,1 14,0 0,-1 -14,0 z m 0,3 0,1 16,0 0,-1 -16,0 z m 0,3 0,1 10,0 0,-1 -10,0 z m 0,3 0,1 12,0 0,-1 -12,0 z m 0,3 0,1 16,0 0,-1 -16,0 z"
transform="translate(39,0)"
id="rect5116"
inkscape:connector-curvature="0" />
</g>
<g
transform="translate(-23,0)"
id="src/libs/qmleditorwidgets/images/alignment_center">
<rect
style="display:inline;fill:#ffffff"
x="584"
y="-757"
width="16"
height="16"
id="rect5154"
transform="matrix(0,1,-1,0,0,0)" />
<path
id="rect5166"
style="color:#000000"
d="m 741,599 16,0 0,1 -16,0 z m 2,-3 12,0 0,1 -12,0 z m 1,-3 10,0 0,1 -10,0 z m -3,-3 16,0 0,1 -16,0 z m 1,-3 14,0 0,1 -14,0 z m 1,-3 12,0 0,1 -12,0 z" />
</g>
<use
x="0"
y="0"
xlink:href="#src/libs/qmleditorwidgets/images/alignment_left"
id="src/libs/qmleditorwidgets/images/alignment_right"
transform="matrix(-1,0,0,1,1452,0)"
width="100%"
height="100%" />
<g
style="display:inline"
id="src/libs/qmleditorwidgets/images/alignment_top"
transform="translate(9,0)">
<rect
style="display:inline;fill:#ffffff"
x="584"
y="-757"
width="16"
height="16"
id="rect5154-0"
transform="matrix(0,1,-1,0,0,0)" />
<path
inkscape:connector-curvature="0"
id="rect5166-5"
style="color:#000000"
d="m 742,585 14,0 0,1 -14,0 z"
sodipodi:nodetypes="ccccc" />
</g>
<g
style="display:inline"
id="src/libs/qmleditorwidgets/images/alignment_middle"
transform="translate(25,0)">
<rect
style="display:inline;fill:#ffffff"
x="584"
y="-757"
width="16"
height="16"
id="rect5154-0-3"
transform="matrix(0,1,-1,0,0,0)" />
<path
inkscape:connector-curvature="0"
id="rect5166-5-0"
style="color:#000000"
d="m 742,592 14,0 0,1 -14,0 z"
sodipodi:nodetypes="ccccc" />
</g>
<g
style="display:inline"
id="src/libs/qmleditorwidgets/images/alignment_bottom"
transform="translate(41,0)">
<rect
style="display:inline;fill:#ffffff"
x="584"
y="-757"
width="16"
height="16"
id="rect5154-0-3-5"
transform="matrix(0,1,-1,0,0,0)" />
<path
inkscape:connector-curvature="0"
id="rect5166-5-0-8"
style="color:#000000"
d="m 742,599 14,0 0,1 -14,0 z"
sodipodi:nodetypes="ccccc" />
</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