mirror of
https://github.com/celesrenata/end-4-flakes.git
synced 2026-06-06 02:39:27 -05:00
53 lines
1.4 KiB
QML
53 lines
1.4 KiB
QML
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs.services
|
|
import qs.modules.common.functions
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell.Hyprland
|
|
|
|
RippleButton {
|
|
id: root
|
|
property string displayText
|
|
property string url
|
|
|
|
property real faviconSize: 20
|
|
implicitHeight: 30
|
|
leftPadding: (implicitHeight - faviconSize) / 2
|
|
rightPadding: 10
|
|
buttonRadius: Appearance.rounding.full
|
|
colBackground: Appearance.colors.colSurfaceContainerHighest
|
|
colBackgroundHover: Appearance.colors.colSurfaceContainerHighestHover
|
|
colRipple: Appearance.colors.colSurfaceContainerHighestActive
|
|
|
|
PointingHandInteraction {}
|
|
onClicked: {
|
|
if (url) {
|
|
Qt.openUrlExternally(url)
|
|
GlobalStates.sidebarLeftOpen = false
|
|
}
|
|
}
|
|
|
|
contentItem: Item {
|
|
anchors.centerIn: parent
|
|
implicitWidth: rowLayout.implicitWidth
|
|
implicitHeight: rowLayout.implicitHeight
|
|
RowLayout {
|
|
id: rowLayout
|
|
anchors.fill: parent
|
|
spacing: 5
|
|
Favicon {
|
|
url: root.url
|
|
size: root.faviconSize
|
|
displayText: root.displayText
|
|
}
|
|
StyledText {
|
|
id: text
|
|
horizontalAlignment: Text.AlignHCenter
|
|
text: displayText
|
|
color: Appearance.m3colors.m3onSurface
|
|
}
|
|
}
|
|
}
|
|
}
|