Compare commits
2 commits
186c9a3aa2
...
e3ba80fd0d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3ba80fd0d | ||
|
|
79a5014a37 |
6 changed files with 33 additions and 9 deletions
|
|
@ -42,11 +42,12 @@ M.BarSection {
|
||||||
root.percent = Math.round((c / m) * 100);
|
root.percent = Math.round((c / m) * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
M.BarIcon {
|
||||||
text: root.percent + "% "
|
icon: "\uF185"
|
||||||
color: M.Theme.base05
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
font.pixelSize: M.Theme.fontSize
|
}
|
||||||
font.family: M.Theme.fontFamily
|
M.BarLabel {
|
||||||
|
label: root.percent + "%"
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
HoverHandler { id: _hover }
|
HoverHandler { id: _hover }
|
||||||
ToolTip {
|
M.BarTooltip {
|
||||||
visible: _hover.hovered && parent.tooltip !== ""
|
visible: _hover.hovered && parent.tooltip !== ""
|
||||||
text: parent.tooltip
|
text: parent.tooltip
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
HoverHandler { id: _hover }
|
HoverHandler { id: _hover }
|
||||||
ToolTip {
|
M.BarTooltip {
|
||||||
visible: _hover.hovered && parent.tooltip !== ""
|
visible: _hover.hovered && parent.tooltip !== ""
|
||||||
text: parent.tooltip
|
text: parent.tooltip
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import "." as M
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
property string tooltip: ""
|
property string tooltip: ""
|
||||||
|
|
||||||
HoverHandler { id: _hover }
|
HoverHandler { id: _hover }
|
||||||
ToolTip {
|
M.BarTooltip {
|
||||||
visible: _hover.hovered && parent.tooltip !== ""
|
visible: _hover.hovered && parent.tooltip !== ""
|
||||||
text: parent.tooltip
|
text: parent.tooltip
|
||||||
}
|
}
|
||||||
|
|
|
||||||
22
modules/BarTooltip.qml
Normal file
22
modules/BarTooltip.qml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import "." as M
|
||||||
|
|
||||||
|
ToolTip {
|
||||||
|
id: tip
|
||||||
|
padding: 6
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: M.Theme.base01
|
||||||
|
border.color: M.Theme.base03
|
||||||
|
border.width: 1
|
||||||
|
radius: 4
|
||||||
|
}
|
||||||
|
|
||||||
|
contentItem: Text {
|
||||||
|
text: tip.text
|
||||||
|
color: M.Theme.base05
|
||||||
|
font.pixelSize: M.Theme.fontSize
|
||||||
|
font.family: M.Theme.fontFamily
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ module modules
|
||||||
singleton Theme 1.0 Theme.qml
|
singleton Theme 1.0 Theme.qml
|
||||||
Bar 1.0 Bar.qml
|
Bar 1.0 Bar.qml
|
||||||
BarSection 1.0 BarSection.qml
|
BarSection 1.0 BarSection.qml
|
||||||
|
BarTooltip 1.0 BarTooltip.qml
|
||||||
Workspaces 1.0 Workspaces.qml
|
Workspaces 1.0 Workspaces.qml
|
||||||
WindowTitle 1.0 WindowTitle.qml
|
WindowTitle 1.0 WindowTitle.qml
|
||||||
Clock 1.0 Clock.qml
|
Clock 1.0 Clock.qml
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue