Make UI changes in the Simulation View for adapting the color gradient

in the Feedrate color scheme. Due to the travel speed is normally very
high compared with the other speeds in the model, the gradient is now
gradual instead of linear in order to show more changes in the low
values and less changes in the high values.
Adapt also the button styles and themes' colors.
Set the play/pause button to the left and reduce the size.
This commit is contained in:
Diego Prado Gesto 2017-11-26 21:21:18 +01:00
parent d0c1569da6
commit fa00a17c78
8 changed files with 257 additions and 184 deletions

View file

@ -55,6 +55,15 @@
"button_disabled": [39, 44, 48, 255],
"button_disabled_text": [255, 255, 255, 101],
"small_button": [39, 44, 48, 0],
"small_button_hover": [39, 44, 48, 255],
"small_button_active": [67, 72, 75, 255],
"small_button_active_hover": [67, 72, 75, 255],
"small_button_text": [255, 255, 255, 197],
"small_button_text_hover": [255, 255, 255, 255],
"small_button_text_active": [255, 255, 255, 255],
"small_button_text_active_hover": [255, 255, 255, 255],
"button_tooltip": [39, 44, 48, 255],
"button_tooltip_border": [39, 44, 48, 255],
"button_tooltip_text": [255, 255, 255, 172],

View file

@ -295,16 +295,26 @@ QtObject {
anchors.fill: parent;
property bool down: control.pressed || (control.checkable && control.checked);
color: {
if(control.customColor !== undefined && control.customColor !== null) {
color:
{
if(control.customColor !== undefined && control.customColor !== null)
{
return control.customColor
} else if(control.checkable && control.checked && control.hovered) {
}
else if(control.checkable && control.checked && control.hovered)
{
return Theme.getColor("button_active_hover");
} else if(control.pressed || (control.checkable && control.checked)) {
}
else if(control.pressed || (control.checkable && control.checked))
{
return Theme.getColor("button_active");
} else if(control.hovered) {
}
else if(control.hovered)
{
return Theme.getColor("button_hover");
} else {
}
else
{
return Theme.getColor("button");
}
}
@ -381,30 +391,39 @@ QtObject {
}
}
property Component orientation_button: Component {
property Component small_tool_button: Component {
ButtonStyle {
background: Item {
implicitWidth: 25;
implicitHeight: 25;
implicitWidth: Theme.getSize("small_button").width;
implicitHeight: Theme.getSize("small_button").height;
Rectangle {
id: buttonFace2;
id: smallButtonFace;
anchors.fill: parent;
property bool down: control.pressed || (control.checkable && control.checked);
color: {
if(control.customColor !== undefined && control.customColor !== null) {
color:
{
if(control.customColor !== undefined && control.customColor !== null)
{
return control.customColor
} else if(control.checkable && control.checked && control.hovered) {
return Theme.getColor("button_active_hover");
} else if(control.pressed || (control.checkable && control.checked)) {
return Theme.getColor("button_active");
} else if(control.hovered) {
return Theme.getColor("button_hover");
} else {
//return Theme.getColor("button");
return "transparent"
}
else if(control.checkable && control.checked && control.hovered)
{
return Theme.getColor("small_button_active_hover");
}
else if(control.pressed || (control.checkable && control.checked))
{
return Theme.getColor("small_button_active");
}
else if(control.hovered)
{
return Theme.getColor("small_button_hover");
}
else
{
return Theme.getColor("small_button");
}
}
Behavior on color { ColorAnimation { duration: 50; } }
@ -413,17 +432,10 @@ QtObject {
border.color: Theme.getColor("tool_button_border")
UM.RecolorImage {
id: tool_button_arrow2
//anchors.right: parent.right;
//anchors.rightMargin: (Theme.getSize("button").width - Theme.getSize("button_icon").width) / 4
//anchors.bottom: parent.bottom;
//anchors.bottomMargin: (Theme.getSize("button").height - Theme.getSize("button_icon").height) / 4
//width: Theme.getSize("standard_arrow").width
//height: Theme.getSize("standard_arrow").height
id: smallToolButtonArrow
width: 5
height: 5
sourceSize.width: 5
sourceSize.height: 5
visible: control.menu != null;
@ -431,19 +443,19 @@ QtObject {
{
if(control.checkable && control.checked && control.hovered)
{
return Theme.getColor("button_text_active_hover");
return Theme.getColor("small_button_text_active_hover");
}
else if(control.pressed || (control.checkable && control.checked))
{
return Theme.getColor("button_text_active");
return Theme.getColor("small_button_text_active");
}
else if(control.hovered)
{
return Theme.getColor("button_text_hover");
return Theme.getColor("small_button_text_hover");
}
else
{
return Theme.getColor("button_text");
return Theme.getColor("small_button_text");
}
}
source: Theme.getIcon("arrow_bottom")
@ -456,31 +468,29 @@ QtObject {
anchors.centerIn: parent;
opacity: !control.enabled ? 0.2 : 1.0
source: control.iconSource;
width: 20;
height: 20;
width: Theme.getSize("small_button_icon").width;
height: Theme.getSize("small_button_icon").height;
color:
{
if(control.checkable && control.checked && control.hovered)
{
return Theme.getColor("button_text_active_hover");
return Theme.getColor("small_button_text_active_hover");
}
else if(control.pressed || (control.checkable && control.checked))
{
return Theme.getColor("button_text_active");
return Theme.getColor("small_button_text_active");
}
else if(control.hovered)
{
//return Theme.getColor("button_text_hover");
return "white"
return Theme.getColor("small_button_text_hover");
}
else
{
//return Theme.getColor("button_text");
return "black"
return Theme.getColor("small_button_text");
}
}
sourceSize: Theme.getSize("button_icon")
sourceSize: Theme.getSize("small_button_icon")
}
}
}

View file

@ -103,6 +103,15 @@
"button_disabled": [31, 36, 39, 255],
"button_disabled_text": [255, 255, 255, 101],
"small_button": [31, 36, 39, 0],
"small_button_hover": [68, 72, 75, 255],
"small_button_active": [68, 72, 75, 255],
"small_button_active_hover": [68, 72, 75, 255],
"small_button_text": [31, 36, 39, 197],
"small_button_text_hover": [255, 255, 255, 255],
"small_button_text_active": [255, 255, 255, 255],
"small_button_text_active_hover": [255, 255, 255, 255],
"button_tooltip": [31, 36, 39, 255],
"button_tooltip_border": [68, 192, 255, 255],
"button_tooltip_text": [192, 193, 194, 255],
@ -323,6 +332,9 @@
"button_icon": [2.5, 2.5],
"button_lining": [0, 0],
"small_button": [2, 2],
"small_button_icon": [1.5, 1.5],
"topbar_logo_right_margin": [3, 0],
"topbar_button": [8, 4],
"topbar_button_icon": [1.2, 1.2],