forked from Shinonome/dots-hyprland
overlay: adjust titlebar spacing
This commit is contained in:
@@ -85,7 +85,7 @@ Singleton {
|
|||||||
property bool pinned: false
|
property bool pinned: false
|
||||||
property bool clickthrough: true
|
property bool clickthrough: true
|
||||||
property real x: 835
|
property real x: 835
|
||||||
property real y: 482
|
property real y: 483
|
||||||
}
|
}
|
||||||
property JsonObject recorder: JsonObject {
|
property JsonObject recorder: JsonObject {
|
||||||
property bool pinned: false
|
property bool pinned: false
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ AbstractOverlayWidget {
|
|||||||
|
|
||||||
function center() {
|
function center() {
|
||||||
const targetX = (root.parent.width - contentColumn.width) / 2
|
const targetX = (root.parent.width - contentColumn.width) / 2
|
||||||
const targetY = (root.parent.height - contentItem.height) / 2 - titleBar.implicitHeight
|
const targetY = (root.parent.height - contentItem.height) / 2 - titleBar.implicitHeight + border.border.width
|
||||||
root.x = targetX
|
root.x = targetX
|
||||||
root.y = targetY
|
root.y = targetY
|
||||||
root.savePosition(targetX, targetY)
|
root.savePosition(targetX, targetY)
|
||||||
@@ -131,9 +131,8 @@ AbstractOverlayWidget {
|
|||||||
id: titleBar
|
id: titleBar
|
||||||
opacity: GlobalStates.overlayOpen ? 1 : 0
|
opacity: GlobalStates.overlayOpen ? 1 : 0
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
property real padding: 6
|
implicitWidth: titleBarRow.implicitWidth + root.padding * 2
|
||||||
implicitWidth: titleBarRow.implicitWidth + padding * 2
|
implicitHeight: titleBarRow.implicitHeight + root.padding * 2
|
||||||
implicitHeight: titleBarRow.implicitHeight + padding * 2
|
|
||||||
color: root.fancyBorders ? "transparent" : Appearance.colors.colLayer1
|
color: root.fancyBorders ? "transparent" : Appearance.colors.colLayer1
|
||||||
// border.color: Appearance.colors.colOutlineVariant
|
// border.color: Appearance.colors.colOutlineVariant
|
||||||
// border.width: 1
|
// border.width: 1
|
||||||
@@ -142,13 +141,13 @@ AbstractOverlayWidget {
|
|||||||
id: titleBarRow
|
id: titleBarRow
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
margins: titleBar.padding
|
margins: root.padding
|
||||||
bottomMargin: root.fancyBorders ? 0 : titleBar.padding
|
|
||||||
}
|
}
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
text: root.materialSymbol
|
text: root.materialSymbol
|
||||||
|
Layout.leftMargin: 6
|
||||||
iconSize: 20
|
iconSize: 20
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.rightMargin: 4
|
Layout.rightMargin: 4
|
||||||
@@ -204,6 +203,7 @@ AbstractOverlayWidget {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.margins: root.fancyBorders ? root.padding : 0
|
Layout.margins: root.fancyBorders ? root.padding : 0
|
||||||
|
Layout.topMargin: -border.border.width // Border of a rectangle is drawn inside its bounds, so we do this to make the gap not too big
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
implicitWidth: root.contentItem.implicitWidth
|
implicitWidth: root.contentItem.implicitWidth
|
||||||
implicitHeight: root.contentItem.implicitHeight
|
implicitHeight: root.contentItem.implicitHeight
|
||||||
|
|||||||
Reference in New Issue
Block a user