forked from Shinonome/dots-hyprland
settings: make right-clicking config file button copy path (#2112)
This commit is contained in:
@@ -332,5 +332,33 @@ ContentPage {
|
||||
NoticeBox {
|
||||
Layout.fillWidth: true
|
||||
text: Translation.tr('Not all options are available in this app. You should also check the config file by hitting the "Config file" button on the topleft corner or opening %1 manually.').arg(Directories.shellConfigPath)
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
RippleButtonWithIcon {
|
||||
id: copyPathButton
|
||||
property bool justCopied: false
|
||||
Layout.fillWidth: false
|
||||
buttonRadius: Appearance.rounding.small
|
||||
materialIcon: justCopied ? "check" : "content_copy"
|
||||
mainText: justCopied ? Translation.tr("Path copied") : Translation.tr("Copy path")
|
||||
onClicked: {
|
||||
copyPathButton.justCopied = true
|
||||
Quickshell.clipboardText = FileUtils.trimFileProtocol(`${Directories.config}/illogical-impulse/config.json`);
|
||||
revertTextTimer.restart();
|
||||
}
|
||||
colBackground: ColorUtils.transparentize(Appearance.colors.colPrimaryContainer)
|
||||
colBackgroundHover: Appearance.colors.colPrimaryContainerHover
|
||||
colRipple: Appearance.colors.colPrimaryContainerActive
|
||||
|
||||
Timer {
|
||||
id: revertTextTimer
|
||||
interval: 1500
|
||||
onTriggered: {
|
||||
copyPathButton.justCopied = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user