Added floaty bar mode, made sidebar texts and Crypto.qml module bold
This commit is contained in:
20
bar/Bar.qml
20
bar/Bar.qml
@@ -12,6 +12,9 @@ PanelWindow {
|
||||
|
||||
readonly property var cfg: Cfg.Config
|
||||
|
||||
readonly property real barEdgePad: cfg.frameVariant === "bar" ? (isTop ? cfg.frameBarPadTop : cfg.frameBarPadBottom) : 0
|
||||
readonly property real barRoundPad: cfg.frameVariant === "bar" ? Math.min(cfg.radius, cfg.barHeight / 2) : 0
|
||||
|
||||
color: "transparent"
|
||||
anchors {
|
||||
top: isTop
|
||||
@@ -19,15 +22,21 @@ PanelWindow {
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
implicitHeight: cfg.barHeight
|
||||
implicitHeight: cfg.barHeight + barEdgePad
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Top
|
||||
WlrLayershell.namespace: "main-shell-bar"
|
||||
WlrLayershell.exclusiveZone: cfg.barHeight
|
||||
WlrLayershell.exclusiveZone: cfg.barHeight + barEdgePad
|
||||
|
||||
Item {
|
||||
id: animatedWrapper
|
||||
anchors.fill: parent
|
||||
anchors {
|
||||
fill: parent
|
||||
topMargin: isTop ? barEdgePad : 0
|
||||
bottomMargin: !isTop ? barEdgePad : 0
|
||||
leftMargin: 0
|
||||
rightMargin: 0
|
||||
}
|
||||
|
||||
opacity: 0
|
||||
scale: 0.95
|
||||
@@ -66,8 +75,8 @@ PanelWindow {
|
||||
Item {
|
||||
id: barContent
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: cfg.margin
|
||||
anchors.rightMargin: cfg.margin
|
||||
anchors.leftMargin: cfg.margin + barRoundPad
|
||||
anchors.rightMargin: cfg.margin + barRoundPad
|
||||
|
||||
function bindModule(item, side) {
|
||||
item.height = Qt.binding(() => barContent.height - 12)
|
||||
@@ -78,6 +87,7 @@ PanelWindow {
|
||||
"targetScreen": barWindow.modelData,
|
||||
"barHeight": cfg.barHeight,
|
||||
"barMargin": cfg.margin,
|
||||
"barEdgePad": barEdgePad,
|
||||
"barSide": side,
|
||||
"menuWindow": barWindow
|
||||
}
|
||||
|
||||
@@ -323,6 +323,7 @@ ModuleChip {
|
||||
text: root.coinSymbol + "/" + root.displayCurrency.toUpperCase() + ": "
|
||||
color: t.cryptoLabel
|
||||
font.pixelSize: 12
|
||||
font.bold: true
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
@@ -339,6 +340,8 @@ ModuleChip {
|
||||
text: root.change24h >= 0 ? "▲" : "▼"
|
||||
color: root.change24h >= 0 ? (t.cryptoUp) : (t.cryptoDown)
|
||||
font.pixelSize: 9
|
||||
font.bold: true
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 4
|
||||
@@ -495,6 +498,7 @@ ModuleChip {
|
||||
color: root.change24h >= 0 ? (t.cryptoUp) : (t.cryptoDown)
|
||||
font.pixelSize: 11
|
||||
font.bold: true
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -516,7 +520,7 @@ ModuleChip {
|
||||
property string value: ""
|
||||
Layout.fillWidth: true
|
||||
Text { text: label; color: t.cryptoPopupDim; font.pixelSize: 12; Layout.fillWidth: true }
|
||||
Text { text: value; color: t.cryptoPopupText; font.pixelSize: 12; font.bold: true; font.family: "monospace" }
|
||||
Text { text: value; color: t.cryptoPopupText; font.pixelSize: 12; font.bold: true; font.family: "monospace"; renderType: Text.NativeRendering }
|
||||
}
|
||||
|
||||
StatRow { label: "Rank"; value: root.rank > 0 ? "#" + root.rank : "—" }
|
||||
@@ -552,6 +556,7 @@ ModuleChip {
|
||||
text: "24h Range"
|
||||
color: t.cryptoPopupDim
|
||||
font.pixelSize: 12
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
@@ -559,6 +564,7 @@ ModuleChip {
|
||||
text: ((root.price - root.low24h) / (root.high24h - root.low24h) * 100).toFixed(1) + "% of range"
|
||||
color: t.cryptoPopupDim
|
||||
font.pixelSize: 11
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,6 +601,7 @@ ModuleChip {
|
||||
color: t.cryptoDown
|
||||
font.pixelSize: 10
|
||||
font.family: "monospace"
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
Item { Layout.fillWidth: true }
|
||||
Text {
|
||||
@@ -602,6 +609,7 @@ ModuleChip {
|
||||
color: t.cryptoUp
|
||||
font.pixelSize: 10
|
||||
font.family: "monospace"
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ ModuleChip {
|
||||
mask: Region { item: toastCol }
|
||||
|
||||
readonly property bool shareEdge: (root.isTop && !atBottom) || (!root.isTop && atBottom)
|
||||
readonly property int edgeGap: shareEdge ? root.barMargin + root.barHeight + 10 : root.barMargin + 10
|
||||
readonly property int edgeGap: shareEdge ? root.barMargin + root.barHeight + root.barEdgePad + 10 : root.barMargin + 10
|
||||
readonly property int toastPad: root.barMargin + Cfg.Config.frameBorderWidth + Cfg.Config.notifToastEdgePad
|
||||
|
||||
Column {
|
||||
@@ -577,9 +577,9 @@ ModuleChip {
|
||||
|
||||
anchors.top: root.isTop ? parent.top : undefined
|
||||
anchors.bottom: root.isTop ? undefined : parent.bottom
|
||||
anchors.topMargin: root.isTop ? (root.barHeight + 10) : 0
|
||||
anchors.bottomMargin: root.isTop ? 0 : (root.barHeight + 10)
|
||||
height: parent.height - root.barHeight - 10
|
||||
anchors.topMargin: root.isTop ? (root.barHeight + root.barEdgePad + 10) : 0
|
||||
anchors.bottomMargin: root.isTop ? 0 : (root.barHeight + root.barEdgePad + 10)
|
||||
height: parent.height - root.barHeight - root.barEdgePad - 10
|
||||
|
||||
clip: true
|
||||
|
||||
|
||||
@@ -367,9 +367,9 @@ ModuleChip {
|
||||
|
||||
anchors.top: root.isTop ? parent.top : undefined
|
||||
anchors.bottom: root.isTop ? undefined : parent.bottom
|
||||
anchors.topMargin: root.isTop ? (Cfg.Config.barHeight + 8) : 0
|
||||
anchors.bottomMargin: root.isTop ? 0 : (Cfg.Config.barHeight + 8)
|
||||
height: parent.height - Cfg.Config.barHeight - 8
|
||||
anchors.topMargin: root.isTop ? (Cfg.Config.barHeight + root.barEdgePad + 8) : 0
|
||||
anchors.bottomMargin: root.isTop ? 0 : (Cfg.Config.barHeight + root.barEdgePad + 8)
|
||||
height: parent.height - Cfg.Config.barHeight - root.barEdgePad - 8
|
||||
|
||||
PopupCard {
|
||||
id: menuCard
|
||||
|
||||
Reference in New Issue
Block a user