mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 06:26:00 +08:00
Hide icons if top bar buttons have no icon
Otherwise there's some empty space there and the RecolourImage will colour that space white. Contributes to issue CURA-4213.
This commit is contained in:
parent
bec786b140
commit
d13b693da0
@ -156,22 +156,23 @@ QtObject {
|
|||||||
height: Theme.getSize("button_icon").height
|
height: Theme.getSize("button_icon").height
|
||||||
UM.RecolorImage
|
UM.RecolorImage
|
||||||
{
|
{
|
||||||
|
visible: control.iconSource != ""
|
||||||
id: icon
|
id: icon
|
||||||
color: UM.Theme.getColor("text_reversed")
|
color: UM.Theme.getColor("text_reversed")
|
||||||
opacity: !control.enabled ? 0.2 : 1.0
|
opacity: !control.enabled ? 0.2 : 1.0
|
||||||
source: control.iconSource
|
source: control.iconSource
|
||||||
width: Theme.getSize("button_icon").width
|
width: visible ? Theme.getSize("button_icon").width : 0
|
||||||
height: Theme.getSize("button_icon").height
|
height: Theme.getSize("button_icon").height
|
||||||
|
|
||||||
sourceSize: Theme.getSize("button_icon")
|
sourceSize: Theme.getSize("button_icon")
|
||||||
}
|
}
|
||||||
UM.RecolorImage
|
UM.RecolorImage
|
||||||
{
|
{
|
||||||
visible: control.overlayIconSource != ""
|
visible: control.overlayIconSource != "" && control.iconSource != ""
|
||||||
color: control.overlayColor
|
color: control.overlayColor
|
||||||
opacity: !control.enabled ? 0.2 : 1.0
|
opacity: !control.enabled ? 0.2 : 1.0
|
||||||
source: control.overlayIconSource
|
source: control.overlayIconSource
|
||||||
width: Theme.getSize("button_icon").width
|
width: visible ? Theme.getSize("button_icon").width : 0
|
||||||
height: Theme.getSize("button_icon").height
|
height: Theme.getSize("button_icon").height
|
||||||
|
|
||||||
sourceSize: Theme.getSize("button_icon")
|
sourceSize: Theme.getSize("button_icon")
|
||||||
@ -180,7 +181,7 @@ QtObject {
|
|||||||
{
|
{
|
||||||
text: control.text;
|
text: control.text;
|
||||||
anchors.left: icon.right
|
anchors.left: icon.right
|
||||||
anchors.leftMargin: Theme.getSize("default_margin").width
|
anchors.leftMargin: icon.visible ? Theme.getSize("default_margin").width : 0
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
font: UM.Theme.getFont("large");
|
font: UM.Theme.getFont("large");
|
||||||
color: UM.Theme.getColor("text_reversed")
|
color: UM.Theme.getColor("text_reversed")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user