mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
Moved sidebar code to Uranium QT so it can be used for scanner aswell
This commit is contained in:
parent
f6daca8c53
commit
b2b3464690
8 changed files with 1 additions and 677 deletions
|
@ -1,48 +0,0 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
Rectangle {
|
||||
id: base;
|
||||
|
||||
width: UM.Theme.sizes.tooltip.width;
|
||||
height: label.height + UM.Theme.sizes.tooltip_margins.height * 2;
|
||||
color: UM.Theme.colors.tooltip;
|
||||
|
||||
opacity: 0;
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
|
||||
property alias text: label.text;
|
||||
|
||||
function show(position) {
|
||||
if(position.y + base.height > parent.height) {
|
||||
x = position.x;
|
||||
y = parent.height - base.height;
|
||||
} else {
|
||||
x = position.x;
|
||||
y = position.y;
|
||||
}
|
||||
base.opacity = 1;
|
||||
}
|
||||
|
||||
function hide() {
|
||||
base.opacity = 0;
|
||||
}
|
||||
|
||||
Label {
|
||||
id: label;
|
||||
anchors {
|
||||
top: parent.top;
|
||||
topMargin: UM.Theme.sizes.tooltip_margins.height;
|
||||
left: parent.left;
|
||||
leftMargin: UM.Theme.sizes.tooltip_margins.width;
|
||||
right: parent.right;
|
||||
rightMargin: UM.Theme.sizes.tooltip_margins.width;
|
||||
}
|
||||
wrapMode: Text.Wrap;
|
||||
font: UM.Theme.fonts.default;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue