forked from Shinonome/dots-hyprland
refactor toolbar fab
This commit is contained in:
@@ -32,7 +32,7 @@ Singleton {
|
||||
const rw = Math.round(width);
|
||||
const rh = Math.round(height);
|
||||
const cropBase = `magick ${StringUtils.shellSingleQuoteEscape(screenshotPath)} `
|
||||
+ `-crop ${rw}x${rh}+${rx}+${ry}`
|
||||
+ `-crop ${rw}x${rh}+${rx}+${ry} +repage`
|
||||
const cropToStdout = `${cropBase} -`
|
||||
const cropInPlace = `${cropBase} '${StringUtils.shellSingleQuoteEscape(screenshotPath)}'`
|
||||
const cleanup = `rm '${StringUtils.shellSingleQuoteEscape(screenshotPath)}'`
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import qs.modules.common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
signal clicked(event: var)
|
||||
property alias iconText: fabWidget.iconText
|
||||
default property alias fabData: fabWidget.data
|
||||
property bool enableShadow: true
|
||||
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
implicitWidth: fabWidget.implicitWidth
|
||||
implicitHeight: fabWidget.implicitHeight
|
||||
Loader {
|
||||
active: root.enableShadow
|
||||
anchors.fill: parent
|
||||
sourceComponent: StyledRectangularShadow {
|
||||
target: fabWidget
|
||||
radius: fabWidget.buttonRadius
|
||||
}
|
||||
}
|
||||
FloatingActionButton {
|
||||
id: fabWidget
|
||||
onClicked: e => root.clicked(e)
|
||||
baseSize: 48
|
||||
colBackground: Appearance.colors.colTertiaryContainer
|
||||
colBackgroundHover: Appearance.colors.colTertiaryContainerHover
|
||||
colRipple: Appearance.colors.colTertiaryContainerActive
|
||||
colOnBackground: Appearance.colors.colOnTertiaryContainer
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user