mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-16 17:22:45 -04:00
text: change default rendering back to Qt
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
|
||||
@@ -27,7 +26,6 @@ Column {
|
||||
readonly property bool effectiveIncrementEnabled: root.onIncrement ? root.incrementEnabled : false
|
||||
readonly property bool effectiveDecrementEnabled: root.onDecrement ? root.decrementEnabled : false
|
||||
|
||||
|
||||
width: Math.max(buttonSize * 2, root.implicitWidth + horizontalPadding * 2)
|
||||
spacing: 4
|
||||
|
||||
@@ -38,20 +36,27 @@ Column {
|
||||
iconSize: root.iconSize
|
||||
buttonSize: root.buttonSize
|
||||
iconName: root.incrementIconName
|
||||
onClicked: if (typeof root.onIncrement === 'function') root.onIncrement()
|
||||
onClicked: if (typeof root.onIncrement === 'function')
|
||||
root.onIncrement()
|
||||
tooltipText: root.incrementTooltipText
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
Item { width: 5; height: 1 }
|
||||
Item {
|
||||
width: 5
|
||||
height: 1
|
||||
}
|
||||
StyledText {
|
||||
isMonospace: true
|
||||
text: root.text
|
||||
font.pixelSize: root.textSize
|
||||
color: root.textColor
|
||||
}
|
||||
Item { width: 5; height: 1 }
|
||||
Item {
|
||||
width: 5
|
||||
height: 1
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
@@ -61,7 +66,8 @@ Column {
|
||||
iconSize: root.iconSize
|
||||
buttonSize: root.buttonSize
|
||||
iconName: root.decrementIconName
|
||||
onClicked: if (typeof root.onDecrement === 'function') root.onDecrement()
|
||||
onClicked: if (typeof root.onDecrement === 'function')
|
||||
root.onDecrement()
|
||||
tooltipText: root.decrementTooltipText
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Common
|
||||
@@ -29,7 +28,9 @@ PanelWindow {
|
||||
|
||||
function show() {
|
||||
mappedVisible = true;
|
||||
Qt.callLater(() => { isVisible = true; });
|
||||
Qt.callLater(() => {
|
||||
isVisible = true;
|
||||
});
|
||||
}
|
||||
|
||||
function hide() {
|
||||
|
||||
@@ -50,21 +50,21 @@ PanelWindow {
|
||||
|
||||
margins {
|
||||
left: {
|
||||
const screenWidth = targetScreen?.width ?? Screen.width
|
||||
const screenWidth = targetScreen?.width ?? Screen.width;
|
||||
if (alignLeft) {
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX)))
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX)));
|
||||
} else if (alignRight) {
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth)))
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth)));
|
||||
} else {
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2)))
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2)));
|
||||
}
|
||||
}
|
||||
top: {
|
||||
const screenHeight = targetScreen?.height ?? Screen.height
|
||||
const screenHeight = targetScreen?.height ?? Screen.height;
|
||||
if (alignLeft || alignRight) {
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2)))
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2)));
|
||||
} else {
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY)))
|
||||
return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ PanelWindow {
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
id: textContent
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
Reference in New Issue
Block a user